2013-02-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
8952bc69
AM
12013-02-06 Alan Modra <amodra@gmail.com>
2
3 * README: Update coding style link.
4
29bd8b6b
CC
52013-01-28 Cary Coutant <ccoutant@google.com>
6
7 * dwp.cc (File_list): New typedef.
8 (Dwo_name_info_reader): New class.
9 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
10 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
11 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
12 (Dwo_file::read_executable): New function.
13 (Dwo_file::read): Move common setup code to ...
14 (Dwo_file::make_object): ... here.
15 (dwp_options): Add --exec/-e.
16 (usage): Likewise.
17 (main): Likewise.
18
c6ac678d
ST
192013-01-24 Sriraman Tallam <tmsriram@google.com>
20
21 * layout.cc (Layout::layout): Check for option text_reorder.
22 (Layout::make_output_section): Ditto.
23 * options.h (text_reorder): New option.
24 * output.cc (Input_section_sort_compare): Remove special ordering
25 of section names.
26 (Output_section::
27 Input_section_sort_section_name_special_ordering_compare::
28 operator()): New function.
29 (Output_section::sort_attached_input_sections): Use new sort function
30 for .text.
31 * output.h (Input_section_sort_section_name_special_ordering_compare):
32 New struct.
33 * testsuite/Makefile.am (text_section_grouping): Test option
34 --no-text-reorder
35 * testsuite/Makefile.in: Regenerate.
36 * testsuite/text_section_grouping.sh: Check order of functions without
37 default text reordering.
38
50701cc1
MF
392013-01-18 Mike Frysinger <vapier@gentoo.org>
40
41 * options.h (General_options): Change default to true for new_dtags.
42
b1b00fcc
MF
432013-01-18 Mike Frysinger <vapier@gentoo.org>
44
45 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
46 when enable_new_dtags is false. Only add DT_RUNPATH when
47 enable_new_dtags is true.
48
ec5b8187
AM
492013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
50
51 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
52 used in declaration and definition consistent.
53 (Target_powerpc::symval_for_branch): Ditto.
54
a880d4c4
ST
552013-01-16 Sriraman Tallam <tmsriram@google.com>
56
57 * testsuite/plugin_final_layout.cc: Fix comment.
58
7c381248
ST
592013-01-16 Sriraman Tallam <tmsriram@google.com>
60
61 * layout.cc (Layout::layout): Do not do default sorting for
62 text sections when section ordering is specified.
63 (make_output_section): Ditto.
64 * testsuite/plugin_final_layout.cc: Name the function sections
65 to catch reordering issues.
66
e2458743
AM
672013-01-15 Alan Modra <amodra@gmail.com>
68
69 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
70 plt-thread-safe.
71
431ed302
AM
722013-01-15 Alan Modra <amodra@gmail.com>
73
74 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
75 * testsuite/Makefile.in: Regenerate.
76
0ec6429b
AM
772013-01-14 Alan Modra <amodra@gmail.com>
78
79 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
80 * testsuite/Makefile.in: Regenerate.
81
0bf402d5
ILT
822013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
83
36af3926 84 PR bfd/14430
0bf402d5
ILT
85 Fix mingw gold build with plugins enabled
86 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
87 * configure.ac: Export DLOPEN_LIBS and add headers check.
88 * plugin.cc: Handle non-dlfcn case.
89 * Makefile.in: Regenerate.
90 * config.in: Regenerate.
91 * configure: Regenerate.
92 * testsuite/Makefile.in: Regenerate.
93
9e9143bc
ST
942013-01-09 Sriraman Tallam <tmsriram@google.com>
95
96 * output.h (sort_attached_input_sections): Change to be public.
97 * script-sections.cc
98 (Output_section_definition::set_section_addresses): Sort
99 attached input sections according to section order before linker
100 script assigns section addresses.
101 (Orphan_output_section::set_section_addresses): Sort
102 attached input sections according to section order before linker
103 script assigns section addresses.
104 * Makefile.am (final_layout.sh): Use a simple linker script to
105 check if section ordering still works.
106 * Makefile.in: Regenerate.
107
679af368
ILT
1082013-01-09 Ben Cheng <bccheng@google.com>
109
110 * arm.cc (Target_arm::attributes_accept_div): New function.
111 (Target_arm::attributes_forbid_div): New function.
112 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
113 attribute using the same new functions as what bfd/elf32_arm.c
114 does.
115
3136a00e
CC
1162013-01-07 Cary Coutant <ccoutant@google.com>
117
118 PR gold/14993
119 * output.cc (Output_section::add_input_section): For incremental
120 updates, don't track input sections that are allocated from patch
121 space.
122
f2a6224b
L
1232013-01-07 H.J. Lu <hongjiu.lu@intel.com>
124 Ian Lance Taylor <iant@google.com>
125
126 PR gold/14897
127 * configure.ac (--enable-ld): Removed.
128 (install_as_default): Set to yes only for --enable-gold=default
129 or --disable-ld.
130 * configure: Regenerated.
131
4f46f626
L
1322013-01-07 H.J. Lu <hongjiu.lu@intel.com>
133
134 * options.h (General_options): Add -fuse-ld= for GCC linker
135 option compatibility.
136
26e4ef59
CC
1372013-01-04 Cary Coutant <ccoutant@google.com>
138
139 * configure.ac: Fix typo restoring CXXFLAGS.
140 * configure: Regenerate.
141
3d587466
CC
1422013-01-04 Cary Coutant <ccoutant@google.com>
143
4f46f626
L
144 * testsuite/Makefile.am (CXXLINK_S): New macro.
145 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
146 * testsuite/Makefile.in: Regenerate.
3d587466 147
44db6695
L
1482013-01-02 H.J. Lu <hongjiu.lu@intel.com>
149
150 * version.cc (print_version): Update copyright year to 2013.
151
edcac0c1
ILT
1522012-12-20 Ian Lance Taylor <iant@google.com>
153
154 * layout.cc (Layout::special_ordering_of_input_section): New
155 function.
156 (Layout::layout): If input section requires special ordering, must
157 sort input sections.
158 (Layout::make_output_section): May sort .text input sections.
159 (Layout::is_section_name_prefix_grouped): Remove.
160 * layout.h (class Layout): Declare
161 special_ordering_of_input_section. Don't declare
162 is_section_name_prefix_grouped.
163 * output.cc (Output_section::add_input_section): Revert last
164 change.
165 (Output_section::Input_section_sort::match_file_name): Don't crash
166 if called on output section data.
167 (Output_section::Input_section_sort_compare): Sort based on
168 special ordering.
169 (Output_section::Input_section_sort_section_order_index_compare):
170 Revert last patch.
171 (Output_section::sort_attached_input_sections): Likewise.
172
28f2a4ac
ST
1732012-12-18 Sriraman Tallam <tmsriram@google.com>
174
edcac0c1 175 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
176 * layout.h (Layout::is_section_name_prefix_grouped): New function.
177 * output.cc (Output_section::add_input_section): Check if section
178 name contains special prefix. Keep input sections to sort such
179 sections.
180 (Output_section::Input_section_sort_section_order_index_compare
181 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
182 (Output_section::sort_attached_input_sections): Add condition to
183 Input_section_entry constructor call.
28f2a4ac
ST
184 * testsuite/Makefile.am (text_section_grouping): New test.
185 * testsuite/Makefile.in: Regenerate.
186 * testsuite/text_section_grouping.cc: New file.
187 * testsuite/text_section_grouping.sh: New file.
188
5bf135a7
NC
1892012-12-17 Nick Clifton <nickc@redhat.com>
190
191 * Makefile.am: Add copyright notice.
192 * NEWS: Likewise.
193 * README: Likewise.
194 * configure.ac: Likewise.
195 * ftruncate.c: Likewise.
196 * Makefile.in: Regenerate.
197
59965708
CC
1982012-12-14 Cary Coutant <ccoutant@google.com>
199
200 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
201 --no-as-needed flag.
202 (exception_separate_shared_12_test): Likewise.
203 (incremental_copy_test): Likewise.
204 * testsuite/Makefile.in: Regenerate.
205
2a77e2ab
CC
2062012-12-14 Cary Coutant <ccoutant@google.com>
207
208 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
209 (Dwp_output_file::Dwp_index::enter_set): Add assert.
210
e3deeb9c
AM
2112012-12-12 Alan Modra <amodra@gmail.com>
212
213 * powerpc.cc (class Track_tls): New.
214 (class Relocate, class Scan): Inherit Track_tls.
215 (Target_powerpc::Scan::local, global): Track tls optimization
216 and avoid creating plt entry for __tls_get_addr if all uses
217 are optimized away.
218 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
219
d8f5a274
AM
2202012-12-12 Alan Modra <amodra@gmail.com>
221
222 * options.h (General_options): Add --toc-sort/--no-toc-sort.
223 Replace no_toc_optimize with toc_optimize.
224 * output.h (Output_section::input_sections): Provide non-const variant.
225 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
226 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
227 accessors.
228 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
229 (class Sort_toc_sections): New.
230 (Target_powerpc::do_finalize_sections): Sort toc sections.
231 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
232
4c8a1de1
RM
2332012-12-10 Roland McGrath <mcgrathr@google.com>
234
235 * testsuite/binary_unittest.cc (read_all): New function.
236 (Sized_binary_test): Use it instead of ::read.
237 * fileread.cc (do_read): Don't assume pread always reads the whole
238 amount in a single call.
239
edc27beb
AM
2402012-12-10 Alan Modra <amodra@gmail.com>
241
242 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
243 Set EM_PPC64 or EM_PPC here.
244 (Target_selector_powerpc::do_recognize): Delete.
245
906b9150
AM
2462012-12-10 Alan Modra <amodra@gmail.com>
247
248 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
249 stub_table_.
250 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
251
418c15ae
RM
2522012-12-07 Roland McGrath <mcgrathr@google.com>
253
254 * testsuite/binary_unittest.cc (Sized_binary_test):
255 Use open_descriptor rather than ::open.
256
decdd3bc
AM
2572012-12-07 Alan Modra <amodra@gmail.com>
258
259 * powerpc.cc (Stub_table::do_write): Delete redundant Address
260 typedef and invalid_address constant.
261 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
262 instantiate constants.
263
db399005
ILT
2642012-12-06 Roland McGrath <mcgrathr@google.com>
265
266 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
267 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
268 * aclocal.m4: Regenerate.
269 * configure: Regenerate.
270 * Makefile.in: Regenerate.
271 * testsuite/Makefile.in: Regenerate.
272
aba6bc71
AM
2732012-12-07 Alan Modra <amodra@gmail.com>
274
275 * options.h (General_options): Add no_toc_optimize.
276 * powerpc.cc (ok_lo_toc_insn): New function.
277 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
278
9e69ed50
AM
2792012-12-06 Alan Modra <amodra@gmail.com>
280
281 * options.h (General_options): Add plt_align, plt_static_chain,
282 plt_thread_safe. Update stub_group_size help text.
283 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
284 for new plt_thread_safe_ var.
285 (use_plt_offset): Correct comments.
286 (Target_powerpc::do_relax): Look for thread creation symbols to
287 determine default plt_thread_safe value. Clear plt call stubs
288 as well as branch stubs each iteration.
289 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
290 insn constants.
291 (l, hi, ha, write_insn): Move earlier.
292 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
293 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
294 plt stubs too.
295 (Stub_table::update_size): Adjust.
296 (Stub_table::prev_size, set_prev_size): Delete.
297 (Stub_table::stub_align): Let --plt-align affect result.
298 (Stub_table::plt_call_size): Calculate sizes for various stubs.
299 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
300 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
301 (Stub_table::do_write): Support more stub variants.
302
f43ba157
AM
3032012-12-04 Alan Modra <amodra@gmail.com>
304
305 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
306 (Target_powerpc::do_define_standard_symbols): New function.
307
34171bc5
AM
3082012-12-03 Alan Modra <amodra@gmail.com>
309
310 * output.h: Formatting, whitespace.
311
dc9589e9 3122012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
313
314 * layout.h (Layout::get_executable_sections): Declare.
315 * layout.cc (Layout::get_executable_sections): New function.
316 * arm.cc (Target_arm::group_sections): Use it.
317 (Arm_output_section::group_sections): Delete now redundant test.
318 * output.cc (Output_reloc::Output_reloc): Add is_relative.
319 param to handle relative relocs.
320 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
321 (Output_data_reloc::add_absolute): Adjust.
322 (Output_data_reloc::add_relative): New function.
323 (Output_data::reset_data_size): New function.
324 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
325 (Output_section::set_addralign): New function.
326 (Output_section::checkpoint_set_addralign): New function.
327 (Output_section::clear_section_offsets_need_adjustment): New function.
328 (Output_section::input_sections): Make public.
329 * powerpc.cc (class Output_data_brlt_powerpc): New.
330 (class Stub_table, class Stub_control): New.
331 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
332 stub_table_, set_stub_table, stub_table): New vectors and accessor
333 functions.
334 (Target_powerpc::do_may_relax, do_relax, push_branch,
335 new_stub_table, stub_tables, brlt_section, group_sections,
336 add_branch_lookup_table, find_branch_lookup_table,
337 write_branch_lookup_table, make_brlt_section): New functions.
338 (Target_powerpc::struct Sort_sections, class Branch_info): New.
339 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
340 branch_info_): New vars.
341 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
342 make call stubs here.
343 (Output_data_glink): Remove all call stub handling from this class.
344 (Target_powerpc::Scan::local, global): Save interesting branch
345 relocs and relocs for ifunc. Adjust calls to plt entry functions.
346 (Target_powerpc::do_finalize_sections): Only make reg save/restore
347 functions on final link.
348 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
349 Handle long branch destinations too.
350 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
351 do_plt_address_for_local): Adjust lookup of plt call stubs.
352
627b30b7
AM
3532012-11-30 Alan Modra <amodra@gmail.com>
354
355 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
356 relocs against protected symbols when building 32-bit shared libs.
357
40b469d7
AM
3582012-11-30 Alan Modra <amodra@gmail.com>
359
360 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
361 param. Call got_section() to make .got. Update all callers
362 and their callers and so on.
363
bb66a627
AM
3642012-11-30 Alan Modra <amodra@gmail.com>
365
366 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
367 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
368 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
369 value if it already exists.
370
d2cf1c6c
L
3712012-11-19 H.J. Lu <hongjiu.lu@intel.com>
372
373 PR gold/14858
374 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
375
edccdf7c
RM
3762012-11-14 Roland McGrath <mcgrathr@google.com>
377
378 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
379 than bfc instruction for data sandboxing.
380
6febeb74
AM
3812012-11-08 Alan Modra <amodra@gmail.com>
382
383 * po/POTFILES.in: Regenerate.
384
0a6f1bf2
AM
3852012-11-05 Alan Modra <amodra@gmail.com>
386
387 * configure.ac: Apply 2012-09-10 change to config.in here.
388 * configure: Regenerate.
389
26a4e9cb
AM
3902012-11-05 Alan Modra <amodra@gmail.com>
391
392 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
393 (struct Opd_ent): Use "Address" rather than "Offset".
394 (Output_data_got_powerpc::got_base_offset): Return Valtype.
395 (Target_powerpc::got_section): Make public.
396 (Target_powerpc::scan_relocs): Move code setting symbols..
397 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
398 Create _SDA_BASE_ only when referenced.
399
cc928013
RM
4002012-11-02 Roland McGrath <mcgrathr@google.com>
401
402 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
403 from last change.
404
50ed5eb1
RM
4052012-11-01 Roland McGrath <mcgrathr@google.com>
406
62fe925a
RM
407 * target.h (Sized_target::relocate_relocs): Use Elf_Off
408 for offset_in_output_section parameter.
409 (Sized_target::relocate_special_relocatable): Likewise.
410 * arm.cc (Target_arm::relocate_relocs): Likewise.
411 (Target_arm::relocate_special_relocatable): Likewise.
412 * i386.cc (Target_i386::relocate_relocs): Likewise.
413 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
414 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
415 * target-reloc.h (relocate_relocs): Likewise.
416 * testsuite/testfile.cc (Target_test): Likewise.
417 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
418 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
419
420 * system.h: Move inclusion of <clocale> to after <libintl.h> in
421 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
422
423 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
424 parameter, which is unused in the [!F_SETFD] case.
425
50ed5eb1
RM
426 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
427 SYMNDX to off_t before comparing it to this->data_size().
428 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
429 * incremental.cc (Output_section_incremental_inputs::do_write):
430 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
431
2cadc0bf
RM
432 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
433
3bfcb652
NC
4342012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
435
436 * gold.cc (Target_arm::do_adjust_elf_header): Add the
437 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
438 in EABI_VER5.
439
c1a8d56e
CC
4402012-10-29 Cary Coutant <ccoutant@google.com>
441
442 * dwp.cc (usage): Add file and exit status parameters;
443 add --help and --version options.
444 (print_version): New function.
445 (main): Add --help and --version options.
446
b2490a7b
L
4472012-10-25 H.J. Lu <hongjiu.lu@intel.com>
448
449 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
450 final_layout_sequence.txt.
451 * testsuite/Makefile.in: Regenerated.
452
aa543512
L
4532012-10-25 H.J. Lu <hongjiu.lu@intel.com>
454
455 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
456 COMPILE generated by automake.
457 (LINK1): Likewise.
458 (CXXCOMPILE1): Likewise.
459 (CXXLINK1): Likewise.
460 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
461 (LINK): Likewise.
462 (CXXCOMPILE): Likewise.
463 (CXXLINK): Likewise.
464 * testsuite/Makefile.in: Regenerated.
465
d361fafb
L
4662012-10-25 H.J. Lu <hongjiu.lu@intel.com>
467
468 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
469 on bad fwrite return.
470
598c7410
L
4712012-10-25 H.J. Lu <hongjiu.lu@intel.com>
472
473 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
474 on val.
475
35c813e2
CC
4762012-10-23 Cary Coutant <ccoutant@google.com>
477
478 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
479 * testsuite/Makefile.in: Regenerate.
480 * testsuite/dwp_test.h: New source file.
481 * testsuite/dwp_test_1.cc: New source file.
482 * testsuite/dwp_test_1.s: New source file.
483 * testsuite/dwp_test_1.sh: New source file.
484 * testsuite/dwp_test_1b.cc: New source file.
485 * testsuite/dwp_test_1b.s: New source file.
486 * testsuite/dwp_test_2.cc: New source file.
487 * testsuite/dwp_test_2.s: New source file.
488 * testsuite/dwp_test_2.sh: New source file.
489 * testsuite/dwp_test_main.cc: New source file.
490 * testsuite/dwp_test_main.s: New source file.
491
77429909
CC
4922012-10-23 Cary Coutant <ccoutant@google.com>
493
494 * dwp.h: New header file.
495 * dwp.cc: New source file.
496 * gold.h: Move shared declarations to system.h.
497 * system.h: New header file.
498 * Makefile.am: Add dwp.
499 * Makefile.in: Regenerate.
500
ed5d6712
CC
5012012-10-23 Cary Coutant <ccoutant@google.com>
502
503 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
504 Dwarf_info_reader::read_from_pointer.
505 (Dwarf_pubnames_table::read_header): Likewise.
506 (Dwarf_pubnames_table::next_name): Likewise.
507 (Dwarf_die::read_attributes): Likewise.
508 (Dwarf_die::skip_attributes): Likewise.
509 (Dwarf_info_reader::read_from_pointer): New function template.
510 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
511 (Dwarf_pubnames_table): Likewise.
512 (Dwarf_info_reader::read_from_pointer): New function template.
513 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
514 Dwarf_pubnames_table ctor.
515
8787852d
CC
5162012-10-23 Cary Coutant <ccoutant@google.com>
517
518 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
519 abbrev_shndx.
520 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
521 abbrev_shndx_.
522 (Dwarf_info_reader::set_abbrev_shndx): New method.
523 (Dwarf_info_reader::abbrev_shndx_): New data member.
524
9fc236f3
CC
5252012-10-23 Cary Coutant <ccoutant@google.com>
526
527 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
528 from object, not parameters.
529 (Dwarf_info_reader::parse): Likewise.
530 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
531 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
532 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
533 methods.
534
effe8365
CC
5352012-10-23 Cary Coutant <ccoutant@google.com>
536
537 * fileread.cc (Input_file::Input_file): New constructor.
538 * fileread.h (class Input_file): Add new constructor.
539
1698990d
AM
5402012-10-18 Alan Modra <amodra@gmail.com>
541
542 PR gold/14727
543 * object.cc (Relobj::is_section_name_included): Also match
544 .sdata personality section.
545
168a4726
AM
5462012-10-18 Alan Modra <amodra@gmail.com>
547
548 * target-reloc.h (class Default_comdat_behavior): New, package up..
549 (get_comdat_behaviour): ..this.
550 (relocate_section): Add Relocate_comdat_behavior template arg,
551 adjust code to suit.
552 * arm.cc (Target_arm::relocate_section): Adjust to suit.
553 (Target_arm::scan_reloc_section): Likewise.
554 * i386.cc (Target_i386::relocate_section): Likewise.
555 * sparc.cc (Target_sparc::relocate_section): Likewise.
556 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
557 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
558 * powerpc.cc (class Relocate_comdat_behavior): New.
559 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
560 gold::relocate_section with new template arg.
561
acc276d8
AM
5622012-10-18 Alan Modra <amodra@gmail.com>
563
564 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
565 dynamic relocs for GOT_TPREL got entries, without symbol if
566 resolving locally.
567 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
568 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
569 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
570
e10f9870
AM
5712012-10-17 Alan Modra <amodra@gmail.com>
572
573 PR gold/14726
574 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
575
ae034989
ST
5762012-10-16 Sriraman Tallam <tmsriram@google.com>
577
578 * layout.cc (Layout::include_section): Keep sections marked
579 SHF_EXCLUDE when doing relocatable links.
580
f3a0ed29
AM
5812012-10-16 Alan Modra <amodra@gmail.com>
582
583 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
584 (Target_powerpc::do_finalize_sections): Call it.
585 (Output_data_save_res): New class and supporting functions.
586 (Target_powerpc::symval_for_branch): Only look up .opd entry for
587 normal symbols defined in object files.
588
c6de8ed4
AM
5892012-10-12 Alan Modra <amodra@gmail.com>
590
591 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
592 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
593 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
594 section if scan_opd_relocs not yet called.
595 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
596
03e25981
AM
5972012-10-12 Alan Modra <amodra@gmail.com>
598
599 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
600 add_local_ifunc_entry): Revert last change.
601 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
602
c9824451
AM
6032012-10-05 Alan Modra <amodra@gmail.com>
604
605 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
606 do_plt_address_for_global): New functions.
607 (Output_data_got_powerpc::do_write): Don't segfault when linking
608 statically.
609 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
610 add_local_ifunc_entry): Return true on adding entry..
611 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
612 glink->add_entry call. Remove unused symtab param. Adjust calls.
613 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
614 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
615 set up symbols here.
616 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
617 syms here. Do so even when no .iplt. Don't segfault when linking
618 statically.
619 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
620 new variants without reloc param.
621 (Glink_sym_ent::Glink_sym_ent): Likewise.
622 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
623 reloc when refs will resolve to plt call stub.
624 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
625 R_PPC_PLTREL24 to resolve locally.
626 (Target_powerpc::Scan::global): Correct ifunc handling.
627 (Target_powerpc::Relocate::relocate): Correct local sym glink
628 lookup. Don't destroy "value" when we have a plt call stub,
629 and when checking plt call validity.
630 (Target_powerpc::do_dynsym_value): Simplify.
631
19fec8c1
AM
6322012-10-05 Alan Modra <amodra@gmail.com>
633
634 * i386.cc (Output_data_plt_i386::address_for_global,
635 address_for_local): Add plt offset to returned value. Adjust uses.
636 * sparc.cc (Output_data_plt_sparc::address_for_global,
637 address_for_local): Likewise.
638 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
639 address_for_local): Likewise.
640 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
641 address_for_local): Likewise.
642 * target.h (Target::plt_address_for_global, plt_address_for_local):
643 Update comment.
644 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
645 (Output_data_got::Got_entry::write): Nor here.
646 * output.h: Comment fix.
647
e867b647
WL
6482012-10-02 Jiong Wang <jiwang@tilera.com>
649
650 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
651 global_offset_table_ value for larget got.
652 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
653
e5d5f5ed
AM
6542012-09-29 Alan Modra <amodra@gmail.com>
655
656 * powerpc.cc (Target_powerpc::iplt_): New output section.
657 (Target_powerpc::iplt_section, make_iplt_section,
658 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
659 (Target_powerpc::make_plt_entry): Handle ifunc syms.
660 Target_powerpc::plt_entry_count): Count iplt entries too.
661 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
662 reloc section in constructor. New params.
663 (Target_powerpc::make_plt_section): Create reloc section here instead.
664 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
665 functions.
666 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
667 (Output_data_glink::add_entry, find_entry): New functions to
668 deal with local syms.
669 (Glink_sym_ent): Add support for local syms.
670 (Output_data_glink::do_write): Handle ifunc plt entries.
671 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
672 (Target_powerpc::Scan::local, global): Handle ifunc syms.
673 (Target_powerpc::Relocate::relocate): Likewise.
674 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
675
ec4dbad3
AM
6762012-09-25 Alan Modra <amodra@gmail.com>
677
678 * object.h (Sized_relobj_file::adjust_local_symbol,
679 do_adjust_local_symbol): New functions.
680 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
681 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
682 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
683 and irregular opd entry spacing.
684 (Powerpc_relobj::do_read_relocs): Add opd size checks.
685 (Global_symbol_visitor_opd): New functor.
686 (Target_powerpc::do_finalize_sections): Omit global symbols defined
687 on deleted opd entries.
688
5c0b3823
WL
6892012-09-15 Jiong Wang <jiwang@tilera.com>
690
691 * tilegx.cc: New file.
692 * Makefile.am (TARGETSOURCES): Add tilegx.cc
693 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
694 * configure.tgt: Add entries for tilegx*.
695 * configure.ac: Likewise.
696 * Makefile.in: Rebuild.
697 * configure: Likewise.
698 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
699 tilegx.
700
bfdfa4cd
AM
7012012-09-13 Alan Modra <amodra@gmail.com>
702
703 * target-reloc.h (scan_relocs): Call scan.local for relocs
704 against symbols in discarded sections. Pass is_discarded
705 param.
706 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
707 Add is_discarded param.
708 * powerpc (Target_powerpc::Scan::local): Likewise. Use
709 is_discarded to flag opd entry as discarded. Don't emit dyn
710 relocs on such entries.
711 (Target_powerpc::Scan::global): Similarly detect and handle
712 such opd entries.
713 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
714 opd_ent_. Update all uses.
715 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
716 (Target_powerpc::relocate_section): Zero out discarded opd
717 entry relocs.
718
d77a0555
ILT
7192012-09-12 Ian Lance Taylor <iant@google.com>
720
721 PR gold/14570
722 * output.cc: Rename Output_data_got template parameter from size
723 to got_size for all functions. Compile all variants of
724 Output_data_got.
725 (Output_data_got::Got_entry::write): Correct use of size for
726 symbol value. Use local_is_tls rather than casting to
727 Sized_relobj_file.
728 * object.h (class Object): Add local_is_tls and do_local_is_tls.
729 (class Sized_relobj_file): Add do_local_is_tls.
730 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
731
815a1205
AM
7322012-09-11 Alan Modra <amodra@gmail.com>
733
734 PR gold/14566
735 * layout.cc (Layout::set_segment_offsets): When using
736 common-page-size alignment, ensure we are on a new max-page-size
737 page.
738 * output.cc (Output_segment::set_section_addresses): Use
739 abi_pagesize, not common_pagesize for relro boundary.
740 (Output_segment::set_offset): Likewise.
741
bd73a62d
AM
7422012-09-11 Alan Modra <amodra@gmail.com>
743
744 * output.h (Output_data_got::add_global_tls, add_local_tls,
745 add_local_tls_pair): New functions.
746 (Output_data_got::add_local_pair_with_rel): Remove second
747 reloc param. Expand comment.
748 (Output_data_got::Got_entry): Rename use_plt_offset_ to
749 use_plt_or_tls_offset_, similarly for constructor param.
750 (Output_data_got::Got_entry::write): Add got_index param.
751 * output.cc (Output_data_got::add_global_tls, add_local_tls,
752 add_local_tls_pair): New functions.
753 (Output_data_got::Got_entry::write): Handle tls symbols
754 with use_plt_or_tls_offset_ set specially.
755 (Output_data_got::add_local_pair_with_rel): Only one reloc.
756 (Output_data_got::do_write): Replace iterator with index, pass
757 index to entry write function.
758 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
759 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
760 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
761 call.
762 * i386.cc (Target_i386::Scan::local): Likewise.
763 * sparc.cc (Target_sparc::Scan::local): Likewise.
764 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
765 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
766 do_tls_offset_for_global): New functions.
767 (Target_powerpc::Scan::local): Correct TLS relocations and got
768 entry values.
769 (Target_powerpc::Scan::global): Don't emit unnecessary
770 dynamic relocations on TLS GOT entries.
771
00716ab1
AM
7722012-09-10 Matthias Klose <doko@ubuntu.com>
773
774 * config.in: Disable sanity check for kfreebsd.
775
c891b3f9
SA
7762012-09-10 Sterling Augustine <saugustine@google.com>
777
778 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
779 (Gdb_index::pubtypes_read): New parameter.
780 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
781 to calls.
782 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
783 pubtypes_object_.
784
e81fea4d
AM
7852012-09-09 Alan Modra <amodra@gmail.com>
786
787 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
788 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
789 * gc.h (gc_process_relocs): Call target gc_add_reference.
790 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
791 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
792 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
793 unnecessary cast.
794 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
795 to cater for when we don't need code offset. Update use.
796 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
797 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
798 set_opd_valid): New functions.
799 (Target_powerpc::do_gc_add_reference): New function.
800 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
801 stashed refs.
802 (Target_powerpc::do_gc_mark_symbol): New function.
803
d2d60eef
CC
8042012-09-06 Cary Coutant <ccoutant@google.com>
805
806 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
807 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
808 (Dwarf_die::skip_attributes): Likewise.
809 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
810 * testsuite/gdb_index_test.cc (inline_func_1): New function.
811 (main): Call it.
812 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
813
32ed4573
L
8142012-09-05 H.J. Lu <hongjiu.lu@intel.com>
815
816 * testsuite/script_test_3.t: Add .got.plt output section
817 statement.
818 * testsuite/script_test_4.t: Likewise.
819
f4baf0d4
AM
8202012-09-05 Alan Modra <amodra@gmail.com>
821
822 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
823 update all uses and lose "enum" when using type.
824
864a1b56
AM
8252012-09-05 Alan Modra <amodra@gmail.com>
826
827 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
828 * configure: Regenerate.
829 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
830 (plugin_final_layout.stdout): Likewise.
831 (memory_test): Set page sizes to 0x1000.
832 * testsuite/Makefile.in: Regenerate.
833 * testsuite/discard_locals_test.sh: Add FIXME comment.
834 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
835 * testsuite/pr14265.t: Add .got output section statement.
836 * testsuite/script_test_2.t: Likewise.
837 * testsuite/script_test_3.t: Likewise.
838 * testsuite/script_test_4.t: Likewise.
839 * testsuite/script_test_5.t: Likewise.
840 * testsuite/script_test_6.t: Likewise.
841 * testsuite/script_test_7.t: Likewise.
842 * testsuite/script_test_9.t: Likewise.
843
3ea0a085
AM
8442012-09-05 Alan Modra <amodra@gmail.com>
845
846 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
847 (Powerpc_relocate_functions::Status): New typedef.
848 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
849 (Target_powerpc::Scan::local): Handle REL64.
850 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
851 for REL32 and REL64.
852 (Target_powerpc::symval_for_branch): New function, extracted from..
853 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
854 checks. Report overflow errors.
855
7404fe1b
AM
8562012-09-05 Alan Modra <amodra@gmail.com>
857
858 * object.h (Sized_relobj_file::emit_relocs): Delete.
859 (Sized_relobj_file::emit_relocs_reltype): Delete.
860 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
861 relocate_relocs for --emit-relocs.
862 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
863 * output.h: Update comment.
864 (Output_segment::first_section): New function.
865 (Output_segment::first_section_load_address): Use first_section.
866 * output.cc (Output_segment::first_section): New function extracted..
867 (Output_segment::first_section_load_address): ..from here. Delete.
868 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
869 * target.h (Sized_target::relocate_for_relocatable): Likewise.
870 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
871 adjust call to target.h function.
872 * i386.cc (Target_i386): Likewise.
873 * sparc.cc (Target_sparc): Likewise.
874 * x86_64.cc (Target_x86_64): Likewise.
875 * powerpc.cc (Target_powerpc): Likewise.
876 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
877 first tls section has section symbol for optimised local dynamic
878 output relocs.
879 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
880 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
881 optimised tls code.
882 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
883 Rename to relocate_relocs. Update error message.
884
957564c9
AS
8852012-09-04 Andreas Schwab <schwab@linux-m68k.org>
886
887 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
888 --just-symbols.
889
dd93cd0a
AM
8902012-08-31 Alan Modra <amodra@gmail.com>
891
892 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
893 (Powerpc_relobj::toc_base_offset): New stub function.
894 (Target_powerpc): Add tp_offset, dtp_offset. Rename
895 got_mod_index_offset to tlsld_got_offset. Update all refs.
896 (Target_powerpc::Relocate::enum skip_tls): New.
897 (Target_powerpc::call_tls_get_addr_): New var.
898 (Target_powerpc::is_branch_reloc): Move to file scope.
899 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
900 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
901 New functions.
902 (Target_powerpc::enum Got_type): Delete old values, add new ones.
903 (powerpc_info): Correct common_pagesize for ppc64.
904 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
905 (Powerpc_relocate_functions): Add overflow check enums and functions.
906 Add non-shift version of rela, rela_ua. Delete all rel public
907 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
908 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
909 addr16_ha3, addr14 functions.
910 (Output_data_got_powerpc::add_constant_pair): New function.
911 (Output_data_got_powerpc::got_base_offset): Likewise.
912 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
913 (instruction constants): Sort, add some more.
914 (Output_data_glink::do_write): Add and use Address typedef. Use
915 object->toc_base_offset() stub for 64-bit.
916 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
917 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
918 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
919 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
920 Always treat .opd relocs as against locally defined symbol.
921 Correct condition for RELATIVE relocs.
922 (Target_powerpc::do_finalize_sections): Test for NULL sections.
923 (Target_powerpc::Relocate::relocate): Use plt call stub as value
924 for 32-bit syms with a plt entry. Correct ppc64 toc base
925 calculations. Handle TLS relocs, and more. Add overflow
926 checking and adjust for Powerpc_relocate_functions changes.
927 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
928 Reinstate --emit-relocs code with FIXME.
929
a1373b60
AM
9302012-08-30 Alan Modra <amodra@gmail.com>
931
932 * layout.cc (Layout::set_segment_offsets): Set p_align to
933 abi_pagesize, not common_pagesize.
934 (Layout::relaxation_loop_body): Similarly use abi_pagesize
935 to determine whether file header can go in segment.
936
703d02da
AM
9372012-08-30 Alan Modra <amodra@gmail.com>
938
939 * output.h (Output_reloc::Output_reloc <output section>): Add
940 is_relative param. Adjust calls.
941 (Output_reloc::add_output_section_relative): New functions.
942 * output.cc (Output_reloc::Output_reloc <output section>): Handle
943 is_relative.
944 (Output_reloc::symbol_value): Handle SECTION_CODE.
945
16164a6b
ST
9462012-08-24 Sriraman Tallam <tmsriram@google.com>
947
948 * gold.cc (queue_middle_tasks): Call layout again when unique
949 segments for sections is desired.
950 * layout.cc (Layout::Layout): Initialize new members.
951 (Layout::get_output_section_flags): New function.
952 (Layout::choose_output_section): Call get_output_section_flags.
953 (Layout::layout): Make output section for mapping to a unique segment.
954 (Layout::insert_section_segment_map): New function.
955 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 956 output sections marked so.
16164a6b
ST
957 (Layout::segment_precedes): Check for unique segments when sorting.
958 * layout.h (Layout::Unique_segment_info): New struct.
959 (Layout::Section_segment_map): New typedef.
960 (Layout::insert_section_segment_map): New function.
961 (Layout::get_output_section_flags): New function.
962 (Layout::is_unique_segment_for_sections_specified): New function.
963 (Layout::set_unique_segment_for_sections_specified): New function.
964 (Layout::unique_segment_for_sections_specified_): New member.
965 (Layout::section_segment_map_): New member.
966 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
967 Rename is_gc_pass_one to is_pass_one.
968 Rename is_gc_pass_two to is_pass_two.
969 Rename is_gc_or_icf to is_two_pass.
970 Check for which pass based on whether symbols data is present.
971 Make it two pass when unique segments for sections is desired.
972 * output.cc (Output_section::Output_section): Initialize new
973 members.
974 * output.h (Output_section::is_unique_segment): New function.
975 (Output_section::set_is_unique_segment): New function.
976 (Output_section::is_unique_segment_): New member.
977 (Output_section::extra_segment_flags): New function.
978 (Output_section::set_extra_segment_flags): New function.
979 (Output_section::extra_segment_flags_): New member.
980 (Output_section::segment_alignment): New function.
981 (Output_section::set_segment_alignment): New function.
982 (Output_section::segment_alignment_): New member.
983 (Output_segment::Output_segment): Initialize is_unique_segment_.
984 (Output_segment::is_unique_segment): New function.
985 (Output_segment::set_is_unique_segment): New function.
986 (Output_segment::is_unique_segment_): New member.
987 * plugin.cc (allow_unique_segment_for_sections): New function.
988 (unique_segment_for_sections): New function.
989 (Plugin::load): Add new functions to transfer vector.
990 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
991 * Makefile.in: Regenerate.
992 * testsuite/plugin_final_layout.sh: Check if unique segment
993 functionality works.
994 * testsuite/plugin_section_order.c (onload): Check if new interfaces
995 are available.
996 (allow_unique_segment_for_sections): New global.
997 (unique_segment_for_sections): New global.
998 (claim_file_hook): Call allow_unique_segment_for_sections.
999 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1000
1e2bee4f
CC
10012012-08-22 Cary Coutant <ccoutant@google.com>
1002
1003 * layout.cc (Layout::include_section): Don't assert on GROUP
1004 sections with --emit-relocs.
1005
1d5dfe78
CC
10062012-08-21 Cary Coutant <ccoutant@google.com>
1007
1008 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1009 if --export-dynamic-symbol names an undef symbol.
1010
c9269dff
AM
10112012-08-18 Alan Modra <amodra@gmail.com>
1012
1013 * powerpc.cc: Formatting and white space.
1014 (Powerpc_relobj): Rename got2_section_ to special_.
1015 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1016 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1017 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1018 (Target_powerpc): Add Address typedef and invalid_address. Use
1019 throughout.
1020 (Target_powerpc::is_branch_reloc): New function.
1021 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1022 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1023 for dst_mask, value and addend.
1024 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1025 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1026 (Output_data_glink::do_write): Correct toc base. Don't try to use
1027 uint16_t for 24-bit offset. Use get_output_section_offset and
1028 check return.
1029 (Target_powerpc::Scan::local): Handle more relocs.
1030 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1031 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1032 Plug in toc restoring insn after plt calls. Translate branches
1033 to function descriptor symbols to corresponding entry point.
1034 (Target_powerpc::relocate_for_relocatable): Check return from
1035 get_output_section_offset.
1036 * symtab.h: Comment typo.
1037
b1759dce
ILT
10382012-08-14 Ian Lance Taylor <iant@google.com>
1039
1040 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1041 unsupported_relocal_local to call unsupported_reloc_global.
1042
b9b2ae8b
NC
10432012-08-14 Nick Clifton <nickc@redhat.com>
1044
1045 PR ld/14265
1046 * script-sections.cc (Sections_element::output_section_name): Add
1047 keep return parameter.
1048 (Output_section_element::match_name): Add keep return parameter.
1049 Return the value of the keep_ member.
1050 * script-sections.h (class Output_section): Update
1051 output_section_name prototype.
1052 * layout.cc (Layout::keep_input_section): New public member
1053 function.
1054 (Layout::choose_output_section): Pass keep parameter to
1055 output_section_name.
1056 * layout.h (class Layout): Add keep_input_section.
1057 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1058 sections.
1059 * testsuite/Makefile.am: Add a test.
1060 * testsuite/Makefile.in: Regenerate.
1061 * testsuite/pr14265.c: Source file for the test.
1062 * testsuite/pr14265.t: Linker script for the test.
1063 * testsuite/pr14265.sh: Shell script for the test.
1064
921b5322
AM
10652012-08-14 Alan Modra <amodra@gmail.com>
1066
1067 * target.h (Target::output_section_name): New function.
1068 (Target::do_output_section_name): New function.
1069 * layout.cc (Layout::choose_output_section): Call the above.
1070 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1071
6ce78956
AM
10722012-08-14 Alan Modra <amodra@gmail.com>
1073
1074 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1075 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1076 for replace_constant call.
1077 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1078 (Output_data_glink::do_print_to_mapfile): New function.
1079 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1080 (Target_powerpc::Relocate::relocate): Likewise.
1081
d1a8cabd
AM
10822012-08-14 Alan Modra <amodra@gmail.com>
1083
1084 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1085 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1086 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1087 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1088 all references to shndx_. Handle special case for R_PPC_PLTREL24
1089 here.
1090 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1091 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1092 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1093 here.
1094 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1095 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1096
d83ce4e3
AM
10972012-08-12 Alan Modra <amodra@gmail.com>
1098
1099 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1100 (glink insn constants): Use uint32_t.
1101 (Output_data_glink::add_entry): Use insert, not [] operator.
1102
cf43a2fe
AM
11032012-08-11 Alan Modra <amodra@gmail.com>
1104
1105 * object.h (Sized_relobj_file::find_shdr): New function.
1106 (Sized_relobj_file::find_special_sections): New function.
1107 * object.cc (Sized_relobj_file::find_shdr): New function.
1108 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1109 (Sized_relobj_file::find_special_sections): New function, split out..
1110 (Sized_relobj_file::do_read_symbols): ..from here.
1111 * output.h (Output_data_got::replace_constant): New function.
1112 (Output_data_got::num_entries): New function.
1113 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1114 (Output_data_got::got_offset): Protected rather than private.
1115 (Output_data_got::replace_got_entry): New function.
1116 * output.cc (Output_data_got::replace_got_entry): New function.
1117 * powerpc.cc (class Powerpc_relobj): New.
1118 (class Powerpc_relocate_functions): Delete all psymval variants or
1119 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1120 Implement _ha functions using corresponding _hi function.
1121 (Powerpc_relobj::find_special_sections): New function.
1122 (Target_powerpc::do_make_elf_object): New function.
1123 (class Output_data_got_powerpc): New.
1124 (class Output_data_glink): New.
1125 (class Powerpc_scan_relocatable_reloc): New.
1126 Many more changes througout file.
1127
3c892704
NC
11282012-08-09 Nick Clifton <nickc@redhat.com>
1129
1130 * po/vi.po: Updated Vietnamese translation.
1131
82435b3b
ILT
11322012-08-07 Ian Lance Taylor <iant@google.com>
1133
1134 * layout.cc (Layout::add_target_dynamic_tags): If
1135 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1136 plt_rel.
1137
a6dc81d2
NC
11382012-07-30 Nick Clifton <nickc@redhat.com>
1139
1140 * po/gold.pot: Updated template.
1141 * po/es.po: Updated Spanish translation.
1142
f1415016
CC
11432012-07-18 Cary Coutant <ccoutant@google.com>
1144
1145 PR gold/14344
1146 * configure.ac: Add check for -gpubnames support.
1147 * configure: Regenerate.
1148 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1149 support; force -gno-pubnames.
1150 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1151 support.
1152 (gdb_index_test_4): New test.
1153 * testsuite/Makefile.in: Regenerate.
1154 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1155 * testsuite/gdb_index_test_2.sh: Likewise.
1156 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1157 * testsuite/gdb_index_test_4.sh: New script.
1158 * testsuite/gdb_index_test_comm.sh: New script with common code;
1159 don't look for space after colon.
1160
b7fd7c37
ST
11612012-07-16 Sriraman Tallam <tmsriram@google.com>
1162
1163 * gold.cc (queue_middle_tasks): Update function order only after
1164 deferred objects due to plugins are processed.
1165
1f3212db
ILT
11662012-07-11 Ian Lance Taylor <iant@google.com>
1167
1168 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1169 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1170 (Target_arm::scan_reloc_for_stub): Likewise.
1171 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1172 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1173 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1174 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1175 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1176
81c82a68
ILT
11772012-07-10 Dodji Seketeli <dodji@redhat.com>
1178 Ian Lance Taylor <iant@google.com>
1179
1180 PR gold/14309
1181 * configure.ac: Test whether std::tr1::hash<off_t> works.
1182 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1183 needed.
1184 * output.h (class Output_fill): Add virtual destructor.
1185 * configure, config.in: Rebuild.
1186
eabc84f4
RM
11872012-06-22 Roland McGrath <mcgrathr@google.com>
1188
1189 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1190
370e30b6
RÁE
11912012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1192
1193 * plugin.cc (Plugin::load): Handle position independent executables.
1194
fb1b895d
CC
11952012-06-06 Cary Coutant <ccoutant@google.com>
1196
1197 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1198 add .debug_macro.
1199 (lines_only_debug_sections): Likewise.
1200 (gdb_fast_lookup_sections): New static array.
1201 (is_gdb_debug_section): Rename formal parameter.
1202 (is_lines_only_debug_section): Likewise.
1203 (is_gdb_fast_lookup_section): New function.
1204 (Layout::include_section): Check for ".zdebug_" prefix; pass
1205 section name suffix to is_gdb_debug_section, et al.; check for
1206 fast-lookup sections when building .gdb_index.
1207 * options.h (--strip-debug-gdb): Update GDB version number.
1208
7c0640fa
CC
12092012-06-06 Cary Coutant <ccoutant@google.com>
1210
1211 * configure.ac: Add check for fallocate.
1212 * configure: Regenerate.
1213 * config.in: Regenerate.
1214
1215 * options.h (class General_options): Add --mmap-output-file and
1216 --posix-fallocate options.
1217 * output.cc: (posix_fallocate): Remove; replace with...
1218 (gold_fallocate): New function.
1219 (Output_file::map_no_anonymous): Call gold_fallocate.
1220 (Output_file::map): Check --mmap-output-file option.
1221
2a49eb69
DK
12222012-06-05 Jing Yu <jingyu@google.com>
1223
1224 * gold.h (textdomain): Add do {} to empty while(0).
1225 (bindtextdomain): Likewise.
1226
fad072ac
CC
12272012-06-04 Cary Coutant <ccoutant@google.com>
1228
1229 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1230 has_dynsym_index.
1231
8cc69fb6
ST
12322012-05-25 Sriraman Tallam <tmsriram@google.com>
1233
1234 * symtab.cc (Symbol_table::define_special_symbol):
1235 Initialize *poldsym to prevent uninitialized variable errors.
1236
1be75daa
CC
12372012-05-23 Cary Coutant <ccoutant@google.com>
1238
1239 * layout.cc (Layout::section_name_mapping): Add rules to handle
1240 exact match on .data.rel.ro.local or .data.rel.ro.
1241 (Layout::output_section_name): Check for exact matches.
1242
9b689de0
CC
12432012-05-23 Cary Coutant <ccoutant@google.com>
1244
1245 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1246 more carefully.
1247
b24fdbf5
CC
12482012-05-22 Cary Coutant <ccoutant@google.com>
1249
1250 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1251 object before exporting symbol.
1252
e550e1a2
L
12532012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1254
1255 * testsuite/tls_test.cc: Include "config.h" first.
1256 * testsuite/tls_test_c.c: Likewise.
1257
df7b86aa
NC
12582012-05-17 Daniel Richard G. <skunk@iskunk.org>
1259 Nick Clifton <nickc@redhat.com>
1260
1261 PR 14072
1262 * configure.in: Add check that sysdep.h has been included before
1263 any system header files.
1264 * configure: Regenerate.
1265 * config.in: Regenerate.
1266
1007b503
CC
12672012-05-14 Cary Coutant <ccoutant@google.com>
1268
1269 * layout.cc (Layout::make_output_section): Mark .tdata section
1270 as RELRO.
1271 * testsuite/relro_test.cc: Add a TLS variable.
1272
fd885f3a
L
12732012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1274
1275 PR gold/14091
1276 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1277 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1278 R_X86_64_64.
1279
80f5885c
CC
12802012-05-08 Cary Coutant <ccoutant@google.com>
1281
1282 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1283 (lines_only_debug_sections): Likewise.
1284
2e702c99
RM
12852012-05-02 Roland McGrath <mcgrathr@google.com>
1286
1287 * nacl.cc: New file.
1288 * nacl.h: New file.
1289 * Makefile.am (CCFILES, HFILES): Add them.
1290 * Makefile.in: Regenerate.
1291 * i386.cc (Output_data_plt_i386_nacl): New class.
1292 (Output_data_plt_i386_nacl_exec): New class.
1293 (Output_data_plt_i386_nacl_dyn): New class.
1294 (Target_i386_nacl): New class.
1295 (Target_selector_i386_nacl): New class.
1296 (target_selector_i386): Use it instead of Target_selector_i386.
1297 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1298 (Target_x86_64_nacl): New class.
1299 (Target_selector_x86_64_nacl): New class.
1300 (target_selector_x86_64, target_selector_x32): Use it instead of
1301 Target_selector_x86_64.
1302 * arm.cc (Output_data_plt_arm_nacl): New class.
1303 (Target_arm_nacl): New class.
1304 (Target_selector_arm_nacl): New class.
1305 (target_selector_arm, target_selector_armbe): Use it instead of
1306 Target_selector_arm.
1307
1308 * target-select.cc (select_target): Take new Input_file* and off_t
1309 arguments, pass them on to recognize method of selector.
1310 * object.cc (make_elf_sized_object): Update caller.
1311 * parameters.cc (parameters_force_valid_target): Likewise.
1312 * incremental.cc (make_sized_incremental_binary): Likewise.
1313 * target-select.h: Update decl.
1314 (Target_selector::recognize): Take new Input_file* argument,
1315 pass it on to do_recognize.
1316 (Target_selector::do_recognize): Take new Input_file* argument.
1317 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1318 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1319 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1320 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1321
1322 * target.h (Target::Target_info): New members isolate_execinstr
1323 and rosegment_gap.
1324 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1325 * arm.cc (Target_arm::arm_info): Update initializer.
1326 * i386.cc (Target_i386::i386_info): Likewise.
1327 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1328 * sparc.cc (Target_sparc::sparc_info): Likewise.
1329 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1330 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1331 * layout.cc (Layout::attach_allocated_section_to_segment):
1332 Take new const Target* argument. If target->isolate_execinstr(), act
1333 like --rosegment.
1334 (Layout::find_first_load_seg): Take new const Target* argument;
1335 if target->isolate_execinstr(), reject PF_X segments.
1336 (Layout::relaxation_loop_body): Update caller.
1337 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1338 reset file offset to zero when we hit LOAD_SEG, and then do a second
1339 loop over the segments before LOAD_SEG to reassign offsets after
1340 addresses have been determined. Handle target->rosegment_gap().
1341 (Layout::attach_section_to_segment): Take new const Target* argument;
1342 pass it to attach_allocated_section_to_segment.
1343 (Layout::make_output_section): Update caller.
1344 (Layout::attach_sections_to_segments): Take new const Target* argument;
1345 pass it to attach_section_to_segment.
1346 * gold.cc (queue_middle_tasks): Update caller.
1347 * layout.h (Layout): Update method decls with new arguments.
1348
1349 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1350 Target_info pointer to use.
1351 (Target_arm::do_make_data_plt): New virtual method.
1352 (Target_arm::make_data_plt): New method that calls it.
1353 (Target_arm::make_plt_entry): Use it.
1354 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1355 for the section alignment.
1356 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1357 method.
1358 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1359 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1360 method.
1361 (Output_data_plt_arm::get_plt_entry_size): Call it.
1362 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1363 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1364 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1365 method.
1366 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1367 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1368 method instead of sizeof(plt_entry).
1369 (Output_data_plt_arm::add_entry): Likewise.
1370 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1371 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1372 than static method.
1373 (Target_arm::plt_entry_size): Likewise.
1374 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1375 Move to ...
1376 (Output_data_plt_arm_standard): ... here, new class.
1377 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1378 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1379 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1380
1381 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1382 Take additional argument for the PLT entry size.
1383 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1384 Use get_plt_entry_size method rather than plt_entry_size variable.
1385 (Output_data_plt_x86_64::reserve_slot): Likewise.
1386 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1387 (Output_data_plt_x86_64::add_entry): Likewise.
1388 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1389 (Output_data_plt_x86_64::address_for_global): Likewise.
1390 (Output_data_plt_x86_64::address_for_local): Likewise.
1391 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1392 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1393 Make method non-static.
1394 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1395 method.
1396 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1397 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1398 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1399 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1400 virtual method.
1401 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1402 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1403 virtual method.
1404 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1405 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1406 virtual method.
1407 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1408 (Output_data_plt_x86_64::plt_entry_size)
1409 (Output_data_plt_x86_64::first_plt_entry)
1410 (Output_data_plt_x86_64::plt_entry)
1411 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1412 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1413 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1414 (Output_data_plt_x86_64_standard): ... here, new class.
1415 (Target_x86_64::Target_x86_64): Take optional argument for the
1416 Target_info pointer to use.
1417 (Target_x86_64::do_make_data_plt): New virtual method.
1418 (Target_x86_64::make_data_plt): New method to call it.
1419 (Target_x86_64::init_got_plt_for_update): Use that.
1420 Call this->plt_->add_eh_frame method here.
1421 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1422 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1423 rather than static method.
1424 (Target_x86_64::plt_entry_size): Likewise.
1425 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1426 rather than plt_entry_size variable. Move guts of PLT filling to...
1427 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1428 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1429 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1430
1431 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1432 additional argument for the section alignment.
1433 Don't do add_eh_frame_for_plt here.
1434 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1435 non-static. Use get_plt_entry_size method rather than plt_entry_size
1436 variable.
1437 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1438 method.
1439 (Output_data_plt_i386::get_plt_entry_size): Call it.
1440 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1441 (Output_data_plt_i386::add_eh_frame): New method to call it.
1442 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1443 method.
1444 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1445 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1446 method.
1447 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1448 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1449 method instead of plt_entry_size.
1450 (Output_data_plt_i386::plt_entry_size)
1451 (Output_data_plt_i386::plt_eh_frame_fde_size)
1452 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1453 (Output_data_plt_i386_standard): ... here, new class.
1454 (Output_data_plt_i386_exec): New class.
1455 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1456 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1457 (Output_data_plt_i386::exec_plt_entry): Move to ...
1458 (Output_data_plt_i386_exec::plt_entry): ... here.
1459 (Output_data_plt_i386_dyn): New class.
1460 (Output_data_plt_i386::first_plt_entry): Move to ...
1461 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1462 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1463 (Output_data_plt_i386_dyn::plt_entry): ... here.
1464 (Target_i386::Target_i386): Take optional argument for the Target_info
1465 pointer to use.
1466 (Target_i386::do_make_data_plt): New virtual method.
1467 (Target_i386::make_data_plt): New method to call it.
1468 (Target_i386::make_plt_section): Use that.
1469 Call this->plt_->add_eh_frame method here.
1470 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1471 rather than plt_entry_size variable.
1472 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1473 (Output_data_plt_i386::address_for_local): Likewise.
1474 (Output_data_plt_i386::do_write): Likewise.
1475 Move guts of PLT filling to...
1476 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1477 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1478 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1479 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1480
b9b9f2ee
CC
14812012-05-01 Cary Coutant <ccoutant@google.com>
1482
1483 * dwarf_reader.cc (Dwarf_die::read_attributes)
1484 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1485 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1486 * reduced_debug_output.cc
1487 (Output_reduced_debug_info_section::get_die_end): Remove
1488 DW_FORM_GNU_ref_index. Add default case.
1489
57923f48
MW
14902012-04-26 Mark Wielaard <mjw@redhat.com>
1491
1492 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1493 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1494 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1495 DW_AT_high_pc as offset from DW_AT_low_pc.
1496
1497 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1498 * testsuite/Makefile.in: Regenerate.
1499 * testsuite/gdb_index_test_3.c: New test source file.
1500 * testsuite/gdb_index_test_3.sh: New test source file.
1501
2c54b4f4
ILT
15022012-04-25 Ian Lance Taylor <iant@google.com>
1503
1504 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1505 pointer.
1506 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1507 as a class, not a struct.
1508 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1509 (Target_arm::apply_cortex_a8_workaround): Likewise.
1510 * gc.h: Declare Reloc_types as a struct, not a class.
1511 * object.h: Declare Symbols_data as a struct.
1512 * reloc.h: Declare Read_relocs_data as a struct.
1513 * target.h: Declare Relocate_info as a struct.
1514
a5a5f7a3
DM
15152012-04-24 David S. Miller <davem@davemloft.net>
1516
1517 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1518 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1519 and R_SPARC_WPLT30.
1520
f038d496
CC
15212012-04-24 Cary Coutant <ccoutant@google.com>
1522
1523 * incremental-dump.cc (find_input_containing_global): Replace
1524 magic number with symbolic constant.
1525 (dump_incremental_inputs): Update version number.
1526 * incremental.cc (Output_section_incremental_inputs): Update version
1527 number; import symbolic constants from Incremental_inputs_reader.
1528 (Incremental_inputs::create_data_sections): Align relocations
1529 section correctly for 64-bit targets.
1530 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1531 constants; add padding.
1532 (Output_section_incremental_inputs::write_header): Add assert for
1533 header_size.
1534 (Output_section_incremental_inputs::write_input_files): Add assert
1535 for input_entry_size.
1536 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1537 add assert for object_info_size, input_section_entry_size,
1538 global_sym_entry_size.
1539 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1540 for data structure sizes; use them.
1541 (Incremental_input_entry_reader): Import symbolic constants from
1542 Incremental_inputs_reader; use them.
1543
a4d85145
DM
15442012-04-23 David S. Miller <davem@davemloft.net>
1545
1546 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1547 and elf_flags_set_.
1548 (Target_sparc::Target_sparc): Initialize new fields.
1549 (Target_sparc::do_make_elf_object): New function.
1550 (Target_sparc::do_adjust_elf_header): New function.
1551
1d509098
CC
15522012-04-23 Cary Coutant <ccoutant@google.com>
1553
1554 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1555 CU range table of gdb index.
1556
7ebeff7f
DM
15572012-04-20 David S. Miller <davem@davemloft.net>
1558
1559 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1560 instead of false.
1561
13cf9988
DM
15622012-04-16 David S. Miller <davem@davemloft.net>
1563
2a1079e8
DM
1564 * sparc.cc (Target_sparc::got_address): New function.
1565 (Sparc_relocate_functions::gdop_hix22): New function.
1566 (Sparc_relocate_functions::gdop_lox10): New function.
1567 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1568 relocs.
1569 (Target_sparc::Scan::local): Likewise if the global symbol is not
1570 preemptible and is not IFUNC.
1571 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1572 transformations for local and non-preemptible non-IFUNC global
1573 symbols.
1574
0bc964fc
DM
1575 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1576 writing out 64-bit part of ranges.
1577
661d7a80
DM
1578 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1579 -fpic and -fpie respectively.
1580 * Makefile.in: Regenerate.
1581
8c2bf391
DM
1582 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1583 (Target_sparc::Target_sparc): Initialize new field.
1584 (Target_sparc::do_plt_section_for_global): New function.
1585 (Target_sparc::do_plt_section_for_local): New function.
1586 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1587 (Target_sparc::make_plt_section): New function, broken out of
1588 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1589 (Target_sparc::make_plt_entry): Call make_plt_section.
1590 (Target_sparc::make_local_ifunc_plt_entry): New function.
1591 (Target_sparc::rela_ifunc_section): New function.
1592 (Target_sparc::plt_section): Remove const.
1593 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1594 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1595 and ifunc_count_ fields.
1596 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1597 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1598 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1599 (Output_data_plt_sparc::rela_ifunc): New function.
1600 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1601 (Output_data_plt_sparc::has_ifunc_section): New function.
1602 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1603 (Output_data_plt_sparc::address_for_global): New function.
1604 (Output_data_plt_sparc::address_for_local): New function.
1605 (Output_data_plt_sparc::plt_index_to_offset): New function.
1606 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1607 and entry_count.
1608 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1609 entry_count.
1610 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1611 R_SPARC_JMP_IREL to switch.
1612 (Target_sparc::Scan::check_non_pic): Likewise.
1613 (Target_sparc::Scan::local): Handle IFUNC symbols.
1614 (Target_sparc::Scan::local): Likewise.
1615 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1616 and plt_address_for_local.
1617 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1618 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1619
13cf9988
DM
1620 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1621 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1622 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1623 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1624 global relocs too.
1625 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1626 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1627 calls.
1628 * sparc.cc (Target_sparc::Scan::global): Likewise.
1629 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1630
31821be0
CC
16312012-04-16 Cary Coutant <ccoutant@google.com>
1632
1633 * archive.cc (Library_base::should_include_member): Check for
1634 --export-dynamic-symbol.
1635 * options.h (class General_options): Add --export-dynamic-symbol.
1636 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1637 --export-dynamic-symbol.
1638 (Symbol_table::gc_mark_undef_symbols): Likewise.
1639 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1640
2615994e
DM
16412012-04-12 David S. Miller <davem@davemloft.net>
1642
1643 * sparc.cc (Reloc::wdisp10): New relocation method.
1644 (Reloc::h34): Likewise.
1645 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1646 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1647 R_SPARC_WDISP10.
1648 (Target_sparc::Scan::local): Likewise.
1649 (Target_sparc::Scan::global): Likewise.
1650 (Target_sparc::Relocate::relocate): Likewise.
1651
6782735d
CC
16522012-04-09 Cary Coutant <ccoutant@google.com>
1653
1654 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1655 low_pc == 0.
1656
8c7a0b00
ILT
16572012-04-06 Ian Lance Taylor <iant@google.com>
1658
1659 * timer.cc: #include <unistd.h>.
1660
58797674
RM
16612012-04-06 Roland McGrath <mcgrathr@google.com>
1662
1663 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1664 * config.in: Regenerate.
1665 * configure: Regenerate.
1666
44350750
NC
16672012-04-05 Nick Clifton <nickc@redhat.com>
1668
1669 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1670 (AM_LC_MESSAGES): Add.
1671 * aclocal.m4: Regenerate.
1672 * config.in: Regenerate.
1673 * configure: Regenerate.
1674
c1027032
CC
16752012-03-21 Cary Coutant <ccoutant@google.com>
1676
1677 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1678 * Makefile.in: Regenerate.
1679 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1680 (Sized_elf_reloc_mapper::symbol_section): New function.
1681 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1682 (make_elf_reloc_mapper): New function.
1683 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1684 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1685 (Dwarf_abbrev_table::do_get_abbrev): New function.
1686 (Dwarf_ranges_table::read_ranges_table): New function.
1687 (Dwarf_ranges_table::read_range_list): New function.
1688 (Dwarf_pubnames_table::read_section): New function.
1689 (Dwarf_pubnames_table::read_header): New function.
1690 (Dwarf_pubnames_table::next_name): New function.
1691 (Dwarf_die::Dwarf_die): New function.
1692 (Dwarf_die::read_attributes): New function.
1693 (Dwarf_die::skip_attributes): New function.
1694 (Dwarf_die::set_name): New function.
1695 (Dwarf_die::set_linkage_name): New function.
1696 (Dwarf_die::attribute): New function.
1697 (Dwarf_die::string_attribute): New function.
1698 (Dwarf_die::int_attribute): New function.
1699 (Dwarf_die::uint_attribute): New function.
1700 (Dwarf_die::ref_attribute): New function.
1701 (Dwarf_die::child_offset): New function.
1702 (Dwarf_die::sibling_offset): New function.
1703 (Dwarf_info_reader::check_buffer): New function.
1704 (Dwarf_info_reader::parse): New function.
1705 (Dwarf_info_reader::do_parse): New function.
1706 (Dwarf_info_reader::do_read_string_table): New function.
1707 (Dwarf_info_reader::lookup_reloc): New function.
1708 (Dwarf_info_reader::get_string): New function.
1709 (Dwarf_info_reader::visit_compilation_unit): New function.
1710 (Dwarf_info_reader::visit_type_unit): New function.
1711 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1712 Sized_elf_reloc_mapper.
1713 (Sized_dwarf_line_info::symbol_section): Remove function.
1714 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1715 (Sized_dwarf_line_info::read_line_mappings): Remove object
1716 parameter, adjust callers.
1717 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1718 * dwarf_reader.h: Include <sys/types.h>.
1719 (class Track_relocs): Remove forward declaration.
1720 (class Elf_reloc_mapper): New class.
1721 (class Sized_elf_reloc_mapper): New class.
1722 (class Dwarf_abbrev_table): New class.
1723 (class Dwarf_range_list): New class.
1724 (class Dwarf_ranges_table): New class.
1725 (class Dwarf_pubnames_table): New class.
1726 (class Dwarf_die): New class.
1727 (class Dwarf_info_reader): New class.
1728 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1729 (Sized_dwarf_line_info::symbol_section): Remove member function.
1730 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1731 base class.
1732 * gdb-index.cc: New source file.
1733 * gdb-index.h: New source file.
1734 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1735 and .debug_types sections, call Layout::add_to_gdb_index.
1736 (Sized_relobj_incr::do_section_name): Implement.
1737 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1738 return type; Implement.
1739 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1740 return type.
1741 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1742 parameter list and return type.
1743 (Sized_incr_dynobj::do_section_contents): Likewise.
1744 * layout.cc: Include gdb-index.h.
1745 (Layout::Layout): Initialize gdb_index_data_.
1746 (Layout::init_fixed_output_section): Check for .gdb_index section.
1747 (Layout::add_to_gdb_index): New function. Instantiate.
1748 * layout.h: Add forward declaration for class Gdb_index.
1749 (Layout::add_to_gdb_index): New member function.
1750 (Layout::gdb_index_data_): New data member.
1751 * main.cc: Include gdb-index.h.
1752 (main): Print statistics for gdb index.
1753 * object.cc (Object::section_contents): Move code into
1754 do_section_contents.
1755 (need_decompressed_section): Check for sections needed when building
1756 gdb index.
1757 (build_compressed_section_map): Likewise.
1758 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1759 gdb index.
1760 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1761 sections; call Layout::add_to_gdb_index.
1762 (Sized_relobj_file::do_decompressed_section_contents): Call
1763 do_section_contents directly.
1764 * object.h (Object::do_section_contents): Adjust parameter list and
1765 return type.
1766 (Object::do_decompressed_section_contents): Call do_section_contents
1767 directly.
1768 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1769 return type.
1770 * options.h (class General_options): Add --gdb-index option.
1771 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1772 list and return type.
1773 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1774 * reloc.h (Track_relocs::checkpoint): New function.
1775 (Track_relocs::reset): New function.
1776
1777 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1778 New test cases.
1779 * testsuite/Makefile.in: Regenerate.
1780 * testsuite/gdb_index_test.cc: New test source file.
1781 * testsuite/gdb_index_test_1.sh: New test source file.
1782 * testsuite/gdb_index_test_2.sh: New test source file.
1783
647f1574
DK
17842012-03-19 Doug Kwan <dougkwan@google.com>
1785
1786 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1787 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1788 __exidx_start and __exidx_end. Make symbol table parameter
1789 anonymous as it is not used.
1790 * gold.cc (queue_middle_tasks): Call target hook to define any
1791 target-specific symbols.
1792 * target.h (Target::define_standard_symbols): New method.
1793 (Target::do_define_standard_symbols): Same.
1794 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1795 * testsuite/Makefile.in: Regenerate.
1796 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1797 and __exidx_end.
1798 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1799 relocations are generated for __exidx_start and __exidx_end.
1800
7c6109da
DK
18012012-03-16 Doug Kwan <dougkwan@google.com>
1802
1803 * testsuite/Makefile.am: Disable test initpri3b.
1804 * testsuite/Makefile.in: Regenerate.
1805
7b8957f8
DK
18062012-03-15 Doug Kwan <dougkwan@google.com>
1807
1808 * arm.cc (Target_arm::got_section): Make .got section read-only
1809 if -z now is given.
1810
14dc9ef7
ILT
18112012-03-15 Ian Lance Taylor <iant@google.com>
1812
1813 PR gold/13850
1814 * layout.cc (Layout::make_output_section): Correctly mark
1815 SHT_INIT_ARRAY, et. al., as relro.
1816
fa40b62a
DK
18172012-03-14 Doug Kwan <dougkwan@google.com>
1818
1819 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1820 dynamic relocations for protected symbols in shared objects.
1821
fd325007
ILT
18222012-03-13 Ian Lance Taylor <iant@google.com>
1823
1824 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1825 keep the larger alignment.
1826
e8dd54e1
CC
18272012-03-12 Cary Coutant <ccoutant@google.com>
1828
1829 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1830 handling of DW_LNE_define_file.
1831
feb5f3b0
CC
18322012-03-12 Cary Coutant <ccoutant@google.com>
1833
1834 * reduced_debug_output.cc
1835 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1836 codes to switch.
1837
a1fb4256
CC
18382012-02-29 Cary Coutant <ccoutant@google.com>
1839
1840 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1841
5dd8762a
CC
18422012-02-29 Cary Coutant <ccoutant@google.com>
1843
1844 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1845 Call Object::decompressed_section_contents.
1846 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1847 New dtor.
1848 (Sized_dwarf_line_info::buffer_start_): New data member.
1849 * merge.cc (Output_merge_data::do_add_input_section): Call
1850 Object::decompressed_section_contents.
1851 (Output_merge_string::do_add_input_section): Likewise.
1852 * object.cc (need_decompressed_section): New function.
1853 (build_compressed_section_map): Decompress sections needed later.
1854 (Sized_relobj_file::do_decompressed_section_contents): New function.
1855 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1856 * object.h (Object::decompressed_section_contents): New function.
1857 (Object::discard_decompressed_sections): New function.
1858 (Object::do_decompressed_section_contents): New function.
1859 (Object::do_discard_decompressed_sections): New function.
1860 (Compressed_section_info): New type.
1861 (Compressed_section_map): Include decompressed section contents.
1862 (Sized_relobj_file::do_decompressed_section_contents): New function.
1863 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1864
7b5de7ee
CC
18652012-02-16 Cary Coutant <ccoutant@google.com>
1866
1867 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1868 * testsuite/Makefile.in: Regenerate.
1869
f9fa4a63
CC
18702012-02-14 Cary Coutant <ccoutant@google.com>
1871
1872 * options.cc (General_options::finalize): Disallow -pie and -static.
1873
2c175ebc
DK
18742012-02-03 Doug Kwan <dougkwan@google.com>
1875
1876 * arm.cc (Arm_relocate_functions::abs8,
1877 Arm_relocate_functions::abs16): Use
1878 Bits::has_signed_unsigned_overflow32.
1879 (Arm_relocate_functions::thm_abs8): Correct range of
1880 overflow check.
1881 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1882 in assertions.
1883
90cff06f
DK
18842012-02-02 Doug Kwan <dougkwan@google.com>
1885
1886 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1887 position independent outputs, not just shared objects.
1888
63887f3d
L
18892012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1890
1891 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1892 * configure: Regenerated.
1893
bef2b434
ILT
18942012-01-27 Ian Lance Taylor <iant@google.com>
1895
1896 * reloc.h (Bits): New class with static functions, copied from
1897 namespace utils in arm.cc.
1898 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1899 instead.
1900
c335b55d
L
19012012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1902
1903 * incremental.cc (write_info_blocks): Correct relocation offset.
1904
41194d9f
L
19052012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1906
1907 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1908 (Relocate::tls_gd_to_le): Likewise.
1909
1bae613c
L
19102012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1911
1912 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1913
24482ca0
L
19142012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1915
1916 * configure.ac: Check if -mcmodel=medium works.
1917 * configure: Regenerated.
1918
c2c7840a
CC
19192012-01-24 Cary Coutant <ccoutant@google.com>
1920
1921 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1922 definition and ...
1923 (read_unsigned_LEB_128_x): ... this new function.
1924 (read_signed_LEB_128): Replaced with inline definition and ...
1925 (read_signed_LEB_128_x): ... this new function.
1926 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1927 (read_unsigned_LEB_128): Add inline definition.
1928 (read_signed_LEB_128_x): New function.
1929 (read_signed_LEB_128): Add inline definition.
1930 * testsuite/Makefile.am (leb128_unittest): New unit test.
1931 * testsuite/Makefile.in: Regenerate.
1932 * testsuite/leb128_unittest.cc: New unit test.
1933
833de760 19342012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1935
1936 PR gold/13617
1937 * i386.cc (Target_i386::do_code_fill): When using a jmp
1938 instruction, pad with nop instructions.
1939 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1940
618d6666
L
19412012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1942
1943 * x86_64.cc (gc_process_relocs): Add typename on types used in
1944 template.
1945 (scan_relocs): Likewise.
1946 (relocate_section): Likewise.
1947 (apply_relocation): Likewise.
1948
3660ff06
L
19492012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1950
1951 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1952 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1953 under x32.
1954
fc51264f
L
19552012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1956
1957 * x86_64.cc: Initial support for x32.
1958
dd74ae06
CC
19592012-01-03 Cary Coutant <ccoutant@google.com>
1960
1961 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1962 Use abstract base class for GOT.
1963 * gold/output.h (class Output_data_got_base): New abstract base class.
1964 (class Output_data_got): Derive from new base class, adjust ctors.
1965 (Output_data_got::reserve_slot): Make virtual; rename to
1966 do_reserve_slot; Adjust callers.
1967 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1968 pointer to abstract base class.
1969 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1970
83896202
ILT
19712011-12-18 Ian Lance Taylor <iant@google.com>
1972
1973 * object.h (Relobj::local_symbol_value): New function.
1974 (Relobj::local_plt_offset): New function.
1975 (Relobj::local_has_got_offset): New function.
1976 (Relobj::local_got_offset): New function.
1977 (Relobj::set_local_got_offset): New function.
1978 (Relobj::do_local_symbol_value): New pure virtual function.
1979 (Relobj::do_local_plt_offset): Likewise.
1980 (Relobj::do_local_has_got_offset): Likewise.
1981 (Relobj::do_local_got_offset): Likewise.
1982 (Relobj::do_set_local_got_offset): Likewise.
1983 (Sized_relobj::do_local_has_got_offset): Rename from
1984 local_has_got_offset.
1985 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1986 (Sized_relobj::do_set_local_got_offset): Rename from
1987 set_local_got_offset.
1988 (Sized_relobj_file::do_local_plt_offset): Rename from
1989 local_plt_offset.
1990 (Sized_relobj_file::do_local_symbol_value): New function.
1991 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1992 local_plt_offset.
1993 * output.cc (Output_data_got::Got_entry::write): Change object to
1994 Relobj. Use local_symbol_value.
1995 (Output_data_got::add_global_with_rel): Change rel_dyn to
1996 Output_data_reloc_generic*. Use add_global_generic.
1997 (Output_data_got::add_global_with_rela): Remove. Change all
1998 callers to use add_global_with_rel.
1999 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2000 Output_data_reloc_generic*. Use add_global_generic.
2001 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2002 callers to use add_global_pair_with_rel.
2003 (Output_data_got::add_local): Change object to Relobj*.
2004 (Output_data_got::add_local_plt): Likewise.
2005 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2006 change rel_dyn to Output_data_reloc_generic*. Use
2007 add_local_generic.
2008 (Output_data_got::add_local_with_rela): Remove. Change all
2009 callers to use all_local_with_rel.
2010 (Output_data_got::add_local_pair_with_rel): Change object to
2011 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2012 add_output_section_generic.
2013 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2014 callers to use add_local_pair_with_rel.
2015 (Output_data_got::reserve_local): Change object to Relobj*.
2016 * output.h: (class Output_data_reloc_generic): Add pure virtual
2017 declarations for add_global_generic, add_local_generic,
2018 add_output_section_generic.
2019 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2020 functions for Output_data_reloc_generic. Update declarations for
2021 changes listed in output.cc.
2022 (class Output_data_got): Change template parameter to got_size.
2023 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2024 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2025 function.
2026 (Sized_relobj_incr::do_local_plt_offset): New function.
2027 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2028 add_global_generic.
2029
76677ad0
CC
20302011-12-17 Cary Coutant <ccoutant@google.com>
2031
2032 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2033 * resolve.cc (Symbol_table::resolve): Likewise.
2034 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2035 arrays.
2036 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2037
8b8dd8d5
ILT
20382011-12-16 Ian Lance Taylor <iant@google.com>
2039
2040 * output.h (Output_data_reloc_generic::add): Only call
2041 add_dynamic_reloc if this is a dynamic reloc section.
2042
d55525b9
L
20432011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2044
2045 PR gold/13505
2046 * target-reloc.h (apply_relocation): Replace <64, false> with
2047 <size, big_endian>.
2048
ff81c7c1
NC
20492011-11-25 Nick Clifton <nickc@redhat.com>
2050
2051 * po/it.po: New Italian translation.
2052
628f39be
SA
20532011-11-17 Sterling Augustine <saugustine@google.com>
2054
2055 * script.cc (script_include_directive): Implement.
2056 (read_script_file): New local variables name and search_path. Update
2057 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2058 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2059 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2060
98ef3ea4
SA
20612011-11-11 Sterling Augustine <saugustine@google.com>
2062
2063 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2064 (file_or_sections_cmd): Likewise.
2065
f4a8b6d7
DK
20662011-11-11 Doug Kwan <dougkwan@google.com>
2067
2068 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2069 if --just-symbols is given.
2070
29ab395d
DK
20712011-11-10 Doug Kwan <dougkwan@google.com>
2072
2073 PR gold/13362
2074 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2075 when processing data relocs.
2076 * reloc.h (Relocate_functions::rel_unaligned): New method.
2077 (Relocate_functions::pcrel_unaligned): Ditto.
2078 (Relocate_functions::rel32_unaligned): Ditto.
2079 (Relocate_functions::pcrel32_unaligned): Ditto.
2080
2c339f71
DK
20812011-11-09 Doug Kwan <dougkwan@google.com>
2082
2083 PR gold/13362
2084 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2085 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2086 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2087 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2088 (Relocate_functions::rel_unaligned): New.
2089 (Relocate_functions::rel32_unaligned): New.
2090 * target-reloc.h (relocate_for_relocatable): Add code to handle
2091 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2092 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2093 arm_unaligned_reloc_r): New targets.
2094 * testsuite/Makefile.in: Regenerate.
2095 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2096 linking.
2097
3f3cddf1
ILT
20982011-11-02 Ian Lance Taylor <iant@google.com>
2099
2100 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2101 NATIVE_LINKER.
2102 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2103 * options.cc (General_options::finalize): Use library search path
2104 from configure script if specified. If not native and no sysroot,
2105 only search TOOLLIBDIR.
2106 * options.h (Search_directory::Search_directory): Change name to
2107 const std::string&.
2108 (General_options::add_to_library_path_with_sysroot): Change arg to
2109 const std::string&.
2110 * configure, Makefile.in, config.in: Rebuild.
2111
a8e2273b
ILT
21122011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2113
2114 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2115 we are working around the ARM1176 Erratum.
2116 * options.h (General_options::fix_arm1176): Add option.
2117 * testsuite/Makefile.am: Add testcases, and keep current ones
2118 working.
2119 * testsuite/Makefile.in: Regenerate.
2120 * testsuite/arm_fix_1176.s: New file.
2121 * testsuite/arm_fix_1176.sh: Likewise.
2122
cd6eab1c
ILT
21232011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2124
2125 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2126 may_use_blx_.
2127 (Target_arm::may_use_blx): Remove method.
2128 (Target_arm::set_may_use_blx): Likewise.
2129 (Target_arm::may_use_v4t_interworking): New method.
2130 (Target_arm::may_use_v5t_interworking): Likewise.
2131 (Target_arm::may_use_blx_): Remove member variable.
2132 (Arm_relocate_functions::arm_branch_common): Check for v5T
2133 interworking.
2134 (Arm_relocate_functions::thumb_branch_common): Likewise.
2135 (Reloc_stub::stub_type_for_reloc): Likewise.
2136 (Target_arm::do_finalize_sections): Correct interworking checks.
2137 * testsuite/Makefile.am: Add new tests.
2138 * testsuite/Makefile.in: Regenerate.
2139 * testsuite/arm_farcall_arm_arm.s: New test.
2140 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2141 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2142 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2143 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2144 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2145 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2146 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2147
286adcf4
CC
21482011-10-31 Cary Coutant <ccoutant@google.com>
2149
2150 PR gold/13023
2151 * expression.cc (Expression::eval_with_dot): Add
2152 is_section_dot_assignment parameter.
2153 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2154 absolute and assigning to dot within a section.
2155 * script-sections.cc
2156 (Output_section_element_assignment::set_section_addresses): Pass
2157 dot_section to set_if_absolute.
2158 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2159 as is_section_dot_assignment flag to eval_with_dot.
2160 (Output_section_element_dot_assignment::set_section_addresses):
2161 Likewise.
2162 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2163 parameter. Also set value if relative to dot_section; set the
2164 symbol's output_section.
2165 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2166 parameter. Adjust all callers.
2167 (Expression::eval_maybe_dot): Likewise.
2168 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2169 Adjust all callers.
2170 * testsuite/script_test_2.t: Test assignment of an absolute value
2171 to dot within an output section element.
2172
9634ed06
CC
21732011-10-31 Cary Coutant <ccoutant@google.com>
2174
2175 * options.h (class General_options): Add --[no-]gnu-unique options.
2176 * symtab.cc (Symbol_table::sized_write_globals): Convert
2177 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2178
de4101c7
CC
21792011-10-31 Cary Coutant <ccoutant@google.com>
2180
2181 PR gold/13359
2182 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2183 unnecessary assertion.
2184 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2185
7257cc92
ST
21862011-10-31 Sriraman Tallam <tmsriram@google.com>
2187
2188 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2189 gc_mark_symbol.
2190 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2191 gc_mark_symbol.
2192 Change to just keep the section associated with symbol.
2193 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2194 they are externally visible and --export-dynamic is turned on.
2195 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2196
bfc34b3f
ILT
21972011-10-19 Ian Lance Taylor <iant@google.com>
2198
2199 PR gold/13163
2200 * script-sections.cc
2201 (Output_section_element_dot_assignment::needs_output_section): New
2202 function.
2203
ea0d8c47
ILT
22042011-10-19 Ian Lance Taylor <iant@google.com>
2205
2206 PR gold/13204
2207 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2208 --section-start option was seen.
2209 * options.h (General_options::any_section_start): New function.
2210
abd242a9
DM
22112011-10-18 David S. Miller <davem@davemloft.net>
2212
2213 PR binutils/13301
2214 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2215 member to track relocation locations that have moved during TLS
2216 reloc optimizations.
2217 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2218 (Target_sparc::Relocate::relocate): Adjust view down by 4
2219 bytes if it matches reloc_adjust_addr_.
2220 (Target_sparc::Relocate::relocate_tls): Always move the
2221 __tls_get_addr call delay slot instruction forward 4 bytes when
2222 performing relaxation.
2223
bab9090f
CC
22242011-10-18 Cary Coutant <ccoutant@google.com>
2225
2226 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2227 (Output_file::map_no_anonymous): Check for non-zero
2228 return code from posix_fallocate.
2229
f7c5b166
CC
22302011-10-17 Cary Coutant <ccoutant@google.com>
2231
2232 PR gold/13245
2233 * plugin.cc (is_visible_from_outside): Check for symbols
2234 referenced from dynamic objects.
2235 * resolve.cc (Symbol_table::resolve): Don't count references
2236 from dynamic objects as references from real ELF files.
2237 * testsuite/plugin_test_2.sh: Adjust expected result.
2238
b490c0bb
CC
22392011-10-17 Cary Coutant <ccoutant@google.com>
2240
2241 * gold.cc: Include timer.h.
2242 (queue_middle_tasks): Stamp time.
2243 (queue_final_tasks): Likewise.
2244 * main.cc (main): Store timer in parameters. Print timers
2245 for each pass.
2246 * parameters.cc (Parameters::Parameters): Initialize timer_.
2247 (Parameters::set_timer): New function.
2248 (set_parameters_timer): New function.
2249 * parameters.h (Parameters::set_timer): New function.
2250 (Parameters::timer): New function.
2251 (Parameters::timer_): New data member.
2252 (set_parameters_timer): New function.
2253 * timer.cc (Timer::stamp): New function.
2254 (Timer::get_pass_time): New function.
2255 * timer.h (Timer::stamp): New function.
2256 (Timer::get_pass_time): New function.
2257 (Timer::pass_times_): New data member.
2258
f475cf7b
CC
22592011-10-17 Cary Coutant <ccoutant@google.com>
2260
2261 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2262 task for members of lib groups.
2263
cdd7e244
CC
22642011-10-17 Cary Coutant <ccoutant@google.com>
2265
2266 PR gold/13288
4f95c8b4 2267 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2268 (File_read::make_view): Move bounds check (replace with assert)...
2269 (File_read::find_or_make_view): ... to here.
2270
dfb45471
CC
22712011-10-12 Cary Coutant <ccoutant@google.com>
2272
4f95c8b4 2273 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2274 ::read returns less than requested size.
2275
53bbcc1b
CC
22762011-10-10 Cary Coutant <ccoutant@google.com>
2277
4f95c8b4 2278 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2279 Initialize defined_count_.
2280 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2281 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2282 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2283 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2284 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2285 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2286 member.
2287 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2288 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2289 Return zeroes instead of internal error.
2290
397b129b
CC
22912011-10-10 Cary Coutant <ccoutant@google.com>
2292
2293 PR gold/13249
4f95c8b4 2294 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2295 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2296 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2297 (Output_reloc::type_): Adjust size of bit field.
2298 (Output_reloc::use_plt_offset_): New bit field.
2299 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2300 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2301 flag. Adjust all callers.
4f95c8b4 2302 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2303 creating RELATIVE relocations.
2304
d5698657
NC
23052011-10-10 Nick Clifton <nickc@redhat.com>
2306
2307 * po/es.po: Updated Spanish translation.
2308 * po/fi.po: Updated Finnish translation.
2309
6a59a5c2
DN
23102011-10-03 Diego Novillo <dnovillo@google.com>
2311
2312 * options.cc (parse_uint): Fix dereference of RETVAL.
2313
f0558624
ST
23142011-09-29 Sriraman Tallam <tmsriram@google.com>
2315
2316 * layout.h (section_order_map_): New member.
2317 (get_section_order_map): New member function.
2318 * output.cc (Output_section::add_input_section): Check for patterns
2319 only when --section-ordering-file is specified.
2320 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2321 output_sections have been formed.
2322 * layout.cc (Layout_Layout): Initialize section_order_map_.
2323 * plugin.cc (update_section_order): Store order in order_map. Do not
2324 update the order.
2325 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2326 * testsuite/Makefile.in: Regenerate.
2327 * testsuite/plugin_section_order.c: New file.
2328 * testsuite/plugin_final_layout.cc: New file.
2329 * testsuite/plugin_final_layout.sh: New file.
2330
a7dac153
CC
23312011-09-29 Cary Coutant <ccoutant@google.com>
2332
4f95c8b4 2333 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2334 Check for NULL.
4f95c8b4 2335 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2336 symbols during incremental update.
2337 (Symbol_table::add_from_dynobj): Likewise.
2338
eebd87a5
ILT
23392011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2340 Ian Lance Taylor <iant@google.com>
2341
2342 * symtab.cc (Symbol_table::define_special_symbol): Always
2343 canonicalize version string.
2344
403a3331
CC
23452011-09-26 Cary Coutant <ccoutant@google.com>
2346
4f95c8b4
CC
2347 * gold.cc (queue_initial_tasks): Move option checks ...
2348 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2349 some options; make others fatal.
2350
235061c2
CC
23512011-09-26 Cary Coutant <ccoutant@google.com>
2352
2353 gcc PR lto/47247
2354 * plugin.cc (get_symbols_v2): New function.
2355 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2356 (is_referenced_from_outside): New function.
2357 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2358 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2359 (get_symbols): Pass version parameter.
2360 (get_symbols_v2): New function.
2361 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2362 parameter.
2363 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2364 (onload): Add LDPT_GET_SYMBOLS_V2.
2365 (all_symbols_read_hook): Use get_symbols_v2; check for
2366 LDPR_PREVAILING_DEF_IRONLY_EXP.
2367 * testsuite/plugin_test_3.sh: Update expected results.
2368
dc87f620
ILT
23692011-09-23 Simon Baldwin <simonb@google.com>
2370
2371 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2372 configuration options.
2373 * configure: Regenerate.
2374 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2375 * Makefile.in: Regenerate.
2376 * testsuite/Makefile.in: Regenerate.
2377
a8279f82
ST
23782011-09-19 Sriraman Tallam <tmsriram@google.com>
2379
2380 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2381
0c9350c8
CC
23822011-09-19 Cary Coutant <ccoutant@google.com>
2383
2384 * incremental.cc (can_incremental_update): Fix typo in comment.
2385 * incremental.h (can_incremental_update): Likewise.
2386
aa06ae28
CC
23872011-09-18 Cary Coutant <ccoutant@google.com>
2388
2389 * incremental.cc (can_incremental_update): New function.
2390 * incremental.h (can_incremental_update): New function.
2391 * layout.cc (Layout::init_fixed_output_section): Call it.
2392 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2393 * object.cc (Sized_relobj_file::do_layout): Call
2394 can_incremental_update.
2395
ebb300b2
CC
23962011-09-13 Cary Coutant <ccoutant@google.com>
2397
2398 * configure.ac: Check for glibc support for gnu_indirect_function
2399 support with static linking, setting automake conditional
2400 IFUNC_STATIC.
2401 * Makefile.in: Regenerate.
2402 * configure: Regenerate.
2403
2404 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2405 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2406 for IFUNC_STATIC.
2407 * testsuite/Makefile.in: Regenerate.
2408
1206d0d5
CC
24092011-09-13 Cary Coutant <ccoutant@google.com>
2410
2411 * incremental.cc (Sized_relobj_incr::do_layout): Call
2412 report_comdat_group for kept comdat sections.
2413 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2414 * testsuite/Makefile.in: Regenerate.
2415 * testsuite/incr_comdat_test_1.cc: New source file.
2416 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2417 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2418 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2419
40b29874
ILT
24202011-09-13 Ian Lance Taylor <iant@google.com>
2421
2422 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2423 variable external_symbols_offset.
2424
1b045aac
ILT
24252011-09-12 Ian Lance Taylor <iant@google.com>
2426
2427 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2428 triggered if object has no symbols.
2429
24c6c55a
DM
24302011-09-09 David S. Miller <davem@davemloft.net>
2431
2432 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2433 (Output_fill_debug_line::do_write): Likewise.
2434
66570254
CC
24352011-08-29 Cary Coutant <ccoutant@google.com>
2436
2437 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2438 casts to match formatting specs.
2439 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2440
8ea8cd50
CC
24412011-08-26 Cary Coutant <ccoutant@google.com>
2442
2443 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2444 remaining hole size when allocating.
2445 (Layout::make_output_section): Set fill methods for debug sections.
2446 * layout.h (Free_list::Free_list_node): Move from private to
2447 public.
2448 (Free_list::set_min_hole_size): New function.
2449 (Free_list::begin, Free_list::end): New functions.
2450 (Free_list::min_hole_): New data member.
2451 * output.cc: Include dwarf.h.
2452 (Output_fill_debug_info::do_minimum_hole_size): New function.
2453 (Output_fill_debug_info::do_write): New function.
2454 (Output_fill_debug_line::do_minimum_hole_size): New function.
2455 (Output_fill_debug_line::do_write): New function.
2456 (Output_section::Output_section): Initialize new data member.
2457 (Output_section::set_final_data_size): Ensure patch space is larger
2458 than minimum hole size.
2459 (Output_section::do_write): Fill holes in debug sections.
2460 * output.h (Output_fill): New class.
2461 (Output_fill_debug_info): New class.
2462 (Output_fill_debug_line): New class.
2463 (Output_section::set_free_space_fill): New function.
2464 (Output_section::free_space_fill_): New data member.
2465 * testsuite/Makefile.am (incremental_test_3): Add
2466 --incremental-patch option.
2467 (incremental_test_4): Likewise.
2468 (incremental_test_5): Likewise.
2469 (incremental_test_6): Likewise.
2470 (incremental_copy_test): Likewise.
2471 (incremental_common_test_1): Likewise.
2472 * testsuite/Makefile.in: Regenerate.
2473
7cf80422
NC
24742011-08-26 Nick Clifton <nickc@redhat.com>
2475
2476 * po/es.po: Updated Spanish translation.
2477
c3f7b0e5
CC
24782011-08-01 Cary Coutant <ccoutant@google.com>
2479
2480 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2481 * gold/testsuite/Makefile.in: Regenerate.
2482 * gold/testsuite/justsyms_exec.c: New source file.
2483 * gold/testsuite/justsyms_lib.c: New source file.
2484
9590bf25
CC
24852011-08-01 Cary Coutant <ccoutant@google.com>
2486
2487 * layout.cc (Layout::set_segment_offsets): Don't realign text
2488 segment if -Ttext was specified.
2489 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2490 file type.
2491 * object.h (Sized_relobj_file::e_type): New function.
2492 (Sized_relobj_file::e_type_): New data member.
2493 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2494 base address for ET_EXEC files.
2495 * target.cc (Target::do_make_elf_object_implementation): Allow
2496 ET_EXEC files with --just-symbols option.
2497
dcd8d12e
CC
24982011-07-28 Cary Coutant <ccoutant@google.com>
2499
2500 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2501 Add thread_number parameter.
2502 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2503 * workqueue-threads.cc
2504 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2505 current thread if its thread number is greater than desired thread
2506 count.
2507 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2508 Add thread_number parameter.
2509 (Workqueue::should_cancel_thread): Likewise.
2510 (Workqueue::find_runnable_or_wait): Pass thread_number to
2511 should_cancel_thread.
2512 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2513 parameter.
2514
804eb480
ST
25152011-07-22 Sriraman Tallam <tmsriram@google.com>
2516
2517 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2518 only after checking if it cannot be forced local.
2519 * symtab.h (is_externally_visible): Check if the symbol is not forced
2520 local.
2521
f1ddb600
ILT
25222011-07-15 Ian Lance Taylor <iant@google.com>
2523
2524 * options.h (class General_options): Add --print-output-format.
2525 Move -EL next to -EB, for better --help output.
2526 * target-select.cc: Include <cstdio>, "options.h", and
2527 "parameters.h".
2528 (Target_selector::do_target_bfd_name): New function.
2529 (print_output_format): New function.
2530 * target-select.h (class Target_selector): Update declarations.
2531 (Target_selector::target_bfd_name): New function.
2532 (print_output_format): Declare.
2533 * main.cc: Include "target-select.h".
2534 (main): Handle --print-output-format.
2535 * gold.cc: Include "target-select.h".
2536 (queue_initial_tasks): Handle --print-output-format when there are
2537 no input files.
2538 * parameters.cc (parameters_force_valid_target): Give a better
2539 error message if -EB/-EL does not match target.
2540 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2541 function.
2542
7d172687
ILT
25432011-07-15 Ian Lance Taylor <iant@google.com>
2544
2545 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2546 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2547 (Output_data_plt_i386::do_write): Write address of .dynamic
2548 section to first entry in .got.plt section.
2549 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2550 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2551 Initialize layout_.
2552 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2553 section to first entry in .got.plt section.
2554 * layout.h (Layout::dynamic_section): New function.
2555
e9552f7e
ST
25562011-07-13 Sriraman Tallam <tmsriram@google.com>
2557
2558 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2559 to claim_file call.
2560 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2561 input_section_position_, and input_section_glob_.
2562 (read_layout_from_file): Call function section_ordering_specified.
2563 * layout.h (is_section_ordering_specified): New function.
2564 (section_ordering_specified): New function.
2565 (section_ordering_specified_): New boolean member.
2566 * main.cc(main): Call load_plugins after layout object is defined.
2567 * output.cc (Output_section::add_input_section): Use
2568 function section_ordering_specified to check if section ordering is
2569 needed.
2570 * output.cc (Output_section::add_relaxed_input_section): Use
2571 function section_ordering_specified to check if section ordering is
2572 needed.
2573 (Output_section::update_section_layout): New function.
2574 (Output_section::sort_attached_input_sections): Check if input section
2575 must be reordered.
2576 * output.h (Output_section::update_section_layout): New function.
2577 * plugin.cc (get_section_count): New function.
2578 (get_section_type): New function.
2579 (get_section_name): New function.
2580 (get_section_contents): New function.
2581 (update_section_order): New function.
58797674 2582 (allow_section_ordering): New function.
e9552f7e
ST
2583 (Plugin::load): Add the new interfaces to the transfer vector.
2584 (Plugin_manager::load_plugins): New parameter.
2585 (Plugin_manager::all_symbols_read): New parameter.
2586 (Plugin_manager::claim_file): New parameter. Save the elf object for
2587 unclaimed objects.
2588 (Plugin_manager::get_elf_object): New function.
2589 (Plugin_manager::get_view): Change to directly use the bool to check
2590 if get_view is called from claim_file_hook.
2591 * plugin.h (input_objects): New function
2592 (Plugin__manager::load_plugins): New parameter.
2593 (Plugin_manager::claim_file): New parameter.
2594 (Plugin_manager::get_elf_object): New function.
2595 (Plugin_manager::in_claim_file_handler): New function.
2596 (Plugin_manager::in_claim_file_handler_): New member.
2597 (layout): New function.
2598 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2599 handler with an extra parameter. Make the elf object before calling
2600 claim_file handler.
2601 * testsuite/plugin_test.c (get_section_count): New function pointer.
2602 (get_section_type): New function pointer.
2603 (get_section_name): New function pointer.
2604 (get_section_contents): New function pointer.
2605 (update_section_order): New function pointer.
2606 (allow_section_ordering): New function pointer.
2607 (onload): Check if the new interfaces exist.
2608
9446efde
ILT
26092011-07-13 Ian Lance Taylor <iant@google.com>
2610
2611 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2612 relro section.
2613 * x86_64.cc (Target_x86_64::got_section): Likewise.
2614 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2615 (relro_now_test_SOURCES): New variable.
2616 (relro_now_test_DEPENDENCIES): New variable.
2617 (relro_now_test_LDFLAGS): New variable.
2618 (relro_now_test_LDADD): New variable.
2619 (relro_now_test.so): New target.
2620 * testsuite/Makefile.in: Rebuild.
2621
07aa62f2
ILT
26222011-07-12 Ian Lance Taylor <iant@google.com>
2623
2624 PR gold/12980
2625 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2626 GLOB_DAT relocation rather than a RELATIVE relocation for a
2627 protected symbol when creating a shared library.
2628 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2629 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2630 * testsuite/protected_main_1.cc (main): Test that protected
2631 function has same address.
2632
e2153196
ILT
26332011-07-11 Ian Lance Taylor <iant@google.com>
2634
2635 PR gold/12979
2636 * options.h (class General_options): Add -Bgroup.
2637 * options.cc (General_options::finalize): If -Bgroup is set,
2638 default to --unresolved-symbols=report-all.
2639 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2640 * target-reloc.h (issue_undefined_symbol_error): Handle
2641 --unresolved-symbols=report-all.
2642
6daf5215
ILT
26432011-07-08 Ian Lance Taylor <iant@google.com>
2644
2645 PR gold/11985
2646 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2647 if linker script discards key sections.
2648 (Layout::create_dynamic_symtab): Likewise.
2649 (Layout::assign_local_dynsym_offsets): Likewise.
2650 (Layout::sized_create_version_sections): Likewise.
2651 (Layout::create_interp): Likewise.
2652 (Layout::finish_dynamic_section): Likewise.
2653 (Layout::set_dynamic_symbol_size): Likewise.
2654
beabb2c6
ILT
26552011-07-08 Ian Lance Taylor <iant@google.com>
2656
2657 PR gold/12386
2658 * options.h (class General_options): Add --unresolved-symbols.
2659 * target-reloc.h (issue_undefined_symbol_error): Check
2660 --unresolved-symbols. Add comments.
2661
9c16daf1
ILT
26622011-07-08 Ian Lance Taylor <iant@google.com>
2663
2664 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2665 expression more complex.
2666
191f1a2d
ILT
26672011-07-08 Ian Lance Taylor <iant@google.com>
2668
2669 PR gold/11317
2670 * target-reloc.h (issue_undefined_symbol_error): New inline
2671 function, broken out of relocate_section.
2672 (relocate_section): Call issue_undefined_symbol_error.
2673 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2674 there is no TLS segment if we are about to issue an undefined
2675 symbol error.
2676 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2677
62855347
ILT
26782011-07-08 Ian Lance Taylor <iant@google.com>
2679
2680 PR gold/12279
2681 * resolve.cc (Symbol_table::should_override): Add fromtype
2682 parameter. Change all callers. Give error when linking together
2683 TLS and non-TLS symbol.
2684 (Symbol_table::should_override_with_special): Add fromtype
2685 parameter. Change all callers.
2686 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2687 there is no TLS segment if we have reported some errors.
2688 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2689
67181c72
ILT
26902011-07-08 Ian Lance Taylor <iant@google.com>
2691
2692 PR gold/12372
2693 * target.h (Target::plt_address_for_global): New function.
2694 (Target::plt_address_for_local): New function.
2695 (Target::plt_section_for_global): Remove.
2696 (Target::plt_section_for_local): Remove.
2697 (Target::do_plt_address_for_global): New virtual function.
2698 (Target::do_plt_address_for_local): New virtual function.
2699 (Target::do_plt_section_for_global): Remove.
2700 (Target::do_plt_section_for_local): Remove.
2701 (Target::register_global_plt_entry): Add Symbol_table and Layout
2702 parameters.
2703 * output.cc (Output_data_got::Got_entry::write): Use
2704 plt_address_for_global and plt_address_for_local.
2705 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2706 address of output section.
2707 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2708 got_irelative_, and irelative_count_ fields. Update
2709 declarations.
2710 (Output_data_plt_i386::has_irelative_section): New function.
2711 (Output_data_plt_i386::entry_count): Add irelative_count_.
2712 (Output_data_plt_i386::set_final_data_size): Likewise.
2713 (class Target_i386): Add got_irelative_ and rel_irelative_
2714 fields. Update declarations.
2715 (Target_i386::Target_i386): Initialize new fields.
2716 (Target_i386::do_plt_address_for_global): New function replacing
2717 do_plt_section_for_global.
2718 (Target_i386::do_plt_address_for_local): New function replacing
2719 do_plt_section_for_local.
2720 (Target_i386::got_section): Create got_irelative_.
2721 (Target_i386::rel_irelative_section): New function.
2722 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2723 fields. Don't define __rel_iplt_{start,end}.
2724 (Output_data_plt_i386::add_entry): Add symtab and layout
2725 parameters. Change all callers. Use different PLT and GOT for
2726 IFUNC symbols.
2727 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2728 layout parameters. Change all callers. Use different PLT and
2729 GOT.
2730 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2731 (Output_data_plt_i386::rel_irelative): New function.
2732 (Output_data_plt_i386::address_for_global): New function.
2733 (Output_data_plt_i386::address_for_local): New function.
2734 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2735 IRELATIVE GOT when changing IFUNC GOT entries.
2736 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2737 reloc.
2738 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2739 if we didn't create an IRELATIVE GOT.
2740 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2741 plt_address_for_local.
2742 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2743 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2744 got_irelative_, and irelative_count_ fields. Update
2745 declarations.
2746 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2747 Initialize new fields. Remove symtab parameter. Change all
2748 callers.
2749 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2750 irelative_count_.
2751 (Output_data_plt_x86_64::has_irelative_section): New function.
2752 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2753 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2754 fields. Update declarations.
2755 (Target_x86_64::Target_x86_64): Initialize new fields.
2756 (Target_x86_64::do_plt_address_for_global): New function replacing
2757 do_plt_section_for_global.
2758 (Target_x86_64::do_plt_address_for_local): New function replacing
2759 do_plt_section_for_local.
2760 (Target_x86_64::got_section): Create got_irelative_.
2761 (Target_x86_64::rela_irelative_section): New function.
2762 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2763 all callers. Don't create __rel_iplt_{start,end}.
2764 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2765 parameters. Change all callers. Use different PLT and GOT for
2766 IFUNC symbols.
2767 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2768 layout parameters. Change all callers. Use different PLT and
2769 GOT.
2770 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2771 parameters. Change all callers. Use different PLT and GOT for
2772 IFUNC symbols.
2773 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2774 (Output_data_plt_x86_64::rela_irelative): New function.
2775 (Output_data_plt_x86_64::address_for_global): New function.
2776 (Output_data_plt_x86_64::address_for_local): New function.
2777 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2778 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2779 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2780 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2781 parameters.
2782 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2783 reloc.
2784 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2785 symbols if we didn't create an IRELATIVE GOT.
2786 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2787 plt_address_for_local.
2788 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2789 * testsuite/ifuncvar1.c: New test file.
2790 * testsuite/ifuncvar2.c: New test file.
2791 * testsuite/ifuncvar3.c: New test file.
2792 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2793 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2794 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2795 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2796 * testsuite/Makefile.in: Rebuild.
2797
33c15b45
CC
27982011-07-07 Cary Coutant <ccoutant@google.com>
2799
2800 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2801 (two_file_test_1_ndebug.o): Likewise.
2802 (two_file_test_1b_ndebug.o): Likewise.
2803 (two_file_test_2_ndebug.o): Likewise.
2804 (two_file_test_main_ndebug.o): Likewise.
2805 (incremental_test_2): Link with no-debug versions.
2806
f48b5fb7
CC
28072011-07-06 Cary Coutant <ccoutant@google.com>
2808
2809 * gold/incremental.cc
2810 (Output_section_incremental_inputs::write_info_blocks): Check for
2811 hidden and internal symbols.
2812
221597a5
CC
28132011-07-06 Cary Coutant <ccoutant@google.com>
2814
2815 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2816 Check disposition for startup file.
2817 (Incremental_inputs::report_command_line): Ignore
2818 --incremental-startup-unchanged option.
2819 * options.cc (General_options::parse_incremental_startup_unchanged):
2820 New function.
2821 (General_options::General_options): Initialize new data member.
2822 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2823 (General_options): Add --incremental-startup-unchanged option.
2824 (General_options::incremental_startup_disposition): New function.
2825 (General_options::incremental_startup_disposition_): New data member.
2826
e24719f6
CC
28272011-07-06 Cary Coutant <ccoutant@google.com>
2828
2829 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2830 input file index to Script_info ctor.
2831 (Sized_incremental_binary::do_file_has_changed): Find the
2832 command-line argument for files named in scripts.
2833 * incremental.h (Script_info::Script_info): New ctor
2834 with input file index.
2835 (Script_info::input_file_index): New function.
2836 (Script_info::input_file_index_): New data member.
2837 (Incremental_binary::get_library): Add const.
2838 (Incremental_binary::get_script_info): Add const.
2839 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2840 * testsuite/Makefile.am (incremental_test_5): New test case.
2841 (incremental_test_6): New test case.
2842 * testsuite/Makefile.in: Regenerate.
2843
8f7c81e8
CC
28442011-07-06 Cary Coutant <ccoutant@google.com>
2845
2846 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2847 debug output when command lines differ.
2848
9fbd3822
CC
28492011-07-06 Cary Coutant <ccoutant@google.com>
2850
2851 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2852 --incremental-patch option.
2853 * layout.cc (Free_list::allocate): Extend allocation beyond original
2854 end if enabled.
2855 (Layout::make_output_section): Mark sections that should get
2856 patch space.
2857 * options.cc (parse_percent): New function.
2858 * options.h (parse_percent): New function.
2859 (DEFINE_percent): New macro.
2860 (General_options): Add --incremental-patch option.
2861 * output.cc (Output_section::Output_section): Initialize new data
2862 members.
2863 (Output_section::add_input_section): Print section name when out
2864 of patch space.
2865 (Output_section::add_output_section_data): Likewise.
2866 (Output_section::set_final_data_size): Add patch space when
2867 doing --incremental-full.
2868 (Output_section::do_reset_address_and_file_offset): Remove patch
2869 space.
2870 (Output_segment::set_section_list_addresses): Print debug output
2871 only if --incremental-update.
2872 * output.h (Output_section::set_is_patch_space_allowed): New function.
2873 (Output_section::is_patch_space_allowed_): New data member.
2874 (Output_section::patch_space_): New data member.
2875 * parameters.cc (Parameters::incremental_full): New function.
2876 * parameters.h (Parameters::incremental_full): New function
2877 * testsuite/Makefile.am (incremental_test_2): Add test for
2878 --incremental-patch option.
2879 * testsuite/Makefile.in: Regenerate.
2880 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2881 (t18): Remove function body.
2882
f6cccc2c
DK
28832011-07-05 Doug Kwan <dougkwan@google.com>
2884
2885 PR gold/12771
2886 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2887 Arm_Address type for relocation result.
2888 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2889 overflow check.
2890 (Arm_relocate_functions::abs32): Use unaligned access.
2891 (Arm_relocate_functions::rel32): Ditto.
2892 (Arm_relocate_functions::prel31): Ditto.
2893 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2894 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2895 static data relocations.
2896 * testsuite/Makefile.in: Regnerate.
2897 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2898
28a13fec
ILT
28992011-07-05 Ian Lance Taylor <iant@google.com>
2900
2901 PR gold/12392
2902 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2903 symbols if necessary.
2904 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2905
24d47b34
ILT
29062011-07-05 Ian Lance Taylor <iant@google.com>
2907
2908 PR gold/12952
2909 * resolve.cc (Symbol::override_base_with_special): Simply override
2910 version with special symbol version, ignoring previous version.
2911
41f9cbbe
ILT
29122011-07-05 Ian Lance Taylor <iant@google.com>
2913
2914 * object.cc (Sized_relobj_file::include_section_group): Add
2915 information to comment about signature location.
2916
886288f1
ILT
29172011-07-02 Ian Lance Taylor <iant@google.com>
2918
2919 PR gold/12957
2920 * options.h (class General_options): Add -f and -F.
2921 * options.cc (General_options::finalize): Fatal error if -f/-F
2922 are used without -shared.
2923 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2924
ae3a6d4f
ILT
29252011-07-02 Ian Lance Taylor <iant@google.com>
2926
2927 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2928
21131061
ILT
29292011-07-01 Ian Lance Taylor <iant@google.com>
2930
2931 PR gold/12525
2932 PR gold/12952
2933 * resolve.cc (Symbol::override_base_with_special): Don't override
2934 the version if the overriding symbol has a different name.
2935 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2936 all callers. If we give an error about an undefined version,
2937 define the base version if necessary.
2938 * dynobj.h (class Versions): Update declaration.
2939 * testsuite/weak_alias_test_5.cc: New file.
2940 * testsuite/weak_alias_test.script: New file.
2941 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2942 and versioned_alias have the right value, and call t2.
2943 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2944 weak_alias_test_5.so.
2945 (weak_alias_test_LDADD): Likewise.
2946 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2947 * testsuite/Makefile.in: Rebuild.
2948
611062c0
ILT
29492011-07-01 Ian Lance Taylor <iant@google.com>
2950
2951 PR gold/12525
2952 * options.h (class General_options): Support -z notext.
2953 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2954 -Wl,-z,notext.
2955 (two_file_shared_nonpic.so): Likewise.
2956 (two_file_shared_mixed.so): Likewise.
2957 (two_file_shared_mixed_1.so): Likewise.
2958 (weak_undef_lib_nonpic.so): Likewise.
2959 (alt/weak_undef_lib_nonpic.so): Likewise.
2960 (tls_test_shared_nonpic.so): Likewise.
2961 * testsuite/Makefile.in: Rebuild.
2962
328c7c2f
ILT
29632011-07-01 Ian Lance Taylor <iant@google.com>
2964
2965 PR gold/12525
2966 * configure.ac: Test whether static linking works, setting
2967 the automake conditional HAVE_STATIC.
2968 * testsuite/Makefile.am: Disable tests using -static if
2969 HAVE_STATIC is not true.
2970 * configure, testsuite/Makefile.in: Rebuild.
2971
02d7cd44
ILT
29722011-07-01 Ian Lance Taylor <iant@google.com>
2973
2974 PR gold/12525
2975 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2976 Assert if we see DW_EH_PE_indirect.
2977 * target.h (Target::ehframe_datarel_base): New function.
2978 (Target::do_ehframe_datarel_base): New target function.
2979 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2980 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2981 function.
2982
07a60597
ILT
29832011-07-01 Ian Lance Taylor <iant@google.com>
2984
2985 PR gold/12571
2986 * options.h (class General_options): Add
2987 --ld-generated-unwind-info.
2988 * ehframe.cc (Fde::write): Add address parameter. Change all
2989 callers. If associated with PLT, fill in address and size.
2990 (Cie::set_output_offset): Only add merge mapping if there is an
2991 object.
2992 (Cie::write): Add address parameter. Change all callers.
2993 (Eh_frame::add_ehframe_for_plt): New function.
2994 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2995 input_offset_ fields into union u_, with new plt field.
2996 (Fde::Fde): Adjust for new union field.
2997 (Fde::Fde) [Output_data version]: New constructor.
2998 (Fde::add_mapping): Only add merge mapping if there is an object.
2999 (class Cie): Update declarations.
3000 (class Eh_frame): Declare add_ehframe_for_plt.
3001 * layout.cc (Layout::layout_eh_frame): Break out code into
3002 make_eh_frame_section, and call it.
3003 (Layout::make_eh_frame_section): New function.
3004 (Layout::add_eh_frame_for_plt): New function.
3005 * layout.h (class Layout): Update declarations.
3006 * merge.cc (Merge_map::add_mapping): Add assertion.
3007 * i386.cc: Include "dwarf.h".
3008 (class Output_data_plt_i386): Make first_plt_entry,
3009 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3010 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3011 and plt_eh_frame_fde.
3012 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3013 boundary. Call add_eh_frame_for_plt if appropriate.
3014 * x86_64.cc: Include "dwarf.h".
3015 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3016 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3017 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3018 and plt_eh_frame_fde.
3019 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3020 appropriate.
3021
14788a3f
ILT
30222011-06-29 Ian Lance Taylor <iant@google.com>
3023
3024 PR gold/12629
3025 * object.cc (Sized_relobj_file::layout_section): Change shdr
3026 parameter to be const.
3027 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3028 out of do_layout.
3029 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3030 appropriate. Call layout_eh_frame_section.
3031 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3032 sections.
3033 * object.h (class Sized_relobj_file): Update declarations.
3034
6c21fce1
ILT
30352011-06-29 Ian Lance Taylor <iant@google.com>
3036
37e41b03 3037 PR gold/12652
6c21fce1
ILT
3038 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3039 modifier.
3040 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3041
4d5e4e62
ILT
30422011-06-29 Ian Lance Taylor <iant@google.com>
3043
3044 PR gold/12675
3045 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3046 SHT_X86_64_UNWIND.
3047 * layout.cc (Layout::layout_eh_frame): Likewise.
3048
886f533a
ILT
30492011-06-29 Ian Lance Taylor <iant@google.com>
3050
3051 PR gold/12695
3052 * layout.cc (Layout::symtab_section_shndx): New function.
3053 * layout.h (class Layout): Declare symtab_section_shndx.
3054 * output.cc (Output_section::write_header): Call it.
3055
f3ae1b28
ILT
30562011-06-29 Ian Lance Taylor <iant@google.com>
3057
3058 PR gold/12818
3059 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3060 symbols which are not used in a relocation.
3061
aecf301f
ILT
30622011-06-28 Ian Lance Taylor <iant@google.com>
3063
3064 PR gold/12898
3065 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3066 script create indistinguishable segments.
3067 (Layout::set_segment_offsets): Use stable_sort when sorting
3068 segments. Pass this to Compare_segments constructor.
3069 * layout.h (class Layout): Make segment_precedes non-static.
3070 (class Compare_segments): Change from struct to class. Add
3071 layout_ field. Add constructor.
3072 * script-sections.cc
3073 (Script_sections::attach_sections_using_phdrs_clause): Rename
3074 local orphan to is_orphan. Don't report failure to put empty
3075 section in segment. On attachment failure, report name of
3076 section, and attach to first PT_LOAD segment.
3077
03ef7571
ILT
30782011-06-28 Ian Lance Taylor <iant@google.com>
3079
3080 PR gold/12934
3081 * target-select.cc (Target_selector::Target_selector): Add
3082 emulation parameter. Change all callers.
3083 (select_target_by_bfd_name): Rename from select_target_by_name.
3084 Change all callers.
3085 (select_target_by_emulation): New function.
3086 (supported_emulation_names): New function.
3087 * target-select.h (class Target_selector): Add emulation_ field.
3088 Update declarations.
3089 (Target_selector::recognize_by_bfd_name): Rename from
3090 recognize_by_name. Change all callers.
3091 (Target_selector::supported_bfd_names): Rename from
3092 supported_names. Change all callers.
3093 (Target_selector::recognize_by_emulation): New function.
3094 (Target_selector::supported_emulations): New function.
3095 (Target_selector::emulation): New function.
3096 (Target_selector::do_recognize_by_bfd_name): Rename from
3097 do_recognize_by_name. Change all callers.
3098 (Target_selector::do_supported_bfd_names): Rename from
3099 do_supported_names. Change all callers.
3100 (Target_selector::do_recognize_by_emulation): New function.
3101 (Target_selector::do_supported_emulations): New function.
3102 (select_target_by_bfd_name): Change name in declaration.
3103 (select_target_by_emulation): Declare.
3104 (supported_emulation_names): Declare.
3105 * parameters.cc (parameters_force_valid_target): Try to find
3106 target based on emulation from -m option.
3107 * options.h (class General_options): Change doc string for -m.
3108 * options.cc (help): Print emulations.
3109 (General_options::parse_V): Likewise.
3110 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3111 Add emulation parameter. Change all callers.
3112
200b2bb9
ILT
31132011-06-28 Ian Lance Taylor <iant@google.com>
3114
3115 * target.h (class Target): Add osabi_ field.
3116 (Target::osabi): New function.
3117 (Target::set_osabi): New function.
3118 (Target::Target): Initialize osabi_.
3119 (Target::do_adjust_elf_header): Make pure virtual.
3120 (Sized_target::do_adjust_elf_header): Declare.
3121 * target.cc (Sized_target::do_adjust_elf_header): New function.
3122 (class Sized_target): Instantiate all versions.
3123 * freebsd.h (class Target_freebsd): Remove.
3124 (Target_selector_freebsd::do_recognize): Call set_osabi on
3125 Target.
3126 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3127 (Target_selector_freebsd::set_osabi): Remove.
3128 * i386.cc (class Target_i386): Inherit from Sized_target rather
3129 than Target_freebsd.
3130 * x86_64.cc (class Target_x86_64): Likewise.
3131
b3ce541e
ILT
31322011-06-28 Ian Lance Taylor <iant@google.com>
3133
3134 * target.h (Target::can_check_for_function_pointers): Rewrite.
3135 Make non-virtual.
3136 (Target::can_icf_inline_merge_sections): Likewise.
3137 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3138 (Target::Target_info): Add can_icf_inline_merge_sections field.
3139 (Target::do_can_check_for_function_pointers): New virtual
3140 function.
3141 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3142 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3143 from can_check_for_function_pointers, move in file.
3144 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3145 section_may_have_icf_unsafe_poineters, move in file.
3146 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3147 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3148 Rename from can_check_for_function_pointers, move in file.
3149 (Target_i386::can_icf_inline_merge_sections): Remove.
3150 (Target_i386::i386_info): Initialize
3151 can_icf_inline_merge_sections.
3152 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3153 Initialize can_icf_inline_merge_sections.
3154 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3155 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3156 Rename from can_check_for_function_pointers, move in file.
3157 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3158 (Target_x86_64::x86_64_info): Initialize
3159 can_icf_inline_merge_sections.
3160 * testsuite/testfile.cc (Target_test::test_target_info):
3161 Likewise.
3162 * icf.cc (get_section_contents): Correct formatting.
3163
6d1c4efb
ILT
31642011-06-27 Ian Lance Taylor <iant@google.com>
3165
3166 * symtab.cc (Symbol::versioned_name): New function.
3167 (Symbol_table::add_to_final_symtab): Use versioned_name when
3168 appropriate.
3169 (Symbol_table::sized_write_symbol): Likewise.
3170 * symtab.h (class Symbol): Declare versioned_name.
3171 * stringpool.h (class Stringpool_template): Add variant of add
3172 which takes a std::basic_string.
3173 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3174 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3175 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3176 (ver_test_12.o): New target.
3177 * testsuite/Makefile.in: Rebuild.
3178
57eb9b50
DK
31792011-06-27 Doug Kwan <dougkwan@google.com>
3180
3181 * arm.cc (Arm_relocate_functions::thm_jump8,
3182 Arm_relocate_functions::thm_jump11): Use a wider signed
3183 type to compute offset.
3184 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3185 arm_thm_jump8.
3186 * testsuite/Makefile.in: Regenerate.
3187 * testsuite/arm_branch_in_range.sh: Check test results of
3188 arm_thm_jump11 and arm_thm_jump8.
3189 * testsuite/arm_thm_jump11.s: New test source file.
3190 * testsuite/arm_thm_jump11.t: New linker script.
3191 * testsuite/arm_thm_jump8.s: New test source file.
3192 * testsuite/arm_thm_jump8.t: New linker script.
3193
487b39df
ILT
31942011-06-24 Ian Lance Taylor <iant@google.com>
3195
3196 * layout.cc: Include "object.h".
3197 (ctors_sections_in_init_array): New static variable.
3198 (Layout::is_ctors_in_init_array): New function.
3199 (Layout::layout): Add entry to ctors_sections_in_init_array if
3200 appropriate.
3201 * layout.h (class Layout): Declare is_ctors_in_init_array.
3202 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3203 is_ctors_reverse_view is set.
3204 (Sized_relobj_file::write_sections): Add layout parameter. Change
3205 all callers. Set is_ctors_reverse_view field of View_size.
3206 (Sized_relobj_file::reverse_words): New function.
3207 * object.h (Sized_relobj_file::View_size): Add
3208 is_ctors_reverse_view field.
3209 (class Sized_relobj_file): Update declarations.
3210 * testsuite/initpri3.c: New test.
3211 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3212 initpri3b.
3213 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3214 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3215 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3216 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3217 * testsuite/Makefile.in: Rebuild.
3218
472076e4
CC
32192011-06-24 Cary Coutant <ccoutant@google.com>
3220
3221 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3222 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3223 (debug_msg_cdebug.err): New targets.
3224 * testsuite/Makefile.in: Regenerate.
3225 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3226 Fix checks for link with shared library.
3227
a60af0db
DK
32282011-06-24 Doug Kwan <dougkwan@google.com>
3229
3230 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3231 skip empty text sections.
3232 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3233
5393d741
ILT
32342011-06-22 Ian Lance Taylor <iant@google.com>
3235
3236 PR gold/12910
3237 * options.h (class General_options): Add --ctors-in-init-array.
3238 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3239 friends as SHT_PROGBITS for merging sections.
3240 (Layout::layout): Remove special handling of .init_array and
3241 friends. Don't sort if doing relocatable link. Sort for .ctors
3242 and .dtors if ctors_in_init_array.
3243 (Layout::make_output_section): Force correct section types for
3244 .init_array and friends. Don't sort if doing relocatable link,
3245 Don't sort .ctors and .dtors if ctors_in_init_array.
3246 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3247 (Layout::output_section_name): Add relobj parameter. Change all
3248 callers. Handle .ctors. and .dtors. in code rather than table.
3249 Handle .ctors and .dtors if ctors_in_init_array.
3250 (Layout::match_file_name): New function, moved from output.cc.
3251 * layout.h (class Layout): Update declarations.
3252 * output.cc: Include "layout.h".
3253 (Input_section_sort_entry::get_priority): New function.
3254 (Input_section_sort_entry::match_file_name): Just call
3255 Layout::match_file_name.
3256 (Output_section::Input_section_sort_init_fini_compare::operator()):
3257 Handle .ctors and .dtors. Sort by explicit priority rather than
3258 by name.
3259 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3260 * testsuite/initpri2.c: New test.
3261 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3262 (check_PROGRAMS): Add initpri2.
3263 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3264 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3265 * configure, testsuite/Makefile.in: Rebuild.
3266
e1f74f98
ILT
32672011-06-19 Ian Lance Taylor <iant@google.com>
3268
3269 PR gold/12880
3270 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3271 .interp section to a PT_INTERP segment even if we have seen a
3272 --dynamic-linker option. Don't do it if we have seen a PHDRS
3273 clause in a linker script.
3274 (Layout::finalize): Don't create a .interp section if we've
3275 already create a PT_INTERP segment.
3276 (Layout::create_interp): Always call choose_output_section (revert
3277 patch of 2011-06-17). Don't create PT_INTERP segment.
3278 * script-sections.cc
3279 (Script_sections::create_note_and_tls_segments): Add a .interp
3280 section to a PT_INTERP segment even if we have seen a
3281 --dynamic-linker option.
3282
766f91bb
ILT
32832011-06-18 Ian Lance Taylor <iant@google.com>
3284
3285 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3286 merely because a non-PT_LOAD segment has a dynamic reloc.
3287
0d212c3a
ILT
32882011-06-18 Ian Lance Taylor <iant@google.com>
3289
3290 * layout.cc (Layout::finish_dynamic_section): Don't create
3291 DT_FLAGS entry if not needed.
3292
911a5072
ILT
32932011-06-18 Ian Lance Taylor <iant@google.com>
3294
3295 PR gold/12745
3296 * layout.cc (Layout::layout_eh_frame): Correct handling of
3297 writable .eh_frame section.
3298
534b4e5f
ILT
32992011-06-17 Ian Lance Taylor <iant@google.com>
3300
3301 PR gold/12893
3302 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3303 symbol is redefined with the exact same object and value.
3304
10b4f102
ILT
33052011-06-17 Ian Lance Taylor <iant@google.com>
3306
3307 PR gold/12880
3308 * layout.h (class Layout): Add interp_segment_ field.
3309 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3310 (Layout::attach_allocated_section_to_segment): If making shared
3311 library, put .interp section in PT_INTERP segment.
3312 (Layout::finalize): Also call create_interp if -dynamic-linker
3313 option was used.
3314 (Layout::create_interp): Assert that there is no PT_INTERP
3315 segment. If not using a SECTIONS clause, use make_output_section.
3316 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3317 * script-sections.cc
3318 (Script_sections::create_note_and_tls_segments): If making shared
3319 library, put .interp section in PT_INTERP segment.
3320
a29b0dad
ILT
33212011-06-17 Ian Lance Taylor <iant@google.com>
3322
e588ea8d
ILT
3323 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3324 when making a shared library.
3325
33262011-06-17 Ian Lance Taylor <iant@google.com>
3327
3328 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3329 parameter. Change all callers. Don't issue warning about PC32
3330 against locally defined symbol.
a29b0dad 3331
9d3b0698
ILT
33322011-06-16 Ian Lance Taylor <iant@google.com>
3333
3334 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3335 occurs in same object.
3336
85b0f90c
AM
33372011-06-14 Alan Modra <amodra@gmail.com>
3338
3339 * po/POTFILES.in: Regenerate.
3340
a94907d9
ILT
33412011-06-09 Ian Lance Taylor <iant@google.com>
3342
3343 * script-sections.cc
3344 (Orphan_output_section::set_section_addresses): For a relocatable
3345 link set address to 0.
3346
4fb3a1c3
CC
33472011-06-09 Cary Coutant <ccoutant@google.com>
3348
3349 PR gold/12804
3350 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3351 used with --compress-debug-sections.
3352 * gold/object.cc (Sized_relobj_file::do_layout): Report
3353 uncompressed size of compressed input sections.
3354
61220854
CC
33552011-06-08 Cary Coutant <ccoutant@google.com>
3356
3357 PR gold/12804
3358 * testsuite/two_file_test_2_v1.cc: Change initialization of
3359 v2 to keep it in .data.
3360
e6455dfb
CC
33612011-06-07 Cary Coutant <ccoutant@google.com>
3362
3363 * common.cc (Symbol_table::do_allocate_commons_list): Call
3364 gold_fallback.
3365 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3366 (Errors::fallback): New function.
3367 (gold_fallback): New function.
3368 * errors.h (Errors::fallback): New function.
3369 * gold.cc (gold_exit): Change status parameter to enum; adjust
3370 all callers.
3371 (queue_initial_tasks): Call gold_fallback.
3372 * gold.h: Include cstdlib.
3373 (Exit_status): New enum type.
3374 (gold_exit): Change status parameter to enum.
3375 (gold_fallback): New function.
3376 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3377 (Layout::create_symtab_sections): Likewise.
3378 (Layout::create_shdrs): Likewise.
3379 * main.cc (main): Adjust call to gold_exit.
3380 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3381 (Output_data_got::add_got_entry_pair): Likewise.
3382 (Output_section::add_input_section): Likewise.
3383 (Output_section::add_output_section_data): Likewise.
3384 (Output_segment::set_section_list_addresses): Likewise.
3385 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3386
fb0e076f
CC
33872011-06-07 Cary Coutant <ccoutant@google.com>
3388
3389 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3390 for incremental links.
3391 * output.cc (Output_segment::set_section_list_addresses): Remove
3392 FIXME and test for TLS or BSS.
3393
a5ee4d5d
CC
33942011-06-07 Cary Coutant <ccoutant@google.com>
3395
3396 * testsuite/Makefile.am: Add incremental_copy_test,
3397 incremental_common_test_1.
3398 * testsuite/Makefile.in: Regenerate.
3399 * testsuite/common_test_1_v1.c: New source file.
3400 * testsuite/common_test_1_v2.c: New source file.
3401 * testsuite/copy_test_v1.cc: New source file.
3402
5146f448
CC
34032011-06-07 Cary Coutant <ccoutant@google.com>
3404
3405 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3406 update, allocate common from bss section's free list.
3407 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3408 linker-defined symbols.
3409 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3410 Skip GOT and PLT entries that are no longer referenced.
3411 (Output_section_incremental_inputs::write_info_blocks): Mark
3412 linker-defined symbols.
3413 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3414 * output.cc (Output_section::allocate): New function.
3415 * output.h (Output_section::allocate): New function.
3416 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3417 linker-defined symbols.
3418 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3419 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3420 (Symbol::init_base_output_data): Likewise.
3421 (Symbol::init_base_output_segment): Likewise.
3422 (Symbol::init_base_constant): Likewise.
3423 (Sized_symbol::init_output_data): Likewise.
3424 (Sized_symbol::init_output_segment): Likewise.
3425 (Sized_symbol::init_constant): Likewise.
3426 (Symbol_table::do_define_in_output_data): Likewise.
3427 (Symbol_table::do_define_in_output_segment): Likewise.
3428 (Symbol_table::do_define_as_constant): Likewise.
3429 * symtab.h (Symbol::is_predefined): New function.
3430 (Symbol::init_base_output_data): Add is_predefined parameter.
3431 (Symbol::init_base_output_segment): Likewise.
3432 (Symbol::init_base_constant): Likewise.
3433 (Symbol::is_predefined_): New data member.
3434 (Sized_symbol::init_output_data): Add is_predefined parameter.
3435 (Sized_symbol::init_output_segment): Likewise.
3436 (Sized_symbol::init_constant): Likewise.
3437 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3438
26d3c67d
CC
34392011-06-07 Cary Coutant <ccoutant@google.com>
3440
3441 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3442 instead of emit_copy_reloc.
3443 (Copy_relocs::emit_copy_reloc): Refactor.
3444 (Copy_relocs::make_copy_reloc): New function.
3445 (Copy_relocs::add_copy_reloc): Remove.
3446 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3447 section.
3448 (Copy_relocs::make_copy_reloc): New function.
3449 (Copy_relocs::add_copy_reloc): Remove.
3450 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3451 unchanged input files.
3452 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3453 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3454 Reserve BSS space for COPY relocations.
3455 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3456 (Output_section_incremental_inputs::write_info_blocks): Record
3457 whether a symbol is copied from a shared object.
3458 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3459 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3460 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3461 (Incremental_input_entry_reader::get_output_symbol_index): Add
3462 is_copy parameter.
3463 (Incremental_binary::emit_copy_relocs): New function.
3464 (Incremental_binary::do_emit_copy_relocs): New function.
3465 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3466 new data member.
3467 (Sized_incremental_binary::add_copy_reloc): New function.
3468 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3469 (Sized_incremental_binary::Copy_reloc): New struct.
3470 (Sized_incremental_binary::Copy_relocs): New typedef.
3471 (Sized_incremental_binary::copy_relocs_): New data member.
3472 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3473 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3474 * target.h (Sized_target::emit_copy_reloc): New function.
3475 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3476
7cdb37d9
CC
34772011-06-02 Cary Coutant <ccoutant@google.com>
3478
3479 PR gold/12163
3480 * gold/archive.cc (Archive::Archive): Initialize new data member.
3481 (Archive::include_all_members): Return if archive has already been
3482 included.
3483 * gold/archive.h (Archive::include_all_members_): New data member.
3484
cc643b88
NC
34852011-06-02 Nick Clifton <nickc@redhat.com>
3486
3487 * dynobj.h: Fix spelling mistake in comment.
3488 * output.cc: Likewise.
3489
f62a3ca7 34902011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3491 Asier Llano
f62a3ca7
DK
3492
3493 PR gold/12826
cc643b88 3494 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3495 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3496 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3497 redundant arm_exidx_test.so.
3498 * testsuite/Makefile.in: Regenerate.
3499 (check_SCRIPTS): Add pr12826.sh
3500 (check_DATA): Add pr12826.stdout
3501 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3502 * testsuite/pr12826.sh: New file.
3503 * testsuite/pr12826_1.s: Ditto.
3504 * testsuite/pr12826_1.s: Ditto.
3505
8dbe1edc
ILT
35062011-05-30 Ian Lance Taylor <iant@google.com>
3507
3508 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3509 sections.
3510
c49875be
ILT
35112011-05-29 Ian Lance Taylor <iant@google.com>
3512
3513 PR gold/12804
3514 * testsuite/Makefile.am: Use different file name for two_file_test
3515 temporary file for each incremental test.
3516 * testsuite/Makefile.in: Rebuild.
3517
69d53f7a
ILT
35182011-05-29 Ian Lance Taylor <iant@google.com>
3519
3520 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3521 binary input file is empty.
3522
41d0ab5f
ILT
35232011-05-27 Ian Lance Taylor <iant@google.com>
3524
3525 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3526 (ver_test_9.so): Likewise.
3527 * testsuite/Makefile.in: Rebuild.
3528
89d8a36b
CC
35292011-05-26 Cary Coutant <ccoutant@google.com>
3530
3531 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3532 * incremental.cc (Incremental_inputs::report_input_section): Fix
3533 comment, indentation.
3534 (Incremental_inputs::report_comdat_group): New function.
3535 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3536 of data for incremental input file entry.
3537 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3538 group count, COMDAT group signatures.
3539 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3540 an unchanged input file.
3541 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3542 Initialize new data member.
3543 (Incremental_object_entry::add_comdat_group): New function.
3544 (Incremental_object_entry::get_comdat_group_count): New function.
3545 (Incremental_object_entry::get_comdat_signature_key): New function.
3546 (Incremental_object_entry::groups_): New data member.
3547 (Incremental_inputs::report_comdat_group): New function.
3548 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3549 data for incremental input file entry.
3550 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3551 (Incremental_input_entry_reader::get_input_section): Adjust size of
3552 data for incremental input file entry.
3553 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3554 (Incremental_input_entry_reader::get_comdat_group_signature): New
3555 function.
3556 * object.cc (Sized_relobj::include_section_group): Report kept
3557 COMDAT groups for incremental links.
3558
1706a06f
ILT
35592011-05-24 David Meyer <pdox@google.com>
3560
3561 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3562 with name parameter. Add found_name parameter.
3563 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3564 * dirsearch.h (class Dirsearch): Update declaration.
3565
a10ae760
ILT
35662011-05-24 Ian Lance Taylor <iant@google.com>
3567
3568 * archive.cc (Library_base::should_include_member): Pull in object
3569 from archive if it defines the entry symbol.
3570 * parameters.cc (Parameters::entry): New function.
3571 * parameters.h (class Parameters): Declare entry.
3572 * output.h (class Output_file_header): Remove entry_ field.
3573 * output.cc (Output_file_header::Output_file_header): Remove entry
3574 parameter. Change all callers.
3575 (Output_file_header::entry): Use parameters->entry.
3576 * gold.cc (queue_middle_tasks): Likewise.
3577 * plugin.cc (Plugin_hook::run): Likewise.
3578
aa92d6ed
CC
35792011-05-24 Cary Coutant <ccoutant@google.com>
3580
3581 * gold.cc (queue_initial_tasks): Pass incremental base filename
3582 to Output_file::open_base_file; don't print error message.
3583 * incremental-dump.cc (main): Adjust call to
3584 Output_file::open_for_modification.
3585 * incremental-dump.cc (main): Likewise.
3586 * incremental.cc (Incremental_inputs::report_command_line):
3587 Ignore --incremental-base option when comparing command lines.
3588 Ignore parameter when given as separate argument.
3589 * options.h (class General_options): Add --incremental-base.
3590 * output.cc (Output_file::Output_file):
3591 (Output_file::open_base_file): Add base_name and writable parameters;
3592 read base file into new file; print error message here.
3593 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3594 callers.
3595 * output.h (Output_file::open_for_modification): Rename to...
3596 (Output_file::open_base_file): ...this; add base_name and
3597 writable parameters; adjust all callers.
3598 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3599 callers.
3600 * testsuite/Makefile.am (incremental_test_4): Test
3601 --incremental-base.
3602 * testsuite/Makefile.in: Regenerate.
3603
2eedd706
CC
36042011-05-24 Cary Coutant <ccoutant@google.com>
3605
3606 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3607 incremental_test_4.
3608 * testsuite/Makefile.in: Regenerate.
3609 * testsuite/two_file_test_1_v1.cc: New test source file.
3610 * testsuite/two_file_test_1b_v1.cc: New test source file.
3611 * testsuite/two_file_test_2_v1.cc: New test source file.
3612
0f1c85a6
CC
36132011-05-24 Cary Coutant <ccoutant@google.com>
3614
3615 * dynobj.h (Dynobj::do_dynobj): New function.
3616 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3617 flag and soname for shared objects.
3618 * incremental.cc (Incremental_inputs::report_object): Make
3619 either Incremental_object_entry or Incremental_dynobj_entry; add
3620 soname to string table.
3621 (Incremental_inputs::report_input_section): Add assertion.
3622 (Output_section_incremental_inputs::set_final_data_size): Adjust
3623 type of input file entry for shared libraries; adjust size of
3624 shared library info entry.
3625 (Output_section_incremental_inputs::write_input_files): Write
3626 as_needed flag for shared libraries.
3627 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3628 of input file entry for shared libraries; write soname.
3629 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3630 soname from incremental info.
3631 * incremental.h (enum Incremental_input_flags): Add
3632 INCREMENTAL_INPUT_AS_NEEDED.
3633 (Incremental_input_entry::Incremental_input_entry): Initialize new
3634 data member.
3635 (Incremental_input_entry::set_as_needed): New function.
3636 (Incremental_input_entry::as_needed): New function.
3637 (Incremental_input_entry::do_dynobj_entry): New function.
3638 (Incremental_input_entry::as_needed_): New data member.
3639 (Incremental_object_entry::Incremental_object_entry): Don't check
3640 for shared library.
3641 (Incremental_object_entry::do_type): Likewise.
3642 (class Incremental_dynobj_entry): New class.
3643 (Incremental_input_entry_reader::as_needed): New function.
3644 (Incremental_input_entry_reader::get_soname): New function.
3645 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3646 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3647 size of shared library info entry.
58797674 3648 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3649 incremental link when adding DT_NEEDED entries.
3650 * object.h (Object::Object): Initialize new data member.
3651 (Object::dynobj): New function.
3652 (Object::set_as_needed): New function.
3653 (Object::as_needed): New function.
3654 (Object::do_dynobj): New function.
3655 (Object::as_needed_): New data member.
3656
6fa2a40b
CC
36572011-05-24 Cary Coutant <ccoutant@google.com>
3658
3659 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3660 info; adjust display of GOT entries.
3661 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3662 vector of input objects; remove file_status_.
3663 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3664 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3665 got_plt reader; call target hooks to reserve GOT entries.
3666 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3667 of input file info header and GOT info entry.
3668 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3669 relocation info.
3670 (Got_plt_view_info::got_descriptor): Remove.
3671 (Got_plt_view_info::sym_index): New data member.
3672 (Got_plt_view_info::input_index): New data member.
3673 (Local_got_offset_visitor::visit): Write input file index.
3674 (Global_got_offset_visitor::visit): Write 0 for input file index.
3675 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3676 with sym_index and input_index.
3677 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3678 incremental info GOT entry; replace got_descriptor with input_index.
3679 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3680 map from input file index to object.
3681 (Sized_relobj_incr::do_layout): Replace direct data member reference
3682 with accessor function.
3683 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3684 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3685 Adjust size of input file info header.
3686 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3687 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3688 (Incremental_input_entry_reader::get_input_section): Adjust size of
3689 input file info header.
3690 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3691 of incremental info GOT entry.
3692 (Incremental_got_plt_reader::get_got_desc): Remove.
3693 (Incremental_got_plt_reader::get_got_symndx): New function.
3694 (Incremental_got_plt_reader::get_got_input_index): New function.
3695 (Sized_incremental_binary::Sized_incremental_binary): Remove
3696 file_status_; add input_objects_.
3697 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3698 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3699 (Sized_incremental_binary::file_is_unchanged): Remove.
3700 (Sized_incremental_binary::set_input_object): New function.
3701 (Sized_incremental_binary::input_object): New function.
3702 (Sized_incremental_binary::file_status_): Remove.
3703 (Sized_incremental_binary::input_objects_): New data member.
3704 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3705 references.
3706 (Sized_relobj_incr::invalid_address): Move to base class.
3707 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3708 class.
3709 (Sized_relobj_incr::do_output_section_offset): Likewise.
3710 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3711 (Sized_relobj_incr::section_offsets_): Likewise.
3712 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3713 function.
3714 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3715 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3716 with accessor function.
3717 (Sized_relobj_file::do_layout): Likewise.
3718 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3719 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3720 (Sized_relobj_file::compute_final_local_value): Replace refs to
3721 section_offsets_ with accessor function.
3722 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3723 * object.h (Relobj::Relobj): Initialize new data members.
3724 (Relobj::add_dyn_reloc): New function.
3725 (Relobj::first_dyn_reloc): New function.
3726 (Relobj::dyn_reloc_count): New function.
3727 (Relobj::first_dyn_reloc_): New data member.
3728 (Relobj::dyn_reloc_count_): New data member.
3729 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3730 references.
3731 (Sized_relobj::Address): New typedef.
3732 (Sized_relobj::invalid_address): Move here from child class.
3733 (Sized_relobj::Sized_relobj): Initialize new data members.
3734 (Sized_relobj::sized_relobj): New function.
3735 (Sized_relobj::is_output_section_offset_invalid): Move here from
3736 child class.
3737 (Sized_relobj::get_output_section_offset): Likewise.
3738 (Sized_relobj::local_has_got_offset): Likewise.
3739 (Sized_relobj::local_got_offset): Likewise.
3740 (Sized_relobj::set_local_got_offset): Likewise.
3741 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3742 (Sized_relobj::clear_got_offsets): New function.
3743 (Sized_relobj::section_offsets): Move here from child class.
3744 (Sized_relobj::do_output_section_offset): Likewise.
3745 (Sized_relobj::do_set_section_offset): Likewise.
3746 (Sized_relobj::Local_got_offsets): Likewise.
3747 (Sized_relobj::local_got_offsets_): Likewise.
3748 (Sized_relobj::section_offsets_): Likewise.
3749 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3750 references.
3751 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3752 class.
3753 (Sized_relobj_file::sized_relobj): New function
3754 (Sized_relobj_file::local_has_got_offset): Move to base class.
3755 (Sized_relobj_file::local_got_offset): Likewise.
3756 (Sized_relobj_file::set_local_got_offset): Likewise.
3757 (Sized_relobj_file::get_output_section_offset): Likewise.
3758 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3759 (Sized_relobj_file::do_output_section_offset): Likewise.
3760 (Sized_relobj_file::do_set_section_offset): Likewise.
3761 (Sized_relobj_file::Local_got_offsets): Likewise.
3762 (Sized_relobj_file::local_got_offsets_): Likewise.
3763 (Sized_relobj_file::section_offsets_): Likewise.
3764 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3765 (all constructors).
3766 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3767 (Output_reloc::get_symbol_index): Likewise.
3768 (Output_reloc::local_section_offset): Likewise.
3769 (Output_reloc::get_address): Likewise.
3770 (Output_reloc::symbol_value): Likewise.
3771 (Output_data_got::reserve_slot): Move to class definition.
3772 (Output_data_got::reserve_local): New function.
3773 (Output_data_got::reserve_slot_for_global): Remove.
3774 (Output_data_got::reserve_global): New function.
3775 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3776 (all constructors, two instantiations).
3777 (Output_reloc::get_relobj): New function (two instantiations).
3778 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3779 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3780 (Output_data_reloc::add_global): Adjust type of relobj.
3781 (Output_data_reloc::add_global_relative): Likewise.
3782 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3783 (Output_data_reloc::add_local): Likewise.
3784 (Output_data_reloc::add_local_relative): Likewise.
3785 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3786 (Output_data_reloc::add_local_section): Likewise.
3787 (Output_data_reloc::add_output_section): Likewise.
3788 (Output_data_reloc::add_absolute): Likewise.
3789 (Output_data_reloc::add_target_specific): Likewise.
3790 (Output_data_got::reserve_slot): Move definition here.
3791 (Output_data_got::reserve_local): New function.
3792 (Output_data_got::reserve_global): New function.
3793 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3794 section_offsets_ with accessor function.
3795 (Sized_relobj_file::write_sections): Likewise.
3796 (Sized_relobj_file::do_relocate_sections): Likewise.
3797 * target.h (Sized_target::reserve_local_got_entry): New function.
3798 (Sized_target::reserve_global_got_entry): New function.
3799 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3800 (Target_x86_64::reserve_global_got_entry): New function.
3801 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3802
4829d394
CC
38032011-05-23 Cary Coutant <ccoutant@google.com>
3804
3805 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3806 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3807 bit when checking got_type.
3808 * incremental.cc (Sized_incremental_binary::setup_readers):
3809 Store symbol table and string table locations; initialize bit vector
3810 of file status flags.
3811 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3812 unchanged files.
3813 (Sized_incremental_binary::do_process_got_plt): New function.
3814 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3815 (Output_section_incremental_inputs::set_final_data_size): Record
3816 file index for each input file.
3817 (Output_section_incremental_inputs::write_got_plt): Store file index
3818 instead of input entry offset for each GOT entry.
3819 * incremental.h
3820 (Incremental_input_entry::Incremental_input_entry): Initialize new
3821 data member.
3822 (Incremental_input_entry::set_offset): Store file index.
3823 (Incremental_input_entry::get_file_index): New function.
3824 (Incremental_input_entry::file_index_): New data member.
3825 (Incremental_binary::process_got_plt): New function.
3826 (Incremental_binary::do_process_got_plt): New function.
3827 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3828 data members.
3829 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3830 (Sized_incremental_binary::set_file_is_unchanged): New function.
3831 (Sized_incremental_binary::file_is_unchanged): New function.
3832 (Sized_incremental_binary::do_process_got_plt): New function.
3833 (Sized_incremental_binary::file_status_): New data member.
3834 (Sized_incremental_binary::main_symtab_loc_): New data member.
3835 (Sized_incremental_binary::main_strtab_loc_): New data member.
3836 * output.cc (Output_data_got::Got_entry::write): Add case
3837 RESERVED_CODE.
3838 (Output_data_got::add_global): Call add_got_entry.
3839 (Output_data_got::add_global_plt): Likewise.
3840 (Output_data_got::add_global_with_rel): Likewise.
3841 (Output_data_got::add_global_with_rela): Likewise.
3842 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3843 (Output_data_got::add_global_pair_with_rela): Likewise.
3844 (Output_data_got::add_local): Call add_got_entry.
3845 (Output_data_got::add_local_plt): Likewise.
3846 (Output_data_got::add_local_with_rel): Likewise.
3847 (Output_data_got::add_local_with_rela): Likewise.
3848 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3849 (Output_data_got::add_local_pair_with_rela): Likewise.
3850 (Output_data_got::reserve_slot): New function.
3851 (Output_data_got::reserve_slot_for_global): New function.
3852 (Output_data_got::add_got_entry): New function.
3853 (Output_data_got::add_got_entry_pair): New function.
3854 (Output_section::add_output_section_data): Edit FIXME.
3855 * output.h
3856 (Output_section_data_build::Output_section_data_build): New
3857 constructor with size parameter.
3858 (Output_data_space::Output_data_space): Likewise.
3859 (Output_data_got::Output_data_got): Initialize new data member; new
3860 constructor with size parameter.
3861 (Output_data_got::add_constant): Call add_got_entry.
3862 (Output_data_got::reserve_slot): New function.
3863 (Output_data_got::reserve_slot_for_global): New function.
3864 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3865 (Output_data_got::add_got_entry): New function.
3866 (Output_data_got::add_got_entry_pair): New function.
3867 (Output_data_got::free_list_): New data member.
3868 * target.h (Sized_target::init_got_plt_for_update): New function.
3869 (Sized_target::register_global_plt_entry): New function.
3870 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3871 Initialize new data member; call init; add constructor with PLT count.
3872 (Output_data_plt_x86_64::init): New function.
3873 (Output_data_plt_x86_64::add_relocation): New function.
3874 (Output_data_plt_x86_64::reserve_slot): New function.
3875 (Output_data_plt_x86_64::free_list_): New data member.
3876 (Target_x86_64::init_got_plt_for_update): New function.
3877 (Target_x86_64::register_global_plt_entry): New function.
3878 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3879 incremental updates.
3880 (Output_data_plt_x86_64::add_relocation): New function.
3881 * testsuite/object_unittest.cc (Object_test): Set default options.
3882
ec69d6da
ILT
38832011-05-16 Ian Lance Taylor <iant@google.com>
3884
3885 * options.h (class General_options): Make -i a synonym for -r.
3886
732e31de
ILT
38872011-05-16 Ian Lance Taylor <iant@google.com>
3888
3889 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3890
403676b5
CC
38912011-05-10 Cary Coutant <ccoutant@google.com>
3892
3893 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3894 strip_all (-s).
3895
5b7b7d6e
ILT
38962011-05-06 Ian Lance Taylor <iant@google.com>
3897
3898 * layout.cc (Layout::layout): If the output section flags change,
3899 update the ordering.
3900
f0f9babf
CC
39012011-04-25 Cary Coutant <ccoutant@google.com>
3902
3903 * incremental-dump.cc (dump_incremental_inputs): Print local
3904 symbol info for each input file.
3905 * incremental.cc
3906 (Output_section_incremental_inputs::set_final_data_size): Add local
3907 symbol info to input file entries in incremental info.
3908 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3909 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3910 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3911 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3912 implementation.
3913 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3914 (Sized_incr_relobj::do_relocate): Write the local symbols.
3915 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3916 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3917 Adjust size of input file header.
3918 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3919 (Incremental_inputs_reader::get_local_symbol_count): New function.
3920 (Incremental_inputs_reader::get_input_section): Adjust size of input
3921 file header.
3922 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3923 (Sized_incr_relobj::This): New typedef.
3924 (Sized_incr_relobj::sym_size): New const data member.
3925 (Sized_incr_relobj::Local_symbol): New struct.
3926 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3927 (Sized_incr_relobj::do_local_symbol_offset): New function.
3928 (Sized_incr_relobj::local_symbol_count_): New data member.
3929 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3930 (Sized_incr_relobj::local_symbol_index_): New data member.
3931 (Sized_incr_relobj::local_symbol_offset_): New data member.
3932 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3933 (Sized_incr_relobj::local_symbols_): New data member.
3934 * object.h (Relobj::output_local_symbol_count): New function.
3935 (Relobj::local_symbol_offset): New function.
3936 (Relobj::do_output_local_symbol_count): New function.
3937 (Relobj::do_local_symbol_offset): New function.
3938 (Sized_relobj::do_output_local_symbol_count): New function.
3939 (Sized_relobj::do_local_symbol_offset): New function.
3940
d0a9ace3
ILT
39412011-04-22 Vladimir Simonov <sv@sw.ru>
3942
3943 * descriptors.cc (set_close_on_exec): New function.
3944 (Descriptors::open): Use set_close_on_exec.
3945 * output.cc (S_ISLNK): Define if not defined.
3946
94a3fc8b
CC
39472011-04-22 Cary Coutant <ccoutant@google.com>
3948
3949 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3950 global symbol map.
3951 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3952 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3953 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3954 relocations.
3955 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3956 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3957 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3958 * incremental.h
3959 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3960 function.
3961 (Incremental_binary::apply_incremental_relocs): New function.
3962 (Incremental_binary::do_apply_incremental_relocs): New function.
3963 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3964 data member.
3965 (Sized_incremental_binary::add_global_symbol): New function.
3966 (Sized_incremental_binary::global_symbol): New function.
3967 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3968 (Sized_incremental_binary::symbol_map_): New data member.
3969 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3970 * target.h (Sized_target::apply_relocation): New function.
3971 * target-reloc.h (apply_relocation): New function.
3972 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3973
c87e4302
DK
39742011-04-22 Doug Kwan <dougkwan@google.com>
3975
3976 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3977 flag of a SHT_ARM_EXIDX section.
2e702c99 3978 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3979 * testsuite/Makefile.in: Regenerate.
3980 * testsuite/arm_exidx_test.s: New file.
3981 * testsuite/arm_exidx_test.sh: Same.
3982
e7782cf6
CC
39832011-04-20 Cary Coutant <ccoutant@google.com>
3984
3985 PR gold/12689
3986 * archive.h (Incremental_archive_entry::Archive_member):
3987 Initialize arg_serial_ (second constructor).
3988
308ecdc7
ILT
39892011-04-17 Ian Lance Taylor <iant@google.com>
3990
3991 * object.cc (Relocate_info::location): Simplify location string.
3992 * errors.cc (Errors::error_at_location): Don't print program
3993 name.
3994 (Errors::warning_at_location): Likewise.
3995 (Errors::undefined_symbol): Likewise.
3996 * testsuite/debug_msg.sh: Update accordingly.
3997
bec5b579
CC
39982011-04-14 Cary Coutant <ccoutant@google.com>
3999
4000 * gold/layout.cc (Layout::symtab_section_offset): New function.
4001 * gold/layout.h (Layout::symtab_section_offset): New function.
4002 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4003
88597d34
ILT
40042011-04-12 Ian Lance Taylor <iant@google.com>
4005
4006 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4007 with MREMAP_MAYMOVE.
4008 * output.h (class Output_file): Add map_is_allocated_ field.
4009 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4010 not available, provide stubs. If mremap is not available, #define
4011 it to gold_mremap.
4012 (MREMAP_MAYMOVE): Define if not defined.
4013 (Output_file::Output_file): Initialize map_is_allocated_.
4014 (Output_file::resize): Check map_is_allocated_.
4015 (Output_file::map_anonymous): If mmap fails, use malloc.
4016 (Output_file::unmap): Don't do anything for an anonymous map.
4017 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4018 is not available, provide stubs.
4019 (File_read::View::~View): Use free rather than delete[].
4020 (File_read::make_view): Use malloc rather than new[]. If mmap
4021 fails, use malloc.
4022 (File_read::find_or_make_view): Use malloc rather than new[].
4023 * gold.h: Remove HAVE_REMAP code.
4024 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4025 exists. Rename mremap to gold_mremap. If mmap is not available
4026 don't do anything.
4027 * configure, config.in: Rebuild.
4028
11e361bc
ILT
40292011-04-11 Ian Lance Taylor <iant@google.com>
4030
4031 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4032 initialize local variable v.
4033
cdc29364
CC
40342011-04-11 Cary Coutant <ccoutant@google.com>
4035
4036 * archive.cc (Archive::include_member): Adjust call to
4037 report_object.
4038 (Add_archive_symbols::run): Track argument serial numbers.
4039 (Lib_group::include_member): Likewise.
4040 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4041 * archive.h (Incremental_archive_entry::Archive_member):
4042 Initialize arg_serial_.
4043 (Archive_member::arg_serial_): New data member.
4044 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4045 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4046 incremental link.
4047 (Sized_dynobj::do_for_all_local_got_entries): New function.
4048 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4049 function.
4050 * fileread.cc (get_mtime): New function.
4051 * fileread.h (get_mtime): New function.
4052 * gold.cc (queue_initial_tasks): Check for incremental update.
4053 (process_incremental_input): New function.
4054 (queue_middle_tasks): Don't force valid target for incremental
4055 update.
4056 * incremental-dump.cc (find_input_containing_global): Adjust
4057 size of symbol info entry.
4058 (dump_incremental_inputs): Dump argument serial number and
4059 in_system_directory flag; bias shndx by 1; print symbol names
4060 when dumping per-file symbol lists; use new symbol info readers.
4061 * incremental.cc
4062 (Output_section_incremental_inputs:update_data_size): New function.
4063 (Sized_incremental_binary::setup_readers): Setup input readers
4064 for each input file; build maps for files added from libraries
4065 and scripts.
4066 (Sized_incremental_binary::check_input_args): New function.
4067 (Sized_incremental_binary::do_check_inputs): Build map of argument
4068 serial numbers to input arguments.
4069 (Sized_incremental_binary::do_file_has_changed): Rename
4070 do_file_is_unchanged to this; compare file modification times.
4071 (Sized_incremental_binary::do_init_layout): New function.
4072 (Sized_incremental_binary::do_reserve_layout): New function.
4073 (Sized_incremental_binary::do_get_input_reader): Remove.
4074 (Sized_incremental_binary::get_symtab_view): New function.
4075 (Incremental_checker::can_incrementally_link_output_file): Remove.
4076 (Incremental_inputs::report_command_line): Exclude --debug options.
4077 (Incremental_inputs::report_archive_begin): Add parameter; track
4078 argument serial numbers; don't put input file entry for archive
4079 before archive members.
4080 (Incremental_inputs::report_archive_end): Put input file entry
4081 for archive after archive members.
4082 (Incremental_inputs::report_object): Add parameter; track argument
4083 serial numbers and in_system_directory flag.
4084 (Incremental_inputs::report_script): Add parameter; track argument
4085 serial numbers.
4086 (Output_section_incremental_inputs::set_final_data_size): Adjust
4087 size of symbol info entry; check for forwarding symbols.
4088 (Output_section_incremental_inputs::write_input_files): Write
4089 in_system_directory flag and argument serial number.
4090 (Output_section_incremental_inputs::write_info_blocks): Map section
4091 indices between incremental info and original input file; store
4092 input section index for each symbol.
4093 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4094 change operator() to visit().
4095 (class Global_got_offset_visitor): Likewise.
4096 (class Global_symbol_visitor_got_plt):
4097 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4098 classes.
4099 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4100 (Sized_incr_relobj::do_read_symbols): New function.
4101 (Sized_incr_relobj::do_layout): New function.
4102 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4103 (Sized_incr_relobj::do_add_symbols): New function.
4104 (Sized_incr_relobj::do_should_include_member): New function.
4105 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4106 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4107 (Sized_incr_relobj::do_section_size): New function.
4108 (Sized_incr_relobj::do_section_name): New function.
4109 (Sized_incr_relobj::do_section_contents): New function.
4110 (Sized_incr_relobj::do_section_flags): New function.
4111 (Sized_incr_relobj::do_section_entsize): New function.
4112 (Sized_incr_relobj::do_section_address): New function.
4113 (Sized_incr_relobj::do_section_type): New function.
4114 (Sized_incr_relobj::do_section_link): New function.
4115 (Sized_incr_relobj::do_section_info): New function.
4116 (Sized_incr_relobj::do_section_addralign): New function.
4117 (Sized_incr_relobj::do_initialize_xindex): New function.
4118 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4119 (Sized_incr_relobj::do_read_relocs): New function.
4120 (Sized_incr_relobj::do_gc_process_relocs): New function.
4121 (Sized_incr_relobj::do_scan_relocs): New function.
4122 (Sized_incr_relobj::do_count_local_symbols): New function.
4123 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4124 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4125 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4126 (Sized_incr_relobj::do_relocate): New function.
4127 (Sized_incr_relobj::do_set_section_offset): New function.
4128 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4129 (Sized_incr_dynobj::do_read_symbols): New function.
4130 (Sized_incr_dynobj::do_layout): New function.
4131 (Sized_incr_dynobj::do_add_symbols): New function.
4132 (Sized_incr_dynobj::do_should_include_member): New function.
4133 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4134 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4135 (Sized_incr_dynobj::do_section_size): New function.
4136 (Sized_incr_dynobj::do_section_name): New function.
4137 (Sized_incr_dynobj::do_section_contents): New function.
4138 (Sized_incr_dynobj::do_section_flags): New function.
4139 (Sized_incr_dynobj::do_section_entsize): New function.
4140 (Sized_incr_dynobj::do_section_address): New function.
4141 (Sized_incr_dynobj::do_section_type): New function.
4142 (Sized_incr_dynobj::do_section_link): New function.
4143 (Sized_incr_dynobj::do_section_info): New function.
4144 (Sized_incr_dynobj::do_section_addralign): New function.
4145 (Sized_incr_dynobj::do_initialize_xindex): New function.
4146 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4147 (make_sized_incremental_object): New function.
4148 (Incremental_library::copy_unused_symbols): New function.
4149 (Incremental_library::do_for_all_unused_symbols): New function.
4150 * incremental.h (enum Incremental_input_flags): New type.
4151 (class Incremental_checker): Remove.
4152 (Incremental_input_entry::Incremental_input_entry): Add argument
4153 serial number.
4154 (Incremental_input_entry::arg_serial): New function.
4155 (Incremental_input_entry::set_is_in_system_directory): New function.
4156 (Incremental_input_entry::is_in_system_directory): New function.
4157 (Incremental_input_entry::arg_serial_): New data member.
4158 (Incremental_input_entry::is_in_system_directory_): New data member.
4159 (class Script_info): Move here from script.h.
4160 (Script_info::Script_info): Add filename parameter.
4161 (Script_info::filename): New function.
4162 (Script_info::filename_): New data member.
4163 (Incremental_script_entry::Incremental_script_entry): Add argument
4164 serial number.
4165 (Incremental_object_entry::Incremental_object_entry): Likewise.
4166 (Incremental_object_entry::add_input_section): Build list of input
4167 sections with map to original shndx.
4168 (Incremental_object_entry::get_input_section_index): New function.
4169 (Incremental_object_entry::shndx_): New data member.
4170 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4171 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4172 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4173 serial number.
4174 (Incremental_inputs::report_archive_begin): Likewise.
4175 (Incremental_inputs::report_object): Likewise.
4176 (Incremental_inputs::report_script): Likewise.
4177 (class Incremental_global_symbol_reader): New class.
4178 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4179 and store flags and input file type.
4180 (Incremental_input_entry_reader::arg_serial): New function.
4181 (Incremental_input_entry_reader::type): Extract type from flags.
4182 (Incremental_input_entry_reader::is_in_system_directory): New function.
4183 (Incremental_input_entry_reader::get_input_section_count): Call
4184 accessor function for type.
4185 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4186 function for type; adjust size of global symbol entry.
4187 (Incremental_input_entry_reader::get_global_symbol_count): Call
4188 accessor function for type.
4189 (Incremental_input_entry_reader::get_object_count): Likewise.
4190 (Incremental_input_entry_reader::get_object_offset): Likewise.
4191 (Incremental_input_entry_reader::get_member_count): Likewise.
4192 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4193 (Incremental_input_entry_reader::get_member_offset): Likewise.
4194 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4195 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4196 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4197 (Incremental_input_entry_reader::get_global_symbol_reader): New
4198 function.
4199 (Incremental_input_entry_reader::get_output_symbol_index): New
4200 function.
4201 (Incremental_input_entry_reader::type_): Remove.
4202 (Incremental_input_entry_reader::flags_): New data member.
4203 (Incremental_inputs_reader::input_file_offset): New function.
4204 (Incremental_inputs_reader::input_file_index): New function.
4205 (Incremental_inputs_reader::input_file): Call input_file_offset.
4206 (Incremental_inputs_reader::input_file_at_offset): New function.
4207 (Incremental_relocs_reader::get_r_type): Reformat.
4208 (Incremental_relocs_reader::get_r_shndx): Reformat.
4209 (Incremental_relocs_reader::get_r_offset): Reformat.
4210 (Incremental_relocs_reader::data): New function.
4211 (Incremental_binary::Incremental_binary): Initialize new data members.
4212 (Incremental_binary::check_inputs): Add cmdline parameter.
4213 (Incremental_binary::file_is_unchanged): Remove.
4214 (Input_reader::arg_serial): New function.
4215 (Input_reader::get_unused_symbol_count): New function.
4216 (Input_reader::get_unused_symbol): New function.
4217 (Input_reader::do_arg_serial): New function.
4218 (Input_reader::do_get_unused_symbol_count): New function.
4219 (Input_reader::do_get_unused_symbol): New function.
4220 (Incremental_binary::input_file_count): New function.
4221 (Incremental_binary::get_input_reader): Change signature to use
4222 index instead of filename.
4223 (Incremental_binary::file_has_changed): New function.
4224 (Incremental_binary::get_input_argument): New function.
4225 (Incremental_binary::get_library): New function.
4226 (Incremental_binary::get_script_info): New function.
4227 (Incremental_binary::init_layout): New function.
4228 (Incremental_binary::reserve_layout): New function.
4229 (Incremental_binary::output_file): New function.
4230 (Incremental_binary::do_check_inputs): New function.
4231 (Incremental_binary::do_file_is_unchanged): Remove.
4232 (Incremental_binary::do_file_has_changed): New function.
4233 (Incremental_binary::do_init_layout): New function.
4234 (Incremental_binary::do_reserve_layout): New function.
4235 (Incremental_binary::do_input_file_count): New function.
4236 (Incremental_binary::do_get_input_reader): Change signature.
4237 (Incremental_binary::input_args_map_): New data member.
4238 (Incremental_binary::library_map_): New data member.
4239 (Incremental_binary::script_map_): New data member.
4240 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4241 new data members.
4242 (Sized_incremental_binary::output_section): New function.
4243 (Sized_incremental_binary::inputs_reader): Add const.
4244 (Sized_incremental_binary::symtab_reader): Add const.
4245 (Sized_incremental_binary::relocs_reader): Add const.
4246 (Sized_incremental_binary::got_plt_reader): Add const.
4247 (Sized_incremental_binary::get_symtab_view): New function.
4248 (Sized_incremental_binary::Inputs_reader): New typedef.
4249 (Sized_incremental_binary::Input_entry_reader): New typedef.
4250 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4251 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4252 (Sized_incremental_binary::do_file_has_changed): New function.
4253 (Sized_incremental_binary::do_init_layout): New function.
4254 (Sized_incremental_binary::do_reserve_layout): New function.
4255 (Sized_input_reader::Inputs_reader): Remove.
4256 (Sized_input_reader::Input_entry_reader): Remove.
4257 (Sized_input_reader::do_arg_serial): New function.
4258 (Sized_input_reader::do_get_unused_symbol_count): New function.
4259 (Sized_input_reader::do_get_unused_symbol): New function.
4260 (Sized_incremental_binary::do_input_file_count): New function.
4261 (Sized_incremental_binary::do_get_input_reader): Change signature;
4262 use index instead of filename.
4263 (Sized_incremental_binary::section_map_): New data member.
4264 (Sized_incremental_binary::input_entry_readers_): New data member.
4265 (class Sized_incr_relobj): New class.
4266 (class Sized_incr_dynobj): New class.
4267 (make_sized_incremental_object): New function.
4268 (class Incremental_library): New class.
4269 * layout.cc (Free_list::num_lists): New static data member.
4270 (Free_list::num_nodes): New static data member.
4271 (Free_list::num_removes): New static data member.
4272 (Free_list::num_remove_visits): New static data member.
4273 (Free_list::num_allocates): New static data member.
4274 (Free_list::num_allocate_visits): New static data member.
4275 (Free_list::init): New function.
4276 (Free_list::remove): New function.
4277 (Free_list::allocate): New function.
4278 (Free_list::dump): New function.
4279 (Free_list::print_stats): New function.
4280 (Layout_task_runner::run): Resize output file for incremental updates.
4281 (Layout::Layout): Initialize new data members.
4282 (Layout::set_incremental_base): New function.
4283 (Layout::init_fixed_output_section): New function.
4284 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4285 incremental updates.
4286 (Layout::create_gold_note): Do not create gold note section for
4287 incremental updates.
4288 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4289 for incremental updates.
4290 (Layout::set_section_offsets): For incremental updates, allocate space
4291 from free list.
4292 (Layout::create_symtab_sections): Layout with offsets relative to
4293 start of section; for incremental updates, allocate space from free
4294 list.
4295 (Layout::create_shdrs): For incremental updates, allocate space from
4296 free list.
4297 (Layout::finish_dynamic_section): For incremental updates, do not
4298 check --as-needed (fixed in subsequent patch).
4299 * layout.h (class Free_list): New class.
4300 (Layout::set_incremental_base): New function.
4301 (Layout::incremental_base): New function.
4302 (Layout::init_fixed_output_section): New function.
4303 (Layout::allocate): New function.
4304 (Layout::incremental_base_): New data member.
4305 (Layout::free_list_): New data member.
4306 * main.cc (main): Print Free_list statistics.
4307 * object.cc (Relobj::finalize_incremental_relocs): Add
4308 clear_counts parameter; clear counts only when clear_counts is set.
4309 (Sized_relobj::Sized_relobj): Initialize new base class.
4310 (Sized_relobj::do_layout): Don't report special sections.
4311 (Sized_relobj::do_for_all_local_got_entries): New function.
4312 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4313 symtab_off to all symbol table offsets.
4314 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4315 * object.h (class Got_offset_list): Move to top of file.
4316 (Object::Object): Allow case where input_file == NULL.
4317 (Object::~Object): Likewise.
4318 (Object::input_file): Assert that input_file != NULL.
4319 (Object::lock): Allow case where input_file == NULL.
4320 (Object::unlock): Likewise.
4321 (Object::is_locked): Likewise.
4322 (Object::token): Likewise.
4323 (Object::release): Likewise.
4324 (Object::is_incremental): New function.
4325 (Object::get_mtime): New function.
4326 (Object::for_all_local_got_entries): New function.
4327 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4328 (Object::set_is_in_system_directory): New function.
4329 (Object::is_in_system_directory): New function.
4330 (Object::do_is_incremental): New function.
4331 (Object::do_get_mtime): New function.
4332 (Object::do_for_all_local_got_entries): New function.
4333 (Object::is_in_system_directory_): New data member.
4334 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4335 (class Sized_relobj_base): New class.
4336 (class Sized_relobj): Derive from Sized_relobj_base.
4337 (class Sized_relobj::Symbols): Redeclare from base class.
4338 (class Sized_relobj::local_got_offset_list): Remove.
4339 (class Sized_relobj::Output_sections): Redeclare from base class.
4340 (class Sized_relobj::do_for_all_local_got_entries): New function.
4341 (class Sized_relobj::write_local_symbols): Add offset parameter.
4342 (class Sized_relobj::local_symbol_offset_): Update comment.
4343 (class Sized_relobj::local_dynsym_offset_): Update comment.
4344 * options.cc (Input_arguments::add_file): Remove const.
4345 * options.h (Input_file_argument::Input_file_argument):
4346 Initialize arg_serial_ (all constructors).
4347 (Input_file_argument::set_arg_serial): New function.
4348 (Input_file_argument::arg_serial): New function.
4349 (Input_file_argument::arg_serial_): New data member.
4350 (Input_arguments::Input_arguments): Initialize file_count_.
4351 (Input_arguments::add_file): Remove const.
4352 (Input_arguments::number_of_input_files): New function.
4353 (Input_arguments::file_count_): New data member.
4354 (Command_line::number_of_input_files): Call
4355 Input_arguments::number_of_input_files.
4356 * output.cc (Output_segment_headers::Output_segment_headers):
4357 Set current size.
4358 (Output_section::Input_section::current_data_size): New function.
4359 (Output_section::Output_section): Initialize new data members.
4360 (Output_section::add_input_section): Don't do merge sections for
4361 an incremental link; allocate space from free list for an
4362 incremental update.
4363 (Output_section::add_output_section_data): Allocate space from
4364 free list for an incremental update.
4365 (Output_section::update_data_size): New function.
4366 (Output_section::set_fixed_layout): New function.
4367 (Output_section::reserve): New function.
4368 (Output_segment::set_section_addresses): Remove const.
4369 (Output_segment::set_section_list_addresses): Remove const; allocate
4370 space from free list for an incremental update.
4371 (Output_segment::set_offset): Adjust size of RELRO segment for an
4372 incremental update.
4373 * output.h (Output_data::current_data_size): Move here from
4374 child classes.
4375 (Output_data::pre_finalize_data_size): New function.
4376 (Output_data::update_data_size): New function.
4377 (Output_section_headers::update_data_size): new function.
4378 (Output_section_data_build::current_data_size): Move to Output_data.
4379 (Output_data_strtab::update_data_size): New function.
4380 (Output_section::current_data_size): Move to Output_data.
4381 (Output_section::set_fixed_layout): New function.
4382 (Output_section::has_fixed_layout): New function.
4383 (Output_section::reserve): New function.
4384 (Output_section::update_data_size): New function.
4385 (Output_section::has_fixed_layout_): New data member.
4386 (Output_section::free_list_): New data member.
4387 (Output_segment::set_section_addresses): Remove const.
4388 (Output_segment::set_section_list_addresses): Remove const.
4389 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4390 New function.
4391 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4392 New function.
4393 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4394 parameter when calling Add_symbols constructor; store argument
4395 serial number for members of a lib group.
4396 (Add_symbols::locks): Allow case where token == NULL.
4397 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4398 (Read_member::~Read_member): New function.
4399 (Read_member::is_runnable): New function.
4400 (Read_member::locks): New function.
4401 (Read_member::run): New function.
4402 (Check_script::~Check_script): New function.
4403 (Check_script::is_runnable): New function.
4404 (Check_script::locks): New function.
4405 (Check_script::run): New function.
4406 (Check_library::~Check_library): New function.
4407 (Check_library::is_runnable): New function.
4408 (Check_library::locks): New function.
4409 (Check_library::run): New function.
4410 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4411 (Add_symbols::library_): New data member.
4412 (class Read_member): New class.
4413 (class Check_script): New class.
4414 (class Check_library): New class.
4415 * reloc.cc (Read_relocs::is_runnable): Allow case where
4416 token == NULL.
4417 (Read_relocs::locks): Likewise.
4418 (Scan_relocs::locks): Likewise.
4419 (Relocate_task::locks): Likewise.
4420 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4421 to clear counters.
4422 (Sized_relobj::incremental_relocs_scan): Fix comment.
4423 (Sized_relobj::do_relocate): Pass output file offset to
4424 write_local_symbols.
4425 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4426 from class declaration.
4427 * script.cc (read_input_script): Allocate Script_info; pass
4428 argument serial number to report_script.
4429 * script.h (class Script_info): Move to incremental.h.
4430 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4431 * symtab.h (Symbol_table::add_from_incrobj): New function.
4432 (Symbol_table::set_file_offset): New function.
4433
b961d0d7
CC
44342011-04-05 Cary Coutant <ccoutant@google.com>
4435
4436 * incremental-dump.cc (dump_incremental_inputs): Change signature
4437 to take a Sized_incremental_binary; change caller. Use readers
4438 in Sized_incremental_binary.
4439 * incremental.cc
4440 (Sized_incremental_binary::find_incremental_inputs_sections):
4441 Rename do_find_incremental_inputs_sections to this.
4442 (Sized_incremental_binary::setup_readers): New function.
4443 (Sized_incremental_binary::do_check_inputs): Check
4444 has_incremental_info_ flag; move setup code to setup_readers;
4445 use input readers.
4446 (Sized_incremental_binary::do_file_is_unchanged): New function.
4447 (Sized_incremental_binary::do_get_input_reader): New function.
4448 * incremental.h (class Incremental_binary): Move to end of file.
4449 (Incremental_binary::file_is_unchanged): New function.
4450 (Incremental_binary::do_file_is_unchanged): New function.
4451 (Incremental_binary::Input_reader): New class.
4452 (Incremental_binary::get_input_reader): New function.
4453 (class Sized_incremental_binary): Move to end of file.
4454 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4455 input section reader classes.
4456 (Sized_incremental_binary::has_incremental_info): New function.
4457 (Sized_incremental_binary::inputs_reader): New function.
4458 (Sized_incremental_binary::symtab_reader): New function.
4459 (Sized_incremental_binary::relocs_reader): New function.
4460 (Sized_incremental_binary::got_plt_reader): New function.
4461 (Sized_incremental_binary::do_file_is_unchanged): New function.
4462 (Sized_incremental_binary::Sized_input_reader): New class.
4463 (Sized_incremental_binary::get_input_reader): New function.
4464 (Sized_incremental_binary::find_incremental_inputs_sections):
4465 Rename do_find_incremental_inputs_sections to this.
4466 (Sized_incremental_binary::setup_readers): New function.
4467 (Sized_incremental_binary::has_incremental_info_): New data member.
4468 (Sized_incremental_binary::inputs_reader_): New data member.
4469 (Sized_incremental_binary::symtab_reader_): New data member.
4470 (Sized_incremental_binary::relocs_reader_): New data member.
4471 (Sized_incremental_binary::got_plt_reader_): New data member.
4472 (Sized_incremental_binary::current_input_file_): New data member.
4473
a869183f
PP
44742011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4475
4476 PR gold/12640
4477 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4478 violation.
4479
44802011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4481
4482 * archive.cc (Archive::include_member): Adjust call to report_object.
4483 (Add_archive_symbols::run): Add script_info to call to
4484 report_archive_begin.
4485 (Lib_group::include_member): Adjust call to report_object.
4486 (Add_lib_group_symbols::run): Adjust call to report_object.
4487 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4488 blocks. Add object count for script input files.
4489 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4490 script_info parameter; change all callers.
4491 (Incremental_inputs::report_object): Add script_info parameter;
4492 change all callers.
4493 (Incremental_inputs::report_script): Store backpointer to
4494 incremental info entry.
4495 (Output_section_incremental_inputs::set_final_data_size): Record
4496 additional information for scripts.
4497 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4498 * incremental.h (Incremental_script_entry::add_object): New function.
4499 (Incremental_script_entry::get_object_count): New function.
4500 (Incremental_script_entry::get_object): New function.
4501 (Incremental_script_entry::objects_): New data member; adjust
4502 constructor.
4503 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4504 (Incremental_inputs::report_object): Add script_info parameter.
4505 (Incremental_inputs_reader::get_object_count): New function.
4506 (Incremental_inputs_reader::get_object_offset): New function.
4507 * options.cc (Input_arguments::add_file): Return reference to
4508 new input argument.
4509 * options.h (Input_argument::set_script_info): New function.
4510 (Input_argument::script_info): New function.
4511 (Input_argument::script_info_): New data member; adjust all
4512 constructors.
4513 (Input_file_group::add_file): Return reference to new input argument.
4514 (Input_file_lib::add_file): Likewise.
4515 (Input_arguments::add_file): Likewise.
4516 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4517 * script.cc (Parser_closure::Parser_closure): Add script_info
4518 parameter; adjust all callers.
4519 (Parser_closure::script_info): New function.
4520 (Parser_closure::script_info_): New data member.
4521 (read_input_script): Report scripts earlier to incremental info.
4522 (script_add_file): Set script_info in Input_argument.
4523 (script_add_library): Likewise.
4524 * script.h (Script_options::Script_info): Rewrite class.
4525
a869183f 45262011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4527
4528 * archive.cc (Library_base::should_include_member): Move
4529 method here from class Archive.
4530 (Archive::Archive): Initialize base class.
4531 (Archive::should_include_member): Move to base class.
4532 (Archive::do_for_all_unused_symbols): New function.
4533 (Add_archive_symbols::run): Remove redundant access to
4534 incremental_inputs.
4535 (Lib_group::Lib_group): Initialize base class.
4536 (Lib_group::do_filename): New function.
4537 (Lib_group::include_member): Pass pointer to Lib_group to
4538 report_object.
4539 (Lib_group::do_for_all_unused_symbols): New function.
4540 (Add_lib_group_symbols::run): Report archive information for
4541 incremental links.
4542 * archive.h (class Library_base): New base class.
4543 (class Archive): Derive from Library_base.
4544 (Archive::filename): Move to base class.
4545 (Archive::set_incremental_info): Likewise.
4546 (Archive::incremental_info): Likewise.
4547 (Archive::Should_include): Likewise.
4548 (Archive::should_include_member): Likewise.
4549 (Archive::Armap_entry): Remove.
4550 (Archive::Unused_symbol_iterator): Remove.
4551 (Archive::unused_symbols_begin): Remove.
4552 (Archive::unused_symbols_end): Remove.
4553 (Archive::do_filename): New function.
4554 (Archive::do_get_mtime): New function.
4555 (Archive::do_for_all_unused_symbols): New function.
4556 (Archive::task_): Move to base class.
4557 (Archive::incremental_info_): Likewise.
4558 (class Lib_group): Derive from Library_base.
4559 (Lib_group::do_filename): New function.
4560 (Lib_group::do_get_mtime): New function.
4561 (Lib_group::do_for_all_unused_symbols): New function.
4562 (Lib_group::task_): Move to base class.
4563 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4564 function.
4565 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4566 function.
4567 * incremental.cc (Incremental_inputs::report_archive_begin):
4568 Use Library_base; call library's get_mtime; add incremental inputs
4569 entry before members.
4570 (class Unused_symbol_visitor): New class.
4571 (Incremental_inputs::report_archive_end): Use Library_base; use
4572 visitor class to record unused symbols; don't add incremental inputs
4573 entry after members.
4574 (Incremental_inputs::report_object): Use Library_base.
4575 * incremental.h
4576 (Incremental_archive_entry::Incremental_archive_entry): Remove
4577 unused Archive parameter.
4578 (Incremental_inputs::report_archive_begin): Use Library_base.
4579 (Incremental_inputs::report_archive_end): Likewise.
4580 (Incremental_inputs::report_object): Likewise.
4581 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4582 function.
4583 * object.h (Object::for_all_global_symbols): New function.
4584 (Object::do_for_all_global_symbols): New function.
4585 (Sized_relobj::do_for_all_global_symbols): New function.
4586 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4587 function.
4588 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4589 function.
4590
61ab3e40
ILT
45912011-03-27 Ian Lance Taylor <iant@google.com>
4592
4593 * archive.cc (Archive::interpret_header): Return -1 if something
4594 goes wrong. Change callers accordingly.
4595
30e1f9e6
CC
45962011-03-25 Cary Coutant <ccoutant@google.com>
4597
4598 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4599 * testsuite/Makefile.in: Regenerate.
4600
9370ce59 46012011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4602
4603 * plugin.cc (get_view): New.
4604 (Plugin::load): Pass get_view to the plugin.
4605 (Plugin_manager::get_view): New.
4606
9312bb0a
ILT
46072011-03-21 Ian Lance Taylor <iant@google.com>
4608
4609 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4610 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4611
7e12ba9e
ST
46122011-03-21 Sriraman Tallam <tmsriram@google.com>
4613
4614 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4615 Change == to -eq.
4616 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4617 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4618 Change == to -eq.
4619 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4620 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4621
fd7a005d
ILT
46222011-03-14 Ian Lance Taylor <iant@google.com>
4623
4624 * script-sections.cc (Sort_output_sections::script_compare):
4625 Rename from is_before, change return type.
4626 (Sort_output_sections::operator()): Adjust accordingly.
4627
ed16fd1b
ILT
46282011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4629
4630 PR gold/12572
4631 * testsuite/odr_violation2.cc: Add comment to make all error line
4632 numbers double digits.
4633 * testsuite/debug_msg.sh: Adjust expected errors.
4634
71ff8986
ILT
46352011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4636
4637 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4638 but mark earlier ones as non-canonical
4639 (offset_to_iterator): Update search target and example
4640 (do_addr2line): Return extra lines in a vector*
4641 (format_file_lineno): Extract from do_addr2line
4642 (one_addr2line): Add vector* out-param
4643 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4644 when a lineno entry appeared last for its instruction
4645 (Dwarf_line_info): Add vector* out-param
4646 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4647 * symtab.cc (Odr_violation_compare): Include the lineno in the
4648 comparison again.
4649 (linenos_from_loc): New. Combine the canonical line for an
4650 address with its other lines.
4651 (True_if_intersect): New. Helper functor to make
4652 std::set_intersection a query.
4653 (detect_odr_violations): Compare sets of lines instead of just
4654 one line for each function. This became less deterministic, but
4655 has fewer false positives.
4656 * symtab.h: Declarations.
4657 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4658 mix an optimized and non-optimized object in the same binary
4659 (odr_violation2.so): Same.
4660 * testsuite/Makefile.in: Regenerate from Makefile.am.
4661 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4662 * testsuite/debug_msg.sh: Update line numbers and add
4663 assertions.
4664 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4665 non-optimized context.
4666 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4667 isn't inlined, and use OdrDerived in an optimized context.
4668 * testsuite/odr_header1.h: Defines OdrDerived, where
4669 optimization will change the
4670 first-instruction-in-the-destructor's file and line number.
4671 * testsuite/odr_header2.h: Defines OdrBase.
4672
a19fefdc
ILT
46732011-03-09 Ian Lance Taylor <iant@google.com>
4674
4675 * fileread.cc (File_read::clear_views): Don't delete the whole
4676 file view.
4677
ecb351e9
ILT
46782011-03-08 Ian Lance Taylor <iant@google.com>
4679
4680 PR gold/12525
4681 * fileread.cc: #include <climits>.
4682 (GOLD_IOV_MAX): Define.
4683 (File_read::read_multiple): Limit number of entries by iov_max.
4684 * fileread.h (class File_read): Always set max_readv_entries to
4685 128.
4686
b821d13c
ILT
46872011-03-07 Ian Lance Taylor <iant@google.com>
4688
4689 PR gold/12525
4690 * options.h (class General_options): Add -dy and -dn.
4691
89243142
CC
46922011-03-02 Cary Coutant <ccoutant@google.com>
4693
4694 * testsuite/script_test_9.t: Add TLS segment.
4695
d0773f31
ILT
46962011-03-02 Simon Baldwin <simonb@google.com>
4697
4698 * configure.ac: Add check for gnu_indirect_function support in
4699 the toolchain building binutils.
4700 * configure: Rebuild.
4701
9370ce59 47022011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4703
4704 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4705 plugin only symbols.
4706 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4707 in plugin files as not needed in the symbol table.
4708
4cf7a849
ST
47092011-02-11 Sriraman Tallam <tmsriram@google.com>
4710
4711 * output.cc (Output_section::add_input_section): Delay fill
4712 generation for section ordering.
4713
b578bd7d
ILT
47142011-02-09 Ian Lance Taylor <iant@google.com>
4715
4716 PR gold/12316
4717 * object.h (class Sized_relobj): Remove clear_local_symbols.
4718 * reloc.cc (Sized_relobj::do_relocate): Don't call
4719 clear_local_symbols.
4720
9370ce59 47212011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4722
4723 * plugin.cc (is_visible_from_outside): Return true for symbols
4724 in the -u option.
4725
55382fb7
ILT
47262011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4727
4728 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4729 filename.
4730
4e271fff
ST
47312011-02-02 Sriraman Tallam <tmsriram@google.com>
4732
4733 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4734 to std::string.
4e271fff 4735 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4736 section_name to be std::string.
4e271fff
ST
4737 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4738
d433c3ac
ILT
47392011-01-25 Ian Lance Taylor <iant@google.com>
4740
4741 * script.cc (script_add_extern): Rewrite to use
4742 add_symbol_reference.
4743
880473a6
DK
47442011-01-25 Doug Kwan <dougkwan@google.com>
4745
d433c3ac 4746 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4747
f30f86fa
ILT
47482011-01-24 Ian Lance Taylor <iant@google.com>
4749
4750 * options.h (class General_options): Accept
4751 --no-detect-odr-violations.
4752
8e51a0b9
ILT
47532011-01-24 Ian Lance Taylor <iant@google.com>
4754
4755 * version.cc (version_string): Bump to 1.11.
4756
0f3b89d8
ILT
47572011-01-24 Ian Lance Taylor <iant@google.com>
4758
4759 * plugin.cc (class Plugin_rescan): Define new class.
4760 (Plugin_manager::claim_file): Set any_claimed_.
4761 (Plugin_manager::save_archive): New function.
4762 (Plugin_manager::save_input_group): New function.
4763 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4764 necessary.
4765 (Plugin_manager::new_undefined_symbol): New function.
4766 (Plugin_manager::rescan): New function.
4767 (Plugin_manager::rescannable_defines): New function.
4768 (Plugin_manager::add_input_file): Set any_added_.
4769 * plugin.h (class Plugin_manager): define new fields rescannable_,
4770 undefined_symbols_, any_claimed_, and any_added_. Declare
4771 Plugin_rescan as friend. Declare new functions.
4772 (Plugin_manager::Rescannable): Define type.
4773 (Plugin_manager::Rescannable_list): Define type.
4774 (Plugin_manager::Undefined_symbol_list): Define type.
4775 (Plugin_manager::Plugin_manager): Initialize new fields.
4776 * archive.cc (Archive::defines_symbol): New function.
4777 (Add_archive_symbols::run): Pass archive to plugins if any.
4778 * archive.h (class Archive): Declare defines_symbol.
4779 * readsyms.cc (Input_group::~Input_group): New function.
4780 (Finish_group::run): Pass input_group to plugins if any.
4781 * readsyms.h (class Input_group): Declare destructor.
4782 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4783 any.
4784
3bb951e5
ILT
47852011-01-10 Ian Lance Taylor <iant@google.com>
4786
4787 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4788 section as relro.
4789 (Layout::set_segment_offsets): Reset increase_relro before calling
4790 set_section_addresses a second time.
4791
0aa45fac
CC
47922011-01-04 Cary Coutant <ccoutant@google.com>
4793
4794 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4795 sections before NOBITS sections.
4796
0db46eb4
L
47972011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4798
4799 * version.cc (print_version): Update copyright to 2011.
4800
829c9745
CC
48012010-12-23 Cary Coutant <ccoutant@google.com>
4802
4803 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4804 of OS to this->add. Add OD parameter to second form of the function.
4805
7500420b
ILT
48062010-12-20 Ian Lance Taylor <iant@google.com>
4807
4808 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4809 second of two consecutive entries with same offset.
4810
f8e9a930
RW
48112010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4812
4813 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4814 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4815 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4816 to avoid unneeded links against $(LDADD).
4817 * testsuite/Makefile.in: Regenerate.
4818
2fbb4320
ILT
48192010-12-15 Ian Lance Taylor <iant@google.com>
4820
4821 PR gold/12324
4822 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4823 for R_X86_64_32 and R_X86_64_PC32.
4824 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4825 ver_matching_def_pic.o.
4826 (ver_matching_def_pic.o): New target.
4827
fedb228d
RW
48282010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4829
4830 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4831 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4832 Move definition before File_read::View member definitions.
4833 (File_read::View::~View): Initialize and hold lock before
4834 updating current_mapped_bytes.
4835
9b547ce6
RW
48362010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4837
4838 * dwarf_reader.cc: Remove outdated comment.
4839 * gold-threads.cc: Fix typo in error message.
4840 * archive.cc: Fix typos in comments.
4841 * archive.h: Likewise.
4842 * arm-reloc-property.cc: Likewise.
4843 * arm-reloc-property.h: Likewise.
4844 * arm-reloc.def: Likewise.
4845 * arm.cc: Likewise.
4846 * attributes.h: Likewise.
4847 * cref.cc: Likewise.
4848 * ehframe.cc: Likewise.
4849 * fileread.h: Likewise.
4850 * gold.h: Likewise.
4851 * i386.cc: Likewise.
4852 * icf.cc: Likewise.
4853 * incremental.h: Likewise.
4854 * int_encoding.cc: Likewise.
4855 * layout.h: Likewise.
4856 * main.cc: Likewise.
4857 * merge.h: Likewise.
4858 * object.cc: Likewise.
4859 * object.h: Likewise.
4860 * options.cc: Likewise.
4861 * readsyms.cc: Likewise.
4862 * reduced_debug_output.cc: Likewise.
4863 * reloc.cc: Likewise.
4864 * script-sections.cc: Likewise.
4865 * sparc.cc: Likewise.
4866 * symtab.h: Likewise.
4867 * target-reloc.h: Likewise.
4868 * target.cc: Likewise.
4869 * target.h: Likewise.
4870 * timer.cc: Likewise.
4871 * timer.h: Likewise.
4872 * x86_64.cc: Likewise.
4873
83e17bd5
CC
48742010-12-09 Cary Coutant <ccoutant@google.com>
4875
4876 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4877 stack.
4878 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4879 parameter; change all callers.
4880 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4881 * options.h (warn_execstack): New option.
4882
017257f8
DK
48832010-12-07 Doug Kwan <dougkwan@google.com>
4884
4885 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4886 like function call relocations.
4887
c20cbc06
ILT
48882010-12-07 Ian Lance Taylor <iant@google.com>
4889
4890 * archive.cc (Archive::get_elf_object_for_member): Permit
4891 punconfigured to be NULL.
4892 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4893 (Archive::include_member): Pass NULL to get_elf_object_for_member
4894 if we searched for the archive and this is the first included
4895 object.
4896
4dbfafcc
ILT
48972010-12-01 Ian Lance Taylor <iant@google.com>
4898
4899 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4900 track_relocs_type_ field.
4901 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4902 Set track_relocs_type_.
4903 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4904 contents when using RELA relocs.
4905 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4906 reloc_map_.
4907 * reloc.cc (Track_relocs::next_addend): New function.
4908 * reloc.h (class Track_relocs): Declare next_addend.
4909
e5e19edd
ILT
49102010-12-01 Ian Lance Taylor <iant@google.com>
4911
4912 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4913 virtual destructor.
4914
9a5ce24c
ILT
49152010-12-01 Ian Lance Taylor <iant@google.com>
4916
4917 * README: Update compilers known to work and fail.
4918
c7791212
NC
49192010-11-23 Matthias Klose <doko@ubuntu.com>
4920
4921 * configure.in: For --enable-gold, handle value `default' instead of
4922 `both*'. Always install ld as ld.bfd, install as ld if gold is
4923 not the default.
4924 * configure: Regenerate.
4925
0ad220c9
DK
49262010-11-18 Doug Kwan <dougkwan@google.com>
4927
4928 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4929 and right_alignment to be zero. Store result alignment only if it is
4930 greater than existing alignment.
4931
ab8056e0
CC
49322010-11-16 Cary Coutant <ccoutant@google.com>
4933
4934 PR gold/12220
4935 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4936 Check for ".zdebug_line".
4937
fd064a5b
CC
49382010-11-16 Doug Kwan <dougkwan@google.com>
4939 Cary Coutant <ccoutant@google.com>
4940
4941 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4942 by reference; adjust all callers.
4943 * output.cc (Output_segment::set_section_addresses): Adjust references
4944 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4945 list is empty.
4946 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4947 end at page boundary.
4948
6fc6ea19
CC
49492010-11-16 Cary Coutant <ccoutant@google.com>
4950
4951 PR gold/12220
4952 * layout.cc (Layout::choose_output_section): Transform names of
4953 compressed sections even when using a script with a SECTIONS clause.
4954 (Layout::output_section_name): Remove code to transform
4955 compressed debug section names.
4956 * output.cc (Output_section::add_input_section): Use uncompressed
4957 section size when tracking input sections.
4958
95a2c8d6
RS
49592010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4960
4961 * symtab.h (Symbol::NON_PIC_REF): Remove.
4962 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4963 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4964 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4965 (Symbol::use_plt_offset): Take a flags argument and pass it
4966 directly to needs_dynamic_reloc. Restrict check for undefined
4967 weak symbols to function calls.
4968 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4969 (Target_arm::Scan::global): Use it.
4970 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4971 (Target_arm::Relocate::relocate): Likewise.
4972 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4973 parameter with an r_type parameter. Use get_reference_flags
4974 to get the flags.
4975 (Target_arm::Relocate::relocate): Update accordingly.
4976 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4977 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4978 (Target_i386::Scan::global): Likewise.
4979 (Target_i386::Relocate::relocate): Likewise.
4980 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4981 parameter with an r_type parameter. Use get_reference_flags
4982 to get the flags.
4983 (Target_i386::Relocate::relocate): Update accordingly.
4984 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4985 (Target_powerpc::Scan::global): Use it.
4986 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4987 (Target_powerpc::Relocate::relocate): Likewise.
4988 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4989 (Target_sparc::Scan::global): Use it.
4990 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4991 (Target_sparc::Relocate::relocate): Likewise.
4992 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4993 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4994 (Target_x86_64::Scan::global): Likewise.
4995 (Target_x86_64::Relocate::relocate): Likewise.
4996
f625ae50
DK
49972010-11-08 Doug Kwan <dougkwan@google.com>
4998 Cary Coutant <ccoutant@google.com>
4999
5000 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5001 (Arm_exidx_merge_section::section_contents_): New data member.
5002 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5003 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5004 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5005 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5006 in parameters instead of calling Object::section_contents without
5007 locking.
5008 (Arm_output_section::group_section): New parameter TASK. Pass it
5009 to callees that need locking objects.
5010 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5011 to lock EXIDX input sections. Fix a formatting issue. Call
5012 Arm_exidx_merged_section::build_contents to create merged section
5013 contents.
5014 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5015 to lock object of stub table owner.
5016 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5017 TEXT_SIZE to initialize data member TEXT_SIZE_.
5018 (Arm_exidx_input_section::addralign): Fix typo in comment.
5019 (Arm_exidx_input_section::text_size): New method.
5020 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5021 that require locking objects. Lock objects before scanning for stubs
5022 and updating local symbols.
5023 (Arm_input_section<big_endian>::init): Copy contents of original
5024 input section.
2e702c99 5025 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5026 original input section instead of calling Object::section_contents
5027 without locking.
5028 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5029 size without calling Object::section_size().
5030 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5031 for size. Allocate a buffer for merged EXIDX entries.
5032 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5033 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5034 building code to Arm_exidx_merged_section::build_contetns. Write
5035 out contetns in buffer instead of building it on the fly.
5036 (Arm_relobj::make_exidx_input_section): Also pass text section size
5037 to Arm_exidx_input_section constructor.
5038 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5039 (Arm_dynobj::do_read_symbols): Fix memory leak.
5040 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5041 * target.h: (class Task): Add forward declaration.
5042 (Target::relax): Add new parameter TASK and pass it to
5043 Target::do_relax().
5044 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5045
5f9bcf58
CC
50462010-11-05 Cary Coutant <ccoutant@google.com>
5047
5048 PR gold/10708
5049 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5050 object when reading from the file.
5051 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5052 second layout pass.
5053 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5054 when reading section contents.
5055 (get_section_contents): Likewise.
5056 (icf::find_identical_sections): Likewise.
5057 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5058 object when reading from the file.
5059 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5060 the object when doing deferred section layout.
5061
e597fa08
NC
50622010-11-03 Nick Clifton <nickc@redhat.com>
5063
5064 PR gold/12001
5065 * script.h (class Symbol_assignment: name): New member. Returns
5066 the name of the symbol.
5067 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5068 Returns true if the given symbol name is on the list of
5069 assignments wating to be processed.
5070 * archive.cc (should_incldue_member): If the symbol is undefined,
5071 check to see if it is on the list of symbols pending assignment.
5072
3f9a3278
ILT
50732010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5074
5075 * script-sections.cc (Script_sections::find_memory_region): Check
5076 for a NULL output section pointer.
5077
d06fb4d1
DK
50782010-10-29 Doug Kwan <dougkwan@google.com>
5079
5080 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5081 Output_section::add_relaxed_input_section.
5082 * output.cc (Output_section::add_relaxed_input_section): Add new
5083 arguments LAYOUT and NAME. Set section order index.
5084 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5085 Copy section order index.
5086 * output.h (Output_section::add_relaxed_input_section): Add new
5087 arguments LAYOUT and NAME.
5088
90e24de5
ILT
50892010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5090
5091 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5092 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5093 * testsuite/Makefile.in: Regenerate.
5094
c9484ea5
DK
50952010-10-20 Doug Kwan <dougkwan@google.com>
5096
5097 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5098 without SHF_LINK_ORDER flags.
5099 * layout.cc (Layout::choose_output_section): Do not filter
5100 SHF_LINK_ORDER flag in a relocatable link.
5101
5bc2f5be
CC
51022010-10-17 Cary Coutant <ccoutant@google.com>
5103
5104 * output.h (Output_segment::set_section_addresses): Change function
5105 signature. Update all callers.
5106 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5107 sections.
5108 (Output_segment::set_section_addresses): Align after last TLS
5109 section. Add padding before last relro section instead of after.
5110
0c91cf04
DK
51112010-10-17 Doug Kwan <dougkwan@google.com>
5112
5113 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5114 GOT output section to be writable.
5115
8c21d9d3
CC
51162010-10-14 Cary Coutant <ccoutant@google.com>
5117
5118 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5119 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5120 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5121 mode.
5122 * incremental.cc (report_command_line): Ignore all forms of
5123 --incremental.
5124 * layout.cc (Layout::Layout): Check parameters for incremental link
5125 mode.
5126 * options.cc (General_options::parse_incremental): New function.
5127 (General_options::parse_no_incremental): New function.
5128 (General_options::parse_incremental_full): New function.
5129 (General_options::parse_incremental_update): New function.
5130 (General_options::incremental_mode_): New data member.
5131 (General_options::finalize): Check incremental_mode_.
5132 * options.h (General_options): Update help text for --incremental.
5133 Add --no-incremental, --incremental-full, --incremental-update.
5134 (General_options::Incremental_mode): New enum type.
5135 (General_options::incremental_mode): New function.
5136 (General_options::incremental_mode_): New data member.
5137 * parameters.cc (Parameters::incremental_mode_): New data member.
5138 (Parameters::set_options): Set incremental_mode_.
5139 (Parameters::set_incremental_full): New function.
5140 (Parameters::incremental): New function.
5141 (Parameters::incremental_update): New function.
5142 (set_parameters_incremental_full): New function.
5143 * parameters.h (Parameters::set_incremental_full): New function.
5144 (Parameters::incremental): New function.
5145 (Parameters::incremental_update): New function.
5146 (Parameters::incremental_mode_): New data member.
5147 (set_parameters_incremental_full): New function.
5148 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5149 incremental link mode.
5150 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5151 (Sized_relobj::do_relocate_sections): Likewise.
5152 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5153 option.
5154 * testsuite/Makefile.in: Regenerate.
5155 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5156
bb32aa18 51572010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5158
5159 * script-sections.h (class Script_sections): Make
5160 Sections_elements typedef public.
5161 * script-sections.cc (class Sort_output_sections): Add elements_
5162 field. Add constructor which sets it; change all callers.
5163 (Sort_output_sections::is_before): New function.
5164 (Sort_output_sections::operator()): Call is_before.
5165 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5166 conditional.
5167 * testsuite/script_test_10.sh: New test. Test script section
5168 order.
5169 * testsuite/script_test_10.t: Likewise.
5170 * testsuite/script_test_10.s: Likewise.
5171 * testsuite/Makefile.am: Wrap the cross linker tests and the
5172 common tests into NATIVE_OR_CROSS_LINKER.
5173 (check_SCRIPTS): Add script_test_10.sh.
5174 (check_DATA): Add script_test_10.stdout.
5175 (script_test_10.o, script_test_10): New targets.
5176 (script_test_10.stdout): New target.
5177 * configure, testsuite/Makefile.in: Regenerate.
5178
3cef7179
ILT
51792010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5180
5181 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5182 error for the deprecated relocations.
5183 (Target_arm::Scan::global): Likewise.
5184 (Target_arm::Relocate::relocate): Likewise.
5185
7411e9a8
RS
51862010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5187
5188 * fileread.cc (Input_file::find_file): Initialize *found_name
5189 and *namep when using the fallback search for case 4.
5190
6a9da32a
CC
51912010-10-11 Cary Coutant <ccoutant@google.com>
5192
5193 * options.h (class General_options): Redefine -z lazy as an alias for
5194 the negation of -z now.
5195
ac897c20
ILT
51962010-10-11 Ian Lance Taylor <iant@google.com>
5197
5198 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5199 binding.
5200
ea5cae92
NC
52012010-10-06 Nick Clifton <nickc@redhat.com>
5202
5203 * script-sections.cc(class Memory_region): Remove
5204 current_lma_offset_ field. Rename current_vma_offset_ to
5205 current_offset_. Add last_section_ field.
5206 (Memory_region::get_current_vma_address): Rename to
5207 get_current_address.
5208 (Memory_region::get_current_lma_address): Delete.
5209 (Memory_region::increment_vma_offset): Rename to
5210 increment_offset.
5211 (Memory_region::increment_lma_offset): Delete.
5212 (Memory_region::attributes_compatible): New method. Returns
5213 true if the provided section is compatible with the region.
5214 (Memory_region::get_last_section): New method. Returns the last
5215 section to use the region.
5216 (Memory_region::set_last_section): New method. Stores the last
5217 section to use the region.
5218 (Script_sections::block_in_region): New method. Returns true if
5219 a block of memory is contained within a region.
5220 (Script_sections::find_memory_region): New method. Locates a
5221 memory region to be used to set a VMA or LMA address.
5222 (Output_section_definition::set_section_addresses): Add code to
5223 check for addresses set by memory regions.
5224 (Output_segment::set_section_addresses): Remove memory region
5225 walking code.
5226 (Script_sections::create_segment): Add a warning if a header
5227 segment is created outside of any region.
5228 * script-sections.h (class Script_sections): Add prototypes for
5229 find_memory_region and block_in_region methods.
5230 * testsuite/memory_test.s: Use .long instead of .word.
5231 * testsuite/memory_test.t: Add some more output sections.
5232 * testsuite/memory_test.sh: Update expected output.
5233
a9bfd952
DK
52342010-10-02 Doug Kwan <dougkwan@google.com>
5235
5236 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5237 defintion to symtab.h
5238 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5239 declaration to defintion.
5240
bacff3ab
NC
52412010-10-01 Nick Clifton <nickc@redhat.com>
5242
5243 * expression.cc (eval): Replace dummy argument with NULL.
5244 (eval_maybe_dot): Check for a NULL result section pointer.
5245 (Symbol_expression::value): Likewise.
5246 (Dot_expression::value): Likewise.
5247 (BINARY_EXPRESSION): Likewise.
5248 (Max_expression::value): Likewise.
5249 (Min_expression::value): Likewise.
5250 (Absolute_expression::value): Likewise.
5251 (Addr_expression::value_from_output_section): Likewise.
5252 (Loaddddr_expression::value_from_output_section): Likewise.
5253 (Segment_start_expression::value): Likewise.
5254 * script-sections.cc
5255 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5256 argument with NULL.
5257 (Sections_elememt_dot_assignment::set_section_addresses):
5258 Likewise.
5259 (Output_data_expression::do_write_to_buffer): Likewise.
5260 (Output_section_definition::finalize_symbols): Likewise.
5261 (Output_section_definition::set_section_addresses): Likewise.
5262
f81bc8b5
DK
52632010-09-30 Doug Kwan <dougkwan@google.com>
5264
5265 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5266
c95e9f27
ST
52672010-09-28 Sriraman Tallam <tmsriram@google.com>
5268
5269 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5270 function.
c95e9f27
ST
5271 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5272 virtual function.
5273 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5274 virtual function.
5275 * icf.cc (get_section_contents): Inline merge sections only when
5276 target allows it.
5277
3cac54d2
RW
52782010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5279
5280 * configure: Regenerate.
5281
2904037a
ILT
52822010-09-17 Ian Lance Taylor <iant@google.com>
5283
5284 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5285 * testsuite/Makefile.am (memory_test.o): New target.
5286 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5287 memory_test.t.
5288 * testsuite/Makefile.in: Rebuild.
2904037a 5289
bca7fb63
DK
52902010-09-17 Doug Kwan <dougkwan@google.com>
5291
5292 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5293 defintion if relocation uses GOT entries of the symbol.
5294 * testsuite/icf_safe_test.sh: Fix test.
5295 * testsuite/icf_safe_so_test.sh: Fix test.
5296
4ef28648
CC
52972010-09-16 Cary Coutant <ccoutant@google.com>
5298
5299 * script_sections.cc (class Memory_region): Remove "NULL" from
5300 vector initializations.
5301
793990de
CC
53022010-09-15 Cary Coutant <ccoutant@google.com>
5303
5304 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5305 Resolve forwarding symbols.
5306
81e015e2
DK
53072010-09-15 Doug Kwan <dougkwan@google.com>
5308
5309 * gold/testsuite/script_test_3.t: Add ARM special sections.
5310 * gold/testsuite/script_test_4.t: Same.
5311 * gold/testsuite/script_test_5.t: Same.
5312 * gold/testsuite/script_test_6.t: Same.
5313 * gold/testsuite/script_test_7.t: Same.
5314 * gold/testsuite/script_test_7.t: Same.
5315 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5316
36171d64
CC
53172010-09-14 Cary Coutant <ccoutant@google.com>
5318
5319 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5320 (Target_x86_64::Relocate::relocate_tls): Replace check for
5321 saw_tls_block_reloc_ with test for executable section.
5322
d89051bd
CC
53232010-09-12 Cary Coutant <ccoutant@google.com>
5324
5325 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5326 position-independent executables to shared libraries need dynamic
5327 relocations.
5328 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5329 position-independent executables.
5330 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5331 * testsuite/Makefile.in: Regenerate.
5332
fca41f0f
NC
53332010-09-10 Nick Clifton <nickc@redhat.com>
5334
5335 PR gold/11997
5336 * testsuite/memory_test.t: Discard any sections that are not
5337 needed.
5338
6695e4b3
L
53392010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5340
5341 PR gold/11996
5342 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5343 "This::" to work around a bug in gcc 4.2.
5344
5345 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5346
0f72bf6f
RÁE
53472010-09-09 Rafael Espindola <espindola@google.com>
5348
5349 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5350 sections with different PF_X flags in the same segment.
5351 (Layout::find_first_load_seg): Search all segments to find the first
5352 one.
5353 * options.h (rosegment): New.
5354
53552010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5356
05a79166 5357 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5358
aa98ff75
DK
53592010-09-08 Doug Kwan <dougkwan@google.com>
5360
5361 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5362 (Arm_relobj::do_relocate_sections): Add new parameter for output
5363 file to match the parent.
5364 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5365 of local symbols instead of input values. Update code to track
5366 changes in gold::relocate_section.
5367 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5368 (Sized_relobj::compute_final_local_value_internal): New methods.
5369 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5370 body into private version of Sized_relobj::compute_final_local_value.
5371 Call the inline method.
5372 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5373 merged symbol value if there is one.
5374 (Symbol_value::has_output_value): New method defintiion.
5375 (Sized_relobj::Compute_final_local_value_status): New enum type.
5376 (Sized_relobj::compute_final_local_value): New methods.
5377 (Sized_relobj::compute_final_local_value_internal): New methods.
5378 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5379 and arm_cortex_a8.sh.
5380 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5381 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5382 New tests.
5383 * Makefile.in: Regenerate.
5384 * testsuite/arm_bl_out_of_range.s: Update test.
5385 * testsuite/thumb_bl_out_of_range.s: Ditto.
5386 * testsuite/thumb_blx_out_of_range.s: Ditto.
5387 * testsuite/arm_branch_out_of_range.sh: New file.
5388 * testsuite/arm_cortex_a8.sh: Ditto.
5389 * testsuite/arm_cortex_a8_b.s: Ditto.
5390 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5391 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5392 * testsuite/arm_cortex_a8_bl.s: Ditto.
5393 * testsuite/arm_cortex_a8_blx.s: Ditto.
5394 * testsuite/arm_cortex_a8_local.s: Ditto.
5395 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5396 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5397
05a79166
L
53982010-09-08 Rafael Espindola <espindola@google.com>
5399
5400 * Makefile.am (memory_test.stdout): Run readelf with -W.
5401 * Makefile.in: Regenerate.
5402 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5403 64 bit output.
5404
33dbc701
RÁE
54052010-09-08 Rafael Espindola <espindola@google.com>
5406
5407 * script-sections.cc (Script_sections::add_memory_region): Convert
5408 field precision to int.
5409 * script.cc (script_set_section_region, script_set_section_region):
5410 Convert field precision to int.
5411
731ca54a
RÁE
54122010-09-08 Rafael Espindola <espindola@google.com>
5413
5414 * arm.cc (do_finalize_sections): Create the __exidx_start and
5415 __exdix_end symbols even when the section is missing.
5416
7f8cd844
NC
54172010-09-08 Nick Clifton <nickc@redhat.com>
5418
5419 * README: Remove claim that MEMORY is not supported.
5420 * expression.cc (script_exp_function_origin)
5421 (script_exp_function_length): Move from here to ...
5422 * script.cc: ... here.
5423 (script_set_section_region, script_add_memory)
5424 (script_parse_memory_attr, script_include_directive): New
5425 functions.
5426 * script-sections.cc
5427 (class Memory_region): New class.
5428 (class Output_section_definition): Add set_memory_region,
5429 set_section_vma, set_section_lma and get_section_name methods.
5430 (class Script_Sections): Add add_memory_region,
5431 find_memory_region, find_memory_region_origin,
5432 find_memory_region_length and set_memory_region methods.
5433 Have set_section_addresses method walk the list of set memory
5434 regions.
5435 Extend the print methos to display memory regions.
5436 * script-sections.h: Add prototypes for new methods.
5437 Add enum for MEMORY region attributes.
5438 * yyscript.y: Add support for parsing MEMORY regions.
5439 * script-c.h: Add prototypes for new functions.
5440 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5441 * testsuite/Makefile.in: Regenerate.
5442 * testsuite/memory_test.sh: New script.
5443 * testsuite/memory_test.s: New assembler source file.
5444 * testsuite/memory_test.t: New linker script.
5445
a4649286
DK
54462010-08-27 Doug Kwan <dougkwan@google.com>
5447
5448 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5449 reference override an existing dynamic weak reference.
5450 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5451 * testsuite/Makefile.in: Regenerate.
5452 * testsuite/dyn_weak_ref.sh: New file.
5453 * testsuite/dyn_weak_ref_1.c: Ditto.
5454 * testsuite/dyn_weak_ref_2.c: Ditto.
5455
b56648ad
ILT
54562010-08-27 Ian Lance Taylor <iant@google.com>
5457
5458 * incremental.h (class Incremental_input_entry): Add virtual
5459 destructor.
5460
809313cb
ILT
54612010-08-27 Ian Lance Taylor <iant@google.com>
5462
5463 * testsuite/start_lib_test_3.c: Mark t3 as used.
5464
11e32464
NC
54652010-08-27 Nick Clifton <nickc@redhat.com>
5466
5467 * options.cc (version_script): Fix small typo in previous
5468 whitespace tidyup.
5469
ca09d69a
NC
54702010-08-25 Nick Clifton <nickc@redhat.com>
5471
5472 * archive.cc: Formatting fixes: Remove whitespace between
5473 typename and following asterisk. Remove whitespace between
5474 function name and opening parenthesis.
5475 * archive.h: Likewise.
5476 * arm.cc: Likewise.
5477 * attributes.cc: Likewise.
5478 * attributes.h: Likewise.
5479 * common.cc: Likewise.
5480 * copy-relocs.cc: Likewise.
5481 * dirsearch.h: Likewise.
5482 * dynobj.cc: Likewise.
5483 * ehframe.cc: Likewise.
5484 * ehframe.h: Likewise.
5485 * expression.cc: Likewise.
5486 * fileread.cc: Likewise.
5487 * fileread.h: Likewise.
5488 * gc.h: Likewise.
5489 * gold-threads.cc: Likewise.
5490 * gold.cc: Likewise.
5491 * i386.cc: Likewise.
5492 * icf.h: Likewise.
5493 * incremental-dump.cc: Likewise.
5494 * incremental.cc: Likewise.
5495 * layout.cc: Likewise.
5496 * layout.h: Likewise.
5497 * main.cc: Likewise.
5498 * merge.cc: Likewise.
5499 * merge.h: Likewise.
5500 * object.cc: Likewise.
5501 * object.h: Likewise.
5502 * options.cc: Likewise.
5503 * options.h: Likewise.
5504 * output.cc: Likewise.
5505 * output.h: Likewise.
5506 * plugin.cc: Likewise.
5507 * plugin.h: Likewise.
5508 * powerpc.cc: Likewise.
5509 * reloc.cc: Likewise.
5510 * script-c.h: Likewise.
5511 * script-sections.cc: Likewise.
5512 * script.cc: Likewise.
5513 * stringpool.cc: Likewise.
5514 * symtab.cc: Likewise.
5515 * symtab.h: Likewise.
5516 * target.cc: Likewise.
5517 * timer.cc: Likewise.
5518 * timer.h: Likewise.
5519 * version.cc: Likewise.
5520 * x86_64.cc: Likewise.
5521
b8fa8750
NC
55222010-08-24 Nick Clifton <nickc@redhat.com>
5523
5524 PR 11899
5525 * layout.cc (segment_precedes): Sort segments by their physical
5526 addresses, if they have been set.
5527
9919d93b
CC
55282010-08-23 Cary Coutant <ccoutant@google.com>
5529
5530 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5531 symbols data.
5532 (Lib_group::include_member): Unlock object after deleting its
5533 symbols data.
5534 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5535 the bug fixed here.
5536
97b4be1c
CC
55372010-08-19 Neil Vachharajani <nvachhar@google.com>
5538 Cary Coutant <ccoutant@google.com>
5539
5540 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5541 constructor, and set_blocker.
5542 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5543 readsyms_blocker_.
5544 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5545 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5546 * testsuite/Makefile.am (start_lib_test): New test case.
5547 * testsuite/Makefile.in: Regenerate.
5548 * testsuite/start_lib_test_main.c: New file.
5549 * testsuite/start_lib_test_1.c: New file.
5550 * testsuite/start_lib_test_2.c: New file.
5551 * testsuite/start_lib_test_3.c: New file.
5552
dd0b1884
ILT
55532010-08-19 Ian Lance Taylor <iant@google.com>
5554
5555 * Makefile.in: Rebuild with automake 1.11.1.
5556 * aclocal.m4: Likewise.
5557 * testsuite/Makefile.in: Likewise.
5558
7223e9ca
ILT
55592010-08-19 Ian Lance Taylor <iant@google.com>
5560
5561 PR 10893
5562 * i386.cc (class Output_data_plt_i386): Update declarations.
5563 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5564 local_ifuncs_ fields.
5565 (Target_i386::do_plt_section_for_global): New function.
5566 (Target_i386::do_plt_section_for_local): New function.
5567 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5568 parameter; change all callers. Initialize global_ifuncs_ and
5569 local_ifuncs_. If doing a static link define __rel_iplt_start and
5570 __rel_iplt_end.
5571 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5572 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5573 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5574 symbols.
5575 (Target_i386::make_plt_section): New function, broken out of
5576 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5577 (Target_i386::make_plt_entry): Call make_plt_section.
5578 (Target_i386::make_local_ifunc_plt_entry): New function.
5579 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5580 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5581 R_386_IRELATIVE to switch.
5582 (Target_i386::Scan::global): Likewise.
5583 (Target_i386::Relocate::relocate): Likewise.
5584 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5585 switch.
5586 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5587 (Target_x86_64::do_plt_section_for_global): New function.
5588 (Target_x86_64::do_plt_section_for_local): New function.
5589 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5590 parameter; change all callers. If doing a static link define
5591 __rela_iplt_start and __rela_iplt_end.
5592 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5593 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5594 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5595 to point to .plt.
5596 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5597 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5598 switch.
5599 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5600 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5601 R_X86_64_IRELATIVE to switch.
5602 (Target_x86_64::Scan::global): Likewise.
5603 (Target_x86_64::Relocate::relocate): Likewise.
5604 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5605 switch.
5606 * target.h (class Target): Add plt_section_for_global and
5607 plt_section_for_local functions. Add do_plt_section_for_global
5608 and do_plt_section_for_local virtual functions.
5609 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5610 clarifying comments.
5611 (Symbol::use_plt_offset): Handle IFUNC symbol.
5612 * object.cc (Sized_relobj::Sized_relobj): Initialize
5613 local_plt_offsets_.
5614 (Sized_relobj::local_has_plt_offset): New function.
5615 (Sized_relobj::local_plt_offset): New function.
5616 (Sized_relobj::set_local_plt_offset): New function.
5617 (Sized_relobj::do_count): Handle IFUNC symbol.
5618 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5619 a bit away from input_shndx_ field. Add set_is_func_symbol and
5620 is_ifunc_symbol functions.
5621 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5622 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5623 local_plt_offsets_ field.
5624 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5625 * output.h (class Output_section_data): Add non-const
5626 output_section function.
5627 (class Output_data_got): Update declarations.
5628 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5629 Add use_plt_offset parameter to global and local constructors.
5630 Change all callers. Change local_sym_index_ field to 31 bits.
5631 Change GSYM_CODE and CONSTANT_CODE accordingly.
5632 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5633 doing a static link don't set sh_link field.
5634 (Output_data_got::Got_entry::write): Use PLT offset if
5635 appropriate.
5636 (Output_data_got::add_global_plt): New function.
5637 (Output_data_got::add_local_plt): New function.
5638 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5639 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5640 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5641 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5642 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5643 IFUNC conditional.
5644 * testsuite/ifunc-sel.h: New file.
5645 * testsuite/ifuncmain1.c: New file.
5646 * testsuite/ifuncmain1vis.c: New file.
5647 * testsuite/ifuncmod1.c: New file.
5648 * testsuite/ifuncdep2.c: New file.
5649 * testsuite/ifuncmain2.c: New file.
5650 * testsuite/ifuncmain3.c: New file.
5651 * testsuite/ifuncmod3.c: New file.
5652 * testsuite/ifuncmain4.c: New file.
5653 * testsuite/ifuncmain5.c: New file.
5654 * testsuite/ifuncmod5.c: New file.
5655 * testsuite/ifuncmain6pie.c: New file.
5656 * testsuite/ifuncmod6.c: New file.
5657 * testsuite/ifuncmain7.c: New file.
5658 * configure, testsuite/Makefile.in: Rebuild.
5659
56f75c03
ILT
56602010-08-18 Ian Lance Taylor <iant@google.com>
5661
5662 * incremental.cc
5663 (Output_section_incremental_inputs::write_input_files): Add cast
5664 to avoid signed/unsigned comparison warning.
5665 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5666
55455f89
CC
56672010-08-12 Cary Coutant <ccoutant@google.com>
5668
5669 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5670
e2054bcb
ILT
56712010-08-13 Ian Lance Taylor <iant@google.com>
5672
5673 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5674
74f67560
DK
56752010-08-12 Cary Coutant <ccoutant@google.com>
5676 Doug Kwan <dougkwan@google.com>
5677
5678 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5679 defintion overrides non-weak undef, remember that the original undef
5680 is not weak.
5681 * symtab.cc (Symbol_table::sized_write_global): For undef without
5682 an original weak binding, set binding to global in output.
5683 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5684 * testsuite/Makefile.in: Regenerate.
5685 * testsuite/strong_ref_weak_def.sh: New file.
5686 * testsuite/strong_ref_weak_def_1.c: Ditto.
5687 * testsuite/strong_ref_weak_def_2.c: Ditto.
5688
d1238d12
CC
56892010-08-12 Cary Coutant <ccoutant@google.com>
5690
5691 * testsuite/incremental_test.sh: Rewrite.
5692 * testsuite/incremental_test_1.c: Rewrite.
5693 * testsuite/incremental_test_2.c: Rewrite.
5694
0e70b911
CC
56952010-08-12 Cary Coutant <ccoutant@google.com>
5696
5697 * arm.cc (Target_arm::got_size): Add const.
5698 (Target_arm::got_entry_count): New function.
5699 (Target_arm::plt_entry_count): New function.
5700 (Target_arm::first_plt_entry_offset): New function.
5701 (Target_arm::plt_entry_size): New function.
5702 (Output_data_plt_arm::entry_count): New function.
5703 (Output_data_plt_arm::first_plt_entry_offset): New function.
5704 (Output_data_plt_arm::get_plt_entry_size): New function.
5705 * i386.cc (Target_i386::got_size): Add const.
5706 (Target_i386::got_entry_count): New function.
5707 (Target_i386::plt_entry_count): New function.
5708 (Target_i386::first_plt_entry_offset): New function.
5709 (Target_i386::plt_entry_size): New function.
5710 (Output_data_plt_i386::entry_count): New function.
5711 (Output_data_plt_i386::first_plt_entry_offset): New function.
5712 (Output_data_plt_i386::get_plt_entry_size): New function.
5713 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5714 find_incremental_inputs_sections. Dump incremental_got_plt section.
5715 * incremental.cc: Include target.h.
5716 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5717 parameter. Adjust all callers. Find incremental_got_plt section.
5718 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5719 section.
5720 (Output_section_incremental_inputs::set_final_data_size): Calculate
5721 size of incremental_got_plt section.
5722 (Output_section_incremental_inputs::do_write): Write the
5723 incremental_got_plt section.
5724 (Got_plt_view_info): New struct.
5725 (Local_got_offset_visitor): New class.
5726 (Global_got_offset_visitor): New class.
5727 (Global_symbol_visitor_got_plt): New class.
5728 (Output_section_incremental_inputs::write_got_plt): New function.
5729 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5730 Add parameter. Adjust all callers.
5731 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5732 (Incremental_inputs::got_plt_section): New function.
5733 (Incremental_inputs::got_plt_section_): New data member.
5734 (Incremental_got_plt_reader): New class.
5735 * layout.cc (Layout::create_incremental_info_sections): Add the
5736 incremental_got_plt section.
5737 * object.h (Got_offset_list::get_list): New function.
5738 (Got offset_list::for_all_got_offsets): New function.
5739 (Sized_relobj::local_got_offset_list): New function.
5740 * powerpc.cc (Target_powerpc::got_size): Add const.
5741 (Target_powerpc::got_entry_count): New function.
5742 (Target_powerpc::plt_entry_count): New function.
5743 (Target_powerpc::first_plt_entry_offset): New function.
5744 (Target_powerpc::plt_entry_size): New function.
5745 (Output_data_plt_powerpc::entry_count): New function.
5746 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5747 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5748 * sparc.cc (Target_sparc::got_size): Add const.
5749 (Target_sparc::got_entry_count): New function.
5750 (Target_sparc::plt_entry_count): New function.
5751 (Target_sparc::first_plt_entry_offset): New function.
5752 (Target_sparc::plt_entry_size): New function.
5753 (Output_data_plt_sparc::entry_count): New function.
5754 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5755 (Output_data_plt_sparc::get_plt_entry_size): New function.
5756 * symtab.h (Symbol::got_offset_list): New function.
5757 (Symbol_table::for_all_symbols): New function.
5758 * target.h (Sized_target::got_entry_count): New function.
5759 (Sized_target::plt_entry_count): New function.
5760 (Sized_target::plt_entry_size): New function.
5761 * x86_64.cc (Target_x86_64::got_size): Add const.
5762 (Target_x86_64::got_entry_count): New function.
5763 (Target_x86_64::plt_entry_count): New function.
5764 (Target_x86_64::first_plt_entry_offset): New function.
5765 (Target_x86_64::plt_entry_size): New function.
5766 (Output_data_plt_x86_64::entry_count): New function.
5767 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5768 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5769
09ec0418
CC
57702010-08-12 Cary Coutant <ccoutant@google.com>
5771
5772 * archive.cc: Include incremental.h.
5773 (Archive::Archive): Initialize incremental_info_.
5774 (Archive::include_member): Record archive members in incremental info.
5775 (Add_archive_symbols::run): Record begin and end of an archive in
5776 incremental info.
5777 (Lib_group::include_member): Record objects in incremental info.
5778 * archive.h (Incremental_archive_entry): Forward declaration.
5779 (Archive::set_incremental_info): New member function.
5780 (Archive::incremental_info): New member function.
5781 (Archive::Unused_symbol_iterator): New class.
5782 (Archive::unused_symbols_begin): New member function.
5783 (Archive::unused_symbols_end): New member function.
5784 (Archive::incremental_info_): New data member.
5785 * incremental-dump.cc (find_input_containing_global): New function.
5786 (dump_incremental_inputs): Dump new incremental info sections.
5787 * incremental.cc: Include symtab.h.
5788 (Output_section_incremental_inputs): New class.
5789 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5790 new incremental info sections.
5791 (Sized_incremental_binary::do_check_inputs): Likewise.
5792 (Incremental_inputs::report_archive): Remove.
5793 (Incremental_inputs::report_archive_begin): New function.
5794 (Incremental_inputs::report_archive_end): New function.
5795 (Incremental_inputs::report_object): New function.
5796 (Incremental_inputs::finalize_inputs): Remove.
5797 (Incremental_inputs::report_input_section): New function.
5798 (Incremental_inputs::report_script): Rewrite.
5799 (Incremental_inputs::finalize): Do nothing but finalize string table.
5800 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5801 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5802 (Incremental_inputs::create_data_sections): New function.
5803 (Incremental_inputs::relocs_entsize): New function.
5804 (Output_section_incremental_inputs::set_final_data_size): New function.
5805 (Output_section_incremental_inputs::do_write): New function.
5806 (Output_section_incremental_inputs::write_header): New function.
5807 (Output_section_incremental_inputs::write_input_files): New function.
5808 (Output_section_incremental_inputs::write_info_blocks): New function.
5809 (Output_section_incremental_inputs::write_symtab): New function.
5810 * incremental.h (Incremental_script_entry): Forward declaration.
5811 (Incremental_object_entry): Forward declaration.
5812 (Incremental_archive_entry): Forward declaration.
5813 (Incremental_inputs): Forward declaration.
5814 (Incremental_inputs_header_data): Remove.
5815 (Incremental_inputs_header): Remove.
5816 (Incremental_inputs_header_write): Remove.
5817 (Incremental_inputs_entry_data): Remove.
5818 (Incremental_inputs_entry): Remove.
5819 (Incremental_inputs_entry_write): Remove.
5820 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5821 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5822 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5823 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5824 Likewise.
5825 (Incremental_input_entry): New class.
5826 (Incremental_script_entry): New class.
5827 (Incremental_object_entry): New class.
5828 (Incremental_archive_entry): New class.
5829 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5830 (Incremental_inputs::report_inputs): Remove.
5831 (Incremental_inputs::report_archive): Remove.
5832 (Incremental_inputs::report_archive_begin): New function.
5833 (Incremental_inputs::report_archive_end): New function.
5834 (Incremental_inputs::report_object): Change prototype.
5835 (Incremental_inputs::report_input_section): New function.
5836 (Incremental_inputs::report_script): Change prototype.
5837 (Incremental_inputs::get_reloc_count): New function.
5838 (Incremental_inputs::set_reloc_count): New function.
5839 (Incremental_inputs::create_data_sections): New function.
5840 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5841 (Incremental_inputs::inputs_section): New function.
5842 (Incremental_inputs::symtab_section): New function.
5843 (Incremental_inputs::relocs_section): New function.
5844 (Incremental_inputs::get_stringpool): Add const.
5845 (Incremental_inputs::command_line): Add const.
5846 (Incremental_inputs::inputs): Remove.
5847 (Incremental_inputs::command_line_key): New function.
5848 (Incremental_inputs::input_file_count): New function.
5849 (Incremental_inputs::input_files): New function.
5850 (Incremental_inputs::relocs_entsize): New function.
5851 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5852 (Incremental_inputs::finalize_inputs): Remove.
5853 (Incremental_inputs::Input_info): Remove.
5854 (Incremental_inputs::lock_): Remove.
5855 (Incremental_inputs::inputs_): Change type.
5856 (Incremental_inputs::inputs_map_): Remove.
5857 (Incremental_inputs::current_object_entry_): New data member.
5858 (Incremental_inputs::inputs_section_): New data member.
5859 (Incremental_inputs::symtab_section_): New data member.
5860 (Incremental_inputs::relocs_section_): New data member.
5861 (Incremental_inputs::reloc_count_): New data member.
5862 (Incremental_inputs_reader): New class.
5863 (Incremental_symtab_reader): New class.
5864 (Incremental_relocs_reader): New class.
5865 * layout.cc (Layout::finalize): Move finalization of incremental info
5866 and creation of incremental info sections to follow finalization of
5867 symbol table. Set offsets for postprocessing sections.
5868 (Layout::create_incremental_info_sections): Call
5869 Incremental_inputs::create_data_sections. Add incremental symtab
5870 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5871 sections to layout after input sections.
5872 * layout.h (struct Timespec): Forward declaration.
5873 (Layout::incremental_inputs): Add const.
5874 (Layout::create_incremental_info_sections): Add parameter.
5875 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5876 * object.cc: Include incremental.h.
5877 (Relobj::finalize_incremental_relocs): New function.
5878 (Sized_relobj::do_layout): Record input sections in incremental info.
5879 * object.h (Object::output_section): New function.
5880 (Object::output_section_offset): Moved from Relobj.
5881 (Object::get_incremental_reloc_base): New function.
5882 (Object::get_incremental_reloc_count): New function.
5883 (Object::do_output_section): New function.
5884 (Object::do_output_section_offset): Moved from Relobj.
5885 (Object::do_get_incremental_reloc_base): New function.
5886 (Object::do_get_incremental_reloc_count): New function.
5887 (Object::Object): Initialize new data members.
5888 (Relobj::output_section): Renamed do_output_section and moved to
5889 protected.
5890 (Relobj::output_section_offset): Moved to Object.
5891 (Relobj::do_get_incremental_reloc_base): New function.
5892 (Relobj::do_get_incremental_reloc_count): New function.
5893 (Relobj::allocate_incremental_reloc_counts): New function.
5894 (Relobj::count_incremental_reloc): New function.
5895 (Relobj::finalize_incremental_relocs): New function.
5896 (Relobj::next_incremental_reloc_index): New function.
5897 (Relobj::reloc_counts_): New data member.
5898 (Relobj::reloc_bases_): New data member.
5899 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5900 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5901 (Sized_relobj::incremental_relocs_scan): New function.
5902 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5903 (Sized_relobj::incremental_relocs_write): New function.
5904 (Sized_relobj::incremental_relocs_write_reltype): New function.
5905 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5906 incremental link.
5907 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5908 archives and object files elsewhere.
5909 (Add_symbols::run): Report object files here.
5910 (Finish_group::run): Report end of archive at end of group.
5911 * reloc.cc: Include layout.h, incremental.h.
5912 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5913 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5914 (Sized_relobj::incremental_relocs_scan): New function.
5915 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5916 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5917 (Sized_relobj::incremental_relocs_write): New function.
5918 (Sized_relobj::incremental_relocs_write_reltype): New function.
5919 * script.cc (read_input_script): Rewrite test for incremental link.
5920 Change call to Incremental_inputs::report_script.
5921 * symtab.h (Symbol_table::first_global_index): New function.
5922 (Symbol_table::output_count): New function.
5923
ce0d1972
DK
59242010-08-12 Doug Kwan <dougkwan@google.com>
5925
5926 * arm.cc (Target_arm::merge_object_attributes): Check command line
5927 options --no-wchar-size-warning and --no-enum-size-warning.
5928 * options.h (General_options): Add ld-compatible options
5929 --no-enum-size-warning and --no-wchar-size-warning.
5930
6e5710ce
ILT
59312010-08-04 Ian Lance Taylor <iant@google.com>
5932
5933 * x86_64.cc (Target_x86_64::Scan::local): Use
5934 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5935 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5936 (Target_x86_64::Scan::global): Likewise.
5937 (Target_x86_64::Relocate::relocate): Likewise.
5938 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5939 Likewise.
5940
fef830db
CC
59412010-08-03 Cary Coutant <ccoutant@google.com>
5942
5943 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5944 to reserve space in merged_strings vector. Keep total input size
5945 for stats.
5946 (Output_merge_string::do_print_merge_stats): Print total input size.
5947 * merge.h (Output_merge_string): Add input_size_ field.
5948 * stringpool.cc (Stringpool_template::string_length): Move
5949 implementations out of Stringpool_template class and place in
5950 stringpool.h.
5951 * stringpool.h (string_length): Move out of Stringpool_template.
5952
1e3811b0
ILT
59532010-08-03 Ian Lance Taylor <iant@google.com>
5954
5955 PR 11712
5956 * layout.cc (relaxation_loop_body): If address of load segment is
5957 set, adjust address to include headers if possible.
5958
7af0c620
ILT
59592010-08-03 Ian Lance Taylor <iant@google.com>
5960
5961 * version.cc (version_string): Bump to 1.10.
5962
22f0da72
ILT
59632010-08-03 Ian Lance Taylor <iant@google.com>
5964
5965 PR 11805
5966 * layout.h (enum Output_section_order): Define.
5967 (class Layout): Update declarations.
5968 * layout.cc (Layout::get_output_section): Add order parameter.
5969 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5970 is_first_non_relro parameters. Change all callers.
5971 (Layout::choose_output_section): Likewise.
5972 (Layout::add_output_section_data): Likewise.
5973 (Layout::make_output_section): Likewise. Set order.
5974 (Layout::default_section_order): New function.
5975 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5976 * output.cc (Output_section::Output_section): Initialize order_.
5977 Don't initialize deleted fields.
5978 (Output_segment::Output_segment): Don't initialize deleted
5979 fields.
5980 (Output_segment::add_output_section_to_load): New function
5981 replacing add_output_section. Change all callers to call this or
5982 add_output_section_to_nonload.
5983 (Output_segment::add_output_section_to_nonload): New function.
5984 (Output_segment::remove_output_section): Rewrite.
5985 (Output_segment::add_initial_output_data): Likewise.
5986 (Output_segment::has_any_data_sections): Likewise.
5987 (Output_segment::is_first_section_relro): Likewise.
5988 (Output_segment::maximum_alignment): Likewise.
5989 (Output_segment::has_dynamic_reloc): New function replacing
5990 dynamic_reloc_count. Change all callers.
5991 (Output_segment::has_dynamic_reloc_list): New function replacing
5992 dynamic_reloc_count_list. Change all callers.
5993 (Output_segment::set_section_addresses): Rewrite.
5994 (Output_segment::set_offset): Rewrite.
5995 (Output_segment::find_first_and_last_list): Remove.
5996 (Output_segment::set_tls_offsets): Rewrite.
5997 (Output_segment::first_section_load_address): Likewise.
5998 (Output_segment::output_section_count): Likewise.
5999 (Output_segment::section_with_lowest_load_address): Likewise.
6000 (Output_segment::write_section_headers): Likewise.
6001 (Output_segment::print_sections_to_map): Likewise.
6002 * output.h (class Output_data): Remove dynamic_reloc_count_
6003 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6004 (Output_data::add_dynamic_reloc): Rewrite.
6005 (Output_data::has_dynamic_reloc): New function.
6006 (Output_data::dynamic_reloc_count): Remove.
6007 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6008 is_last_relro_, is_first_non_relro_, is_interp_,
6009 is_dynamic_linker_section_ fields. Add order and set_order
6010 functions. Remove is_relro_local, set_is_relro_local,
6011 is_last_relro, set_is_last_relro, is_first_non_relro,
6012 set_is_first_non_relro functions, is_interp, set_is_interp,
6013 is_dynamic_linker_section, and set_is_dynamic_linker_section
6014 functions.
6015 (class Output_segment): Change Output_data_list from std::list to
6016 std:;vector. Add output_lists_ field. Remove output_data_ and
6017 output_bss_ fields. Update declarations.
6018
3ff2ccb0
ILT
60192010-08-02 Ian Lance Taylor <iant@google.com>
6020
6021 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6022 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6023 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6024
88a4108b
ILT
60252010-08-02 Ian Lance Taylor <iant@google.com>
6026
6027 PR 11855
6028 * script.cc (Script_options::Script_options): Initialize
6029 symbol_definitions_ and symbol_references_.
6030 (Script_options::add_symbol_assignment): Update
6031 symbol_definitions_ and symbol_references_.
6032 (Script_options::add_symbol_reference): New function.
6033 (script_symbol): New function.
6034 * script.h (class Script_options): Add symbol_definitions_ and
6035 symbol_references_ fields.
6036 (Script_options::referenced_const_iterator): New type.
6037 (Script_options::referenced_begin): New function.
6038 (Script_options::referenced_end): New function.
6039 (Script_options::is_referenced): New function.
6040 (Script_options::any_unreferenced): New function.
6041 * script-c.h (script_symbol): Declare.
6042 * yyscript.y (exp): Call script_symbol.
6043 * symtab.cc: Include "script.h".
6044 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6045 Change all callers. Check symbols referenced by scripts.
6046 (Symbol_table::add_undefined_symbols_from_command_line): Add
6047 layout parameter. Change all callers.
6048 (Symbol_table::do_add_undefined_symbols_from_command_line):
6049 Likewise. Break out loop body. Check symbols referenced by
6050 scripts.
6051 (Symbol_table::add_undefined_symbol_from_command_line): New
6052 function broken out of
6053 do_add_undefined_symbols_from_command_line.
6054 * symtab.h (class Symbol_table): Update declarations.
6055 * archive.cc: Include "layout.h".
6056 (Archive::should_include_member): Add layout parameter. Change
6057 all callers. Check for symbol mentioned in expression.
6058 * archive.h (class Archive): Update declaration.
6059 * object.cc (Sized_relobj::do_should_include_member): Add layout
6060 parameter.
6061 * object.h (Object::should_include_member): Add layout parameter.
6062 Change all callers.
6063 (Object::do_should_include_member): Add layout parameter.
6064 (class Sized_relobj): Update declaration.
6065 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6066 parameter.
6067 * dynobj.h (class Sized_dynobj): Update declaration.
6068 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6069 layout parameter.
6070 * plugin.h (class Sized_pluginobj): Update declaration.
6071
5f1ab67a
ILT
60722010-08-02 Ian Lance Taylor <iant@google.com>
6073
6074 PR 11866
6075 * output.cc (Output_segment::set_offset): Search for the first and
6076 last sections rather than assuming that the list is in order.
6077 (Output_segment::find_first_and_last_list): New function.
6078 * output.h (class Output_segment): Update declarations.
6079 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6080 (relro_strip_test_SOURCES): New variable.
6081 (relro_strip_test_DEPENDENCIES): New variable.
6082 (relro_strip_test_LDFLAGS): New variable.
6083 (relro_strip_test_LDADD): New variable.
6084 (relro_strip_test.so): New target.
6085
a8df5856
ILT
60862010-08-02 Ian Lance Taylor <iant@google.com>
6087
6088 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6089 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6090 (Target_i386::got_tlsdesc_section): New function.
6091 (Target_i386::got_section): Create space for GOT entries for
6092 TLSDESC relocations.
6093 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6094 R_386_TLS_GOTDESC.
6095 (Target_i386::Scan::global): Likewise.
6096 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6097 using TLSDESC GOT.
6098 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6099 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6100 (Target_x86_64::got_tlsdesc_section): New function.
6101 (Target_x86_64::got_section): Create space for GOT entries for
6102 TLSDESC relocations.
6103 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6104 R_386_TLS_GOTDESC.
6105 (Target_x86_64::Scan::global): Likewise.
6106 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6107 using TLSDESC GOT.
6108
0c10a0a6
ILT
61092010-08-02 Ian Lance Taylor <iant@google.com>
6110
6111 * testsuite/final_layout.sh: Use dc to convert from hex to
6112 decimal.
6113
41cbeecc
ST
61142010-07-29 Sriraman Tallam <tmsriram@google.com>
6115
6116 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6117 paramter to the call to gold::gc_process_relocs.
6118 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6119 paramter to the call to gold::gc_process_relocs.
6120 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6121 parameter to the call to gold::gc_process_relocs.
6122 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6123 template parameter to the call to gold::gc_process_relocs.
6124 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6125 paramter to the call to gold::gc_process_relocs.
6126 * gc.h (get_embedded_addend_size): New function.
6127 (gc_process_relocs): Save the size of the reloc for use by ICF.
6128 * icf.cc (get_section_contents): Get the addend from the text section
6129 for SHT_REL relocation sections.
6130 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6131 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6132 * int_encoding.h (read_from_pointer): New overloaded function.
6133 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6134 * testsuite/icf_sht_rel_addend_test.sh: New file.
6135 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6136 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6137
6ea55b82
RW
61382010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6139
6140 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6141 * Makefile.in: Regenerate.
6142 * testsuite/Makefile.in: Regenerate.
6143
9691462b
ILT
61442010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6145
6146 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6147 * gold/testsuite/debug_msg.cc: Likewise.
6148 * gold/testsuite/odr_violation1.cc
6149 * gold/testsuite/odr_violation2.cc
6150
76897331
CC
61512010-07-21 Cary Coutant <ccoutant@google.com>
6152
6153 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6154 string, and length fields.
6155 (Output_merge_string::Merged_strings_list): New type.
6156 (Output_merge_string::Merged_strings_lists): New typedef.
6157 (Output_merge_string): Replace merged_strings_ with
6158 merged_strings_lists_.
6159 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6160 Merged_strings_list per input object and section. Don't store pointer
6161 to the string. Don't store length with each merged string entry.
6162 (Output_merge_string::finalize_merged_data): Loop over list of merged
6163 strings lists. Recompute length of each merged string.
6164
78384e8f
CC
61652010-07-15 Cary Coutant <ccoutant@google.com>
6166
6167 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6168 here.
6169
783659f9
ILT
61702010-07-14 Ian Lance Taylor <iant@google.com>
6171
6172 * descriptors.cc (Descriptors::open): Report correct name in error
6173 message.
6174
131687b4
DK
61752010-07-13 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc (Arm_input_section::Arm_input_section): For a
6178 SHT_ARM_EXIDX section, always keeps the input sections.
6179 (Arm_input_section::set_exidx_section_link): New method.
6180 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6181 has_errors_ to false.
6182 (Arm_exidx_input_section::has_errors,
6183 Arm_exidx_input_section::set_has_errors): New methods.
6184 (Arm_exidx_input_section::has_errors_): New data member.
6185 (Arm_relobj::get_exidx_shndx_list): New method.
6186 (Arm_output_section::append_text_sections_to_list): Do not skip
6187 section without SHF_EXECINSTR.
6188 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6189 errors.
2e702c99 6190 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6191 section header. Make error messages more verbose. Check for
6192 a non-executable section linked to an EXIDX section.
6193 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6194 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6195 check that there is no deferred EXIDX section if we exit early.
6196 Instead of not making an EXIDX section in case of an error, make one
6197 and set the has_errors flag of it.
6198 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6199 in a relocatable link.
6200 (Target_arm::do_relax): Look for the EXIDX output section instead of
6201 assuming that it is called .ARM.exidx.
2e702c99 6202 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6203 section list. Do not check for SHF_EXECINSTR section flags but
6204 skip any input section with errors.
6205 * output.cc (Output_section::Output_section): Initialize
6206 always_keeps_input_sections_ to false.
6207 (Output_section::add_input_section): Check for
6208 always_keeps_input_sections_.
6209 * output.h (Output_section::always_keeps_input_sections,
6210 Output_section::set_always_keeps_input_sections): New methods.
6211 (Output_section::always_keeps_input_sections): New data member.
6212
69517287
RÁE
62132010-07-13 Rafael Espindola <espindola@google.com>
6214
6215 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6216 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6217
82742395
ILT
62182010-07-13 Philip Herron <herron.philip@googlemail.com>
6219 Ian Lance Taylor <iant@google.com>
6220
6221 * output.h (Output_section_lookup_maps::add_merge_section):
6222 Correct check of whether value was inserted.
6223 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6224 (Output_section_lookup_maps::add_relaxed_input_section):
6225 Likewise.
6226 * arm.cc (Target_arm::got_section): Remove used local os.
6227 * i386.cc (Target_i386::got_section): Likewise.
6228 * x86_64.cc (Target_x86_64::got_section): Likewise.
6229 * sparc.cc (Target_sparc::got_section): Likewise.
6230 (Target_sparc::relocate): Remove unused local have_got_offset.
6231 * powerpc.cc (Target_powerpc::relocate): Likewise.
6232
f2d707b5
ILT
62332010-07-13 Ian Lance Taylor <iant@google.com>
6234
241531d6
ILT
6235 * compressed_output.cc (zlib_decompress): Fix signature in
6236 !HAVE_ZLIB_H case.
6237
f2d707b5
ILT
6238 * archive.cc (Archive::include_member): Unlock an external member
6239 of a thin archive. Don't bother to delete an object we know is
6240 NULL.
6241
a2e47362
CC
62422010-07-12 Cary Coutant <ccoutant@google.com>
6243
6244 * compressed_output.cc (zlib_decompress): New function.
6245 (get_uncompressed_size): New function.
6246 (decompress_input_section): New function.
6247 * compressed_output.h (get_uncompressed_size): New function.
6248 (decompress_input_section): New function.
6249 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6250 Handle compressed debug sections.
6251 * layout.cc (is_compressed_debug_section): New function.
6252 (Layout::output_section_name): Map compressed section names to
6253 canonical names.
6254 * layout.h (is_compressed_debug_section): New function.
6255 (is_debug_info_section): Recognize compressed debug sections.
6256 * merge.cc: Include compressed_output.h.
6257 (Output_merge_data::do_add_input_section): Handle compressed
6258 debug sections.
6259 (Output_merge_string::do_add_input_section): Handle compressed
6260 debug sections.
6261 * object.cc: Include compressed_output.h.
6262 (Sized_relobj::Sized_relobj): Initialize new data members.
6263 (build_compressed_section_map): New function.
6264 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6265 * object.h (Object::section_is_compressed): New method.
6266 (Object::do_section_is_compressed): New method.
6267 (Sized_relobj::Compressed_section_map): New type.
6268 (Sized_relobj::do_section_is_compressed): New method.
6269 (Sized_relobj::compressed_sections_): New data member.
6270 * output.cc (Output_section::add_input_section): Handle compressed
6271 debug sections.
6272 * reloc.cc: Include compressed_output.h.
6273 (Sized_relobj::write_sections): Handle compressed debug sections.
6274
ce279a62
CC
62752010-07-08 Cary Coutant <ccoutant@google.com>
6276
6277 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6278 weak when resolving to a dynamic def.
6279 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6280 for weak undef/dynamic def cases. Adjust callers.
6281 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6282 undef_binding_weak_.
6283 (Symbol_table::sized_write_globals): Adjust symbol binding.
6284 (Symbol_table::sized_write_symbol): Add binding parameter.
6285 * symtab.h (Symbol::set_undef_binding): New method.
6286 (Symbol::is_undef_binding_weak): New method.
6287 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6288 (Symbol_table::should_override): Add new parameter.
6289 (Symbol_table::sized_write_symbol): Add new parameter.
6290
6291 * testsuite/weak_undef_file1.cc: Add new test case.
6292 * testsuite/weak_undef_file2.cc: Fix header comment.
6293 * testsuite/weak_undef_test.cc: Add new test case.
6294
b2286c10
DK
62952010-06-29 Doug Kwan <dougkwan@google.com>
6296
6297 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6298 Initialize USE_SYMBOL_.
6299 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6300 definition.
6301 (Arm_reloc_property::uses_symbol_): New data member declaration.
6302 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6303 uses symbol value and symbol is undefined but not weakly undefined.
6304
4802450a
RÁE
63052010-06-28 Rafael Espindola <espindola@google.com>
6306
6307 * plugin.cc (Plugin::load): Use dlerror.
6308
e5ca47ba
ILT
63092010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6310
6311 * symtab.cc (detect_odr_violations): When reporting an ODR
6312 violation, report an object where the symbol is defined.
6313
8a75a161
DK
63142010-06-25 Doug Kwan <dougkwan@google.com>
6315
6316 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6317 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6318 definition.
6319 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6320 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6321 target hook to detect function points.
6322 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6323 * icf.h (Icf::check_section_for_function_pointers): Change type of
6324 parameter SECTION_NAME to const reference to std::string. Use
6325 target hook to determine if section may have unsafe pointers.
6326 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6327 method definition.
6328
42218b9f
RÁE
63292010-06-21 Rafael Espindola <espindola@google.com>
6330
6331 * fileread.cc (Input_file::find_fie): New
6332 (Input_file::open): Use Input_file::find_fie.
6333 * fileread.h (Input_file::find_fie): New
6334 * plugin.cc (set_extra_library_path): New.
6335 (Plugin::load): Add set_extra_library_path to the transfer vector.
6336 (Plugin_manager::set_extra_library_path): New.
6337 (Plugin_manager::add_input_file): Use the extra search path if set.
6338 (set_extra_library_path(): New.
6339 * plugin.h (Plugin_manager): Add set_extra_library_path and
6340 extra_search_path_.
6341
a0506cca
CC
63422010-06-19 Cary Coutant <ccoutant@google.com>
6343
6344 * layout.cc (gdb_sections): Add .debug_types.
6345 (lines_only_debug_sections): Likewise.
6346
6508b958
RÁE
63472010-06-18 Rafael Espindola <espindola@google.com>
6348
6349 * plugin.cc (add_input_file,add_input_library)
6350 (Plugin_manager::add_input_file): Make filename arguments const.
6351 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6352 const.
6353
3e235302
DK
63542010-06-16 Doug Kwan <dougkwan@google.com>
6355
6356 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6357 .ARM.attributes section if we have not merged any input
6358 attributes sections.
6359
106e8a6c
DK
63602010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6361
6362 * arm.cc: Allow combining objects with no EABI version
6363 information.
6364
91ff43fe
RÁE
63652010-06-15 Rafael Espindola <espindola@google.com>
6366
6367 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6368
68ed838c
ILT
63692010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6370
6371 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6372 (struct iovec): Correct !HAVE_READV definition.
6373
f3a2388f
CC
63742010-06-10 Cary Coutant <ccoutant@google.com>
6375
6376 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6377 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6378 reloc sections.
6379 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6380
6381 PR 11683
6382 * symtab.h (Symbol::is_placeholder): New member function.
6383 * target-reloc.h (relocate_section): Check for placeholder symbols.
6384
6385 * testsuite/Makefile.am (plugin_test_8): New test.
6386 (plugin_test_9): New test.
6387 * testsuite/Makefile.in: Regenerate.
6388
e1df38aa
NC
63892010-06-09 Nick Clifton <nickc@redhat.com>
6390
6391 * yyscript.y (input_list_element): Allow strings prefixed with
6392 the '-' character. Treat these as libraries.
6393 * script.cc (script_add_library): New function. Adds a library
6394 specified by "-l<name>" found in an input script.
6395 * script-c.h: Add prototype for script_add_library.
6396
25bbe950
DK
63972010-06-07 Doug Kwan <dougkwan@google.com>
6398
6399 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6400 Restrict stub-group size to be within long conditional branch
6401 range when working around cortex-A8 erratum.
6402
0f32ea4c
ILT
64032010-06-07 Damien Diederen <dd@crosstwine.com>
6404
6405 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6406 #ifdef typo.
6407
8fe2a369
ST
64082010-06-03 Sriraman Tallam <tmsriram@google.com>
6409
6410 PR gold/11658
6411 * output.cc
6412 (Output_section::Input_section_sort_entry::compare_section_ordering):
6413 Change to return non-zero correctly.
6414 (Output_section::Input_section_sort_section_order_index_compare
6415 ::operator()): Change to fix ambiguity in comparisons.
6416
6e9ba2ca
ST
64172010-06-01 Sriraman Tallam <tmsriram@google.com>
6418
6419 * gold.h (is_wildcard_string): New function.
6420 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6421 (Layout::layout_eh_frame): Ditto.
6422 (Layout::find_section_order_index): New method.
6423 (Layout::read_layout_from_file): New method.
6424 * layout.h (Layout::find_section_order_index): New method.
6425 (Layout::read_layout_from_file): New method.
6426 (Layout::input_section_position_): New private member.
6427 (Layout::input_section_glob_): New private member.
6428 * main.cc (main): Call read_layout_from_file here.
6429 * options.h (--section-ordering-file): New option.
6430 * output.cc (Output_section::input_section_order_specified_): New
6431 member.
6432 (Output_section::Output_section): Initialize new member.
6433 (Output_section::add_input_section): Add new parameter.
6434 Keep input sections when --section-ordering-file is used.
6435 (Output_section::set_final_data_size): Sort input sections when
6436 section ordering file is specified.
6437 (Output_section::Input_section_sort_entry): Add new parameter.
6438 Check sorting type.
6439 (Output_section::Input_section_sort_entry::compare_section_ordering):
6440 New method.
6441 (Output_section::Input_section_sort_compare::operator()): Change to
6442 consider section_order_index.
6443 (Output_section::Input_section_sort_init_fini_compare::operator()):
6444 Change to consider section_order_index.
6445 (Output_section::Input_section_sort_section_order_index_compare
6446 ::operator()): New method.
6447 (Output_section::sort_attached_input_sections): Change to sort
6448 according to section order when specified.
e1df38aa
NC
6449 (Output_section::add_input_section<32, true>): Add new parameter.
6450 (Output_section::add_input_section<64, true>): Add new parameter.
6451 (Output_section::add_input_section<32, false>): Add new parameter.
6452 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6453 * output.h (Output_section::add_input_section): Add new parameter.
6454 (Output_section::input_section_order_specified): New
6455 method.
6456 (Output_section::set_input_section_order_specified): New method.
6457 (Input_section::Input_section): Initialize section_order_index_.
6458 (Input_section::section_order_index): New method.
6459 (Input_section::set_section_order_index): New method.
6460 (Input_section::section_order_index_): New member.
6461 (Input_section::Input_section_sort_section_order_index_compare): New
6462 struct.
6463 (Output_section::input_section_order_specified_): New member.
6464 * script-sections.cc (is_wildcard_string): Delete and move modified
6465 method to gold.h.
6466 (Output_section_element_input::Output_section_element_input): Modify
6467 call to is_wildcard_string.
6468 (Output_section_element_input::Input_section_pattern
6469 ::Input_section_pattern): Ditto.
6470 (Output_section_element_input::Output_section_element_input): Ditto.
6471 * testsuite/Makefile.am (final_layout): New test case.
6472 * testsuite/Makefile.in: Regenerate.
6473 * testsuite/final_layout.cc: New file.
6474 * testsuite/final_layout.sh: New file.
6475
3537c84b
RÁE
64762010-06-01 Rafael Espindola <espindola@google.com>
6477
6478 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6479
105b6afd
RÁE
64802010-06-01 Rafael Espindola <espindola@google.com>
6481
6482 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6483 visibility of symbols.
6484
29e11421
DK
64852010-05-27 Doug Kwan <dougkwan@google.com>
6486
6487 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6488 from start of output section instead of address for a local symbol
6489 in a merged or relaxed section when doing a relocatable link.
6490
5e0f337e
RÁE
64912010-05-26 Rafael Espindola <espindola@google.com>
6492
703d02da 6493 PR 11604
5e0f337e
RÁE
6494 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6495 adding sections the garbage collector removed.
6496 * gold/testsuite/Makefile.am: Add test.
6497 * gold/testsuite/Makefile.in: Regenerate.
6498 * gold/testsuite/plugin_test_7.sh: New.
6499 * gold/testsuite/plugin_test_7_1.c: New.
6500 * gold/testsuite/plugin_test_7_2.c: New.
6501
f4187277
RÁE
65022010-05-26 Rafael Espindola <espindola@google.com>
6503
6504 * script-sections.cc (Output_section_definition::set_section_addresses):
6505 Check for --section-start.
6506
5c388529
DK
65072010-05-26 Doug Kwan <dougkwan@google.com>
6508
6509 * arm.cc (Arm_scan_relocatable_relocs): New class.
6510 (Target_arm::relocate_special_relocatable): New method.
6511 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6512 (Arm_relocate_functions::thumb_branch_common): Same.
6513 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6514 instead of Default_scan_relocatable_relocs.
6515 * target-reloc.h (relocate_for_relocatable): Let target handle
6516 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6517 * target.h (Sized_target::relocate_special_relocatable): New method.
6518
bca1c3ae
ILT
65192010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6520
6521 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6522
0439c796
DK
65232010-05-23 Doug Kwan <dougkwan@google.com>
6524
6525 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6526 instead of a cast.
6527 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6528 with a direct branch, not a conditional branch, to a stub.
6529 * merge.cc (Output_merge_base::record_input_section): New method
6530 defintion.
6531 (Output_merge_data::do_add_input_section): Record input section if
6532 keeps-input-sections flag is set.
6533 (Output_merge_string::do_add_input_section): Ditto.
6534 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6535 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6536 INPUT_SECTIONS_.
6537 (Output_merge_base::keeps_input_sections,
6538 Output_merge_base::set_keeps_input_sections,
6539 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6540 method definitions.
6541 (Output_merge_base::Input_sections): New type declaration.
6542 (Output_merge_base::input_sections_begin,
6543 Output_merge_base::input_sections_end,
6544 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6545 (Output_merge_base::bool keeps_input_sections_,
6546 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6547 Output_merge_base::input_sections_): New data members.
6548 (Output_merge_data::do_set_keeps_input_sections): New method
6549 defintion.
6550 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6551 * output.cc (Output_section::Input_section::relobj): Move method
6552 defintion from class declaration to here and handle merge sections.
6553 (Output_section::Input_section::shndx): Ditto.
6554 (Output_section::Output_section): Remove initializations of removed
6555 data members and initialize new data member LOOKUP_MAPS_.
6556 (Output_section::add_input_section): Set keeps-input-sections flag
6557 for a newly created merge output section as appropriate. Adjust code
6558 to use Output_section_lookup_maps class.
6559 (Output_section::add_relaxed_input_section): Adjst code for lookup
6560 maps code refactoring.
2e702c99 6561 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6562 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6563 class. If adding input section to a newly created merge output
6564 section fails, remove the new merge section.
6565 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6566 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6567 (Output_section::find_merge_section): Ditto.
0439c796 6568 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6569 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6570 Output_section_lookup_maps class.
6571 (Output_section::get_input_sections): Export merge sections. Adjust
6572 code to use Output_section_lookup_maps class.
6573 (Output_section:::add_script_input_section): Adjust code to use
6574 Output_section_lookup_maps class. Update lookup maps for merge
6575 sections also.
6576 (Output_section::discard_states): Use Output_section_lookup_maps.
6577 (Output_section::restore_states): Same.
6578 * output.h (Merge_section_properties): Move class defintion out of
6579 Output_section.
6580 (Output_section_lookup_maps): New class.
6581 (Output_section::Input_section::is_merge_section): New method
6582 defintion.
6583 (Output_section::Input_section::relobj): Move defintion out of class
6584 defintion. Declare method only.
6585 (Output_section::Input_section::shndx): Ditto.
6586 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6587 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6588 (Output_section::Merge_section_by_properties_map,
6589 Output_section::Output_section_data_by_input_section_map,
6590 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6591 Remove types.
2e702c99 6592 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6593 KEEPS_INPUT_SECTIONS.
6594 (Output_section::build_lookup_maps): New method declaration.
6595 (Output_section::merge_section_map_,
6596 Output_section::merge_section_by_properties_map_,
6597 Output_section::relaxed_input_section_map_,
6598 Output_section::is_relaxed_input_section_map_valid_): Remove data
6599 members.
6600 (Output_section::lookup_maps_): New data member.
6601
76295588
L
66022010-05-21 Doug Kwan <dougkwan@google.com>
6603
6604 PR gold/11619
6605 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6606 avoid a compilation error.
6607
d103a984
RÁE
66082010-05-19 Rafael Espindola <espindola@google.com>
6609
6610 * script-sections.cc (Output_section_definition::allocate_to_segment):
6611 Update the phdrs_list even when the output section is NULL.
6612 * testsuite/Makefile.am: Add test.
6613 * testsuite/Makefile.in: Regenerate.
6614 * testsuite/script_test_9.cc: New.
6615 * testsuite/script_test_9.sh: New.
6616 * testsuite/script_test_9.t: New.
6617
6625d24e
DK
66182010-05-19 Doug Kwan <dougkwan@google.com>
6619
6620 * arm.cc (Arm_input_section::original_size): New method.
6621 (Arm_input_section::do_addralign): Add a cast.
6622 (Arm_input_section::do_output_offset): Remove static cast.
6623 (Arm_input_section::original_addralign,
6624 Arm_input_section::original_size_): Change type to uint32_t.
6625 (Arm_input_section::init): Add safe casts for section alignment
6626 and size.
6627 (Arm_input_section::set_final_data_size): Do not set address and
6628 offset of stub table.
6629 (Arm_output_section::fix_exidx_coverage): Change use of of
6630 Output_section::Simple_input_section to that of
6631 Output_section::Input_section.
6632 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6633 except for the first pass.
6634 * output.cc (Output_section::get_input_sections): Change type of
6635 input_sections to std::list<Input_section>.
6636 (Output_section::add_script_input_section): Rename from
6637 Output_section::add_simple_input_section. Change type of SIS
6638 parameter from Simple_input_section to Input_section.
6639 * output.h (Output_section::Simple_input_section): Remove class.
6640 (Output_section::Input_section): Change class visibility to public.
6641 (Output_section::Input_section::addralign): Use stored alignments
6642 for special input sections if set.
6643 (Output_section::Input_section::set_addralign): New method.
6644 (Output_section::get_input_sections): Change parameter type from
6645 list of Simple_input_section to list of Input_section.
6646 (Output_section::add_script_input_section): Rename from
6647 Output_section::add_simple_input_section. Change first parameter's
6648 type from Simple_input_section to Input_section and remove the
6649 second and third parameters.
6650 * script-sections.cc (Input_section::Input_section_list): Change
6651 type to list of Output_section::Input_section/
6652 (Input_section_info::Input_section_info): Change parameter type of
6653 INPUT_SECTION to Output_section::Input_section.
6654 (Input_section_info::input_section): Change return type.
6655 (Input_section_info::input_section_): Change type to
6656 Output_section::Input_section.
6657 (Output_section_element_input::set_section_addresses): Adjust code
6658 to use Output_section::Input_section instead of
6659 Output_section::Simple_input_section. Adjust code for renaming
6660 of Output_section::add_simple_input_section.
6661 (Orphan_output_section::set_section_addresses): Ditto.
6662
e1e82ea4
RW
66632010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6664
6665 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6666 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6667
91e75c8a
RÁE
66682010-05-18 Rafael Espindola <espindola@google.com>
6669
6670 * options.cc (General_options::finalize): Handle -nostdlib.
6671 * options.h (nostdlib): New option.
6672 * script.cc (script_add_search_dir): Handle -nostdlib.
6673
da59ad79
DK
66742010-05-12 Doug Kwan <dougkwan@google.com>
6675
6676 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6677 attributes section only if there no attributes section after merging.
6678 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6679 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6680 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6681 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6682 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6683 and arm_attr_merge_7.stdout.
6684 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6685 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6686 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6687 arm_attr_merge_7b.o): New rules.
6688 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6689 arm_attr_merge_7
6690 * testsuite/Makefile.in: Regenerate.
6691 * testsuite/arm_attr_merge.sh: New file.
6692 * testsuite/arm_attr_merge_[67][ab].s: Same.
6693
3e01a7fd
NC
66942010-05-05 Nick Clifton <nickc@redhat.com>
6695
6696 * po/es.po: Updated Spanish translation.
6697
7ad2014a
L
66982010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6699
6700 * Makefile.am (install-exec-local): Properly install gold as
6701 default cross linker.
6702 * Makefile.in: Regenerated.
6703
4fda8867
NC
67042010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6705 Nick Clifton <nickc@redhat.com>
6706
6707 * configure.ac (install_as_default): Define and set to false
6708 unless --enable-gold or --enable-gold=both/gold has been
6709 specified.
6710 * configure: Regenerate.
6711
6712 * Makefile.am (install-exec-local): Install the executable as
6713 'ld.gold'. If install_as_default is true then also install it as
6714 'ld'.
6715 * Makefile.in: Regenerated.
6716
bd288ea2
ILT
67172010-04-24 Ian Lance Taylor <iant@google.com>
6718
6719 * layout.cc (Layout::layout_reloc): In relocatable link don't
6720 combine reloc sections for grouped sections.
6721
ef38fd8a
ST
67222010-04-23 Sriraman Tallam <tmsriram@google.com>
6723
6724 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6725 sections that are not ordinary to icf.
6726 * icf.cc (get_section_contents): Handle relocation pointing to section
6727 with no object or shndx information.
6728 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6729 * testsuite/Makefile.in: Regenerate.
6730 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6731 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6732
f6973bdc
ILT
67332010-04-22 Ian Lance Taylor <iant@google.com>
6734
6735 * expression.cc (Expression::Expression_eval_info): Add
6736 result_alignment_pointer field.
6737 (Expression::eval_with_dot): Add result_alignment_pointer
6738 parameter. Change all callers.
6739 (Expression::eval_maybe_dot): Likewise.
6740 (class Binary_expression): Add alignment_pointer parameter to
6741 left_value and right_value. Change all callers.
6742 (BINARY_EXPRESSION): Set result alignment.
6743 (class Trinary_expression): Add alignment_pointer parameter to
6744 arg2_value and arg3_value. Change all callers.
6745 (Trinary_cond::value): Set result alignment.
6746 (Max_expression::value, Min_expression::value): Likewise.
6747 (Align_expression::value): Likewise.
6748 * script-sections.cc (class Sections_element): Add dot_alignment
6749 parameter to set_section_addresses virtual function. Update
6750 instantiations.
6751 (class Output_section_element): Likewise.
6752 (Script_sections::create_segments): Add dot_alignment parameter.
6753 Change all callers.
6754 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6755 (Script_sections::set_phdrs_clause_addresses): Likewise.
6756 * script-sections.h: Update declarations.
6757 * script.h: Update declarations.
6758 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6759 min_p_align.
6760 * testsuite/script_test_3.t: Set large alignment.
6761 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6762 segment has expected alignment.
6763
9c9c98a5
NC
67642010-04-22 Nick Clifton <nickc@redhat.com>
6765
6766 * po/gold.pot: Updated by the Translation project.
6767 * po/vi.po: Updated Vietnamese translation.
6768
2253bfba
L
67692010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6770
6771 * testsuite/Makefile.am (check_PROGRAMS): Add
6772 icf_virtual_function_folding_test.
6773 * testsuite/Makefile.in: Regenerated.
6774
85fdf906
AH
67752010-04-15 Andrew Haley <aph@redhat.com>
6776
6777 * options.h (merge_exidx_entries): New option.
6778 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6779 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6780 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6781 (Target_arm::merge_exidx_entries): New function.
6782 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6783 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6784 to Arm_exidx_fixup constructor.
6785 Add new arg, merge_exidx_entries.
6786 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6787 Arm_output_section::fix_exidx_coverage.
6788
ce97fa81
ST
67892010-04-18 Sriraman Tallam <tmsriram@google.com>
6790
6791 * icf.cc (get_section_contents): Check for preemptible functions.
6792 Ignore addend when appropriate.
6793 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6794 section folded.
6795 (add_from_relobj): Check for section folded.
6796 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6797 * symtab.h (should_add_dynsym_entry): Add new parameter.
6798 * target-reloc.h (scan_relocs): Check for section folded.
6799 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6800 Check reloc types for function pointers in shared objects.
6801 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6802 case.
6803 (icf_preemptible_functions_test): New test case.
6804 (icf_string_merge_test): New test case.
6805 * testsuite.Makefile.in: Regenerate.
6806 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6807 bar_glob. Refactor code.
6808 * testsuite/icf_preemptible_functions_test.cc: New file.
6809 * testsuite/icf_preemptible_functions_test.sh: New file.
6810 * testsuite/icf_string_merge_test.cc: New file.
6811 * testsuite/icf_string_merge_test.sh: New file.
6812 * testsuite/icf_virtual_function_folding_test.cc: New file.
6813 * testsuite/icf_virtual_function_folding_test.sh: New file.
6814
04ceb17c
DK
68152010-04-14 Doug Kwan <dougkwan@google.com>
6816
6817 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6818 for local symbol recounting if we remove a section due to ICF.
6819 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6820 there are no regular objects in input.
6821
153e7da4
DK
68222010-04-13 Doug Kwan <dougkwan@google.com>
6823
6824 * arm.cc (Arm_input_section::set_final_data_size): Compute
6825 accurate final data size instead of using current data size.
6826
4dbd9faf
DK
68272010-04-09 Doug Kwan <dougkwan@google.com>
6828
6829 * layout.cc (Layout::choose_output_section): Handle script section
6830 types.
6831 (Layout::make_output_section_for_script): Add section type parameter.
6832 Handle script section types.
6833 * layout.h (Layout::make_output_section_for_script): Add section
6834 type parameter.
6835 * output.cc (Output_section::Output_section): Initialize data member
6836 is_noload_.
6837 (Output_section::do_reset_address_and_file_offset): Do not set address
6838 to 0 if section is a NOLOAD section.
6839 * output.h (Output_section::is_noload): New method.
6840 (Output_section::set_is_noload): Ditto.
6841 (Output_section::is_noload_): New data member.
6842 * script-c.h (Script_section_type): New enum type.
6843 (struct Parser_output_section_header): Add new file section_type.
6844 * script-sections.cc (Sections_element::output_section_name): Add
6845 parameter for returning script section type.
6846 (Output_section_definition::output_section_name): Ditto.
6847 (Output_section_definition::section_type)P; New method.
6848 (Output_section_definiton::script_section_type_name): Ditto.
6849 (Output_section_definition::script_section_type_): New data member.
6850 (Output_section_definition::Output_section_definition): Initialize
6851 data member Output_section_definition::script_section_type_.
6852 (Output_section_definition::create_sections): Pass script section type
6853 to Layout::make_output_section_for_script.
6854 (Output_section_definition::output_section_name): Return script
6855 section type to caller.
6856 (Output_section_definition::set_section_address): Do not advance
6857 dot value and load address if section type is NOLOAD. Set address
6858 of NOLOAD sections regardless of section flags.
6859 (Output_section_definition::print): Print section type if it is
6860 not SCRIPT_SECTION_TYPE_NONE.
6861 (Output_section_definition::section_type): New method.
6862 (Output_section_definition::script_section_type_name): Ditto.
6863 (Script_sections::output_section_name): Add new parameter
6864 PSECTION_TYPE for returning script section type. Pass it to
6865 section elements. Handle discard sections.
6866 (Sort_output_sections::operator()): Handle NOLOAD sections.
6867 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6868 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6869 returning script section type.
6870 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6871 INFO and NOLOAD.
6872 * yyscript.y (union): Add new field SECTION_TYPE.
6873 (COPY, DSECT, INFO, NOLOAD): New tokens.
6874 (opt_address_and_section_type): Change type to output_section_header.
6875 (section_type): New non-terminal
6876 (section_header): Handle section type.
2253bfba 6877 (opt_address_and_section_type): Return section type value.
4dbd9faf 6878
721ea635
L
68792010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6880
6881 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6882 * testsuite/plugin_common_test_2.c (foo): Likewise.
6883
6bf924b0
DK
68842010-04-08 Doug Kwan <dougkwan@google.com>
6885
6886 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6887 Output_merge_data.
6888 * output.cc (Output_section::add_merge_input_section): Simplify
6889 code and return status of Output_merge_base::add_input_section.
e1df38aa 6890 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6891 returns true.
6892
24af6f92
DK
68932010-04-07 Doug Kwan <dougkwan@google.com>
6894
6895 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6896 if section is marked as containing instructions but has no mapping
6897 symbols.
6898 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6899 correct section index.
6900 (Arm_relobj::find_linked_text_section): Ditto.
6901
00698fc5
CC
69022010-04-07 Cary Coutant <ccoutant@google.com>
6903
6904 * archive.cc (include_member): Destroy Read_symbols_data object before
6905 releasing file.
6906 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6907 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6908 (Read_symbols_data::~Read_symbols_data) New destructor.
6909 (Section_relocs::Section_relocs) New constructor.
6910 (Section_relocs::~Section_relocs) New destructor.
6911 (Read_relocs_data::Read_relocs_data) New constructor.
6912 (Read_relocs_data::~Read_relocs_data) New destructor.
6913 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6914 pointers to NULL after deleting.
6915
7296d933
DK
69162010-04-07 Doug Kwan <dougkwan@google.com>
6917
6918 * arm.cc: Replace "endianity" with "endianness" in comments.
6919 (Arm_exidx_cantunwind): Ditto.
6920 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6921 (Arm_relobj::merge_flags_and_attributes): New method.
6922 (Arm_relobj::merge_flags_and_attributes_): New data member.
6923 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6924 (Arm_relobj::scan_sections_for_stubs): Ditto.
6925 (Arm_relobj::do_read_symbols): Check to see if we really want to
6926 merge processor-specific flags and attributes. Exit early if
6927 an object is empty except for section names and the undefined symbol.
6928 (Target_arm::do_finalize_sections): Move check for ELF format to
6929 Arm_relobj::do_read_symbols. Merge processor specific flags and
6930 attributes from a regular object only when we have determined that
6931 it is aapropriate. Do not create an .ARM.attributes section in
6932 output if there is no regular input object.
6933 (Target_arm::merge_processor_specific_flags): Check
6934 --warn-mismatch before printing any error.
6935 (Target_arm::merge_object_attributes): Ditto.
6936 * gold.cc (queue_middle_tasks): Handle the case in which there is
6937 no regular object in input.
6938 * options.cc (General_options::parse_EB): New method.
6939 (General_options::parse_EL): Same.
6940 (General_options::General_options): Initialize endianness_.
6941 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6942 New options.
6943 (General_options::Endianness): New enum.
6944 (General_options::endianness): New method.
6945 (General_options::endianness_): New data member.
6946 * parameters.cc (Parameters::set_options): Check target endianness.
6947 (Parameters::set_target_once): Ditto.
6948 (Parameters::check_target_endianness): New method.
6949 (parameters_force_valid_target): If either -EL or -EB is specified,
6950 use it to define endianness of default target.
6951 * parameters.h (Parameters::check_target_endianness): New method
6952 declaration.
6953 * target.h (class Target): Change "endianity" to "endianness"
6954 in comments.
6955
efc8d4f2
RW
69562010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6957
6958 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6959 * configure: Regenerate.
6960 * Makefile.in: Regenerate.
6961 * testsuite/Makefile.in: Regenerate.
6962
be234d88
CC
69632010-04-06 Cary Coutant <ccoutant@google.com>
6964
6965 gcc PR lto/42757
6966 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6967 prevailing definitions of common symbols.
6968 * testsuite/plugin_test_6.sh: New test case.
6969 * testsuite/plugin_common_test_1.c: New test case.
6970 * testsuite/plugin_common_test_2.c: New test case.
6971 * testsuite/Makefile.am (plugin_test_6): New test case.
6972 * testsuite/Makefile.in: Regenerate.
6973
bd32c6bd
NC
69742010-04-06 Nick Clifton <nickc@redhat.com>
6975
6976 * po/vi.po: New Vietnamese translation.
6977
323c532f
DK
69782010-03-30 Doug Kwan <dougkwan@google.com>
6979
6980 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6981
4fcd97eb
DK
69822010-03-25 Doug Kwan <dougkwan@google.com>
6983
6984 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6985 to avoid a conversion warning on a 32-bit host.
6986
4ebf39db
ILT
69872010-03-24 Ian Lance Taylor <iant@google.com>
6988
6989 * testsuite/script_test_3.t: Add a TLS segment.
6990 * testsuite/Makefile.am (check_PROGRAMS): Add
6991 tls_phdrs_script_test.
6992 (tls_phdrs_script_test_SOURCES): Define.
6993 (tls_phdrs_script_test_DEPENDENCIES): Define.
6994 (tls_phdrs_script_test_LDFLAGS): Define.
6995 (tls_phdrs_script_test_LDADD): Define.
6996 * testsuite/Makefile.in: Rebuild.
6997
4a599bdd
CC
69982010-03-23 Cary Coutant <ccoutant@google.com>
6999
7000 * fileread.cc (find_or_make_view): Fix comment.
7001
6c93b22c
ILT
70022010-03-23 Ian Lance Taylor <iant@google.com>
7003
7004 * script-sections.cc (class Orphan_section_placement): Define
7005 PLACE_TLS and PLACE_TLS_BSS.
7006 (Orphan_section_placement::Orphan_section_placement): Initialize
7007 new places.
7008 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7009 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7010 (tls_script_test_SOURCES): Define.
7011 (tls_script_test_DEPENDENCIES): Define.
7012 (tls_script_test_LDFLAGS): Define.
7013 (tls_script_test_LDADD): Define.
7014 * testsuite/Makefile.in: Rebuild.
7015
a2c7281b
DK
70162010-03-22 Doug Kwan <dougkwan@google.com>
7017
7018 * arm.cc (Arm_relocate_functions::abs8,
7019 Arm_relocate_functions::abs16): Use correct check for overflow
7020 specified in the ARM ELF specs.
7021 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7022 target of a BLX instruction specially.
7023 (Reloc_stub::stub_type_for_reloc): Ditto.
7024 (Relocate::relocate): Use symbolic names instead of numeric relocation
7025 codes to report error.
7026 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7027 workaround.
7028 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7029 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7030 thumb2_blx_out_of_range.stdout
7031 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7032 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7033 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7034 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7035 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7036 thumb2_blx_in_range, thumb2_blx_in_range.o,
7037 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7038 thumb2_blx_out_of_range.o): New rules.
2e702c99 7039 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7040 thumb2_blx_in_range and thumb2_blx_out_of_range.
7041 * testsuite/Makefile.in: Regenerate.
7042 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7043 * testsuite/thumb_blx_in_range.s: New file.
7044 * testsuite/thumb_blx_out_of_range.s: New file.
7045
b0193076
RÁE
70462010-03-22 Rafael Espindola <espindola@google.com>
7047
7048 * archive.cc (Should_include): Move to archive.h.
7049 (should_include_member): Make it a member of Archive.
7050 (Lib_group): New.
7051 (Add_lib_group_symbols): New.
7052 * archive.h: Include options.h.
7053 (Archive_member): Moved from Archive.
7054 (Should_include): Moved from archive.cc.
7055 (Lib_group): New.
7056 (Add_lib_group_symbols): New.
7057 * dynobj.cc (do_should_include_member): New.
7058 * dynobj.h (do_should_include_member): New.
7059 * gold.cc (queue_initial_tasks): Update call to queue.
7060 * main.cc (main): Print lib group stats.
7061 * object.cc (do_should_include_member): New.
7062 * object.h: Include archive.h.
7063 (Object::should_include_member): New.
7064 (Object::do_should_include_member): New.
7065 (Sized_relobj::do_should_include_member): New.
7066 * options.cc (General_options::parse_start_lib): New.
7067 (General_options::parse_end_lib): New.
7068 (Input_arguments::add_file): Handle lib groups.
7069 (Input_arguments::start_group): Check we are not in a lib.
7070 (Input_arguments::start_lib): New.
7071 (Input_arguments::end_lib): New.
7072 * options.h (General_options): Add start_lib and end_lib.
7073 (Input_argument::lib_): New.
7074 (Input_argument::lib): New.
7075 (Input_argument::is_lib): New.
7076 (Input_file_lib): New.
7077 (Input_arguments::in_lib_): New.
7078 (Input_arguments::in_lib): New.
7079 (Input_arguments::start_lib): New.
7080 (Input_arguments::end_lib_): New.
7081 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7082 in unused members as preempted.
7083 (Sized_pluginobj::do_should_include_member): New.
7084 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7085 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7086 return the blocker.
7087 (Read_symbols::do_whole_lib_group): New.
7088 (Read_symbols::do_lib_group): New.
7089 (Read_symbols::do_read_symbols): Handle lib groups.
7090 (Read_symbols::get_name): Handle lib groups.
7091 * readsyms.h (Read_symbols): Add an archive member pointer.
7092 (Read_symbols::do_whole_lib_group): New.
7093 (Read_symbols::do_lib_group): New.
7094 (Read_symbols::member_): New.
7095 * script.cc (read_input_script): Update call to queue_soon.
7096
d099120c
DK
70972010-03-19 Doug Kwan <dougkwan@google.com>
7098
7099 * arm.cc (Stub_table::Stub_table): Initialize new data members
7100 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7101 (Stub_table::add_reloc_stub): Assign stub offset and update
7102 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7103 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7104 New data members.
2e702c99 7105 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7106 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7107 instead of going over all reloc stubs.
2e702c99 7108 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7109 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7110 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7111 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7112 Stringpool_template::offset_.
7113 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7114 Stringpool_template::offset_ to zero.
7115
1aa37384
DK
71162010-03-15 Doug Kwan <dougkwan@google.com>
7117
7118 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7119 offset_.
7120 (Stringpool_template::new_key_offset): New method.
7121 (Stringpool_template::add_string): Assign offsets when adding new
7122 strings.
7123 (Stringpool_template::set_string_offsets): Do not set string offsets
7124 when not optimizing.
7125 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7126 member size_.
2e702c99
RM
7127 (Chunked_vector::clear): Clear size_.
7128 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7129 (Chunked_vector::size): Return size_.
7130 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7131 (Chunked_vector::size_): New data member.
1aa37384
DK
7132 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7133 (Stringpool_template::new_key_offset): New method declaration.
7134 (Stringpool_template::offset_): New data member.
7135
b672b057
RÁE
71362010-03-15 Rafael Espindola <espindola@google.com>
7137
7138 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7139 Add_symbols' constructor.
7140 * readsyms.h (Add_symbols): Remove the input_group member.
7141
b6848d3c
ILT
71422010-03-10 Ian Lance Taylor <iant@google.com>
7143
7144 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7145 target to ask whether a reference to a symbol requires a stack
7146 split.
7147 * target.h (Target::is_call_to_non_split): New function.
7148 (Target::do_is_call_to_non_split): Declare virtual function.
7149 * target.cc: Include "symtab.h".
7150 (Target::do_is_call_to_non_split): New function.
7151 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7152
a2a5469e
CC
71532010-03-10 Cary Coutant <ccoutant@google.com>
7154
7155 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7156 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7157 (File_read::open[2]): Add whole_file_view_ to list of views.
7158 (File_read::make_view): Remove test of whole_file_view_.
7159 (File_read::find_or_make_view): Create whole_file_view_ if
7160 necessary.
7161 (File_read::clear_views): Replace bool parameter with enum;
7162 adjust all callers. Don't delete views with permanent data;
7163 do delete cached views and views from archives if
7164 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7165 if clearing the corresponding view.
7166 * fileread.h (File_read::Clear_views_mode): New enum.
7167 (File_read::View::is_permanent_view): New method.
7168 (File_read::clear_views): Replace bool parameter
7169 with enum; adjust all callers.
7170 * options.h (General_options): Change keep_files_mapped option;
7171 add map_whole_files.
7172 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7173 releasing the file.
7174 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7175 the file.
7176
8861f32b
DM
71772010-03-10 David S. Miller <davem@davemloft.net>
7178
7179 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7180
d62d0f5f
ST
71812010-03-09 Sriraman Tallam <tmsriram@google.com>
7182
7183 * icf.cc (get_section_contents): Add '@' marker after processing the
7184 merge reloc.
7185
9177756d
DK
71862010-03-08 Doug Kwan <dougkwan@google.com>
7187
7188 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7189 due to a conversion warning.
7190 (Arm_relobj::update_output_local_symbol_count): Check for local
7191 symbol with unset output index.
7192
9e9e071b
ILT
71932010-03-05 Ian Lance Taylor <iant@google.com>
7194
7195 * options.h (class General_options): Add --spare-dynamic-tags.
7196 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7197 --spare-dynamic-tags.
7198
a81ee015
ILT
71992010-03-05 Ian Lance Taylor <iant@google.com>
7200
7201 * incremental.cc: Include "libiberty.h".
7202
44ec90b9
RO
72032010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7204
7205 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7206 function, is_info_ member.
7207 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7208 (Versions::Versions): Update caller.
7209 (Versions::define_base_version): Likewise.
7210 (Versions::add_def): Likewise.
7211
0897ed3b
ST
72122010-03-03 Sriraman Tallam <tmsriram@google.com>
7213
7214 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7215 (Scan::possible_function_pointer_reloc): New function.
7216 (Scan::local_reloc_may_be_function_pointer): Change to call
7217 possible_function_pointer_reloc.
7218 (Scan::global_reloc_may_be_function_pointer): Ditto.
7219 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7220 relocations in ".data.rel.ro._ZTV" section.
7221 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7222 * testsuite/icf_safe_so_test.cc: Ditto.
7223 * testsuite/icf_safe_test.cc: Ditto.
7224 * testsuite/icf_safe_test.sh: Ditto.
7225
d3bbad62
ILT
72262010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7227 Ian Lance Taylor <iant@google.com>
7228
7229 * target-reloc.h (relocate_section): Check the symbol table index
7230 for -1U before setting the local symbol index.
7231 (scan_relocatable_relocs): If copying the relocation, record that
7232 the local symbol is required.
7233 * object.h (Symbol_value::is_output_symtab_index_set): New
7234 function.
7235 (Symbol_value::may_be_discarded_from_output_symtab): New
7236 function.
7237 (Symbol_value::has_output_symtab_entry): New function.
7238 (Symbol_value::needs_output_symtab_entry): Remove.
7239 (Symbol_value::output_symtab_index): Make sure the symbol index is
7240 set.
7241 (Symbol_value::set_output_symtab_index): Make sure the symbol
7242 index is not set. Make sure the new index is valid.
7243 (Symbol_value::set_must_have_output_symtab_entry): New function.
7244 (Symbol_value::has_output_dynsym_entry): New function.
7245 (Symbol_value::set_output_dynsym_index): Make sure the new index
7246 is valid.
7247 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7248 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7249 local symbol if permitted.
7250 (Sized_relobj::do_finalize_local_symbols): Call
7251 is_output_symtab_index_set rather than needs_output_symtab_entry.
7252 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7253 rather than needs_output_symtab_entry. Call
7254 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7255 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7256 is_output_symtab_index_set rather than needs_output_symtab_entry.
7257 * testsuite/discard_locals_relocatable_test.c: New file.
7258 * testsuite/discard_locals_test.sh: Test -r.
7259 * testsuite/Makefile.am (check_DATA): Add
7260 discard_locals_relocatable_test1.syms,
7261 discard_local_relocatable_test2.syms.
7262 (MOSTLYCLEANFILES): Likewise. Also add
7263 discard_locals_relocatable_test1.lout and
7264 discard_locals_relocatable_test2.out.
7265 (discard_locals_relocatable_test1.syms): New target.
7266 (discard_locals_relocatable_test.o): New target.
7267 (discard_locals_relocatable_test1.out): New target.
7268 (discard_locals_relocatable_test2.syms): New target.
7269 (discard_locals_relocatable_test2.out): New target.
7270 (various): Add missing ../ld-new dependencies.
7271 * testsuite/Makefile.in: Rebuild.
7272
7e8ccf26
NC
72732010-03-03 Nick Clifton <nickc@redhat.com>
7274
7275 * po/fi.po: New Finnish translation.
7276
2a0ff005
DK
72772010-03-01 Doug Kwan <dougkwan@google.com>
7278
7279 * layout.cc (Layout::Layout): Force section types of .init_array*,
7280 .preinit_array* and .fini_array* sections.
7281 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7282 Fix check of return value of std::string::find.().
7283 (Output_section::Input_section_sort_compare::operator()): Remove
7284 comment about .init_array.
7285 (Output_section::Input_section_sort_init_fini_compare::operator()):
7286 New method.
7287 (Output_section::sort_attached_input_sections): Handle .init_array
7288 and .fini_array specially.
7289 * output.h (Output_section::Inut_section_sort_compare): Update
7290 comment.
7291 (Output_section::Input_section_sort_init_fini_compare): New struct.
7292
c3e4ae29
DK
72932010-02-26 Doug Kwan <dougkwan@google.com>
7294
7295 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7296 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7297 * testsuite/debug_msg.sh: Avoid matching source line number for
7298 use of global variable undef_int.
7299
2fd9ae7a
DK
73002010-02-26 Doug Kwan <dougkwan@google.com>
7301
7302 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7303 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7304 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7305 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7306 * options.cc (General_options::General_options): Initialize member
7307 fix_v4bx_.
7308 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7309 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7310 and rm_no_fix_v4bx.stdout
7311 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7312 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7313 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7314 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7315 and arm_no_fix_v4bx.
7316 * Makefile.in: Regenerate.
7317 * testsuite/arm_fix_v4bx.s: New file.
7318 * testsuite/arm_fix_v4bx.sh: Ditto.
7319
67ec7d0b
DK
73202010-02-24 Doug Kwan <dougkwan@google.com>
7321
7322 * arm.cc (Target_arm::got_section): Make the .got section the first
7323 non RELRO section in the data segment.
7324 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7325 suffixes of section names.
7326
10165461
DK
73272010-02-24 Doug Kwan <dougkwan@google.com>
7328
7329 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7330 flags and attributes merging if an input file is a binary file.
7331 * fileread.cc (Input_file::open): Record format of original file.
7332 * fileread.h (Input_file::Format): New enum type.
2e702c99 7333 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7334 (Input_file::format): New method definition.
7335 (Input_file::format_):: New data member.
7336
4a54abbb
DK
73372010-02-24 Doug Kwan <dougkwan@google.com>
7338
7339 * arm.cc (Arm_output_data_got): New class.
7340 (ARM_TCB_SIZE): New constant
7341 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7342 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7343 If user uses a script with a SECTIONS clause, issue only a warning
7344 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7345 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7346 garbage collection.
7347 (Target_arm::got_mode_index_entry): Handle static linking.
7348 (Target_arm::Scan::local): Ditto.
7349 (Target_arm::Scan::global): Ditto.
7350 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7351 all incorrectly implemented relocations.
e1df38aa 7352 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7353 Arm_output_section::fix_exidx_coverage.
7354 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7355 from ".ARM.exidx." and ".ARM.extab.".
7356
ca419a6f
ILT
73572010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7358
7359 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7360 section if it does not already exist.
7361 * attributes.cc (Attributes_section_data::Attributes_section_data):
7362 Don't crash if size is zero.
7363
135b9c78
ILT
73642010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7365 Ian Lance Taylor <iant@google.com>
7366
7367 * gold.cc (queue_middle_tasks): If no input files were opened,
7368 exit.
7369 * workqueue.h (Task_function::Task_function): Assert that there is
7370 a blocker.
7371
bb0bfe4f
DK
73722010-02-22 Doug Kwan <dougkwan@google.com>
7373
7374 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7375 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7376 types to avoid warnings due to different uint64_t implementations
7377 on different hosts.
7378
2a2b6d42
DK
73792010-02-21 Doug Kwan <dougkwan@google.com>
7380
7381 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7382 handling of the maximum backward branch offset.
2e702c99 7383 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7384 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7385 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7386 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7387 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7388 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7389 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7390 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7391 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7392 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7393 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7394 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7395 thumb2_bl_out_of_range.o): New rules.
7396 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7397 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7398 thumb2_bl_out_of_range
7399 * testsuite/Makefile.in: Regenerate.
7400 * testsuite/arm_bl_in_range.s: New file.
7401 * testsuite/arm_bl_out_of_range.s: Ditto.
7402 * testsuite/arm_branch_in_range.sh: Ditto.
7403 * testsuite/arm_branch_range.t: Ditto.
7404 * testsuite/thumb2_branch_range.t: Ditto.
7405 * testsuite/thumb_bl_in_range.s: Ditto.
7406 * testsuite/thumb_bl_out_of_range.s: Ditto.
7407 * testsuite/thumb_branch_range.t: Ditto.
7408
b487ad64
ST
74092010-02-20 Sriraman Tallam <tmsriram@google.com>
7410
7411 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7412 Add reloc offset information.
7413 * icf.cc (get_section_contents): Change iterators to point to the new
7414 vectors. Add reloc offset information to the contents.
7415 * icf.h (Icf::Sections_reachable_info): New typedef.
7416 (Icf::Sections_reachable_list): New typedef.
7417 (Icf::Offset_info): New typedef.
7418 (Icf::Reloc_info): New struct typedef.
7419 (Icf::Reloc_info_list): New typedef.
7420 (Icf::symbol_reloc_list): Delete method.
7421 (Icf::addend_reloc_list): Delete method.
7422 (Icf::section_reloc_list): Delete method.
7423 (Icf::reloc_info_list): New method.
7424 (Icf::reloc_info_list_): New member.
7425
f96accdf
DK
74262010-02-19 Doug Kwan <dougkwan@google.com>
7427
7428 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7429 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7430 * arm.cc (Arm_relocation_functions): New forward declaration.
7431 (Target_arm::Target_arm): Initialize new data members
7432 got_mod_index_offset_ and tls_base_symbol_defined_.
7433 (Target_arm::Relocate::relocate_tls): New method.
7434 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7435 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7436 New methods.
2e702c99 7437 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7438 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7439 (Target_arm::got_mod_index_offset_,
7440 Target_arm::tls_base_symbol_defined_): New data members.
7441 (Target_arm::Scan::local, Target::Scan::global,
7442 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7443 relocations.
7444
c8761b9a
DK
74452010-02-18 Doug Kwan <dougkwan@google.com>
7446
7447 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7448 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7449 text section as a parameter becuase some broken tools may not set
7450 the link in section header.
7451 (Target_arm::has_got_section): New method.
7452 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7453 without any mapping symbol as data only. Remove warning.
7454 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7455 link in its section header, try to discover the link by inspecting the
7456 REL31 relocation at the beginning of the section.
7457 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7458 in error message.
7459 (Target_arm::Scan::global): Treat any reference to the symbol
7460 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7461
21bb3914
ST
74622010-02-12 Sriraman Tallam <tmsriram@google.com>
7463
7464 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7465 (Scan::global_reloc_may_be_function_pointer): New function.
7466 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7467 (Scan::global_reloc_may_be_function_pointer): New function.
7468 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7469 (Scan::global_reloc_may_be_function_pointer): New function.
7470 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7471 (Scan::global_reloc_may_be_function_pointer): New function.
7472 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7473 (Scan::global_reloc_may_be_function_pointer): New function.
7474 (Scan::possible_function_pointer_reloc): New function.
7475 (Target_x86_64::can_check_for_function_pointers): New function.
7476 * gc.h (gc_process_relocs): Scan relocation types to determine if
7477 function pointers were taken for targets that support it.
7478 * icf.cc (Icf::find_identical_sections): Include functions for
7479 folding in safe ICF whose pointer is not taken.
7480 * icf.h (Secn_fptr_taken_set): New typedef.
7481 (fptr_section_id_): New member.
7482 (section_has_function_pointers): New function.
7483 (set_section_has_function_pointers): New function.
7484 (check_section_for_function_pointers): New function.
7485 * options.h: Fix comment for safe ICF option.
7486 * target.h (can_check_for_function_pointers): New function.
7487 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7488 Modify icf_safe_test for X86-64.
7489 * testsuite/Makefile.in: Regenerate.
7490 * testsuite/icf_safe_so_test.cc: New file.
7491 * testsuite/icf_safe_so_test.sh: New file.
7492 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7493 (main): Change to take pointer to function kept_func_3.
7494 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7495 folding is done correctly for X86-64.
7496
0da6fa6c
DM
74972010-02-12 David S. Miller <davem@davemloft.net>
7498
7499 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7500 is_symbolless parameter.
7501 (Output_reloc<SHT_REL>::is_symbolless): New.
7502 (Output_reloc<SHT_REL>::is_symbolless_): New.
7503 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7504 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7505 (Output_reloc<SHT_RELA>::is_symbolless): New.
7506 (Output_data_reloc::add_global): Handle is_symbolless.
7507 (Output_data_reloc::add_global_relative): Likewise.
7508 (Output_data_reloc::add_local): Likewise.
7509 (Output_data_reloc::add_local_relative): Likewise.
7510 (Output_data_reloc::add_symbolless_global_addend): New.
7511 (Output_data_reloc::add_symbolless_local_addend): New.
7512 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7513 is_symbolless.
7514 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7515 instead of ->is_relative_
7516 (Output_reloc::write): Likewise.
7517 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7518 (Output_reloc::write_rel): Simplify.
7519
7520 * sparc.cc (Target_sparc::Scan::local): Use
7521 ->add_symbolless_local_addend as needed.
7522 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7523 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7524 based upon relocation offset.
7525
e4782e83
DK
75262010-02-11 Doug Kwan <dougkwan@google.com>
7527
7528 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7529 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7530 beginning of function.
7531 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7532 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7533 parameter is_32bit in calls to should_apply_static_reloc.
7534 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7535 (check_DATA): Add arm_abs_global.stdout.
7536 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7537 arm_abs_global.stdout): New rules.
7538 (MOSTLLYCLEANFILES): Add arm_abs_global
7539 * Makefile.in: Regenerate.
7540 * testsuite/arm_abs_global.s: New file.
7541 * testsuite/arm_abs_global.sh: Ditto.
7542 * testsuite/arm_abs_lib.s: Ditto.
7543
93ceb764
ILT
75442010-02-11 Ian Lance Taylor <iant@google.com>
7545
7546 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7547 Read_relocs task.
7548 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7549 Allocate_commons_task first.
7550 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7551 task, rather than symtab_lock_.
7552 (Gc_process_relocs::~Gc_process_relocs): New function.
7553 (Gc_process_relocs::is_runnable): Check this_blocker_.
7554 (Gc_process_relocs::locks): Use next_blocker_ rather than
7555 blocker_.
7556 (Scan_relocs::~Scan_relocs): New function.
7557 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7558 symtab_lock_.
7559 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7560 next_blocker_.
7561 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7562 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7563 constructor accordingly.
7564 (class Gc_process_relocs): Likewise.
7565 (class Scan_relocs): Likewise.
7566 * common.h (class Allocate_commons_task): Remove symtab_lock_
7567 field, and corresponding constructor parameter.
7568 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7569 symtab_lock_.
7570 (Allocate_commons_task::locks): Likewise.
7571
114dfbe1
ILT
75722010-02-11 Ian Lance Taylor <iant@google.com>
7573
7574 * gold-threads.h (class Once): Define.
7575 (class Initialize_lock): Rewrite as child of Once.
7576 * gold-threads.cc (class Once_initialize): Define.
7577 (once_pointer_control): New static variable.
7578 (once_pointer, once_arg): New static variables.
7579 (c_run_once): New static function.
7580 (Once::Once, Once::run_once, Once::internal_run): New functions.
7581 (class Initialize_lock_once): Remove.
7582 (initialize_lock_control): Remove.
7583 (initialize_lock_pointer): Remove.
7584 (initialize_lock_once): Remove.
7585 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7586 (Initialize_lock::initialize): Rewrite.
7587 (Initialize_lock::do_run_once): New function.
7588 * archive.cc (Archive::interpret_header): Only clear name if it is
7589 not already empty.
7590 * fileread.cc: Include "gold-threads.h"
7591 (file_counts_lock): New static variable.
7592 (file_counts_initialize_lock): Likewise.
7593 (File_read::release): Only increment counts when using --stats.
7594 Use a lock around the increment.
7595 * parameters.cc (class Set_parameters_target_once): Define.
7596 (set_parameters_target_once): New static variable.
7597 (Parameters::Parameters): Move here from parameters.h.
7598 (Parameters::set_target): Rewrite.
7599 (Parameters::set_target_once): New function.
7600 (Parameters::clear_target): Move here and rewrite.
7601 * parameters.h (class Parameters): Update declarations. Add
7602 set_parameters_target_once_ field.
7603 (Parameters::Parameters): Move to parameters.cc.
7604 (Parameters::clear_target): Likewise.
7605 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7606 task.
7607 (Start_group::~Start_group): New function.
7608 (Start_group::is_runnable): New function.
7609 (Start_group::locks, Start_group::run): New functions.
7610 (Finish_group::run): Change saw_undefined to size_t.
7611 * readsyms.h (class Start_group): Define.
7612 (class Finish_group): Change saw_undefined_ field to size_t.
7613 (Finish_group::Finish_group): Remove saw_undefined and
7614 this_blocker parameters. Change all callers.
7615 (Finish_group::set_saw_undefined): New function.
7616 (Finish_group::set_blocker): New function.
7617 * symtab.h (class Symbol_table): Change saw_undefined to return
7618 size_t. Change saw_undefined_ field to size_t.
7619 * target-select.cc (Set_target_once::do_run_once): New function.
7620 (Target_selector::Target_selector): Initialize set_target_once_
7621 field. Don't initialize lock_ and initialize_lock_ fields.
7622 (Target_selector::instantiate_target): Rewrite.
7623 (Target_selector::set_target): New function.
7624 * target-select.h (class Set_target_once): Define.
7625 (class Target_selector): Update declarations. Make
7626 Set_target_once a friend. Remove lock_ and initialize_lock_
7627 fields. Add set_target_once_ field.
7628
fa17a3f4
ILT
76292010-02-10 Ian Lance Taylor <iant@google.com>
7630
7631 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7632 queueing any tasks.
7633 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7634 (queue_middle_tasks): Add all blockers before queueing any tasks.
7635 (queue_final_tasks): Likewise.
7636 * token.h (Task_token::add_blockers): New function.
7637 * object.h (Input_objects::number_of_relobjs): New function.
7638
c7177d31
ILT
76392010-02-10 Ian Lance Taylor <iant@google.com>
7640
5de0e392
ILT
7641 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7642 shared, not if not position independent.
7643 * x86_64.cc (Relocate::relocate_tls): Likewise.
7644 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7645 (tls_pie_pic_test): New target.
7646 * testsuite/Makefile.in: Rebuild.
7647
c7177d31
ILT
7648 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7649 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7650 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7651 * testsuite/Makefile.in: Rebuild.
7652
684b268a
DM
76532010-02-09 David S. Miller <davem@davemloft.net>
7654
7655 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7656 R_SPARC_RELATIVE using ->add_local_relative().
7657 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7658
612a8d3d
DM
7659 * output.h (Output_data_dynamic::add_section_size): New method
7660 that takes two Output_data objects.
7661 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7662 entry param. Handle it in initializers.
7663 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7664 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7665 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7666 arg.
7667 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7668 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7669 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7670 for dynrel_includes_plt.
7671 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7672 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7673 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7674 before .rela.plt
7675 (Target_sparc::do_finalize_sections): Update to pass true for
7676 dynrel_includes_plt.
7677 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7678 output before .rela.plt
7679 (Target_powerpc::do_finalize_sections): Update to pass true for
7680 dynrel_includes_plt when 32-bit.
7681
cb1be87e
DK
76822010-02-08 Doug Kwan <dougkwan@google.com>
7683
7684 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7685 method.
7686 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7687 Arm_relobj::scan_section_for_cortex_a8_stubs,
7688 Arm_relobj::do_relocation_section): Instead of calling
7689 Output_section::output_address, use faster
7690 Arm_relobj::simple_input_section_output_address.
7691
705b5121
DM
76922010-02-08 David S. Miller <davem@davemloft.net>
7693
7694 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7695 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7696 relocation helper function.
7697
024c4466
DM
7698 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7699 just like R_SPARC_GOT{10,13,22}.
7700 (Target_sparc::Scan::local): Likewise.
7701 (Target_sparc::Relocate:relocate): Likewise.
7702
9109c078
ILT
77032010-02-06 Ian Lance Taylor <iant@google.com>
7704
7705 * configure.ac: Rewrite targetobjs duplicate removal code to use
7706 only shell constructs.
7707 * configure: Rebuild.
7708
cf846138
DK
77092010-02-05 Doug Kwan <dougkwan@google.com>
7710
7711 PR 11247
7712 * arm.cc (Arm_relobj::section_is_scannable): New method.
7713 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7714 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7715
6cfaf60b
DK
77162010-02-04 Doug Kwan <dougkwan@google.com>
7717
7718 PR 11247
7719 * arm-reloc-property.cc (cstdio): Include.
7720 * configure.ac (targetobjs): Remove duplicates.
7721 * configure: Regenerate.
7722 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7723 big and little endian version for a given address size.
7724
5c57f1be
DK
77252010-02-03 Doug Kwan <dougkwan@google.com>
7726
7727 * arm-reloc-property.cc
7728 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7729 definition.
7730 * arm-reloc-property.h
7731 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7732 New method definition.
7733 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7734 declaration.
7735 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7736 overflow to N.
7737 (GOT_PREL): Change implemented to Y.
7738 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7739 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7740 (Arm_relocate_functions::movw_abs_nc): Remove method.
7741 (Arm_relocate_functions::movt_abs): Ditto.
7742 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7743 (Arm_relocate_functions::thm_movt_abs): Ditto.
7744 (Arm_relocate_functions::movw_rel_nc): Ditto.
7745 (Arm_relocate_functions::movw_rel): Ditto.
7746 (Arm_relocate_functions::movt_rel): Ditto.
7747 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7748 (Arm_relocate_functions:thm_movw_rel): Ditto.
7749 (Arm_relocate_functions:thm_movt_rel): Ditto.
7750 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7751 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7752 New method definitions.
7753 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7754 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7755 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7756 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7757 (Target_arm::Relocate::relocate): Check for non-static or
7758 unimplemented relocation code and exit early. Change calls to
7759 Target_arm::reloc_uses_thumb_bit and
7760 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7761 instead. Refactor code to handle similar relocations to increase
7762 code sharing. Remove check for unsupported relocation code in switch
7763 statement.
7764 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7765 relocation property table to find out size. Change error message to
7766 print out the name of a relocation code instead of the numeric value.
7767 (Target_arm::scan_reloc_for_stub): Use relocation property table
7768 instead of calling Target_arm::reloc_uses_thumb_bit().
7769
218c5831
DK
77702010-02-02 Doug Kwan <dougkwan@google.com>
7771
7772 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7773 types of relaxed input section.
7774
0d31c79d
DK
77752010-02-02 Doug Kwan <dougkwan@google.com>
7776
7777 * Makefile.am (HFILES): Add arm-reloc-property.h.
7778 (DEFFILES): New.
2e702c99
RM
7779 (TARGETSOURCES): Add arm-reloc-property.cc
7780 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7781 (libgold_a_SOURCES): $(DEFFILES)
7782 * Makefile.in: Regenerate.
7783 * arm-reloc-property.cc: New file.
7784 * arm-reloc-property.h: New file.
7785 * arm-reloc.def: New file.
7786 * arm.cc: Update comments.
7787 (arm-reloc-property.h): New included header.
7788 (arm_reloc_property_table): New global variable.
7789 (Target_arm::do_select_as_default_target): New method definition.
7790 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7791 arm-reloc-property to targ_extra_obj.
7792 * parameters.cc (set_parameters_target): Call
7793 Target::select_as_default_target().
7794 * target.h (Target::select_as_default_target): New method definition.
7795 (Target::do_select_as_default_target): Same.
7796
546c7457
DK
77972010-02-01 Doug Kwan <dougkwan@google.com>
7798
7799 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7800 first_output_text_section_.
7801 (Arm_exidx_fixup::first_output_text_section): New method definition.
7802 (Arm_exidx_fixup::first_output_text_section_): New data member.
7803 (Arm_exidx_fixup::process_exidx_section): Record the first text
7804 output section seen.
7805 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7806 and entsize in output section header.
7807
11b861d5
DK
78082010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7809
7810 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7811 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7812 (Arm_relocate_functions::thm_alu11): New Method.
7813 (Arm_relocate_functions::thm_pc8): New Method.
7814 (Arm_relocate_functions::thm_pc12): New Method.
7815 (Target_arm::Scan::local): Handle the relocations.
7816 (Target_arm::Scan::global): Likewise.
7817 (Target_arm::Relocate::relocate): Likewise.
7818 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7819
c9a2c125
DK
78202010-01-29 Doug Kwan <dougkwan@google.com>
7821
7822 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7823 of relocation types as ld.
7824
1521477a
DK
78252010-01-29 Doug Kwan <dougkwan@google.com>
7826
7827 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7828 to public.
7829 (Arm_relocate_functions::thumb_branch_common): Ditto.
7830 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7831 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7832 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7833 Arm_relocate_functions::jump24): Remove.
7834 (Target_arm::Relocate::relocate): Adjust code to call
7835 Arm_relocation_functions::arm_branch_common and
7836 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7837 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7838
e7eca48c
DK
78392010-01-29 Doug Kwan <dougkwan@google.com>
7840
7841 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7842 output_local_symbol_count_needs_update_.
7843 (Arm_relobj::output_local_symbol_count_needs_update,
7844 Arm_relobj::set_output_local_symbol_count_needs_update,
7845 Arm_relobj::update_output_local_symbol_count): New methods.
7846 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7847 member.
7848 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7849 of pointed function as in a R_ARM_PREL31 relocation.
7850 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7851 for output local symbol count updating.
7852 (Target_arm::do_relax): Update output local symbol counts in objects
7853 if necessary.
7854 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7855
02961d7e
ILT
78562010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7857
7858 * arm.cc: Added support for the ARM relocations:
7859 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7860 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7861 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7862 movw_prel_nc).
7863 (Arm_relocate_functions::movw_rel): New method.
7864 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7865 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7866 thm_movw_prel_nc).
7867 (Arm_relocate_functions::thm_movw_rel): New method.
7868 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7869 thm_movt_prel).
7870 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7871 relocations.
7872 (Target_arm::Scan::global): Likewise.
7873 (Target_arm::Relocate::relocate): Likewise.
7874 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7875 Likewise.
7876
b10d2873
ILT
78772010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7878
7879 * arm.cc: Added support for ARM group relocations.
7880 (Target_arm::reloc_needs_sym_origin): New method.
7881 (Arm_relocate_functions::calc_grp_kn): New method.
7882 (Arm_relocate_functions::calc_grp_residual): New method.
7883 (Arm_relocate_functions::calc_grp_gn): New method.
7884 (Arm_relocate_functions::arm_grp_alu): New Method.
7885 (Arm_relocate_functions::arm_grp_ldr): New Method.
7886 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7887 (Arm_relocate_functions::arm_grp_ldc): New Method.
7888 (Target_arm::Scan::local): Handle the ARM group relocations.
7889 (Target_arm::Scan::global): Likewise.
7890 (Target_arm::Relocate::relocate): Likewise.
7891 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7892 Likewise.
7893
2b328d4e
DK
78942010-01-26 Doug Kwan <dougkwan@google.com>
7895
7896 * arm.cc (set): Include.
7897 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7898 pointer type.
2e702c99 7899 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7900 (Arm_output_section::append_text_sections_to_list): New method.
7901 (Arm_output_section::fix_exidx_coverage): Ditto.
7902 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7903 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7904 Relobj::set_section_offset() instead of
7905 Sized_relobj::invalidate_section_offset().
2e702c99 7906 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7907 parameter for section headers. Ignore relocation sections for
7908 unallocated sections and EXIDX sections.
7909 (Target_arm::fix_exidx_coverage): New method.
7910 (Target_arm::output_section_address_less_than): New type.
7911 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7912 linked text section instead of the EXIDX section.
7913 (Arm_output_section::create_stub_group): Add an assertion to check
7914 that this is not an EXIDX output section.
7915 (Arm_output_section::append_text_sections_to_list): New method.
7916 (Arm_output_section::fix_exidx_coverage): Ditto.
7917 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7918 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7919 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7920 first pass.
7921 (Target_arm::fix_exidx_coverage): New method.
7922 * object.h (Relobj::set_output_section): New method.
7923 (Sized_relobj::invalidate_section_offset): Remove method.
7924 (Sized_relobj::do_invalidate_section_offset): Remove method.
7925 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7926
c7f3c371
DK
79272010-01-25 Doug Kwan <dougkwan@google.com>
7928
7929 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7930 Fix warning due to signed and unsigned comparison on a 32-bit host.
7931
8923b24c
DK
79322010-01-22 Doug Kwan <dougkwan@google.com>
7933
7934 * arm.cc (Target_arm::do_relax): Record an output section for section
7935 offset adjustment it contains any stub table that has changed.
7936 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7937 offsets in an output section if necessary.
7938 * output.cc (Output_section::Output_section): Initialize
7939 section_offsets_need_adjustments_.
7940 (Output_section::add_input_section_for_script): Renamed to
7941 Output_section::add_simple_input_section.
7942 (Output_section::save_states): Add a comment.
7943 (Output_section::discard_states): New method defintion.
7944 (Output_section::adjust_section_offsets): Same.
7945 * output.h (Output_section::add_input_section_for_script): Renamed to
7946 Output_section::add_simple_input_section.
7947 (Output_section::discard_states): New method declaration.
7948 (Output_section::adjust_section_offsets): Same.
7949 (Output_section::section_offsets_need_adjustment,
7950 Output_section::set_section_offsets_need_adjustment): New method
7951 definitions.
7952 (Output_section::section_offsets_need_adjustment_): New data member.
7953 * script-sections.cc
7954 (Output_section_element_input::set_section_address): Adjust code for
7955 renaming of Output_section::add_input_section_for_script.
7956 (Orphan_output_section::set_section_address): Same.
7957
9b2fd367
DK
79582010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7959
7960 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7961 Fix_v4bx enum values .
7962 * gold/options.h (General_options): New option definitions.
7963 (General_options::fix_v4bx): New method.
7964 (General_options::Fix_v4bx): New enum.
7965 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7966 (General_options::parse_fix_v4bx_interworking): New method.
7967
80d0d023
DK
79682010-01-22 Doug Kwan <dougkwan@google.com>
7969
7970 * arm.cc (Arm_exidx_fixup): New class.
7971
af2cdeae
DK
79722010-01-21 Doug Kwan <dougkwan@google.com>
7973
7974 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7975 classes.
7976 (Arm_exidx_section_offset_map): New type.
7977
993d07c1
DK
79782010-01-21 Doug Kwan <dougkwan@google.com>
7979
7980 * arm.cc (Arm_exidx_input_section): New class.
7981 (Arm_relobj::exidx_input_section_by_link,
7982 Arm_relobj::exidx_input_section_by_shndx,
7983 Arm_relobj::make_exidx_input_section): New methods.
7984 (read_arm_attributes_section): Remove.
7985 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7986 information about them.
7987 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7988 to here.
7989
5ac169d4
DK
79902010-01-20 Doug Kwan <dougkwan@google.com>
7991
7992 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7993 Input_section_specifier to Section_id.
7994 (Target_arm::new_arm_input_section: Adjust code for change of key
7995 type.
7996 (Target_arm::find_arm_input_section): Ditto.
7997 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7998 (Section_id): Remove.
7999 (Garbage_collection::Section_id_hash): Remove.
8000 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8001 (Section_id): Remove.
8002 (Icf::Section_id_hash): Remove.
8003 * object.h (Section_id, Const_section_id, Section_id_hash,
8004 Const_section_id_hash): New type definitions.
8005 * output.cc (Output_section::add_relaxed_input_section): Change to
8006 use Const_section_id instead of Input_section_specifier as key type.
8007 (Output_section::add_merge_input_section): Ditto.
8008 (Output_section::build_relaxation_map): Change to use Section_id
8009 instead of Input_section_specifier as key type.
2e702c99 8010 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8011 Ditto.
8012 (Output_section::convert_input_sections_to_relaxed_sections): Change
8013 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8014 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8015 (Output_section::find_relaxed_input_section): Ditto.
8016 * output.h (Input_section_specifier): Remove class.
8017 (Output_section::Output_section_data_by_input_section_map): Change
8018 key type to Const_section_id.
8019 (Output_section::Output_relaxed_input_section_by_input_section_map):
8020 Ditto.
8021 (Output_section::Relaxation_map): Change key type to Section_id.
8022
a2162063
ILT
80232010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8024
8025 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8026 (class Arm_v4bx_stub): New class.
8027 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8028 (Stub_factory::make_arm_v4bx_stub): New method.
8029 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8030 (Stub_table::empty): Handle v4bx stubs.
8031 (Stub_table::add_arm_v4bx_stub): New method.
8032 (Stub_table::find_arm_v4bx_stub): New method.
8033 (Arm_relocate_functions::v4bx): New method.
8034 (Target_arm::fix_v4bx): New method.
8035 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8036 (Stub_table::relocate_stubs): Likewise.
8037 (Stub_table::do_write): Likewise.
8038 (Stub_table::update_data_size_and_addralign): Likewise.
8039 (Stub_table::finalize_stubs): Likewise.
8040 (Target_arm::Scan::local): Likewise.
8041 (Target_arm::Scan::global): Likewise.
8042 (Target_arm::do_finalize_sections): Likewise.
8043 (Target_arm::Relocate::relocate): Likewise.
8044 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8045 Likewise.
8046 (Target_arm::scan_reloc_for_stub): Likewise.
8047 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8048
5696ab0b
ILT
80492010-01-19 Ian Lance Taylor <iant@google.com>
8050
8051 * output.cc (Output_section_headers::do_sized_write): Write large
8052 segment count to sh_info field.
8053 (Output_file_header::do_sized_write): For large segment count,
8054 write PN_XNUM to e_phnum field.
8055
800d0f56
ILT
80562010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8057
8058 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8059 (Arm_relocate_functions::thm_jump8): New function.
8060 (Arm_relocate_functions::thm_jump11): New function.
8061 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8062 R_ARM_THM_JUMP11.
8063 (Target_arm::Scan::global): Likewise.
8064 (Target_arm::Relocate::relocate): Likewise.
8065 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8066 Likewise.
8067
41263c05
DK
80682010-01-14 Doug Kwan <dougkwan@google.com>
8069
8070 * arm.cc (map, utility): Include headers.
8071 (Target_arm::apply_cortex_a8_workaround): New method.
8072 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8073 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8074 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8075 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8076 the --[no-]fix-cortex-a8 command line options.
8077 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8078 (Target_arm::relocate_stub): Use addend in instruction template.
8079 * options.h (DEFINE_bool): Set the user-set flag.
8080 (General_options): Add --[no-]-fix-cortex options.
8081 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8082 : Update fast look-up map after conversion.
41263c05 8083
459e9b03
ST
80842010-01-14 Sriraman Tallam <tmsriram@google.com>
8085
8086 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8087 in the first pass of do_layout.
8088
b521dfe4
DK
80892010-01-13 Doug Kwan <dougkwan@google.com>
8090
8091 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8092 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8093 apparent compiler problem of not folding static constant integral
8094 data members of elfcpp::Elf_sizes<32>.
8095
44272192
DK
80962010-01-13 Doug Kwan <dougkwan@google.com>
8097
8098 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8099 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8100 Arm_relobj::scan_section_for_cortex_a8_erratum,
8101 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8102 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8103 sections to scan for relocation stubs into a new method
8104 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8105 relocation and Cortex-A8 stub scanning.
8106 (Target_arm::do_relax): Force stubs to be after stubbed sections
8107 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8108 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8109 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8110
44b71ece
ILT
81112010-01-12 Ian Lance Taylor <iant@google.com>
8112
8113 * target-reloc.h (visibility_error): New inline function.
8114 (relocate_section): Call visibility_error.
8115 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8116 (MOSTLYCLEANFILES): Likewise.
8117 (protected_4_pic.o, protected_3.err): New targets.
8118 * testsuite/protected_4.cc: New file.
8119
a120bc7f
DK
81202010-01-12 Doug Kwan <dougkwan@google.com>
8121
8122 * arm.cc (Cortex_a8_reloc): New class.
8123 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8124 and cortex_a8_relocs_info_.
8125 (Target_arm::fix_cortex_a8): New method definition.
8126 (Target_arm::Cortex_a8_relocs_info): New type.
8127 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8128 New data member declarations.
8129 (Target_arm::scan_reloc_for_stub): Record information about
8130 relocations for THUMB branches that might be exempted from the
8131 Cortex-A8 workaround.
8132 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8133 at the beginning of a relaxation pass.
8134
20138696
DK
81352010-01-12 Doug Kwan <dougkwan@google.com>
8136
8137 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8138 (Arm_relobj::Mapping_symbol_position,
8139 Arm_reloj::Mapping_symbol_position_less,
8140 Arm_relobj::Mapping_symbols_info): New types.
8141 (Target_arm::is_mapping_symbol_name): New method definition.
8142 (Arm_relobj::do_count_local_symbols): Save information about mapping
8143 symbols.
8144
089d69dc
DK
81452010-01-11 Doug Kwan <dougkwan@google.com>
8146
8147 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8148 Arm_relocate_functions::thumb32_branch_upper,
8149 Arm_relocate_functions::thumb32_branch_lower,
8150 Arm_relocate_functions::thumb32_cond_branch_offset,
8151 Arm_relocate_functions::thumb32_cond_branch_upper,
8152 Arm_relocate_functions::thumb32_cond_branch_lower,
8153 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8154 branch offset encoding.
8155 (Arm_relocate_functions::thumb_branch_common): Use new branch
8156 offset encoding methods to avoid code duplication.
8157 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8158 (Stub_addend_reader::operator()): Use new branch encoding method
8159 to avoid code duplication.
8160
99e5bff2
DK
81612010-01-11 Doug Kwan <dougkwan@google.com>
8162
8163 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8164 (Target_arm::do_finalize_sections): Define special EXIDX section
8165 symbols only if referenced.
8166 * gc.h (Garbage_collection::add_reference): New method.
8167 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8168 code duplication.
8169
98e090bd
ILT
81702010-01-11 Ian Lance Taylor <iant@google.com>
8171
d0a91bd8
ILT
8172 * script.cc (Version_script_info::build_expression_list_lookup):
8173 Change complaing about duplicate wildcard match from error to
8174 warning.
8175
98e090bd
ILT
8176 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8177 of 2009-12-30.
8178 (Version_script_info::Version_script_info): Initialize globs_,
8179 default_version_, default_is_global_, and exact_. Don't
8180 initialize globals_ or locals_.
8181 (Version_script_info::build_lookup_tables): Build local symbols
8182 first.
8183 (Version_script_info::unquote): New function.
8184 (Version_script_info::add_exact_match): New function.
8185 (Version_script_info::build_expression_list_lookup): Remove lookup
8186 parameter. Add is_global parameter. Change all callers. Handle
8187 wildcard pattern specially. Unquote pattern. Call
8188 add_exact_match.
8189 (Version_script_info::get_name_to_match): New function.
8190 (Version_script_info::get_symbol_version): New function.
8191 (Version_script_info::get_symbol_version_helper): Remove.
8192 (Version_script_info::check_unmatched_names): Call unquote.
8193 * script.h (class Version_script_info): Change get_symbol_version
8194 to be non-inline and add is_global parameter; change all callers.
8195 Rewrite symbol_is_local. Update declarations. Define struct
8196 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8197 Remove globals_ and locals_ members. Add exact_, globs_,
8198 default_version_, is_global_.
8199 (Version_script_info::Glob): Remove pattern, add expression and
8200 is_global. Update constructor. Change all callers.
8201 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8202 default version.
8203 (Versions::symbol_section_contents): If a symbol is undefined, or
8204 defined in a dynamic object, set the version index to
8205 VER_NDX_LOCAL.
8206 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8207 symbol_is_local.
8208 (Symbol_table::add_from_pluginobj): Likewise.
8209 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8210
d56962d3
DK
82112010-01-11 Doug Kwan <dougkwan@google.com>
8212
8213 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8214 (incremental_dump_LDADD): Add linking option for libintl.
8215 * Makefile.in: Regenerate.
8216
94e6ee91
L
82172010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8218
8219 PR gold/11144
8220 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8221 instead of -Ds.
8222 * testsuite/Makefile.in: Regenerated.
8223
e96c574b
DK
82242010-01-10 Doug Kwan <dougkwan@google.com>
8225
8226 * options.h (DEFINE_var): Use parentheses around argument varname__
8227 in macro body to avoid any unintended subsequent substitutions.
8228
7198066b
ILT
82292010-01-10 Ian Lance Taylor <iant@google.com>
8230
ba4d53bf
ILT
8231 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8232 candidates before doing symbol resolution.
8233
7198066b
ILT
8234 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8235 ODR candidates if only one is weak.
8236
a2beed37
ILT
82372010-01-08 Ian Lance Taylor <iant@google.com>
8238
8239 * script.cc (Version_script_info::build_expression_list_lookup):
8240 Don't warn about ambiguous version, just record the ambiguity.
8241 (Version_script_info::get_symbol_version_helper): Give error if
8242 version is ambiguous.
8243
2fb7225c
DK
82442010-01-08 Doug Kwan <dougkwan@google.com>
8245
8246 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8247 prev_data_size_ and prev_addralign_. Remove initializer for
8248 deleted data member has_been_changed_.
8249 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8250 to determine if the table is empty.
8251 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8252 Remove.
8253 (Stub_table::add_reloc_stub): Define method in class definition
8254 instead of just declaring it there.
8255 (Stub_table::add_cortex_a8_stub): New method definition.
8256 (Stub_table::update_data_size_and_addralign): Ditto.
8257 (Stub_table::finalize_stubs): Ditto.
8258 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8259 (Stub_table::do_addralign_): Return address alignment in the
8260 (Stub_table::do_reset_address_and_file_offset): Define method in
8261 class definition instead of declaring it there. Set current data
8262 size to be the data size of the previous pass.
8263 (Stub_table::set_final_data_size): Use current data size as the
8264 final data size.
8265 (Stub_table::relocate_stub): Change parameter type of stub from
8266 Reloc_stub pointer to Stub pointer.
8267 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8268 (Stub_table::Cortex_a8_stub_list): New typedef.
8269 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8270 Stub_table::prev_addralign_): New data member.
8271 (Arm_relobj::Arm_relobj): Initialize data member
8272 section_has_cortex_a8_workaround_.
8273 (Arm_relobj::section_has_cortex_a8_workaround,
8274 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8275 definitions.
8276 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8277 declarations.
8278 (Target_arm::relocate_stub): Change parameter type of stub from
8279 Reloc_stub pointer to Stub pointer.
8280 (Insn_template::size, Insn_template::alignment): Handle
8281 THUMB16_SPECIAL_TYPE.
8282 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8283 Stub_table::update_data_size_and_addralign,
8284 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8285 definitions.
8286 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8287 (Stub_table::do_write): Ditto.
8288 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8289
880cd20d
ILT
82902010-01-08 Ian Lance Taylor <iant@google.com>
8291
8292 PR 11108
8293 * symtab.h (class Symbol): Remove fields is_target_special_ and
8294 has_plt_offset_. Add field is_defined_in_discarded_section_.
8295 (Symbol::is_defined_in_discarded_section): New function.
8296 (Symbol::set_is_defined_in_discarded_section): New function.
8297 (Symbol::has_plt_offset): Rewrite.
8298 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8299 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8300 Don't initialize is_target_special_ or has_plt_offset_.
8301 Initialize is_defined_in_discarded_section_.
8302 (Symbol_table::add_from_relobj): If appropriate, set
8303 is_defined_in_discarded_section.
8304 * resolve.cc (Symbol::override_base_with_special): Don't test
8305 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8306 * target-reloc.h (relocate_section): Do special handling for
8307 symbols defined in discarded sections for global symbols as well
8308 as local symbols.
8309
2703e3eb
ILT
83102010-01-08 Ian Lance Taylor <iant@google.com>
8311
8312 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8313 the SHT_SYMTAB case.
8314
339d40a3
ILT
83152010-01-08 Ian Lance Taylor <iant@google.com>
8316
8317 * object.cc (Sized_relobj::do_layout): Don't get confused if
8318 layout_eh_frame returns NULL.
8319
abecea76
ILT
83202010-01-08 Ian Lance Taylor <iant@google.com>
8321
8322 PR 11084
8323 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8324 dynamic symbol table, use the normal symbol table.
8325 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8326 symbol table.
8327
6b7dd3f3
ILT
83282010-01-08 Ian Lance Taylor <iant@google.com>
8329
8330 PR 11072
8331 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8332 sections.
8333
36c50e63
L
83342010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8335
8336 * version.cc (print_version): Change to "Copyright 2010".
8337
e291e7b9
ILT
83382010-01-08 Ian Lance Taylor <iant@google.com>
8339
8340 PR 10287
8341 PR 11063
8342 * i386.cc (class Target_i386): Change return type of plt_section
8343 to be non-const.
8344 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8345 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8346 tls_desc_rel_ field.
8347 (Output_data_plt_i386::rel_tls_desc): New function.
8348 (Target_i386::rel_tls_desc_section): New function.
8349 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8350 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8351 R_386_TLS_DESC reloc in rel_tls_desc_section.
8352 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8353 Define struct Tlsdesc_info.
8354 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8355 (Target_x86_64::do_reloc_symbol_index): New function.
8356 (Target_x86_64::add_tlsdesc_info): New function.
8357 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8358 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8359 tlsdesc_rel_ field.
8360 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8361 all callers.
8362 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8363 (Target_x86_64::rela_tlsdesc_section): New function.
8364 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8365 handling.
8366 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8367 (Target_x86_64::do_reloc_addend): New function.
8368 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8369 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8370 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8371 (Output_reloc::type): New function.
8372 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8373 (Output_reloc::is_target_specific): New function.
8374 (Output_reloc::target_arg): New function.
8375 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8376 absolute relocs and target specific relocs.
8377 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8378 add_target_specific.
8379 (class Output_data_reloc) [SHT_RELA]: Likewise.
8380 * output.cc (Output_reloc::Output_reloc): Add four new versions
8381 for absolute relocs and target specific relocs.
8382 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8383 (Output_reloc::get_symbol_index): Likewise.
8384 (Output_reloc::local_section_offset): Check that local_sym_index_
8385 is not TARGET_CODE or 0.
8386 (Output_reloc::symbol_value): Likewise.
8387 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8388 reloc.
8389 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8390 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8391 functions.
8392 * layout.cc (add_target_dynamic_tags): Use output section for
8393 DT_PLTRELSZ and DT_JMPREL.
8394
3a44184e
ILT
83952010-01-07 Ian Lance Taylor <iant@google.com>
8396
8397 PR 11061
8398 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8399 function.
8400 (class Output_data_reloc_generic): Define.
8401 (class Output_data_reloc_base): Change base class to
8402 Output_data_reloc_generic. Change add() method to call
8403 bump_relative_reloc_count for a relative reloc. Remove
8404 sort_relocs_ field.
8405 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8406 to sort_relocs().
8407 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8408 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8409 appropriate.
8410 * layout.h (class Layout): Update declaration.
8411
ea715a34
ILT
84122010-01-07 Ian Lance Taylor <iant@google.com>
8413
8414 * output.h (class Output_data): Add const version of
8415 output_section and do_output_section.
8416 (class Output_section_data): Add const version of
8417 do_output_section.
8418 (class Output_section): Likewise.
8419 * layout.cc (Layout::add_target_dynamic_tags): New function.
8420 * layout.h (class Layout): Update declarations.
8421 * arm.cc (Target_arm::do_finalize_sections): Use
8422 add_target_dynamic_tags.
8423 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8424 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8425 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8426 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8427
659948a4
ILT
84282010-01-07 Ian Lance Taylor <iant@google.com>
8429
8430 PR 11042
8431 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8432 object as needed.
8433
9d3b86f6
ILT
84342010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8435 Ian Lance Taylor <iant@google.com>
8436
8437 PR 11019
8438 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8439 Xindex::read_symtab_xindex.
8440
bb0d3eb0
DK
84412010-01-07 Doug Kwan <dougkwan@google.com>
8442
8443 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8444 (Insn_template::thumb16_bcond_insn): New method declaration.
8445 (Insn_template): Fix spelling.
8446 (Stub::thumb16_special): New method declaration.
8447 (Stub::do_write): Define virtual method which was previously pure
8448 virtual.
8449 (Stub::do_thumb16_special): New method declaration.
8450 (Stub::do_fixed_endian_write): New template member.
8451 (Reloc_stub::do_write): Remove.
8452 (Reloc_stub::do_fixed_endian_write): Remove.
8453 (Cortex_a8_stub): New class definition.
8454 (Stub_factory::make_cortex_a8_stub): New method definition.
8455 (Stub_factory::Stub_factory): Add missing static storage class
8456 qualifier for elf32_arm_stub_a8_veneer_blx.
8457
ffeef7df
ILT
84582010-01-07 Ian Lance Taylor <iant@google.com>
8459
dc3f80fe
ILT
8460 PR 10980
8461 * options.h (class General_options): Add --warn-unresolved-symbols
8462 and --error-unresolved-symbols.
8463 * errors.cc (Errors::undefined_symbol): Implement
8464 --warn-unresolved-symbols.
8465
ffeef7df
ILT
8466 * options.h (class General_options): Add -z text and -z textoff.
8467 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8468
f1ec9ded
ST
84692010-01-06 Sriraman Tallam <tmsriram@google.com>
8470
8471 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8472 (Garbage_collection::cident_sections): New function.
8473 (Garbage_collection::add_cident_section): New function.
8474 (Garbage_collection::cident_sections_): New member.
8475 (gc_process_relocs): Add references to sections whose names are C
8476 identifiers.
8477 * gold.h (cident_section_start_prefix): New constant.
8478 (cident_section_stop_prefix): New constant.
8479 (is_cident): New function.
8480 * layout.cc (Layout::define_section_symbols): Replace string constants
8481 with the newly defined constants.
8482 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8483 C identifiers.
8484 * testsuite/Makefile.am: Add gc_orphan_section_test.
8485 * testsuite/Makefile.in: Regenerate.
8486 * testsuite/gc_orphan_section_test.cc: New file.
8487 * testsuite/gc_orphan_section_test.sh: New file.
8488
6eda8c29
ILT
84892010-01-06 Ian Lance Taylor <iant@google.com>
8490
b9674e17
ILT
8491 PR 10980
8492 * options.h (class General_options): Add --warn-shared-textrel.
8493 * layout.cc (Layout::finish_dynamic_section): Implement
8494 --warn-shared-textrel.
8495
6eda8c29
ILT
8496 PR 10980
8497 * options.h (class General_options): Add --warn-multiple-gp.
8498
32dcd44e
ILT
84992010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8500
8501 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8502 $(THREADSLIB) and $(LIBDL).
8503 * Makefile.in: Rebuild.
8504
a192ba05
ILT
85052010-01-06 Ian Lance Taylor <iant@google.com>
8506
8507 PR 10980
8508 * options.cc (General_options::parse_section_start): New function.
8509 (General_options::section_start): New function.
8510 (General_options::General_options): Initialize all members.
8511 * options.h: Include <map>
8512 (class General_options): Add --section-start. Add section_starts_
8513 member.
8514 * layout.cc (Layout::attach_allocated_section_to_segment): If
8515 --section-start was used, set the address of the segment. Remove
8516 local sort_sections.
8517 (Layout::relaxation_loop_body): If the address of the load segment
8518 has been set by --section-start, don't use it.
8519 * output.h (Output_segment::update_flags_for_output_section): New
8520 function.
8521 * output.cc (Output_segment::add_output_section): Call
8522 update_flags_for_output_section.
8523
dde3f402
ILT
85242010-01-05 Ian Lance Taylor <iant@google.com>
8525
62dfdd4d
ILT
8526 PR 10980
8527 * options.h (class General_options): Add --undefined-version.
8528 * script.cc (struct Version_expression): Add was_matched_by_symbol
8529 field.
8530 (Version_script_info::matched_symbol): New function.
8531 (Version_script_info::get_symbol_version_helper): Call
8532 matched_symbol.
8533 (Version_script_info::check_unmatched_names): New function.
8534 * script.h (class Version_script_info): Update declarations.
8535 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8536
9c4ae156
ILT
8537 * options.h (class General_options): Use DEFINE_bool_alias for
8538 allow_multiple_definition.
8539 * resolve.cc (Symbol_table::should_override): Don't test
8540 allow_multiple_definition.
8541
dde3f402
ILT
8542 PR 10980
8543 * options.h (class General_options): Add --cref.
8544 * main.cc (main): Print cref table if --cref. Don't close mapfile
8545 until after printing cref table.
8546 * cref.cc: Include "symtab.h".
8547 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8548 (Cref_table_compare::operator()): New function.
8549 (Cref_inputs::gather_cref): New function.
8550 (filecol): New static const.
8551 (Cref_inputs::print_cref): New function.
8552 (Cref::print_cref): New function.
8553 * cref.h: Include <cstdio>.
8554 (class Cref): Update declarations.
8555 * mapfile.h (Mapfile::file): New function.
8556 * object.h (class Object): Define Symbols. Declare virtual
8557 do_get_global_symbols.
8558 (Object::get_global_symbols): New function.
8559 * object.cc (Input_objects::add_object): Pass object to cref_ if
8560 --cref.
8561 (Input_objects::archive_start): Likewise.
8562 (Input_objects::archive_stop): Likewise.
8563 (Input_objects::print_cref): New function.
8564 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8565 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8566 --cref.
8567 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8568 function.
8569 * plugin.h (class Sized_pluginobj): Update declarations.
8570
8781f709
ILT
85712010-01-05 Ian Lance Taylor <iant@google.com>
8572
8573 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8574 to is_default_version. Rename insdef to insdefault.
8575 (Symbol_table::add_from_relobj): Rename def to is_default_version
8576 and local to is_forced_local.
8577 (Symbol_table::add_from_pluginobj): Likewise.
8578 (Symbol_table::add_from_dynobj): Likewise.
8579 (Symbol_table::define_special_symbol): Rename insdef to
8580 insdefault.
8581
fe35d28d
ILT
85822010-01-04 Ian Lance Taylor <iant@google.com>
8583
30bc8c46
ILT
8584 PR 10980
8585 * options.h (class General_options): Add
8586 --allow-multiple-definition and -z muldefs.
8587 * resolve.cc (Symbol_table::should_override): Don't warn about a
8588 multiple symbol definition if --allow-multiple-definition or -z
8589 muldefs.
8590
7eaea549
ILT
8591 PR 10980
8592 * options.h (class General_options): Add --add-needed and
8593 --copy-dt-needed-entries. Tweak --as-needed help entry.
8594 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8595 error if --copy-dt-needed-entries aka --add-needed is used and
8596 would cause a change in behaviour.
8597
fe35d28d
ILT
8598 PR 10980
8599 * options.h (class General_options): Add -G as a short version of
8600 --shared. Add no-op options -assert, -g, and -i.
8601
55a2bb35
ST
86022010-01-04 Sriraman Tallam <tmsriram@google.com>
8603
8604 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8605 check for .text or .gnu.linkonce.t sections.
8606 * icf.cc (Icf::find_identical_sections): Ditto.
8607 Change the detection for mangled function name within the section
8608 name.
8609 * icf.h (is_section_foldable_candidate): New function.
8610
719328e1
ILT
86112009-12-30 Ian Lance Taylor <iant@google.com>
8612
8613 PR 10980
8614 * options.h (class General_options): Permit two dashes with
8615 --retain-symbols-file.
8616
d7bb5745
ILT
86172009-12-30 Ian Lance Taylor <iant@google.com>
8618
403a15dd
ILT
8619 PR 10979
8620 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8621 don't put the file header and segment headers in the text
8622 segment.
8623
eda294df
ILT
8624 PR 10979
8625 * common.cc (Sort_commons::operator()): Stabilize sort when both
8626 entries are NULL.
8627 (Symbol_table::do_allocate_commons_list): When allocating common
8628 symbols, skip a symbol which is no longer common.
8629 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8630 an object before checking its type.
8631 * testsuite/common_test_2.c: New file.
8632 * testsuite/common_test_3.c: New file.
8633 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8634 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8635 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8636 (common_test_2_pic.o, common_test_2.so): New targets.
8637 (common_test_3_pic.o, common_test_3.so): New targets.
8638 * testsuite/Makefile.in: Rebuild.
8639
d7bb5745
ILT
8640 PR 10979
8641 * script.cc (read_input_script): If we see a new SECTIONS clause,
8642 and we have added an input section, give an error.
8643 * layout.h (class Layout): Add have_added_input_section function.
8644 Add have_added_input_section_ field.
8645 * layout.cc (Layout::Layout): Initialize
8646 have_added_input_section_.
8647 (Layout::layout): Set have_added_input_section_.
8648 (Layout::layout_eh_frame): Likewise.
8649
fc59c572
ILT
86502009-12-30 Ian Lance Taylor <iant@google.com>
8651
8652 PR 10931
8653 * options.h (class General_options): Add --sort-common option.
8654 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8655 * common.cc (Sort_common): Add sort_order parameter to
8656 constructor. Add sort_order_ field.
8657 (Sort_commons::operator): Check sort_order_.
8658 (Symbol_table::allocate_commons): Determine the sort order.
8659 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8660 Change all callers.
8661 (Symbol_table::do_allocate_commons_list): Likewise.
8662
1c74fab0
ILT
86632009-12-30 Ian Lance Taylor <iant@google.com>
8664
8665 PR 10916
8666 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8667 symbols from this object, don't change the visibility of an
8668 undefined symbol.
8669 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8670
6affe781
ILT
86712009-12-30 Ian Lance Taylor <iant@google.com>
8672
8673 PR 10861
8674 * script.h (class Version_script_info): Define Language enum.
8675 Update declarations. Define Glob, Exact, and Lookup types. Add
8676 new fields globals_, locals_, and is_finalized_.
8677 * script.cc: Various formatting fixes.
8678 (class Parser_closure): Change language_stack_ from a vector of
8679 std::string to one of Version_script_info::Language. Adjust all
8680 uses accordingly.
8681 (class Lazy_demangler): Remove.
8682 (struct Version_expression): Change language from std::string to
8683 Version_script_info::Language.
8684 (Version_script_info::Version_script_info): New function.
8685 (Version_script_info::~Version_script_info): Don't call clear.
8686 (Version_script_info::finalize): New function.
8687 (Version_script_info::build_lookup_tables): New function.
8688 (Version_script_info::build_expression_list_lookup): New
8689 function.
8690 (Version_script_info::get_symbol_version_helper): Rewrite to use
8691 lookup tables.
8692 (Version_script_info::print_expression_list): Adjust to use
8693 Version_script_info::Language.
8694 (script_push_lex_into_version_mode): Check that the version script
8695 has not been finalized.
8696 (version_script_push_lang): Change language string to
8697 Version_script_info::Language.
8698 * options.cc (Command_line::version_script): New function.
8699 * options.h (class General_options): Add finalize_dynamic_list
8700 function. Change version_script from declaration to definition.
8701 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8702 * testsuite/version_script.map: Remove duplicate def of foo.
8703 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8704 version_script.map.
8705 * testsuite/Makefile.in: Rebuild.
8706
818bf354
ILT
87072009-12-30 Ian Lance Taylor <iant@google.com>
8708
8709 PR 10843
8710 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8711 if the input symbol index is 0, make the output symbol index 0.
8712
ebcc8304
ILT
87132009-12-30 Ian Lance Taylor <iant@google.com>
8714
8715 PR 10670
8716 * options.h (class General_options): Add -x/--discard-all.
8717 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8718 --discard-all. If the local symbol needs a dynamic entry, check
8719 that before handling --discard-locals.
8720
176fe33f
ILT
87212009-12-30 Ian Lance Taylor <iant@google.com>
8722
bb321bb1
ILT
8723 PR 10450
8724 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8725 flags to PF_R.
8726 (Output_segment::add_output_section): Don't change the flags if
8727 the type is PT_TLS.
8728
176fe33f
ILT
8729 PR 10450
8730 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8731 GNU hash table if they need a dynamic value. Otherwise, don't add
8732 them if they are defined in a dynamic object or are forced local.
8733
e8cd95c7
ILT
87342009-12-29 Ian Lance Taylor <iant@google.com>
8735
1b81fb71
ILT
8736 PR 10450
8737 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8738 .gnu.hash table for a 32-bit target.
8739
8d6d383d
ILT
8740 PR 10450
8741 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8742 regular and a dynamic object only needs a dynamic symbol table
8743 entry if it is externally visible.
8744
e785ec03
ILT
8745 PR 10450
8746 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8747 constructor. Add global_offset_table_ field.
8748 (Target_i386::got_section): Set global_offset_table_.
8749 (Target_i386::do_finalize_sections): Set global_offset_table_
8750 size.
8751 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8752 in constructor. Add global_offset_table_ field.
8753 (Target_x86_64::got_section): Set global_offset_table_.
8754 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8755 size.
8756
1a2dff53
ILT
8757 * layout.cc (Layout::Layout): Initialize increase_relro_.
8758 (Layout::get_output_section): Add is_relro, is_last_relro, and
8759 is_first_non_relro parameters. Change all callers.
8760 (Layout::choose_output_section): Likewise.
8761 (Layout::add_output_section_data): Likewise.
8762 (Layout::make_output_section): Likewise.
8763 (Layout::set_segment_offsets): Clear increase_relro when using a
8764 linker script.
8765 * layout.h (class Layout): Add increase_relro method. Add
8766 increase_relro_ field. Update declarations.
8767 * output.cc (Output_section::Output_section): Initialize
8768 is_last_relro_ and is_first_non_relro_.
8769 (Output_segment::add_output_section): Group relro sections is
8770 do_sort is true. Handle is_last_relro and is_first_non_relro.
8771 (Output_segment::maximum_alignment): Remove relro handling.
8772 (Output_segment::set_section_addresses): Add increase_relro
8773 parameter. Change all callers. Add initial alignment to align
8774 relro sections on separate page. Remove old relro handling.
8775 (Output_segment::set_section_list_addresses): Remove in_relro
8776 parameter. Change all callers.
8777 (Output_segment::set_offset): Add increase parameter. Change all
8778 callers. Remove old relro handling.
8779 * output.h (class Output_section): Add new methods: is_last_relro,
8780 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8781 Add is_last_relro_ and is_first_non_relro_ fields.
8782 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8783 Create separate .got.plt section. Call increase_relro.
8784 * x86_64.cc (Target_x86_64::got_section): Likewise.
8785 * testsuite/relro_script_test.t: Add .got.plt.
8786
f0ba79e2
ILT
8787 PR 10450
8788 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8789 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8790 (Layout::finalize): Call set_dynamic_symbol_size.
8791 (Layout::set_dynamic_symbol_size): New function.
8792 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8793 set_dynamic_symbol_size.
8794
e8cd95c7
ILT
8795 PR 10450
8796 * output.h (class Output_section): Add is_entsize_zero_ field.
8797 * output.cc (Output_section::Output_section): Initialize
8798 is_entsize_zero_.
8799 (Output_section::set_entsize): If two different entsizes are
8800 requested, force it to zero.
8801 (Output_section::add_input_section): Set flags for .debug_str
8802 before updating section flags. Set entsize.
8803 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8804 and SHF_STRING if all input sections have those flags.
8805
3e1b9a8a
RÁE
88062009-12-29 Rafael Espindola <espindola@google.com>
8807
8808 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8809 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8810 reporting.
3e1b9a8a 8811
3dcad376
ST
88122009-12-29 Sriraman Tallam <tmsriram@google.com>
8813
8814 * options.cc (General_options::parse_version): Allow -v to exit
8815 without an error if there is nothing to link.
8816
084e2665
ILT
88172009-12-29 Ian Lance Taylor <iant@google.com>
8818
8819 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8820 using a version of gcc before 4.1.
8821 * configure: Rebuild.
8822
250acde3
CD
88232009-12-28 Chris Demetriou <cgd@google.com>
8824
8825 * attributes.cc (Output_attributes_section_data::do_write): Use
8826 std::vector::front rather than std::vector::data.
8827
99fff23b
ILT
88282009-12-28 Ian Lance Taylor <iant@google.com>
8829
8830 * symtab.h (class Symbol_table): Add enum Defined.
8831 * resolve.cc (Symbol_table::should_override): Add defined
8832 parameter. Change all callers. Test whether object is NULL
8833 before calling a method on it.
8834 (Symbol_table::report_resolve_problem): Add defined parameter.
8835 Change all callers.
8836 (Symbol_table::should_override_with_special): Likewise.
8837 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8838 parameter. Change all callers.
8839 (Symbol_table::do_define_in_output_data): Likewise.
8840 (Symbol_table::define_in_output_segment): Likewise.
8841 (Symbol_table::do_define_in_output_segment): Likewise.
8842 (Symbol_table::define_as_constant): Likewise.
8843 (Symbol_table::do_define_as_constant): Likewise.
8844 * script.h (class Symbol_assignment): Add is_defsym parameter to
8845 constructor; change all callers.
8846 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8847 parameter. Change all callers. Add is_defsym_ field.
8848 (class Parser_closure): Add parsing_defsym parameter to
8849 constructor; change all callers. Add parsing_defsym accessor
8850 function. Add parsing_defsym_ field.
8851
556bd683
ILT
88522009-12-28 Ian Lance Taylor <iant@google.com>
8853
8854 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8855 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8856
1782c879
ILT
88572009-12-23 Ian Lance Taylor <iant@google.com>
8858
8859 * i386.cc (Target_i386::do_calls_non_split): Recognize
8860 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8861 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8862 -fsplit-stack prologue when using %r11.
1782c879 8863
329ca2b1
ST
88642009-12-21 Sriraman Tallam <tmsriram@google.com>
8865
8866 * options.cc (General_options::parse_version): Make -v continue and do
8867 the link like GNU ld does.
8868
d675ff46
RÁE
88692009-12-17 Rafael Avila de Espindola <espindola@google.com>
8870
8871 * Makefile.am (CCFILES): Add timer.cc.
8872 (HFILES): Add timer.h.
8873 * configure.ac: Check for sysconf and times.
8874 * main.cc: include timer.h.
8875 (main): Use Timer instead of get_run_time.
8876 * timer.cc: New.
8877 * timer.h: New.
8878 * workqueue.cc: include timer.h.
8879 (Workqueue::find_and_run_task):
8880 Report user, sys and wall time.
8881 * Makefile.in: Regenerate.
8882 * config.in: Regenerate.
8883 * configure: Regenerate.
8884
d6344fb5
DK
88852009-12-16 Doug Kwan <dougkwan@google.com>
8886
8887 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8888 sections.
8889 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8890 relaxed input sections.
8891 * output.cc (Output_section::find_relaxed_input_section): Change
8892 return type to Output_relaxed_input_section pointer. Adjust code
8893 for new type of relaxed_input_section_map_.
8894 * output.h (Output_section::find_relaxed_input_section): Change
8895 return type to Output_relaxed_input_section pointer.
8896 (Output_section::Output_relaxed_input_section_by_input_section_map):
8897 New type.
8898 (Output_section::relaxed_input_section_map_): Change type to
8899 Output_section::Output_relaxed_input_section_by_input_section_map.
8900 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8901 input section.
8902
0e0d5469
ILT
89032009-12-15 Ian Lance Taylor <iant@google.com>
8904
8905 * layout.cc (Layout::create_shstrtab): Only write out after input
8906 sections if we are compressing debug sections.
8907
0649a889
ILT
89082009-12-15 Ian Lance Taylor <iant@google.com>
8909
8910 * archive.cc (Archive::add_symbols): Only look up a symbol without
8911 a version if there is, in fact, a version.
8912
2ea97941
ILT
89132009-12-14 Ian Lance Taylor <iant@google.com>
8914
8915 Revert -Wshadow changes, all changes from:
8916 2009-12-11 Doug Kwan <dougkwan@google.com>
8917 2009-12-11 Nick Clifton <nickc@redhat.com>
8918 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8919
b0eec2cc
DK
89202009-12-11 Doug Kwan <dougkwan@google.com>
8921
8922 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8923 due to -Wshadow.
8924 * attributes.cc (Object_attribute::size): Ditto.
8925 (Attributes_section_data::size): Ditto.
8926 (Attributes_section_data::Attributes_section_data): Ditto.
8927 (Output_attributes_section_data::do_write): Ditto.
8928 * attributes.h (Object_attribute::set_type): Ditto.
8929 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8930
91d6fa6a
NC
89312009-12-11 Nick Clifton <nickc@redhat.com>
8932
8933 * archive.cc: Fix shadowed variable warnings.
8934 * arm.cc: Likewise.
8935 * compressed_output.cc: Likewise.
8936 * compressed_output.h: Likewise.
8937 * configure: Likewise.
8938 * dwarf_reader.cc: Likewise.
8939 * dynobj.cc: Likewise.
8940 * dynobj.h: Likewise.
8941 * ehframe.cc: Likewise.
8942 * ehframe.h: Likewise.
8943 * errors.cc: Likewise.
8944 * expression.cc: Likewise.
8945 * fileread.cc: Likewise.
8946 * fileread.h: Likewise.
8947 * freebsd.h: Likewise.
8948 * i386.cc: Likewise.
8949 * icf.cc: Likewise.
8950 * incremental.h: Likewise.
8951 * layout.cc: Likewise.
8952 * layout.h: Likewise.
8953 * mapfile.cc: Likewise.
8954 * merge.cc: Likewise.
8955 * merge.h: Likewise.
8956 * object.cc: Likewise.
8957 * object.h: Likewise.
8958 * options.h: Likewise.
8959 * output.cc: Likewise.
8960 * output.h: Likewise.
8961 * parameters.cc: Likewise.
8962 * plugin.cc: Likewise.
8963 * powerpc.cc: Likewise.
8964 * reduced_debug_output.cc: Likewise.
8965 * reduced_debug_output.h: Likewise.
8966 * reloc.cc: Likewise.
8967 * reloc.h: Likewise.
8968 * resolve.cc: Likewise.
8969 * script-sections.cc: Likewise.
8970 * script.cc: Likewise.
8971 * script.h: Likewise.
8972 * sparc.cc: Likewise.
8973 * symtab.cc: Likewise.
8974 * symtab.h: Likewise.
8975 * target-select.cc: Likewise.
8976 * target-select.h: Likewise.
8977 * token.h: Likewise.
8978 * workqueue.cc: Likewise.
8979 * workqueue.h: Likewise.
8980 * x86_64.cc: Likewise.
8981
a0351a69
DK
89822009-12-10 Doug Kwan <dougkwan@google.com>
8983
8984 * arm.cc (attributes.h): New include.
8985 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8986 (Arm_relobj::~Arm_relobj): Delete object pointed by
8987 attributes_section_data_.
8988 (Arm_relobj::attributes_section_data): New method definition.
8989 (Arm_relobj::attributes_section_data_): New data member declaration.
8990 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8991 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8992 attributes_section_data_.
8993 (Arm_dynobj::attributes_section_data): New method definition.
8994 (Arm_dynobj::attributes_section_data_): New data member declaration.
8995 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8996 initialization value of may_use_blx_ to false.
2e702c99 8997 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8998 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8999 object attributes to compute results instead of hard-coding.
9000 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9001 Target_arm::get_secondary_compatible_arch,
9002 Target_arm::set_secondary_compatible_arch
9003 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9004 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9005 New method declarations.
9006 (Target_arm::get_aeabi_object_attribute): New method definition.
9007 (Target_arm::attributes_section_data_): New data member declaration.
9008 (read_arm_attributes_section): New template definition.
9009 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9010 (Arm_dynobj::do_read_symbols): Ditto.
9011 (Target_arm::do_finalize_sections): Merge attributes sections from
9012 input. Check for BLX use after attributes section merging.
9013 Fix __exidx_start and __exidx_end visibility. Create an
9014 .ARM.attributes section if necessary.
9015 (Target_arm::get_secondary_compatible_arch,
9016 Target_arm::set_secondary_compatible_arch,
9017 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9018 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9019 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9020 New method definitions.
9021
b59befec
ILT
90222009-12-09 Ian Lance Taylor <iant@google.com>
9023
9024 * plugin.cc (Plugin::load): Don't cast from void* to a function
9025 pointer.
9026
1276bc89
ILT
90272009-12-09 Ian Lance Taylor <iant@google.com>
9028
9029 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9030 information fields.
9031
2f2de248
L
90322009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9033
9034 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9035 Replace two_file_shared_1.so with two_file_shared_2.so.
9036 * testsuite/Makefile.in: Regenerated.
9037
4f787271
DK
90382009-12-08 Doug Kwan <dougkwan@google.com>
9039
9040 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9041 (HFILES): Add attributes.h and int_encoding.h.
9042 * Makefile.in: Regenerate.
9043 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9044 function definitions to int_encoding.cc
9045 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9046 prototypes to int_encoding.h
9047 * reduced_debug_output.cc (int_encoding.h): New include.
9048 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9049 function definitions to int_encoding.cc
9050 (insert_into_vector, read_from_pointer): Move template definitions to
9051 int_encoding.h
9052 * attributes.cc: New file.
9053 * attributes.h: New file.
9054 * int_encoding.cc: New file.
9055 * int_encoding.h: New file.
9056
20b52f1a
RÁE
90572009-12-07 Rafael Avila de Espindola <espindola@google.com>
9058
9059 PR gold/11055
9060 * incremental-dump.cc (dump_incremental_inputs): New.
9061 (main): Use dump_incremental_inputs.
9062
53d7974c
L
90632009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9064
9065 PR gold/10893
9066 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9067 checking elfcpp::STT_FUNC.
9068 (Target_i386::Relocate::relocate): Likewise.
9069 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9070
9071 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9072 symbols from shared libraries into normal FUNC symbols.
9073
9074 * symtab.h (Symbol): Add is_func and use it.
9075
05a352e6
DK
90762009-12-05 Doug Kwan <dougkwan@google.com>
9077
9078 * arm.cc (Target_arm::arm_info): Initialize new fields
9079 attributes_section and attributes_vendor.
9080 * i386.cc (Target_i386::i386_info): Same.
9081 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9082 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9083 fields attributes_section and attributes_vendor.
53d7974c 9084 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9085 * target.h (Target::attributes_section, Target::attributes_vendor,
9086 Target::is_attributes_section, Target::attribute_arg_type,
9087 Target::attributes_order): New method definitions.
9088 (Target::Target_info::attributes_section,
9089 Target::Target_info::attributes_vendor): New fields.
9090 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9091 virtual method definitions.
9092 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9093 attributes_section and attributes_vendor.
9094 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9095
f4e5969c
DK
90962009-12-05 Doug Kwan <dougkwan@google.com>
9097
9098 * arm.cc: Update comments about interworking and stub generation.
9099 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9100 considered as non-PIC.
9101 (Arm_relocate_functions::base_abs): Fix formatting.
9102 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9103 of function to use GOT entry address instead of offset.
9104 (Target_arm::Scan::global): Issue an error if a symbol would need a
9105 PLT does not get one because it is untyped. Remove code to create
9106 dynamic symbols for relative branches.
9107 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9108 takes unsigned integer instead of boolean.
9109
1abce4a6
L
91102009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9111
9112 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9113 (two_file_test_LDADD): Likewise.
9114 (common_test_1_LDADD): Likewise.
9115 (exception_test_LDADD) Likewise.
9116 (weak_test_LDADD): Likewise.
9117 (many_sections_test_LDADD): Likewise.
9118 (initpri1_LDADD): Likewise.
9119 (script_test_1_LDADD): Likewise.
9120 (script_test_2_LDADD): Likewise.
9121 (justsyms_LDADD): Likewise.
9122 (binary_test_LDADD): Likewise.
9123 (large_LDADD): Likewise.
9124 * testsuite/Makefile.in: Regenerated.
9125
adcf2816 91262009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9127
adcf2816
L
9128 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9129 (Symbol_table::override_with_special): Likewise.
9130 (Symbol_table::add_from_object): Likewise.
9131
28e67f5d
RÁE
91322009-12-04 Rafael Avila de Espindola <espindola@google.com>
9133
9134 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9135 Don't set the data_offset twice.
9136
ae10a101
RÁE
91372009-12-04 Rafael Avila de Espindola <espindola@google.com>
9138
9139 * testsuite/Makefile.in: Regenerate.
9140
f59f41f3
DK
91412009-12-03 Doug Kwan <dougkwan@google.com>
9142
9143 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9144 (Target_arm::do_finalize_sections): Add parameter for symbol table
9145 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9146 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9147 parameter for symbol table pointer.
9148 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9149 an additional parameter for a pointer to symbol table.
9150 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9151 parameter for a symbol table pointer.
9152 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9153 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9154 Ditto.
9155 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9156 parameter for a symbol table pointer.
9157
ca55d848
RÁE
91582009-12-03 Rafael Avila de Espindola <espindola@google.com>
9159
9160 * incremental.cc (Incremental_inputs_header)
9161 (Incremental_inputs_header_write, Incremental_inputs_entry)
9162 (Incremental_inputs_entry_write): Move ...
9163 * incremental.h (Incremental_inputs_header)
9164 (Incremental_inputs_header_write, Incremental_inputs_entry)
9165 (Incremental_inputs_entry_write): here.
9166
3aec4f9c
RÁE
91672009-12-02 Rafael Avila de Espindola <espindola@google.com>
9168
9169 * incremental.cc (make_sized_incremental_binary): Set the target.
9170 Error if it is incompatible.
9171 * output.h (Output_file): Add filename method.
9172
9c0ae74d
RÁE
91732009-12-02 Rafael Avila de Espindola <espindola@google.com>
9174
9175 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9176 from the get_* methods.
9177
a45500ae
RÁE
91782009-12-02 Rafael Avila de Espindola <espindola@google.com>
9179
9180 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9181 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9182 Write 0 for the data_offset of scripts.
9183
325e6408
RÁE
91842009-12-02 Rafael Avila de Espindola <espindola@google.com>
9185
9186 * testsuite/Makefile.am: Add the incremental_test.sh test.
9187 * testsuite/incremental_test.sh: New.
9188 * testsuite/incremental_test_1.c: New.
9189 * testsuite/incremental_test_2.c: New.
9190
954c3e2e
RÁE
91912009-12-01 Rafael Avila de Espindola <espindola@google.com>
9192
703d02da 9193 * incremental-dump.cc (main): Fix typos.
954c3e2e 9194
f8086623
RÁE
91952009-11-27 Rafael Avila de Espindola <espindola@google.com>
9196
9197 PR gold/11025
9198 * incremental-dump.cc (main): Use llu to print 64 bit values.
9199
3b0dd6ac
L
92002009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9201 H.J. Lu <hongjiu.lu@intel.com>
9202
9203 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9204 $(LIBDL).
9205 (incremental_dump_LDADD): Likewise.
9206 * Makefile.in: Regenerated.
9207
a6d1ef57 92082009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9209
a6d1ef57
DK
9210 Revert:
9211
9212 2009-11-25 Doug Kwan <dougkwan@google.com>
9213
9214 * arm.cc (Target_arm::Target_arm): Move method definition
9215 outside of class definition. Add code to handle
9216 --target1-rel, --target1-abs and --target2= options.
9217 (Target_arm::get_reloc_reloc_type): Change method to be
9218 non-static and const.
9219 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9220 New data member declaration.
9221 (Target_arm::Scan::local, Target_arm::Scan::global,
9222 Target_arm::Relocate::relocate,
9223 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9224 Adjust call to Target_arm::get_real_reloc_type.
9225 (Target_arm::get_real_reloc_type): Use command line options
9226 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9227 * options.h (--target1-rel, --target1-abs, --target2): New
9228 ARM-only options.
9229
50aeb7d4
DK
92302009-11-25 Doug Kwan <dougkwan@google.com>
9231
9232 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9233 class definition. Add code to handle --target1-rel, --target1-abs
9234 and --target2= options.
9235 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9236 and const.
9237 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9238 member declaration.
9239 (Target_arm::Scan::local, Target_arm::Scan::global,
9240 Target_arm::Relocate::relocate,
9241 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9242 call to Target_arm::get_real_reloc_type.
9243 (Target_arm::get_real_reloc_type): Use command line options to
9244 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9245 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9246 options.
9247
51938283
DK
92482009-11-25 Doug Kwan <dougkwan@google.com>
9249
9250 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9251 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9252 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9253 formatting.
9254 (Arm_relocate_functions::thm_call): Replace body with a call to
9255 Arm_relocate_functions::thumb_branch_common.
9256 (Arm_relocate_functions::thm_jump24,
9257 Arm_relocate_functions::thm_xpc22): New method definitions.
9258 (Arm_relocate_functions::thumb_branch_common): New method definition.
9259 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9260 operator.
9261 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9262 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9263
e2b8f3c4
RÁE
92642009-11-24 Rafael Avila de Espindola <espindola@google.com>
9265
9266 * Makefile.am: Build incremental-dump
9267 * Makefile.in: Regenerate.
9268 * incremental-dump.cc: New.
9269 * incremental.cc (Incremental_inputs_header_data,
9270 Incremental_inputs_entry_data): Move to incremental.h
9271 * incremental.h: (Incremental_inputs_header_data,
9272 Incremental_inputs_entry_data): Move from incremental.cc
9273
bcba9aec
RÁE
92742009-11-24 Rafael Avila de Espindola <espindola@google.com>
9275
9276 * incremental.cc (Incremental_inputs_header,
9277 Incremental_inputs_header_write, Incremental_inputs_entry,
9278 Incremental_inputs_entry_write): Add a typedef with the data type.
9279
7c3afe08
RÁE
92802009-11-24 Rafael Avila de Espindola <espindola@google.com>
9281
9282 * incremental.cc (Incremental_inputs_header,
9283 Incremental_inputs_header_write, Incremental_inputs_entry,
9284 Incremental_inputs_entry_write): Update comment about which
9285 type has the filed descriptions.
9286
d204b6e9
DK
92872009-11-15 Doug Kwan <dougkwan@google.com>
9288
9289 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9290 (Arm_relocate_functions::arm_branch_common): Change method defintion
9291 in class definition to a method declaration and update list of formal
9292 parameters.
9293 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9294 Arm_relocation_functions::jump24): Adjust call to
9295 Arm_relocate_functions::arm_branch_common. Update list of formal
9296 parameters.
9297 (Arm_relocate_functions::xpc25): New method definition.
9298 (Arm_relocate_functions::arm_branch_common): Move method defintion
9299 out from class definition. Use stubs for mode-switching and extending
9300 branch ranges.
9301 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9302 specially. Change code to enable use of stubs in ARM branches.
9303
43d12afe
DK
93042009-11-10 Doug Kwan <dougkwan@google.com>
9305
9306 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9307 in method declaration.
9308 (Target_arm::relocate_stub): New method declaration.
9309 (Target_arm::default_target): Change to return a pointer instead of
9310 a const reference.
9311 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9312 Target_arm::default_target.
9313 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9314 method definition.
9315 (Target_arm::relocate_section): Adjust view.
9316 (Target_arm::relocate_stub): New method definition.
9317
ac33a407
DK
93182009-11-10 Doug Kwan <dougkwan@google.com>
9319
9320 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9321 a format warning.
9322 * incremental.cc (open_incremental_binary): Initialized local
9323 variables to avoid warnings.
9324 * object.cc (make_elf_object): Ditto.
9325 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9326 a format warning.
e1df38aa 9327
88ee28e9
L
9328009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9329
9330 PR gold/10930
9331 * testsuite/plugin_test.c: Include "config.h".
9332
2daedcd6
DK
93332009-11-09 Doug Kwan <dougkwan@google.com>
9334
9335 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9336 (arm_symbol_value): Remove.
9337 (Arm_relocate_functions::arm_branch_common,
9338 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9339 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9340 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9341 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9342 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9343 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9344 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9345 Arm_relocate_functions::thm_mobw_abs_nc,
9346 Arm_relocate_functions::thm_mov_abs,
9347 Arm_relocate_functions::movw_prel_nc,
9348 Arm_relocate_functions::thm_movt_abs,
9349 Arm_relocate_functions::movt_prel,
9350 Arm_relocate_functions::thm_movw_prel_nc,
9351 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9352 (Target_arm::Relocate::relocate): Only decompose address into two
9353 parts if relocation type uses the thumb-bit and pass the actual
9354 bit instead of a flag indicating that the thumb-bit is used. Adjust
9355 calls to methods in Arm_relocate_functions for this change.
9356
1276bc89 93572009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9358
9359 PR 10925
9360 * reloc.cc: Instantiate
9361 Sized_relobj::initialize_input_to_output_maps and
9362 Sized_relobj:free_input_to_output_maps.
9363
e53ad1b5
ILT
93642009-11-06 Ian Lance Taylor <iant@google.com>
9365
9366 PR 10876
9367 * defstd.cc (in_segment): Set only_if_ref true for "end".
9368
eb44217c
DK
93692009-11-06 Doug Kwan <dougkwan@google.com>
9370
9371 * arm.cc (class Reloc_stub): Correct a comment.
9372 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9373 (Target_arm::scan_section_for_stubs): New method declaration.
9374 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9375 Change methods from private to protected.
9376 (Target_arm::do_may_relax): New method definition.
9377 (Target_arm::do_relax, Target_arm::group_sections,
9378 Target_arm::scan_reloc_for_stub,
9379 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9380 (Target_arm::arm_input_section_map_): New data member declaration.
9381 (Target_arm::scan_reloc_for_stub,
9382 Target_arm::scan_reloc_section_for_stubs,
9383 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9384 Target_arm::do_relax): New method definitions.
9385
5d329b7d
ILT
93862009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9387
9388 * configure.ac: Check for (struct stat)::st_mtim
9389 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9390 * config.in: Regenerate.
9391 * configure: Regenerate.
9392
96a0d71b
ILT
93932009-11-05 Ian Lance Taylor <iant@google.com>
9394
9395 PR 10910
9396 * output.cc (Output_segment::add_output_section): Add missing
9397 return statement.
9398
594c8e5e
ILT
93992009-11-04 Ian Lance Taylor <iant@google.com>
9400
9401 PR 10880
9402 * object.h (class Object): Add is_needed and set_is_needed
9403 methods. Add is_needed_ field. Make bool fields into bitfields.
9404 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9405 defined in a dynamic object and referenced by a regular object,
9406 set is_needed for the dynamic object.
9407 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9408 if the file is marked with as_needed and it is not needed.
9409
22b127cc
ILT
94102009-11-04 Ian Lance Taylor <iant@google.com>
9411
9412 PR 10887
9413 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9414 tags if data is discarded by linker script.
9415 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9416 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9417 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9418 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9419
f5c870d2
ILT
94202009-11-04 Ian Lance Taylor <iant@google.com>
9421
9422 * layout.cc (Layout::get_output_section): Add is_interp and
9423 is_dynamic_linker_section parameters. Change all callers.
9424 (Layout::choose_output_section): Likewise.
9425 (Layout::make_output_section): Likewise.
9426 (Layout::add_output_section_data): Add is_dynamic_linker_section
9427 parameter. Change all callers.
9428 * layout.h (class Layout): Update declarations.
9429 * output.h (class Output_section): Add is_interp, set_is_interp,
9430 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9431 Add is_interp_, is_dynamic_linker_section_ fields. Change
9432 generate_code_fills_at_write_ to a bitfield.
9433 * output.cc (Output_section::Output_sections): Initialize new
9434 fields.
9435 (Output_segment::add_output_section): Add do_sort parameter.
9436 Change all callers.
9437
1ae4d23b
ILT
94382009-11-03 Ian Lance Taylor <iant@google.com>
9439
9440 PR 10860
9441 * options.h (class General_options): Add --warn-common.
9442 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9443 merging two common symbols.
9444 (Symbol_table::should_override): Handle --warn-common when merging
9445 a common symbol with a defined symbol. Use report_resolve_problem
9446 for multiple definitions.
9447 (Symbol_table::report_resolve_problem): New function.
9448 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9449
55da9579
DK
94502009-11-03 Doug Kwan <dougkwan@google.com>
9451
9452 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9453 stub_factory_.
9454 (Target_arm::stub_factory): New method definition.
9455 (Target_arm::new_arm_input_section,
9456 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9457 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9458 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9459 New type definitions.
9460 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9461 member declarations.
9462 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9463 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9464 New method definitions.
9465
37a9ac43
ILT
94662009-11-03 Ian Lance Taylor <iant@google.com>
9467
9468 * options.h (class General_options): Add --warn_constructors.
9469
b3d6a3d4
ILT
94702009-11-03 Ian Lance Taylor <iant@google.com>
9471
9472 PR 10893
9473 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9474 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9475
934b01dd
ILT
94762009-11-03 Ian Lance Taylor <iant@google.com>
9477
9478 PR 10895
9479 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9480 --msgid-bugs-address.
9481 (install-pdf): New target.
9482 (install-data_yes): Look up one directory to find mkinstalldirs.
9483
03c1939b
L
94842009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9485
9486 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9487 tree.
9488
ebd95253
DK
94892009-10-30 Doug Kwan <dougkwan@google.com>
9490
9491 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9492
e9bbb538
DK
94932009-10-30 Doug Kwan <dougkwan@google.com>
9494
9495 * arm.cc (Stub_addend_reader): New struct template definition
9496 and partial specializations.
9497 (Stub_addend_reader::operator()): New method definition for a
9498 partially specialized template.
9499
d5b40221
DK
95002009-10-30 Doug Kwan <dougkwan@google.com>
9501
9502 * arm.cc (Arm_relobj::processor_specific_flags): New method
9503 definition.
9504 (Arm_relobj::do_read_symbols): New method declaration.
9505 (Arm_relobj::processor_specific_flags_): New data member declaration.
9506 (Arm_dynobj): New class definition.
9507 (Target_arm::do_finalize_sections): Add input_objects parameter.
9508 (Target_arm::do_adjust_elf_header): New method declaration.
9509 (Target_arm::are_eabi_versions_compatible,
9510 (Target_arm::merge_processor_specific_flags): New method declaration.
9511 (Target_arm::do_make_elf_object): New overloaded method definitions
9512 and declaration.
9513 (Arm_relobj::do_read_symbols): New method definition.
9514 (Arm_dynobj::do_read_symbols): Ditto.
9515 (Target_arm::do_finalize_sections): Add input_objects parameters.
9516 Merge processor-specific flags from all input objects.
9517 (Target_arm::are_eabi_versions_compatible,
9518 Target_arm::merge_processor_specific_flags,
9519 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9520 New method definitions.
9521 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9522 Input_objects pointer type parameter.
9523 * layout.cc (Layout::finalize): Pass input objects to target's.
9524 finalize_sections function.
9525 * output.cc (Output_file_header::do_sized_write): Set ELF file
9526 header's processor-specific flags.
9527 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9528 Input_objects pointer type parameter.
9529 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9530 * target.h (Input_objects): New forward class declaration.
9531 (Target::processor_specific_flags,
9532 Target::are_processor_specific_flags_sect): New method definitions.
9533 (Target::finalize_sections): Add input_objects parameter.
9534 (Target::Target): Initialize processor_specific_flags_ and
9535 are_processor_specific_flags_set_.
9536 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9537 parameter.
9538 (Target::set_processor_specific_flags): New method definition.
9539 (Target::processor_specific_flags_,
9540 Target::are_processor_specific_flags_set_): New data member
9541 declarations.
9542 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9543 Input_objects pointer type parameter.
9544
ebabffbd
DK
95452009-10-30 Doug Kwan <dougkwan@google.com>
9546
9547 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9548
ad0f2072
ILT
95492009-10-28 Ian Lance Taylor <iant@google.com>
9550
9551 * object.h (class Relobj): Drop options parameter from
9552 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9553 do_scan_relocs, do_relocate. Change all callers.
9554 (class Sized_relobj): Drop options parameters from
9555 do_gc_process_relocs, do_scan_relocs, do_relocate,
9556 do_relocate_sections, relocate_sections, emit_relocs_scan,
9557 emit_relocs_scan_reltype. Change all callers.
9558 (struct Relocate_info): Remove options field and all references to
9559 it.
9560 * reloc.h (class Read_relocs): Remove options constructor
9561 parameter and options_ field. Change all callers.
9562 (class Gc_process_relocs, class Scan_relocs): Likewise.
9563 (class Relocate_task): Likewise.
9564 * target-reloc.h (scan_relocs): Remove options parameter. Change
9565 all callers.
9566 (scan_relocatable_relocs): Likewise.
9567 * target.h (class Sized_target): Remove options parameter from
9568 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9569 all callers.
9570 * gc.h (gc_process_relocs): Remove options parameter. Change all
9571 callers.
9572 * arm.cc: Update functions to remove options parameters.
9573 * i386.cc: Likewise.
9574 * powerpc.cc: Likewise.
9575 * sparc.cc: Likewise.
9576 * x86_64.cc: Likewise.
9577 * testsuite/testfile.cc: Likewise.
9578
8ffa3667
DK
95792009-10-28 Doug Kwan <dougkwan@google.com>
9580
9581 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9582 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9583 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9584 New method definitions.
9585
40f36857
CC
95862009-10-28 Cary Coutant <ccoutant@google.com>
9587
9588 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9589 (Plugin::cleanup_done_): New member.
9590 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9591 (Plugin_manager::cleanup_done_): Remove.
9592 (Plugin_manager::add_input_file): Edit error message.
9593 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9594 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9595
2c849493
ILT
95962009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9597
9598 * fileread.cc: (File_read::View::~View): Use the new
9599 data_ownership_ filed.
9600 (File_read::~File_read): Dispose the new whole_file_view_.
9601 (File_read::open): Mmap the whole file if needed.
9602 (File_read::open): Use whole_file_view_ instead of contents_.
9603 (File_read::find_view): Use whole_file_view_ if applicable.
9604 (File_read::do_read): Use whole_file_view_ instead of contents_.
9605 (File_read::make_view): Use whole_file_view_ instead of contents_,
9606 update File_read::View::View call.
9607 (File_read::find_or_make_view): Update File_read::View::View
9608 call.
9609 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9610 remove contents_
9611 (File_read::View::Data_ownership): New enum.
9612 (File_read::View::View): Replace bool mapped_ with Data_ownership
9613 argument.
9614 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9615 (File_read::View::data_ownership_): New field.
9616 (File_read::contents_): Remove (replaced by whole_file_view_).
9617 (File_read::whole_file_view_): New field.
9618 * options.h (class General_options): Add --keep-files-mapped.
9619
24998053
CC
96202009-10-27 Cary Coutant <ccoutant@google.com>
9621
9622 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9623 * testsuite/Makefile.am (plugin_test_5): New test case.
9624 * testsuite/Makefile.in: Regenerate.
9625
72adc4fa
DK
96262009-10-25 Doug Kwan <dougkwan@google.com>
9627
9628 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9629 from private to protected to allow access by child class.
9630 (Sized_relobj::do_relocate_sections): New method declaration.
9631 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9632 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9633 Sized_relobj::relocate_sections. Instantiate template explicitly
9634 for different target sizes and endianity.
9635
07f508a2
DK
96362009-10-24 Doug Kwan <dougkwan@google.com>
9637
9638 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9639 (Arm_input_section::as_arm_input_section): New method.
9640 (Arm_output_section): New class definition.
9641 (Arm_output_section::create_stub_group,
9642 Arm_output_section::group_sections): New method definitions.
9643
10ad9fe5
DK
96442009-10-22 Doug Kwan <dougkwan@google.com>
9645
9646 * arm.cc (Arm_input_section): New class definition.
9647 (Arm_input_section::init, Arm_input_section:do_write,
9648 Arm_input_section::set_final_data_size,
9649 Arm_input_section::do_reset_address_and_file_offset): New method
9650 definitions.
9651
56ee5e00
DK
96522009-10-21 Doug Kwan <dougkwan@google.com>
9653
9654 * arm.cc (Stub_table, Arm_input_section): New forward class
9655 declarations.
9656 (Stub_table): New class defintion.
9657 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9658 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9659 New method definition.
9660
b569affa
DK
96612009-10-21 Doug Kwan <dougkwan@google.com>
9662
9663 * arm.cc: Update copyright comments.
9664 (Target_arm): New forward class template declaration.
9665 (Arm_address): New type.
9666 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9667 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9668 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9669 constants.
9670 (Insn_template): Same.
9671 (DEF_STUBS): New macro.
9672 (Stub_type): New enum type.
9673 (Stub_template): New class definition.
9674 (Stub): Same.
9675 (Reloc_stub): Same.
9676 (Stub_factory): Same.
9677 (Target_arm::Target_arm): Initialize may_use_blx_ and
9678 should_force_pic_veneer_.
9679 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9680 Target_arm::should_force_pic_veneer,
9681 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9682 Target_arm::using_thumb_only, Target_arm:;default_target): New
9683 method defintions.
9684 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9685 New data member declarations.
9686 (Insn_template::size, Insn_template::alignment): New method defintions.
9687 (Stub_template::Stub_template): New method definition.
9688 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9689 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9690 (Stub_factory::Stub_factory): New method definition.
9691 * gold.h (string_hash): New template.
9692 * output.h (Input_section_specifier::hash_value): Use
9693 gold::string_hash.
9694 (Input_section_specifier::string_hash): Remove.
9695 * stringpool.cc (Stringpool_template::string_hash): Use
9696 gold::string_hash.
9697
6c172549
DK
96982009-10-20 Doug Kwan <dougkwan@google.com>
9699
9700 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9701 symbols of relaxed input sections.
9702 * output.h (Output_section::find_relaxed_input_section): Make
9703 method public.
9704
c5617f2f
DK
97052009-10-16 Doug Kwan <dougkwan@google.com>
9706
9707 * dynobj.cc (Versions::Versions): Initialize version_script_.
9708 Only insert base version symbol definition for a shared object
9709 if version script defines any version versions.
9710 (Versions::define_base_version): New method definition.
9711 (Versions::add_def): Check that base version is not needed.
9712 (Versions::add_need): Define base version lazily.
9713 * dynobj.h (Versions::define_base_version): New method declaration.
9714 (Versions::needs_base_version_): New data member declaration.
9715 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9716 (check_DATA): Add no_version_test.stdout.
9717 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9718 New make rules.
9719 * testsuite/Makefile.in: Regenerate.
9720 * testsuite/no_version_test.c: New file.
9721 * testsuite/no_version_test.sh: Ditto.
9722
3c12dcdb
DK
97232009-10-16 Doug Kwan <dougkwan@google.com>
9724
9725 * expression.cc (class Segment_start_expression): New class definition.
9726 (Segment_start_expression::value): New method definition.
9727 (script_exp_function_segment_start): Return a new
9728 Segment_start_expression.
9729 * gold/script-c.h (script_saw_segment_start_expression): New function
9730 prototype.
9731 * script-sections.cc (Script_sections::Script_sections): Initialize
9732 SAW_SEGMENT_START_EXPRESSION_ to false.
9733 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9734 and -Tbbs options to specify section addresses if given in
9735 command line and no SEGMENT_START expression is seen in a script.
9736 * script-sections.h (Script_sections::saw_segment_start_expression,
9737 Script_sections::set_saw_segment_start_expression): New method
9738 definition.
9739 (Script_sections::saw_segment_start_expression_): New data member
9740 declaration.
9741 * script.cc (script_saw_segment_start_expression): New function.
9742 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9743 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9744 script_test_7.sh and script_test_8.sh.
9745 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9746 script_test_8.stdout.
9747 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9748 (script_test_6, script_test_6.stdout, script_test_7,
9749 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9750 * Makefile.in: Regenerate.
9751 * testsuite/script_test_6.sh: New file.
9752 * testsuite/script_test_6.t: Same.
9753 * testsuite/script_test_7.sh: Same.
9754 * testsuite/script_test_7.t: Same.
9755 * testsuite/script_test_8.sh: Same.
9756
64b1ae37
DK
97572009-10-16 Doug Kwan <dougkwan@google.com>
9758
9759 * output.cc (Output_segment::set_section_list_address): Cast
9760 expressions to unsigned long long type to avoid format warnings.
9761
661be1e2
ILT
97622009-10-15 Ian Lance Taylor <iant@google.com>
9763
12edd763 9764 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9765 dot assignment to script_sections_.
12edd763
ILT
9766 * script-sections.cc (Script_sections::add_dot_assignment):
9767 Initialize if necessary.
9768
68b6574b
ILT
9769 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9770 program headers with no load segment if there is a linker script.
9771
661be1e2
ILT
9772 * layout.cc (Layout::set_segment_offsets): Align the file offset
9773 to the segment aligment for -N or -n with no load segment.
9774 * output.cc (Output_segment::add_output_section): Don't crash if
9775 the first section is a TLS section.
9776 (Output_segment::set_section_list_addresses): Print an error
9777 message if the address moves backward in a linker script.
9778 * script-sections.cc
9779 (Output_section_element_input::set_section_addresses): Don't
9780 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9781 (Orphan_output_section::set_section_addresses): Likewise.
9782
f15f61a7
DK
97832009-10-15 Doug Kwan <dougkwan@google.com>
9784
9785 * layout.cc (Layout::finish_dynamic_section): Generate tags
9786 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9787 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9788 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9789
82bb573a
ILT
97902009-10-14 Ian Lance Taylor <iant@google.com>
9791
9792 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9793 fields.
9794 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9795 data_shdr fields of relinfo.
9796 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9797 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9798 R_386_TLS_LDO_32, adjust based on section flags.
9799 (Target_i386::Relocate::fix_up_ldo): Remove.
9800
374ad285
ILT
98012009-10-13 Ian Lance Taylor <iant@google.com>
9802
9803 Add support for -pie.
9804 * options.h (class General_options): Add -pie and
9805 --pic-executable.
9806 (General_options::output_is_position_independent): Test -pie.
9807 (General_options::output_is_executable): Return true if not shared
9808 and not relocatable.
9809 (General_options::output_is_pie): Remove.
9810 * options.cc (General_options::finalize): Reject incompatible uses
9811 of -pie.
9812 * gold.cc (queue_middle_tasks): A -pie link is not static.
9813 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9814 * symtab.cc (Symbol::final_value_is_known): Return false if
9815 output_is_position_independent.
9816 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9817 output_is_position_independent.
9818 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9819 output_is_position_independent.
9820 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9821 output_is_position_independent.
9822 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9823 two_file_pie_test.
9824 (basic_pie_test.o, basic_pie_test): New targets.
9825 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9826 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9827 (two_file_pie_test): New target.
9828 * testsuite/Makefile.in: Rebuild.
9829 * README: Remove note saying that -pie is not supported.
9830
c6585162
ILT
98312009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9832
9833 * options.h (class General_options): Add -init and -fini.
9834 * layout.cc (Layout::finish_dynamic_section): Emit
9835 given init and fini functions.
9836
032ce4e9
ST
98372009-10-13 Sriraman Tallam <tmsriram@google.com>
9838
9839 * gc.h (gc_process_relocs): Check if icf is enabled using new
9840 function.
9841 * gold.cc (queue_initial_tasks): Likewise.
9842 (queue_middle_tasks): Likewise.
9843 * object.cc (do_layout): Likewise.
9844 * symtab.cc (is_section_folded): Likewise.
9845 * main.cc (main): Likewise.
9846 * reloc.cc (Read_relocs::run): Likewise.
9847 (Sized_relobj::do_scan_relocs): Likewise.
9848 * icf.cc (is_function_ctor_or_dtor): New function.
9849 (Icf::find_identical_sections): Check if function is ctor or dtor when
9850 safe icf is chosen.
9851 * options.h (General_options::icf): Change option to be an enum.
9852 (Icf_status): New enum.
9853 (icf_enabled): New method.
9854 (icf_safe_folding): New method.
9855 (set_icf_status): New method.
9856 (icf_status_): New variable.
9857 * (options.cc) (General_options::finalize): Set icf_status_.
9858 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9859 icf_test and icf_keep_unique_test to use the --icf enum flag.
9860 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9861 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9862
f345227a
ST
98632009-10-12 Sriraman Tallam <tmsriram@google.com>
9864
9865 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9866 includes to gc.h and icf.h.
9867 * arm.cc: Include gc.h.
9868 * gold.cc: Likewise.
9869 * i386.cc: Likewise.
9870 * powerpc.cc: Likewise.
9871 * sparc.cc: Likewise.
9872 * x86_64.cc: Likewise.
9873 * gc.h: Include icf.h.
9874
1c7814ed
ILT
98752009-10-11 Ian Lance Taylor <iant@google.com>
9876
9877 * plugin.cc: Include "gold.h" before other header files.
9878
ae3b5189
CD
98792009-10-10 Chris Demetriou <cgd@google.com>
9880
9881 * options.h (Input_file_argument::Input_file_type): New enum.
9882 (Input_file_argument::is_lib_): Replace with...
9883 (Input_file_argument::type_): New member.
9884 (Input_file_argument::Input_file_argument): Take Input_file_type
9885 'type' rather than boolean 'is_lib' as second argument.
9886 (Input_file_argument::is_lib): Use type_.
9887 (Input_file_argument::is_searched_file): New function.
9888 (Input_file_argument::may_need_search): Handle is_searched_file.
9889 * options.cc (General_options::parse_library): Support -l:filename.
9890 (General_options::parse_just_symbols): Update for Input_file_argument
9891 changes.
9892 (Command_line::process): Likewise.
9893 * archive.cc (Archive::get_file_and_offset): Likewise.
9894 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9895 * script.cc (read_script_file, script_add_file): Likewise.
9896 * fileread.cc (Input_file::Input_file): Likewise.
9897 (Input_file::will_search_for): Handle is_searched_file.
9898 (Input_file::open): Likewise.
9899 * readsyms.cc (Read_symbols::get_name): Likewise.
9900 * testsuite/Makefile.am (searched_file_test): New test.
9901 * testsuite/Makefile.in: Regenerate.
9902 * testsuite/searched_file_test.cc: New file.
9903 * testsuite/searched_file_test_lib.cc: New file.
9904
f3048a1d
ILT
99052009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9906 Ian Lance Taylor <iant@google.com>
9907
9908 * descriptor.cc: Include <cstdio> and "binary-io.h".
9909 (Descriptors::open): Open the files in binary mode always.
9910 * script.cc (Lex::get_token): Treat \r as whitespace.
9911
d4780e57
ILT
99122009-10-09 Ian Lance Taylor <iant@google.com>
9913
9914 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9915
d9a893b8
ILT
99162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9917 Ian Lance Taylor <iant@google.com>
9918
9919 * configure.ac: Check for readv function also.
9920 * fileread.cc (readv): Define if not HAVE_READV.
9921 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9922 does not exist.
9923 * config.in: Regenerate.
9924 * configure: Regenerate.
9925
c0a62865
DK
99262009-10-09 Doug Kwan <dougkwan@google.com>
9927
9928 * layout.cc (Layout::make_output_section): Call target hook to make
9929 ordinary output section.
9930 (Layout::finalize): Adjust parameter list of call the
9931 Target::may_relax().
9932 * layout.h (class Layout::section_list): New method.
9933 * merge.h (Output_merge_base::entsize): Change visibility to public.
9934 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9935 New methods.
9936 (Output_merge_string::do_is_string): New method.
9937 * object.cc (Sized_relobj::do_setup): renamed from
9938 Sized_relobj::set_up.
9939 * object.h (Sized_relobj::adjust_shndx,
9940 Sized_relobj::initializ_input_to_output_maps,
9941 Sized_relobj::free_input_to_output_maps): Change visibilities to
9942 protected.
9943 (Sized_relobj::setup): Virtualize.
9944 (Sized_relobj::do_setup): New method declaration.
9945 (Sized_relobj::invalidate_section_offset,
9946 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9947 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9948 * options.cc (parse_int): New function.
9949 * options.h (parse_int): New declaration.
9950 (DEFINE_int): New macro.
9951 (stub_group_size): New option.
9952 * output.cc (Output_section::Output_section): Initialize memebers
9953 merge_section_map_, merge_section_by_properties_map_,
9954 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9955 (Output_section::add_input_section): Handled deferred code-fill
9956 generation and remove an old comment.
9957 (Output_section::add_relaxed_input_section): New method definition.
9958 (Output_section::add_merge_input_section): Use merge section by
9959 properties map to speed to search. Update merge section maps
9960 as appropriate.
9961 (Output_section::build_relaxation_map): New method definition.
9962 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9963 Same.
9964 (Output_section::relax_input_section): Renamed to
9965 Output_section::convert_input_sections_to_relaxed_sections and change
9966 interface to take a vector of pointers to relaxed sections.
9967 (Output_section::find_merge_section,
9968 Output_section::find_relaxed_input_section): New method definitions.
9969 (Output_section::is_input_address_mapped,
9970 Output_section::output_offset, Output_section::output_address):
9971 Use output section data maps to speed up searching.
9972 (Output_section::find_starting_output_address): Add comments.
9973 (Output_section::do_write,
9974 Output_section::write_to_postprocessing_buffer): Do code-fill
9975 generation as appropriate.
9976 (Output_section::get_input_sections): Invalidate relaxed input section
9977 map.
9978 (Output_section::restore_states): Adjust type of checkpoint .
9979 Invalidate relaxed input section map.
9980 * output.h (Output_merge_base): New class declaration.
9981 (Input_section_specifier): New class defintion.
9982 (class Output_relaxed_input_section) Change base class to
9983 Output_section_data_build.
9984 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9985 base class initializer.
9986 (Output_section::add_relaxed_input_section): New method declaration.
9987 (Output_section::Input_section): Change visibility to protected.
2e702c99 9988 (Output_section::Input_section::relobj,
c0a62865
DK
9989 Output_section::Input_section::shndx): Handle relaxed input sections.
9990 Output_section::input_sections) Change visibility to protected. Also
9991 define overload to return a non-const pointer.
9992 (Output_section::Merge_section_properties): New class defintion.
9993 (Output_section::Merge_section_by_properties_map,
9994 Output_section::Output_section_data_by_input_section_map,
9995 Output_section::Relaxation_map): New types.
9996 (Output_section::relax_input_section): Rename method to
9997 Output_section::convert_input_sections_to_relaxed_sections and change
9998 interface to take a vector of relaxed section pointers.
9999 (Output_section::find_merge_section,
10000 Output_section::find_relaxed_input_section,
10001 Output_section::build_relaxation_map,
10002 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10003 New method declarations.
10004 (Output_section::merge_section_map_
10005 Output_section::merge_section_by_properties_map_,
10006 Output_section::relaxed_input_section_map_,
10007 Output_section::is_relaxed_input_section_map_valid_,
10008 Output_section::generate_code_fills_at_write_): New data members.
10009 * script-sections.cc
10010 (Output_section_element_input::set_section_addresses): Call
10011 current_data_size and addralign methods of relaxed input sections.
10012 (Orphan_output_section::set_section_addresses): Call current_data_size
10013 and addralign methods of relaxed input sections.
10014 * symtab.cc (Symbol_table::compute_final_value): Extract template
10015 from the body of Symbol_table::sized_finalize_symbol.
10016 (Symbol_table::sized_finalized_symbol): Call
10017 Symbol_table::compute_final_value.
10018 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10019 (Symbol_table::compute_final_value): New templated method declaration.
10020 * target.cc (Target::do_make_output_section): New method defintion.
10021 * target.h (Target::make_output_section): New method declaration.
10022 (Target::relax): Add more parameters for input objects, symbol table
10023 and layout. Adjust call to do_relax.
10024 (Target::do_make_output_section): New method declaration.
10025 (Target::do_relax): Add parameters for input objects, symbol table
10026 and layout.
10027
d446d6c4
ILT
100282009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10029
10030 * pread.c: Include stdio.h.
10031
bc06c745
ILT
100322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10033
10034 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10035 defined.
10036
75aea3d0
ILT
100372009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10038
10039 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10040 Change read_shndx type to unsigned int.
10041 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10042 int.
10043 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10044 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10045 Change read_shndx type to unsigned int.
10046 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10047 int.
10048 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10049 * layout.cc (Layout::create_symtab_sections): Cast the result of
10050 local_symcount * symsize to off_t in the gold_assert.
10051
be8fcb75
ILT
100522009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10053
10054 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10055 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10056 R_ARM_BASE_ABS.
10057 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10058 (Arm_relocate_functions::thm_abs5): New function.
10059 (Arm_relocate_functions::abs12): New function.
10060 (Arm_relocate_functions::abs16): New function.
10061 (Arm_relocate_functions::base_abs): New function.
10062 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10063 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10064 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10065 R_ARM_BASE_ABS.
10066 (Scan::global): Likewise.
10067 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10068 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10069 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10070 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10071 R_ARM_BASE_ABS.
10072
c2a122b6
ILT
100732009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10074
10075 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10076 (Arm_relocate_functions::movt_prel): New function.
10077 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10078 (Arm_relocate_functions::thm_movt_prel): New function.
10079 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10080 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10081 (Scan::global, Relocate::relocate): Likewise.
10082 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10083
c4aa1e2d
ILT
100842009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10085
10086 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10087 Incremental_checker.
10088 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10089 unsigned int.
10090 (class Incremental_inputs_header): New class.
10091 (Incremental_inputs_header_writer): Edit comment.
10092 (Incremental_inputs_entry): New class.
10093 (Incremental_inputs_entry_writer): Edit comment.
10094 (Sized_incremental_binary::do_find_incremental_inputs_section):
10095 Add *strtab_shndx parameter, fill it.
10096 (Sized_incremental_binary::do_check_inputs): New method.
10097 (Incremental_checker::can_incrementally_link_output_file): Use
10098 Sized_incremental_binary::check_inputs.
10099 (Incremental_inputs::report_command_line): Save command line in
10100 command_line_.
10101 * incremental.h:
10102 (Incremental_binary::find_incremental_inputs_section): New
10103 method.
10104 (Incremental_binary::do_find_incremental_inputs_section): Add
10105 strtab_shndx parameter.
10106 (Incremental_binary::do_check_inputs): New pure virtual method.
10107 (Sized_incremental_binary::do_check_inputs): Declare.
10108 (Incremental_checker::Incremental_checker): Add incremental_inputs
10109 parameter, use it to initialize incremental_inputs_.
10110 (Incremental_checker::incremental_inputs_): New field.
10111 (Incremental_checker::command_line): New method.
10112 (Incremental_checker::inputs): New method.
10113 (Incremental_checker::command_line_): New field.
10114
c549a694
ILT
101152009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10116
10117 * incremental.cc: Include <cstdarg> and "target-select.h".
10118 (vexplain_no_incremental): New function.
10119 (explain_no_incremental): New function.
10120 (Incremental_binary::error): New method.
10121 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10122 method.
10123 (make_sized_incremental_binary): New function.
10124 (open_incremental_binary): New function.
10125 (can_incrementally_link_file): Add checks if output is ELF and has
10126 inputs section.
10127 * incremental.h: Include "elfcpp_file.h" and "output.h".
10128 (Incremental_binary): New class.
10129 (Sized_incremental_binary): New class.
10130 (open_incremental_binary): Declare.
10131 * object.cc (is_elf_object): Use
10132 elfcpp::Elf_recognizer::is_elf_file.
10133 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10134 * output.h (Output_file::filesize): New method.
10135
fd3c5f0b
ILT
101362009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10137
10138 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10139 New function.
10140 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10141 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10142 function.
10143 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10144 function.
10145 (Arm_relocate_functions::movw_abs_nc): New function.
10146 (Arm_relocate_functions::movt_abs): New function.
10147 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10148 (Arm_relocate_functions::thm_movt_abs): New function.
10149 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10150 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10151 (Scan::global): Likewise.
10152 (Relocate::relocate): Likewise.
10153 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10154
7f5309a5
ILT
101552009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10156
10157 * arm.cc (Arm_relocate_functions::got_prel) New function.
10158 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10159 (Relocate::relocate): Likewise.
10160 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10161
364c7fa5
ILT
101622009-10-06 Ian Lance Taylor <iant@google.com>
10163
10164 * options.h (class General_options): Define
10165 split_stack_adjust_size parameter.
10166 * object.h (class Object): Add uses_split_stack_ and
10167 has_no_split_stack_ fields. Add uses_split_stack and
10168 has_no_split_stack accessor functions. Declare
10169 handle_split_stack_section.
10170 (class Reloc_symbol_changes): Define.
10171 (class Sized_relobj): Define Function_offsets. Declare
10172 split_stack_adjust, split_stack_adjust_reltype, and
10173 find_functions.
10174 * object.cc (Object::handle_split_stack_section): New function.
10175 (Sized_relobj::do_layout): Call handle_split_stack_section.
10176 * dynobj.cc (Sized_dynobj::do_layout): Call
10177 handle_split_stack_section.
10178 * reloc.cc (Sized_relobj::relocate_sections): Call
10179 split_stack_adjust for executable sections in split_stack
10180 objects. Pass reloc_map to relocate_section.
10181 (Sized_relobj::split_stack_adjust): New function.
10182 (Sized_relobj::split_stack_adjust_reltype): New function.
10183 (Sized_relobj::find_functions): New function.
10184 * target-reloc.h: Include "object.h".
10185 (relocate_section): Add reloc_symbol_changes parameter. Change
10186 all callers.
10187 * target.h (class Target): Add calls_non_split method. Declare
10188 do_calls_non_split virtual method. Declare match_view and
10189 set_view_to_nop.
10190 * target.cc: Include "elfcpp.h".
10191 (Target::do_calls_non_split): New function.
10192 (Target::match_view): New function.
10193 (Target::set_view_to_nop): New function.
10194 * gold.cc (queue_middle_tasks): Give an error if mixing
10195 split-stack and non-split-stack objects with -r.
10196 * i386.cc (Target_i386::relocate_section): Add
10197 reloc_symbol_changes parameter.
10198 (Target_i386::do_calls_non_split): New function.
10199 * x86_64.cc (Target_x86_64::relocate_section): Add
10200 reloc_symbol_changes parameter.
10201 (Target_x86_64::do_calls_non_split): New function.
10202 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10203 parameter.
10204 * powerpc.cc (Target_powerpc::relocate_section): Add
10205 reloc_symbol_changes parameter.
10206 * sparc.cc (Target_sparc::relocate_section): Add
10207 reloc_symbol_changes parameter.
10208 * configure.ac: Call AM_CONDITIONAL for the default target.
10209 * configure: Rebuild.
10210 * testsuite/Makefile.am (TEST_AS): New variable.
10211 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10212 (check_DATA): Add split_i386 and split_x86_64 files.
10213 (SPLIT_DEFSYMS): Define.
10214 (split_i386_[1234n].o): New targets.
10215 (split_i386_[124]): New targets.
10216 (split_i386_[1234r].stdout): New targets.
10217 (split_x86_64_[1234n].o): New targets.
10218 (split_x86_64_[124]): New targets.
10219 (split_x86_64_[1234r].stdout): New targets.
10220 (MOSTLYCLEANFILES): Add new executables.
10221 * testsuite/split_i386.sh: New file.
10222 * testsuite/split_x86_64.sh: New file.
10223 * testsuite/split_i386_1.s: New file.
10224 * testsuite/split_i386_2.s: New file.
10225 * testsuite/split_i386_3.s: New file.
10226 * testsuite/split_i386_4.s: New file.
10227 * testsuite/split_i386_n.s: New file.
10228 * testsuite/split_x86_64_1.s: New file.
10229 * testsuite/split_x86_64_2.s: New file.
10230 * testsuite/split_x86_64_3.s: New file.
10231 * testsuite/split_x86_64_4.s: New file.
10232 * testsuite/split_x86_64_n.s: New file.
10233 * testsuite/testfile.cc (Target_test): Update relocation_section
10234 function.
10235 * testsuite/Makefile.in: Rebuild.
10236
e8a9fcda
ILT
102372009-10-06 Ian Lance Taylor <iant@google.com>
10238
10239 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10240 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10241 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10242 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10243 the address on ldo_addrs_.
10244 (Target_i386::Relocate::fix_up_ldo): New function.
10245
e99daf92
ILT
102462009-10-06 Rafael Espindola <espindola@google.com>
10247
10248 * plugin.cc (add_input_library): New.
10249 (Plugin::load): Add add_input_library to tv.
10250 (Plugin_manager::add_input_file): Add the is_lib argument.
10251 (add_input_file): Update call to Plugin_manager::add_input_file.
10252 (add_input_library): New.
10253 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10254
966d4097
DK
102552009-09-30 Doug Kwan <dougkwan@google.com>
10256
10257 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10258 symbol and call Symbol::may_need_copy_reloc to determine if
10259 a copy reloc is needed.
10260 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10261 nocopyreloc is given in command line.
10262 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10263 given in command line.
10264 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10265 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10266 of the removed Target_i386::may_need_copy_reloc.
10267 * options.h (copyreloc): New option with default value false.
10268 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10269 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10270 instead of the removed Target_powerpc::may_need_copy_reloc.
10271 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10272 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10273 instead of the removed Target_sparc::may_need_copy_reloc.
10274 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10275 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10276 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10277 instead of the removed Target_x86_64::may_need_copy_reloc.
10278
029ba973
ILT
102792009-09-30 Ian Lance Taylor <iant@google.com>
10280
10281 * object.h (class Object): Remove target_ field, and target,
10282 sized_target, and set_target methods.
10283 (Object::sized_target): Remove.
10284 (class Sized_relobj): Update declarations. Remove sized_target.
10285 * object.cc (Sized_relobj::setup): Remove target parameter.
10286 Change all callers.
10287 (Input_objects::add_object): Don't do anything with the target.
10288 (make_elf_sized_object): Add punconfigured parameter. Change all
10289 callers. Set or test parameter target.
10290 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10291 Change all callers.
10292 * parameters.cc (Parameters::set_target): Change parameter type to
10293 be non-const.
10294 (Parameters::default_target): Remove.
10295 (set_parameters_target): Change parameter type to be non-const.
10296 (parameters_force_valid_target): New function.
10297 (parameters_clear_target): New function.
10298 * parameters.h (class Parameters): Update declarations. Remove
10299 default_target method. Add sized_target and clear_target
10300 methods. Change target_ to be non-const.
10301 (set_parameters_target): Update declaration.
10302 (parameters_force_valid_target): Declare.
10303 (parameters_clear_target): Declare.
10304 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10305 as NULL if we aren't searching.
10306 (Add_symbols::run): Don't check for compatible target.
10307 * fileread.cc (Input_file::open_binary): Call
10308 parameters_force_valid_target.
10309 * gold.cc (queue_middle_tasks): Likewise.
10310 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10311 set_target on object.
10312 * dynobj.h (class Sized_dynobj): Update declarations.
10313 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10314 make_elf_object returns NULL.
10315 (Archive::include_member): Don't check whether object target is
10316 compatible.
10317 * output.cc (Output_section::add_input_section): Get target from
10318 parameters.
10319 (Output_section::relax_input_section): Likewise.
10320 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10321 parameters.
10322 (Sized_relobj::do_scan_relocs): Likewise.
10323 (Sized_relobj::relocate_sections): Likewise.
10324 * resolve.cc (Symbol_table::resolve): Likewise.
10325 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10326 parameter. Change all callers.
10327 (Symbol_table::add_from_object): Get target from parameters.
10328 (Symbol_table::add_from_relobj): Don't check object target.
10329 (Symbol_table::add_from_dynobj): Likewise.
10330 (Symbol_table::define_special_symbol): Get target from
10331 parameters.
10332 * symtab.h (class Symbol_table): Update declaration.
10333 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10334 parameter. Change all callers. Clear parameter target.
10335 (Binary_test): Test target here.
10336 * testsuite/object_unittest.cc (gold_testsuite): Remove
10337 target_test_pointer parameter. Change all callers.
10338 (Object_test): Test target here.
10339
a6a22b83
ILT
103402009-09-26 Ian Lance Taylor <iant@google.com>
10341
10342 * testsuite/initpri1.c: Don't try to use constructor priorities if
10343 compiling with gcc before 4.3.
10344
6a8f49fe
ILT
103452009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10346
10347 * testsuite/retain_symbols_file_test.sh (check_present): Change
10348 output file name to retain_symbols_file_test.stdout.
10349 (check_absent): Likewise.
10350
8c604651
CS
103512009-09-18 Craig Silverstein <csilvers@google.com>
10352
10353 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10354 * options.cc: Include <cerrno> and <fstream>.
10355 (General_options::finalize): Parse -retain-symbols-file tag.
10356 * options.h: New flag.
10357 (General_options): New method should_retain_symbol, new
10358 variable symbols_to_retain.
10359 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10360 should_retain_symbol map.
10361 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10362 * testsuite/Makefile.in: Regenerate.
10363 * testsuite/retain_symbols_file_test.sh: New file.
10364
ca58b19f
NC
103652009-09-18 Nick Clifton <nickc@redhat.com>
10366
10367 * po/es.po: Updated Spanish translation.
10368
20e6d0d6
DK
103692009-09-17 Doug Kwan <dougkwan@google.com>
10370
10371 * debug.h (DEBUG_RELAXATION): New constant.
10372 (DEBUG_ALL): Add DEBUG_RELAXATION.
10373 (debug_string_to_enum): Add relaxation debug option.
10374 * layout.cc
10375 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10376 Layout::Relaxation_debug_check::read_sections,
10377 Layout::Relaxation_debug_check::read_sections): New method definitions.
10378 (Layout::Layout): Initialize data members
10379 record_output_section_data_from_scrips_,
10380 script_output_section_data_list_ and relaxation_debug_check_.
10381 (Layout::save_segments, Layout::restore_segments,
10382 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10383 Layout::relaxation_loop_body): New method definitions.
10384 (Layout::finalize): Support relaxation. Move section layout code to
10385 Layout::relaxation_loop_body.
10386 (Layout::set_asection_address_from_script): Move code for orphan
10387 section placement out.
10388 (Layout::place_orphan_sections_in_script): New method definition.
10389 * layout.h (Output_segment_headers, Output_file_header):
10390 New forward class declarations.
10391 (Layout::~Layout): Define.
10392 (Layout::new_output_section_data_from_script): New method definition.
10393 (Layout::place_orphan_sections_in_script): New method declaration.
10394 (Layout::Segment_states): New type declaration.
10395 (Layout::save_segments, Layout::restore_segments,
10396 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10397 Layout::relaxation_loop_body): New method declarations.
10398 (Layout::Output_section_data_list): New type declaration.
10399 (Layout::Relaxation_debug_check): New class definition.
10400 (Layout::record_output_section_data_from_script_,
10401 Layout::script_output_section_data_list_, Layout::segment_states_,
10402 Layout::relaxation_debug_check_): New data members.
10403 * output.cc: (Output_section_headers::do_size): New method definition.
10404 (Output_section_headers::Output_section_headers): Move size
10405 computation to Output_section_headers::do_size.
10406 (Output_segment_headers::do_size): New method definition.
e1df38aa 10407 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10408 Output_file_header::do_size and call it.
10409 (Output_file_header::do_size): New method definition.
10410 (Output_data_group::Output_data_group): Adjust call to
10411 Output_section_data.
10412 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10413 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10414 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10415 RELAXED_INPUT_SECTION_CODE.
10416 (Output_section::Output_section): Initialize data member checkpoint_.
10417 (Output_section::~Output_section): Delete checkpoint object pointed
10418 by checkpoint_.
10419 (Output_section::add_input_section): Always add an Input_section if
10420 relaxing.
10421 (Output_section::add_merge_input_section): Add assert.
10422 (Output_section::relax_input_section): New method definition.
10423 (Output_section::set_final_data_size): Set load address to zero for
10424 an unallocated section.
10425 (Output_section::do_address_and_file_offset_have_reset_values):
10426 New method definition.
10427 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10428 Handle relaxed input section.
10429 (Output_section::sort_attached_input_sections): Checkpoint input
10430 section list lazily.
10431 (Output_section::get_input_sections): Change type of input_sections to
10432 list of Simple_input_section pointers. Checkpoint input section list
10433 lazily. Also handle relaxed input sections.
10434 (Output_section::add_input_section_for_script): Take a reference to
10435 a Simple_input_section object instead of Relobj pointer and section
10436 index as parameter. Handle relaxed input sections.
10437 (Output_section::save_states, Output_section::restore_states): New
10438 method definitions.
10439 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10440 (Output_data::is_data_size_fixed): New method definition.
10441 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10442 if it is fixed.
10443 (Output_data::address_and_file_offset_have_reset_values): New method
10444 definition.
10445 (Output_data::do_address_and_file_offset_have_reset_values): New method
10446 definition.
10447 (Output_data::set_data_size): Check that data size is not fixed.
10448 (Output_data::fix_data_size): New method definition.
10449 (Output_data::is_data_size_fixed_): New data member.
10450 (Output_section_headers::set_final_data_size): New method definition.
10451 (Output_section_headers::do_size): New method declaration.
10452 (Output_segment_headers::set_final_data_size): New method definition.
10453 (Output_segment_headers::do_size): New method declaration.
10454 (Output_file_header::set_final_data_size)::New method definition.
10455 (Output_file_header::do_size)::New method declaration.
10456 (Output_section_data::Output_section_data): Add new parameter
10457 is_data_size_fixed and use it to fix data size.
10458 (Output_data_const::Output_data_const): Adjust call to base class
10459 constructor and fix data size.
10460 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10461 base class constructor and fix data size.
10462 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10463 base class constructor and fix data size.
10464 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10465 class constructor and fix data size.
10466 (Output_data_group::set_final_data_size): New method definition.
10467 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10468 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10469 class constructor and fix data size.
10470 (Output_relaxed_input_section): New class definition.
10471 (Output_section::Simple_input_section): New class definition.
10472 (Output_section::get_input_sections): Adjust parameter list.
10473 (Output_section::add_input_section_for_script): Same.
10474 (Output_section::save_states, Output_section::restore_states,
10475 Output_section::do_address_and_file_offset_have_reset_values,
10476 (Output_section::Input_section::Input_section): Handle
10477 RELAXED_INPUT_SECTION_CODE. Add new overload for
10478 Output_relaxed_input_section.
10479 (Output_section::Input_section::is_input_section,
10480 Output_section::Input_section::set_output_section): Handle relaxed
10481 input section.
10482 (Output_section::Input_section::is_relaxed_input_section,
10483 Output_section::Input_section::output_section_data,
10484 Output_section::Input_section::relaxed_input_section): New method
10485 definitions.
10486 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10487 value.
10488 (Output_section::Input_section::u1_): Update comments.
10489 (Output_section::Input_section::u2_): Add new union member poris.
10490 (Output_section::Checkpoint_output_section): New classs definition.
10491 (Output_section::relax_input_section): New method declaration.
10492 (Output_section::checkpoint_): New data member.
10493 (Output_segment): Update comments.
10494 (Output_segment::Output_segment): Un-privatize copy constructor.
10495 (Output_segment::operator=): Un-privatize.
10496 * script-sections.cc (Output_section_element::Input_section_list):
10497 Change element type to Output_section::Simple_input_section.
10498 (Output_section_element_dot_assignment::set_section_addresses):
10499 Register output section data for relaxation clean up.
10500 (Output_data_exression::Output_data_expression): Adjust call to base
10501 constructor to fix data size.
10502 (Output_section_element_data::set_section_addresses): Register
10503 Output_data_expression object for relaxation clean up.
10504 (struct Input_section_info): Replace Relobj pointer and section index
10505 pair with Output_section::Simple_input_section and Convert struct to a
10506 class.
10507 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10508 Input_section_info data member to use accessors.
20e6d0d6
DK
10509 (Output_section_element_input::set_section_addresses): Use layout
10510 parameter. Adjust code to use Output_section::Simple_input_section
10511 and Input_secction_info classes. Register filler for relaxation
10512 clean up.
10513 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10514 and section index pair with Output_section::Simple_input_section
10515 class. Adjust code accordingly.
10516 (Phdrs_element::release_segment): New method definition.
10517 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10518 segment list.
10519 (Script_sections::release_segments): New method definition.
10520 * gold/script-sections.h (Script_sections::release_segments): New
10521 method declaration.
10522 * gold/target.h (Target::may_relax, Target::relax,
10523 Target::do_may_relax, Target::do_relax): New method definitions.
10524
5e445df6
ILT
105252009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10526
10527 * arm.cc (has_signed_unsigned_overflow): New function.
10528 (Arm_relocate_functions::abs8): New function.
10529 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10530 (Target_arm::Scan::global): Likewise.
10531 (Target_arm::relocate::relocate): Likewise.
10532 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10533 Likewise.
10534
8c604651 105352009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10536
10537 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10538 * testsuite/Makefile.in: Regenerate.
10539
1e9cc1c2
NC
105402009-09-11 Nick Clifton <nickc@redhat.com>
10541
10542 * po/gold.pot: Updated by the Translation project.
10543
6a89f575
CC
105442009-09-08 Cary Coutant <ccoutant@google.com>
10545
10546 * output.cc (Output_file::open): Add execute permission to empty file.
10547 * testsuite/Makefile.am (permission_test): New test.
10548 * testsuite/Makefile.in: Regenerate.
10549
fdcac5af
ILT
105502009-09-02 Ian Lance Taylor <iant@google.com>
10551
10552 * output.cc (Output_file::resize): Call map_no_anonymous rather
10553 than map.
10554
44453f85
ILT
105552009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10556
10557 * gold.cc: Include "incremental.h".
10558 (queue_initial_tasks): Call Incremental_checker methods.
10559 * incremental.cc: Include "output.h".
10560 (Incremental_checker::can_incrementally_link_output_file): New
10561 method.
10562 * incremental.h (Incremental_checker): New class.
10563
10564 * output.cc (Output_file::open_for_modification): New method.
10565 (Output_file::map_anonymous): Changed return type to bool. Record
10566 map in base_ field.
10567 (Output_file::map_no_anonymous): New method, broken out of map.
10568 (Output_file::map): Use map_no_anonymous and map_anonymous.
10569 * output.h (class Output_file): Update declarations.
10570
293c1386
CC
105712009-08-24 Cary Coutant <ccoutant@google.com>
10572
10573 * options.h (Command_line::Pre_options): New class.
10574 (Command_line::pre_options): New member.
10575 * options.cc (gold::options::ready_to_register): New variable.
10576 (One_option::register_option): Do nothing if not registering options.
10577 Assert if same short option registered twice.
10578 (General_options::General_options): Turn off option registration when
10579 done constructing.
10580 (Command_line::Pre_options::Pre_options): New constructor.
10581
f773f3d2
CC
105822009-08-24 Cary Coutant <ccoutant@google.com>
10583
06a73cfe
CC
10584 * options.h (General_options::no_keep_memory): Remove incorrect
10585 short option.
f773f3d2 10586
a15af8e2
RW
105872009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10588
10589 * Makefile.am (am__skiplex, am__skipyacc): New.
10590 * Makefile.in: Regenerate.
10591
c462b41b
RW
105922009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10593
14ec8efd
RW
10594 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10595 (INCLUDES): ... this.
10596 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10597 (AM_CPPFLAGS): Renamed from ...
10598 (INCLUDE): ... this.
10599 * Makefile.in, testsuite/Makefile.in: Regenerate.
10600
81ecdfbb
RW
10601 * Makefile.in: Regenerate.
10602 * aclocal.m4: Likewise.
10603 * config.in: Likewise.
10604 * configure: Likewise.
10605 * testsuite/Makefile.in: Likewise.
10606
c462b41b
RW
10607 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10608 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10609 * Makefile.in: Regenerate.
10610 * testsuite/Makefile.in: Regenerate.
10611
2da73f13
CC
106122009-08-19 Cary Coutant <ccoutant@google.com>
10613
10614 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10615 symbols in shared libraries overridden by hidden or internal symbols
10616 in the main program.
10617
2db70501
CD
106182009-08-19 Chris Demetriou <cgd@google.com>
10619
10620 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10621 checking source file names in error messages.
10622
f733487b
DK
106232009-08-18 Doug Kwan <dougkwan@google.com>
10624
10625 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10626 an elcpp::Ehdr as parameter. Adjust call to set_target.
10627 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10628 an elfcpp::Ehdr as parameter.
10629 * object.cc (Object::set_target): Remove the version that looks up
10630 a target and sets it.
10631 (Sized_relobj::setup): Take a Target object instead of
10632 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10633 (make_elf_sized_object): Find target and ask target to
10634 make an ELF object.
10635 * object.h: (Object::set_target): Remove the version that looks up
10636 a target and sets it.
10637 (Sized_relobj::setup): Take a Target object instead of
10638 an elfcpp:Ehdr as parameter.
10639 * target.cc: Include dynobj.h.
10640 (Target::do_make_elf_object_implementation): New.
2e702c99 10641 (Target::do_make_elf_object): New.
f733487b
DK
10642 * target.h (Target::make_elf_object): New template declaration.
10643 (Target::do_make_elf_object): New method declarations.
10644 (Target::do_make_elf_object_implementation): New template declaration.
10645
cc70f101
ILT
106462009-08-14 Ian Lance Taylor <iant@google.com>
10647
10648 * gold.h (FUNCTION_NAME): Define.
10649 (gold_unreachable): Use FUNCTION_NAME.
10650
ef5e0cb1
ST
106512009-08-12 Sriraman Tallam <tmsriram@google.com>
10652
10653 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10654 symbol in the --keep-unique list is not found.
10655
48c187ce
ST
106562009-08-12 Sriraman Tallam <tmsriram@google.com>
10657
10658 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10659 been maked as --keep-unique.
10660 (Icf::unfold_section): New function.
10661 * icf.h (Icf::unfold_section): New function.
10662 * options.h (General_options::keep_unique): New option.
10663 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10664 * testsuite/Makefile.in: Regenerate.
10665 * testsuite/icf_keep_unique_test.sh: New file.
10666 * testsuite/icf_keep_unique_test.cc: New file.
10667
645afe0c
CC
106682009-08-12 Cary Coutant <ccoutant@google.com>
10669
10670 PR 10471
10671 * resolve.cc (Symbol_table::resolve): Check for references from
10672 dynamic objects to hidden and internal symbols.
10673 * testsuite/Makefile.am (hidden_test.sh): New test.
10674 * testsuite/Makefile.in: Regenerate.
10675 * testsuite/hidden_test.sh: New script.
10676 * testsuite/hidden_test_1.c: New test source.
10677 * testsuite/hidden_test_main.c: New test source.
10678
11af873f
DK
106792009-08-11 Doug Kwan <dougkwan@google.com>
10680
10681 * arm.cc: Update comments.
10682 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10683 segment to locate the .ARM.exidx section if present.
10684
b9f7d72d
DK
106852009-08-09 Doug Kwan <dougkwan@google.com>
10686
10687 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10688 patch.
10689
ddd3c53c
ST
106902009-08-07 Sriraman Tallam <tmsriram@google.com>
10691 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10692 compiler warnings.
10693
27721062
ST
106942009-08-06 Sriraman Tallam <tmsriram@google.com>
10695
10696 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10697 valid tls_segment only for non-debug-section relocations.
10698 * testsuite/Makefile.am: Add gc_tls_test.
10699 * testsuite/Makefile.in: Regenerate.
10700 * testsuite/gc_tls_test.cc: New file.
10701 * testsuite/gc_tls_test.sh: New file.
10702
ef15dade 107032009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10704
ef15dade
ST
10705 * icf.cc: New file.
10706 * icf.h: New file.
10707 * Makefile.am (CCFILES): Add icf.cc.
10708 (HFILES): Add icf.h
10709 * Makefile.in: Regenerate.
10710 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10711 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10712 section, symbol and addend information for the relocs.
10713 * gold.cc (queue_middle_tasks): Call identical code folding.
10714 * gold.h: Add defines for multimap.
10715 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10716 to the call of finalize_local_symbols.
10717 * main.cc (main): Create object of class Icf.
10718 * object.cc (Sized_relobj::do_layout): Allow this function to be
10719 called twice during icf.
10720 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10721 to sections marked as identical by icf.
10722 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10723 when available.
10724 (Sized_relobj::do_section_entsize): New function.
10725 * object.h (Object::section_entsize): New function.
10726 (Object::do_section_entsize): New pure virtual function.
10727 (Relobj::finalize_local_symbols): Add new parameter.
10728 (Relobj::do_section_entsize): New function.
10729 * options.h (General_options::icf): New option.
10730 (General_options::icf_iterations): New option.
10731 (General_options::print_icf_sections): New option.
10732 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10733 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10734 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10735 icf.
10736 * symtab.cc (Symbol_table::is_section_folded): New function.
10737 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10738 to sections marked as identical by icf.
10739 * symtab.h (Symbol_table::set_icf): New function.
10740 (Symbol_table::icf): New function.
10741 (Symbol_table::is_section_folded): New function.
10742 (Symbol_table::icf_): New data member.
10743 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10744 * testsuite/Makefile.am: Add commands to build icf_test.
10745 * testsuite/Makefile.in: Regenerate.
10746 * testsuite/icf_test.sh: New file.
10747 * testsuite/icf_test.cc: New file.
10748
c3b65ac4
CD
107492009-07-24 Chris Demetriou <cgd@google.com>
10750
10751 * layout.cc (is_compressible_debug_section): Fix incorrect
10752 comment about compressed section names.
10753
1caf2c51
ILT
107542009-07-20 Ian Lance Taylor <ian@airs.com>
10755
10756 PR 10419
10757 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10758
1ef4d87f
ILT
107592009-07-16 Ian Lance Taylor <iant@google.com>
10760
10761 PR 10400
10762 * layout.h: #include <map>.
10763 (class Kept_section): Change from struct to class. Add accessors
10764 and setters. Add section size to Comdat_group mapping. Change
10765 Comdat_group to std::map. Add is_comdat_ field. Add
10766 linkonce_size field in union.
10767 (class Layout): Update declaration of find_or_add_kept_section.
10768 Don't declare find_kept_object.
10769 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10770 parameter. Add object, shndx, is_comdat, and is_group_name
10771 parameters. Change all callers. Adjust for new Kept_section.
10772 (Layout::find_kept_object): Remove.
10773 * object.cc (Sized_relobj::include_section_group): Update use of
10774 Kept_section. Rename secnum to shndx. Only record
10775 Kept_comdat_section if sections are the same size.
10776 (Sized_relobj::include_linkonce_section): Update use of
10777 Kept_section. Only record Kept_comdat_section if sections are the
10778 same size. Set size of linkonce section.
10779 (Sized_relobj::map_to_kept_section): Update call to
10780 get_kept_comdat_section.
10781 * object.h (class Sized_relobj): Rename fields in
10782 Kept_comdat_section to drop trailing underscores; change object
10783 field to Relobj*. Change Kept_comdat_section_table to store
10784 struct rather than pointer.
10785 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10786 Add kept_object and kept_shndx parameters. Change all callers.
10787 (Sized_relobj::get_kept_comdat_section): Change return type to
10788 bool. Add kept_object and kept_shndx parameters. Change all
10789 callers.
10790 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10791 Layout::find_or_add_kept_section.
10792
37c3b7b0
ILT
107932009-07-09 Ian Lance Taylor <iant@google.com>
10794
10795 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10796 Reserve space in the hash table.
10797
98fa85cb
ILT
107982009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10799
10800 * fileread.cc (File_read::get_mtime): New method.
10801 * fileread.h (Timespec): New structure.
10802 (File_read::get_mtime): New method.
10803 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10804 Renamed from timestamp_nsec.
10805 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10806 Elf_Xword.
e1df38aa 10807 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10808 timestamp_nsec.
e1df38aa 10809 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10810 (Incremental_inputs::report_obejct): Save mtime; style fix.
10811 (Incremental_inputs::report_script): Save mtime; style fix.
10812 (Incremental_inputs::finalize_inputs): Style fix.
10813 (Incremental_inputs::finalize): Style fix.
10814 (Incremental_inputs::create_input_section_data): Store inputs
10815 mtime.
10816 * incremental.h (Incremental_inputs::report_script): Add mtime
10817 argument.
10818 (Incremental_inputs::Input_info::Input_info): Intialize only one
10819 union member.
10820 (Incremental_inputs::Input_info::archive): Move to nameless
10821 union.
10822 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10823 (Incremental_inputs::Input_info::script): Move to nameless union.
10824 (Incremental_inputs::mtime): New field.
10825 * script.cc (read_input_script): Pass file mtime to
10826 Incremental_input.
10827 * script.h (Script_info::inputs): Style fix.
10828
c9d70757
ILT
108292009-07-01 Ian Lance Taylor <ian@airs.com>
10830
10831 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10832 instead of 32.
10833
9c547ec3
ILT
108342009-06-24 Ian Lance Taylor <iant@google.com>
10835
10836 PR 10156
10837 * layout.cc (Layout::choose_output_section): If we find an
10838 existing section, update the flags.
10839 (Layout::create_notes): New function, broken out of
10840 Layout::finalize.
10841 (Layout::finalize): Don't create note sections.
10842 (Layout::create_note): Don't crash if linker script discards
10843 section.
10844 (Layout::create_gold_note): Likewise.
10845 (Layout::create_build_id): Likewise. Don't set
10846 after_input_sections on the section.
10847 (Layout::create_executable_stack_info): Remove target parameter.
10848 Change caller.
10849 * layout.h (class Layout): Declare create_notes. Update
10850 declaration of create_executable_stack_info.
10851 * gold.cc (queue_middle_tasks): Call create_notes.
10852 * output.cc (Output_section::update_flags_for_input_section): Move
10853 here from output.h. If SHF_ALLOC flag is newly set, mark address
10854 invalid.
10855 * output.h (Output_data::mark_address_invalid): New function.
10856 (class Output_section): Only declare, not define,
10857 update_flags_for_input_section. Remove set_flags.
10858
55458500
ILT
108592009-06-24 Ian Lance Taylor <iant@google.com>
10860
10861 * script-sections.cc (Output_section_definition::
10862 set_section_addresses): Rename shadowing local load_address to
10863 laddr.
10864
1307d6cd
ILT
108652009-06-24 Ian Lance Taylor <iant@google.com>
10866
10867 PR 10244
10868 * reloc.cc (relocate_sections): Skip empty relocation sections.
10869
ec3f783e
ILT
108702009-06-23 Ian Lance Taylor <iant@google.com>
10871
10872 PR 10156
10873 * layout.cc (Layout::create_note): Use choose_output_section
10874 rather than make_output_section.
10875
459c9f1c
ILT
108762009-06-23 Ian Lance Taylor <iant@google.com>
10877
10878 PR 10237
10879 * options.cc (General_options::parse_V): Set printed_version_.
10880 (General_options::General_options): Initialize printed_version_.
10881 * options.h (class General_options): Add printed_version_ field.
10882 * gold.cc (queue_initial_tasks): If there are no input files,
10883 don't give a fatal error if we printed the version information.
10884 (queue_middle_tasks): If using -r with a shared object, give a
10885 fatal error rather than an ordinary error.
10886
1518dc8f
ILT
108872009-06-23 Ian Lance Taylor <iant@google.com>
10888
10889 PR 10219
10890 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10891 (Layout::make_output_section): Set have_stabstr_section_ if we see
10892 a .stab*str section.
10893 (Layout::finalize): Call link_stabs_sections.
10894 (Layout::link_stabs_sections): New file.
10895 * layout.h (class Layout): Add have_stabstr_section_ field.
10896 Declare link_stabs_sections.
10897
3d857b98
DK
108982009-06-23 Doug Kwan <dougkwan@google.com>
10899
10900 * Makefile.am (libgold_a_LIBADD): New.
10901 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10902 * Makefile.in: Regenerate.
3d857b98
DK
10903 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10904 * configure: Regenerate.
10905 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10906 * fileread.cc: Include sys/state.h
10907 * gold.h: Declare memmem and strndup if found missing.
10908 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10909
0639a6f6
ILT
109102009-06-23 Ian Lance Taylor <iant@google.com>
10911
10912 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10913 * configure: Rebuild.
10914
8d63875c
ILT
109152009-06-23 Ian Lance Taylor <iant@google.com>
10916
10917 PR 10147
10918 * object.cc (Object::section_contents): Don't try to get a view if
10919 the section has length zero.
10920 (Object::handle_gnu_warning_section): If the section is empty, use
10921 the name of the section as the warning.
10922
f7c8a183
ILT
109232009-06-23 Ian Lance Taylor <iant@google.com>
10924
10925 PR 10133
10926 * stringpool.h (class Stringpool_template): Add optimize_ field.
10927 (Stringpool_template::set_optimize): New function.
10928 * stringpool.cc (Stringpool_template::Stringpool_template):
10929 Initialize optimize_ field.
10930 (Stringpool_template::set_string_offsets): Test local optimize
10931 fild rather than parameter.
10932 * layout.cc (Layout::Layout): Call set_optimize on the section
10933 name stringpool.
10934
e6a307ba
ILT
109352009-06-22 Ian Lance Taylor <iant@google.com>
10936
10937 PR 10030
10938 * yyscript.y: Parse TARGET.
10939 * script.cc (script_set_target): New function.
10940 * script-c.h (script_set_target): Declare.
10941 * options.cc (General_options::string_to_object_format): Rename
10942 from string_to_object_format in anonymous namespace. Change
10943 callers.
10944 * options.h (class General_options): Declare
10945 string_to_object_format.
10946
3ee173de
ILT
109472009-06-22 Ian Lance Taylor <iant@google.com>
10948
10949 * script-sections.cc (Script_sections::create_segments): Don't put
10950 program headers in a PT_LOAD segment if -n or -N.
10951
109522009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10953
10954 PR 10141
10955 * options.h (class General_options): Add -z lazy and -z now. Sort
10956 -z options into alphabetical order.
10957 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10958
cd6739a1 109592009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10960
10961 * layout.cc (Layout::make_output_section): Call
10962 Target::new_output_section.
10963 (Layout::attach_allocated_section_to_segment): Put large section
10964 sections in a separate load segment with the large segment flag
10965 set.
10966 (Layout::segment_precedes): Sort large data segments after other
10967 load segments.
10968 (align_file_offset): New static function.
10969 (Layout::set_segment_offsets): Use align_file_offset.
10970 * output.h (class Output_section): Add is_small_section_ and
10971 is_large_section_ fields.
10972 (Output_section::is_small_section): New function.
10973 (Output_section::set_is_small_section): New function.
10974 (Output_section::is_large_section): New function.
10975 (Output_section::set_is_large_section): New function.
10976 (Output_section::is_large_data_section): New function.
10977 (class Output_segment): Add is_large_data_segment_ field.
10978 (Output_segment::is_large_data_segment): New function.
10979 (Output_segment::set_is_large_data_segment): New function.
10980 * output.cc (Output_section::Output_section): Initialize new
10981 fields.
10982 (Output_segment::Output_segment): Likewise.
10983 (Output_segment::add_output_section): Add assertion that large
10984 data sections always go in large data segments. Force small data
10985 sections to the end of the list of data sections. Force small BSS
10986 sections to the start of the list of BSS sections. For large BSS
10987 sections to the end of the list of BSS sections.
10988 * symtab.h (class Symbol): Declare is_common_shndx.
10989 (Symbol::is_defined): Check Symbol::is_common_shndx.
10990 (Symbol::is_common): Likewise.
10991 (class Symbol_table): Define enum Commons_section_type. Update
10992 declarations. Add small_commons_ and large_commons_ fields.
10993 * symtab.cc (Symbol::is_common_shndx): New function.
10994 (Symbol_table::Symbol_table): Initialize new fields.
10995 (Symbol_table::add_from_object): Put small and large common
10996 symbols in the right list.
10997 (Symbol_table::sized_finalized_symbol): Check
10998 Symbol::is_common_shndx.
10999 (Symbol_table::sized_write_globals): Likewise.
11000 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11001 common symbol lists. Don't call do_allocate_commons_list if the
11002 list is empty.
11003 (Symbol_table::do_allocate_commons_list): Remove is_tls
11004 parameter. Add comons_section_type parameter. Change all
11005 callers. Handle small and large common symbols.
11006 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11007 Symbol::is_common_shndx.
11008 * resolve.cc (symbol_to_bits): Likewise.
11009 * target.h (Target::small_common_shndx): New function.
11010 (Target::small_common_section_flags): New function.
11011 (Target::large_common_shndx): New function.
11012 (Target::large_common_section_flags): New function.
11013 (Target::new_output_section): New function.
11014 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11015 small_common_section_flags, and large_common_section_flags
11016 fields.
11017 (Target::do_new_output_section): New virtual function.
11018 * arm.cc (Target_arm::arm_info): Initialize new fields.
11019 * i386.cc (Target_i386::i386_info): Likewise.
11020 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11021 Likewise.
11022 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11023 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11024 (Target_x86_64::do_new_output_section): New function.
11025 * configure.ac: Define conditional MCMODEL_MEDIUM.
11026 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11027 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11028 (large_LDFLAGS): Define.
11029 * testsuite/large.c: New file.
11030 * testsuite/testfile.cc (Target_test::test_target_info):
11031 Initialize new fields.
11032 * configure, testsuite/Makefile.in: Rebuild.
11033
bb04269c
DK
110342009-06-05 Doug Kwan <dougkwan@google.com>
11035
11036 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11037 * Makefile.in: Regenerate.
bb04269c
DK
11038 * i386.cc (class Target_i386): Define new virtual method to
11039 override do_is_local_label_name in parent.
11040 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11041 local symbols if --discard-locals or -X is given.
11042 * options.h (class General_options): Declare new options
11043 '--discard-locals' and '-X' for discarding locals.
11044 * target.h (class Target): Define new methods is_local_label_name.
11045 Declare new virtual method do_is_local_label_name.
11046 * target.cc: New file.
11047 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11048 (check_SCRIPTS): Add discard_locals_test.sh.
11049 (check_DATA): Add discard_local_tests.syms.
11050 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11051 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11052 * testsuite/Makefile.in: Regenerate.
11053 * testsuite/discard_locals_test.c: New file.
11054 * testsuite/discard_locals_test.sh: Same.
11055
805bb01c
DK
110562009-06-05 Doug Kwan <dougkwan@google.com>
11057
11058 * object.cc (Sized_relobj::Sized_relobj): Initialize
11059 discarded_eh_frame_shndx_ to -1U.
11060 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11061 section.
11062 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11063 a discarded .eh_frame section.
11064 (Sized_relobj::do_finalize_local_symbols): Ditto.
11065 * object.h (class Sized_relobj): Declare new member
11066 discarded_eh_frame_shndx_.
11067 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11068 (local_labels_test.o, local_labels_test): New rules.
11069 * testsuite/Makefile.in: Regenerate.
11070
1dcd334d
DK
110712009-06-04 Doug Kwan <dougkwan@google.com>
11072
11073 * layout.cc (Layout::section_name_mapping): Add mapping for
11074 special ARM sections.
11075
96d49306
DK
110762009-06-03 Doug Kwan <dougkwan@google.com>
11077
11078 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11079 (utils::has_overflow): Same.
11080
dff16297
ILT
110812009-06-03 Ian Lance Taylor <iant@google.com>
11082
11083 * layout.cc (Layout::section_name_mapping): New array, replacing
11084 Layout::linkonce_mapping.
11085 (Layout::section_name_mapping_count): New variable, replacing
11086 Layout::linkonce_mapping_count.
11087 (Layout::linkonce_output_name): Remove.
11088 (Layout::output_section_name): Rewrite.
11089 * layout.h (class Layout): Rename Linkonce_mapping to
11090 Section_name_mapping, linkonce_mapping to section_name_mapping,
11091 linkonce_mapping_count to section_name_mapping_count. Don't
11092 declare linkonce_output_name.
11093
c121c671
DK
110942009-06-03 Doug Kwan <dougkwan@google.com>
11095
11096 * gold/arm.cc (namespace utils): New.
11097 (Target_arm::reloc_is_non_pic): Define new method.
11098 (class Arm_relocate_functions): New.
11099 (Target_arm::Relocate::relocate): Handle relocation types used by
11100 Android.
11101
07800fab
ILT
111022009-06-03 Ian Lance Taylor <iant@google.com>
11103
11104 * arm.cc (Target_arm::scan::global): Use || instead of |.
11105
c121c671
DK
111062009-06-02 Doug Kwan <dougkwan@google.com>
11107
11108 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11109 issued_non_pic_error_.
11110 (class Target_arm::Scan): Declare new method check_non_pic.
11111 Define new method symbol_needs_plt_entry.
11112 Declare new data member issued_non_pic_error_.
11113 (class Target_arm::Relocate): Declare new method
11114 should_apply_static_reloc.
11115 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11116 (Target_arm::Scan::check_non_pic): Define new method.
11117 (Target_arm::Scan::local): Handle a small subset of reloc types used
11118 by Android.
11119 (Target_arm::Scan::local): Same.
11120 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11121
b19b0c6d
ILT
111222009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11123
11124 * incremental.cc (Incremental_inputs::report_command_line): Filter
11125 out --incremental-* options.
11126
94cdfcff
DK
111272009-05-29 Doug Kwan <dougkwan@google.com>
11128
11129 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11130 template class.
11131 (class Target_arm): Update comment.
11132 (Target_arm::Target_arm): Initialize new data members GOT_,
11133 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11134 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11135 and Target_arm::rel_dyn_section.
11136 Declare new_enum Target_arm::Got_type.
11137 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11138 and DYNBSS_.
11139 Update commments for member do_dynsym_value.
11140 (Target_arm::got_size, Target_arm::plt_section,
11141 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11142 new methods inside class defintion.
11143 (Target_arm::got_section): Define new method.
11144 (Target_arm::rel_dyn_section): Same.
11145 (Output_data_plt_arm): New template class.
11146 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11147 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11148 (Output_data_plt_arm::add_entry): Same.
11149 (Output_data_plt_arm::first_plt_entry): Define new
11150 static data member for PLT instruction template.
11151 (Output_data_plt_arm::plt_entry): Same.
11152 (Output_data_plt_arm::do_write): Define new method.
11153 (Target_arm::make_plt_entry): Same.
11154 (Target_arm::do_finalize_sections): Same.
11155 (Target_arm::do_dynsym_value): Same.
11156
4a657b0d
DK
111572009-05-28 Doug Kwan <dougkwan@google.com>
11158
11159 * Makefile.am (TARGETSOURCES): Add arm.cc.
11160 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11161 * Makefile.in: Regenerate.
11162 * arm.cc: New file.
11163 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11164
e7ae8c36
DK
111652009-05-26 Doug Kwan <dougkwan@google.com>
11166
11167 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11168 (General_options::check_excluded_libs): Strip off directories in
11169 archive name before matching like GNU ld does.
11170 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11171 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11172 (exclude_libs_test_LDFLAGS): Add linker option
11173 -Wl,--exclude-libs,libexclude_libs_test_3
11174 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11175 an explicit archive without using -l.
11176 (alt/libexclude_libs_test_3.a): New make rule.
11177 * testsuite/Makefile.in: Regenerate.
11178 * testsuite/exclude_libs_test.c : Declare lib3_default().
11179 (main): Call it.
11180 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11181 * exclude_libs_test_3.c: New file.
11182
f12e7348
NC
111832009-05-26 Nick Clifton <nickc@redhat.com>
11184
11185 * po/id.po: New Indonesian translation.
11186 * po/gold.pot: Updated template file.
11187
4daadc0d
ST
111882009-05-22 Sriraman Tallam <tmsriram@google.com>
11189
e1df38aa 11190 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11191 gc_comdat_test files. Add -Wl,--gc-sections to build
11192 gc_comdat_test.
11193 * testsuite/Makefile.in: Regenerate.
11194 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11195
531813ad
ST
111962009-05-21 Sriraman Tallam <tmsriram@google.com>
11197
11198 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11199 kept comdat section was garbage collected.
11200 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11201 * testsuite/Makefile.in: Regenerate.
11202 * testsuite/gc_comdat_test.sh: New file.
11203 * testsuite/gc_comdat_test_1.cc: New file.
11204 * testsuite/gc_comdat_test_2.cc: New file.
11205
65514900
CC
112062009-05-19 Doug Kwan <dougkwan@google.com>
11207
11208 * archive.cc (Archive::Archive): Move constructor from archive.h
11209 to here. Initialize no_export_.
11210 (Archive::get_elf_object_for_member): Set no_export flag of object.
11211 * archive.h (Archive::Archive): Move constructor body to
11212 archive.cc.
11213 (Archive::no_export): New method.
11214 (Archive::no_export_): New field.
11215 * object.h (Object::Object): Initialize no_export_ to false.
11216 (Object::no_export, Object::set_no_export): New methods.
11217 (Object::no_export_): New field.
11218 * options.cc (General_options::parse_exclude_libs): New method.
11219 (General_options::check_excluded_libs) Same.
11220 * options.h (exclude_libs): New option.
11221 (General_options::check_excluded_libs): New method declaration.
11222 (General_options::excluded_libs_): New field.
11223 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11224 default or protected visibility if an object has no-export flag set.
11225 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11226 (check_SCRIPTS): Add exclude_libs_test.sh.
11227 (check_DATA): Add exclude_libs_test.syms.
11228 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11229 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11230 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11231 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11232 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11233 libexclude_libs_test_2.a): New rules.
11234 * testsuite/Makefile.in: Regenerate.
11235 * testsuite/exclude_libs_test.c: New file.
11236 * testsuite/exclude_libs_test.sh: Ditto.
11237 * testsuite/exclude_libs_test_1.c: Ditto.
11238 * testsuite/exclude_libs_test_2.c: Ditto.
11239
1b77ea50
ILT
112402009-05-15 Ian Lance Taylor <iant@google.com>
11241
11242 * configure.ac: Check for declarations for cases where libiberty.h
11243 checks HAVE_DECL_xxx.
11244 * configure, config.in: Rebuild.
11245
072fe7ce
ILT
112462009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11247
11248 * gold.h (Incremental_argument_list): Remove (invalid) forward
11249 declaration.
11250 * incremental.cc (Incremental_inputs::report_achive): New method.
11251 (Incremental_inputs::report_object): New method.
11252 (Incremental_inputs::report_script): New method.
11253 (Incremental_inputs::finalize_inputs): New method.
11254 (Incremental_inputs::finalize): Call finalize_inputs().
11255 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11256 Create inputs entries.
11257 * incremental.h (Incremental_input_type): New enum.
11258 (Incremental_inputs::Incremental_input): Initialize new fields.
11259 (Incremental_inputs::report_inputs): New method.
11260 (Incremental_inputs::report_achive): New method.
11261 (Incremental_inputs::report_object): New method.
11262 (Incremental_inputs::report_script): New method.
11263 (Incremental_inputs::finalize_inputs): New method.
11264 (Incremental_inputs::Input_info): New struct.
11265 (Incremental_inputs::Input_info_map): New typedef.
11266 (Incremental_inputs::lock_): New field.
11267 (Incremental_inputs::Inputs_): New field.
11268 (Incremental_inputs::Inputs_map): New field.
11269 * main.cc (main): Call Incremental_input::report_inputs.
11270 * options.h (Input_argument_list): Typedef moved from
11271 Input_arguments.
11272 (Input_file_group::Files): Remove, use ::Input_argument_list.
11273 (Input_file_group::Input_argument_list): Remove, use
11274 ::Input_argument_list.
11275 * plugin.cc (Plugin_manager::add_input_file): Add error in
11276 incremental build.
11277 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11278 functions.
11279 * script.cc (read_input_script): Call
11280 Incremental_input::report_script.
11281 * script.h (Script_info): New class.
11282
b0481b0b
ILT
112832009-04-27 Ian Lance Taylor <iant@google.com>
11284
11285 * x86_64.cc (do_adjust_output_section): Set entsize to
11286 plt_entry_size.
11287
b22a5a41 112882009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11289
11290 * output.cc (Output_file::close): After short writes, continue
11291 writing from the correct offset in the buffer being written.
11292
40fde488
CD
112932009-04-23 Chris Demetriou <cgd@google.com>
11294
11295 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11296 * configure: Regenerate.
11297 * config.in: Regenerate.
11298 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11299 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11300
3ce2c28e
ILT
113012009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11302
11303 * incremental.cc (Incremental_inputs_header_data): Renamed from
11304 Incremental_input_header_data.
11305 (Incremental_inputs_header_data::data_size): New field.
11306 (Incremental_inputs_header_data::put_input_file_count): Renamed
11307 from input_file_count.
11308 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11309 from command_line_offset.
11310 (Incremental_inputs_header_data::put_reserved): Renamed from
11311 put_reserved.
11312 (Incremental_inputs_entry_data): Renamed from
11313 Incremental_input_entry_data.
11314 (Incremental_inputs_entry_data::data_size): New field.
11315 (Incremental_inputs::report_command_line): New method.
11316 (Incremental_inputs::finalize): New method.
11317 (Incremental_inputs::create_incremental_inputs_data): New method.
11318 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11319 * incremental.h: New file.
11320 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11321 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11322 incremental builds.
703d02da 11323 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11324 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11325 (Layout::create_incremental_info_sections): New method.
11326 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11327 * main.cc (main): Notify Incremental_input of the command line.
11328
e55bde5e
ILT
113292009-04-01 Ian Lance Taylor <iant@google.com>
11330 Mikolaj Zalewski <mikolajz@google.com>
11331
11332 * gold.h (reserve_unordered_map): Define, three versions, one for
11333 each version of Unordered_map.
11334 * layout.cc (Layout::Layout): Remove options parameter. Add
11335 number_of_input_files parameter. Don't initialize options_.
11336 Initialize number_of_input_files_ and resized_signatures_. Move
11337 sections_are_attached_.
11338 (Layout::layout_group): Reserve space for group_signatures_.
11339 (Layout::find_or_add_kept_section): Change name parameter to be a
11340 reference. Resize signatures_ map when it gets large enough.
11341 (Layout::layout_eh_frame): Use parameters->options() instead of
11342 this->options_.
11343 (Layout::make_output_section): Likewise.
11344 (Layout::attach_allocated_section_to_segment): Likewise.
11345 (Layout::finalize, Layout::create_executable_stack): Likewise.
11346 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11347 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11348 * layout.h (class Layout): Update declarations. Remove options_
11349 field. Add number_of_input_files_ and resized_signatures_
11350 fields. Move sections_are_attached_ field.
11351 * main.cc (main): Pass number of input files to Layout
11352 constructor. Don't pass options.
11353
154b857c
ILT
113542009-03-30 Ian Lance Taylor <iant@google.com>
11355
11356 * ffsll.c (ffsll): Correct implementation.
11357
2f35ab9b
ILT
113582009-03-27 Ian Lance Taylor <iant@google.com>
11359
fd03461a
ILT
11360 * ffsll.c: New file.
11361 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11362 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11363 * ftruncate.c (ftruncate): Declare before definition.
11364 * mremap.c (mremap): Likewise.
11365 * pread.c (pread): Likewise.
11366 * configure, Makefile.in, config.in: Rebuild.
11367
2f35ab9b
ILT
11368 * mremap.c: New file.
11369 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11370 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11371 (mremap): Declare if HAVE_MREMAP is not defined.
11372 * configure, Makefile.in, config.in: Rebuild.
11373
33aea2fd
CC
113742009-03-27 Cary Coutant <ccoutant@google.com>
11375
11376 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11377 position independent.
11378 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11379 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11380
6d479619
CC
113812009-03-24 Cary Coutant <ccoutant@google.com>
11382
11383 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11384 an executable.
11385 (needs_dynamic_reloc): Likewise.
11386
afc06bb8
ILT
113872009-03-24 Ian Lance Taylor <iant@google.com>
11388
11389 * yyscript.y (file_cmd): Recognize EXTERN.
11390 (extern_name_list, extern_name_list_body): New nonterminals.
11391 * script.cc (script_add_extern): Define.
11392 * script-c.h (script_add_extern): Declare.
11393
f6060a4d
ILT
113942009-03-24 Rafael Avila de Espindola <espindola@google.com>
11395
11396 * object.cc (is_elf_object): Define.
11397 * object.h (is_elf_object): Declare.
11398 * archive.cc (Archive::get_elf_object_for_member): Call
11399 is_elf_object.
33aea2fd 11400 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11401
26736d8e
ILT
114022009-03-24 Elliott Hughes <enh@google.com>
11403
11404 * output.cc (Output_file::map_anonymous): Define.
11405 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11406 try an anonymous one. Report the size if the mmap fails.
11407 * output.h (class Output_file): Declare map_anonymous.
11408
22fd9730
ILT
114092009-03-24 Ian Lance Taylor <iant@google.com>
11410
11411 * target-select.cc (instantiate_target): Don't acquire the lock if
11412 the instantiated_target_ field has already been set.
11413
cb010894
ILT
114142009-03-23 Ian Lance Taylor <iant@google.com>
11415
7f055c20
ILT
11416 * gold-threads.h (class Initialize_lock): Define.
11417 * gold-threads.cc (class Initialize_lock_once): Define.
11418 (initialize_lock_control): New static variable.
11419 (initialize_lock_pointer): New static variable.
11420 (initialize_lock_once): New static function.
11421 (Initialize_lock::Initialize_lock): Define.
11422 (Initialize_lock::initialize): Define.
11423 * target-select.h: Include "gold-threads.h".
11424 (class Target_selector): Add lock_ and initialize_lock_ fields.
11425 Don't define instantiate_target, just declare it.
11426 * target-select.cc (Target_selector::Target_selector): Initialize
11427 new fields.
11428 (Target_selector::instantiate_target): Define.
11429 * descriptors.h: Include "gold-threads.h".
11430 (class Descriptors): Add initialize_lock_ field.
11431 * descriptors.cc (Descriptors::Descriptors): Initialize new
11432 field.
11433 (Descriptors::open): Use initialize_lock_ field
11434 * errors.h (class Errors): Add initialize_lock_ field.
11435 * errors.cc (Errors::Errors): Initialize new field.
11436 (Errors::initialize_lock): Use initialize_lock_ field.
11437 * powerpc.cc (class Target_selector_powerpc): Remove
11438 instantiated_target_ field. In do_recognize call
11439 instantiate_target rather than do_instantiate_target. In
11440 do_instantiate_target just allocate a new target.
11441 * sparc.cc (class Target_selector_sparc): Likewise.
11442
36959681
ILT
11443 * freebsd.h: New file.
11444 * i386.cc: Include "freebsd.h".
11445 (Target_i386): Derive from Target_freebsd rather than
11446 Sized_target.
11447 (Target_selector_i386): Derive from Target_selector_freebsd rather
11448 than Target_selector.
11449 * x86_64.cc: Include "freebsd.h".
11450 (Target_x86_64): Derive from Target_freebsd rather than
11451 Sized_target.
11452 (Target_selector_x86_64): Derive from Target_selector_freebsd
11453 rather than Target_selector.
11454 * target.h (class Target): Add adjust_elf_header and
11455 do_adjust_elf_header.
11456 * output.cc (Output_file_header:: do_sized_write): Call target
11457 adjust_elf_header routine.
11458 * configure.tgt: Set targ_osabi.
11459 * configure.ac: Define GOLD_DEFAULT_OSABI.
11460 * parameters.cc (Parameters::default_target): Pass
11461 GOLD_DEFAULT_OSABI to select_target.
11462 * target-select.h (class Target_selector): Make instantiate_target
11463 protected rather than private.
11464 * Makefile.am (HFILES): Add freebsd.h.
11465 * configure, Makefile.in, config.in: Rebuild.
11466
cb010894
ILT
11467 * merge.cc (do_add_input_section): Correct pend value. Change
11468 message about last entry not being null terminated from error to
11469 warning.
11470
0e879927
ILT
114712009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11472
11473 * incremental.cc: New file.
11474 * Makefile.am (CCFILES): Add incremental.cc.
11475 * Makefile.in: Rebuild.
11476
41105937
PP
114772009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11478
11479 * layout.cc (Layout::output_section_name): Preserve names
11480 of '.note.' sections.
e1df38aa 11481
60439920
ILT
114822009-03-19 Ian Lance Taylor <iant@google.com>
11483
11484 * descriptors.cc (Descriptors::open): Check that the options are
11485 valid before using them.
11486
0d371ad3
ILT
114872009-03-18 Ian Lance Taylor <iant@google.com>
11488
11489 * script-sections.h: Include <list>.
11490 (class Script_sections): Change Sections_elements from std::vector
11491 to std::list. Typedef public Elements_iterator. Add
11492 orphan_section_placement_, data_segment_align_start_, and
11493 saw_data_segment_align_ fields. Remove data_segment_align_index_
11494 field.
11495 * script-sections.cc (class Orphan_section_placement): New class.
11496 (class Sections_element): Add virtual functions is_relro and
11497 orphan_section_init. Remove virtual function place_orphan_here.
11498 (class Output_section_definition): Add is_relro and
11499 orphan_section_init. Remove place_orphan_here.
11500 (class Orphan_output_section): Likewise.
11501 (Script_sections::Script_sections): Update for field changes.
11502 (Script_sections::data_segment_align): Set saw_data_segment_align_
11503 and data_segment_align_start_, not data_segment_align_index.
11504 (Script_sections::data_segment_relro_end): Check
11505 saw_data_segment_align_. Use data_segment_align_start_ rather
11506 than data_segment_align_index_.
11507 (Script_sections::place_orphan): Rewrite to use
11508 Orphan_section_placement.
11509
9201d894
ILT
115102009-03-17 Ian Lance Taylor <iant@google.com>
11511
9c5b8369
ILT
11512 * archive.cc (Archive::add_symbols): Check for a version attached
11513 to the symbol name in the archive map.
11514 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11515 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11516 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11517 (ver_test_11.a): New target.
11518 * testsuite/Makefile.in: Rebuild.
11519
9201d894
ILT
11520 * configure.ac: Check for chsize and posix_fallocate. Replace
11521 ftruncate.
11522 * ftruncate.c: New file, from gnulib.
11523 * output.cc (posix_fallocate): Define dummy version if not
11524 HAVE_POSIX_FALLOCATE.
11525 (Output_file::map): Call posix_fallocate rather than lseek and
11526 write.
11527 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11528 * configure, Makefile.in, config.in: Rebuild.
11529
ef4ab7a8 115302009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11531
ef4ab7a8
PP
11532 * layout.h (Layout::create_note): Add section_name parameter.
11533 * layout.cc (Layout::create_note): Likewise.
11534 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11535
8c500701
ILT
115362009-03-17 Ian Lance Taylor <iant@google.com>
11537
e85b18e1
ILT
11538 * descriptors.cc: Include "options.h".
11539 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11540 (Descriptors::open): Always use O_CLOEXEC when opening a new
11541 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11542 then set FD_CLOEXEC.
11543
9efe6174
ILT
11544 * sparc.cc (class Target_sparc): Add has_got_section.
11545 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11546 make sure we have a GOT section.
11547
11548 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11549 (Target_sparc::Scan::local): Likewise.
11550 (Target_sparc::Scan::global): Likewise.
11551 (Target_sparc::Relocate::relocate): Likewise.
11552 (Target_sparc::Relocate::relocate_tls): Likewise.
11553
8c500701
ILT
11554 * symtab.cc (Symbol_table::define_default_version): New function,
11555 broken out of add_from_object.
11556 (Symbol_table::add_from_object): Call define_default_version.
11557 (Symbol_table::define_special_symbol): Add resolve_oldsym
11558 parameter. Change all callers. If the version for a symbol comes
11559 from a version script, resolve it with the symbol with the same
11560 name with no version. Also add the symbol without a version if
11561 appropriate.
11562 (do_define_in_output_data): If resolving with oldsym, don't delete
11563 sym.
11564 (do_define_in_output_segment): Likewise.
11565 (do_define_as_constant): Likewise.
11566 * symtab.h (class Symbol_table): Update declarations.
11567
f1ed28fb
ILT
115682009-03-13 Ian Lance Taylor <iant@google.com>
11569
15f8229b
ILT
11570 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11571 (Read_symbols::requeue): New function.
11572 (Read_symbols::do_read_symbols): If make_elf_object fails because
11573 the target type is not configured, and the file was searched for,
11574 issue a warning and retry with the next directory.
11575 (Add_symbols::run): If the file has an incompatible format, and
11576 it was searched for, requeue the Read_symbols task. On error,
11577 release the object.
11578 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11579 dirindex parameter to constructor. Change all callers. Declare
11580 incompatible_warning and requeue.
11581 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11582 input_argument_ and input_group_ fields. Add them to
11583 constructor. Change all callers.
11584 (class Read_script): Add dirindex_ field. Add it to constructor.
11585 Change all callers.
11586 * archive.cc (Archive::setup): Remove input_objects parameter.
11587 Change all callers.
11588 (Archive::get_file_and_offset): Likewise.
11589 (Archive::read_all_symbols): Likewise.
11590 (Archive::read_symbols): Likewise.
11591 (Archive::get_elf_object_for_member): Remove input_objects
11592 parameter. Add punconfigured parameter. Change all callers.
11593 (Archive::add_symbols): Change return type to bool. Check return
11594 value of include_member.
11595 (Archive::include_all_members): Likewise.
11596 (Archive::include_member): Change return type to bool. Return
11597 false if first included object has incompatible target. Set
11598 included_member_ field.
11599 (Add_archive_symbols::run): If add_symbols returns false, requeue
11600 Read_symbols task.
11601 * archive.h (class Archive): Add included_member_ field.
11602 Initialize it in constructor. Add input_file and searched_for
11603 methods. Update declarations.
11604 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11605 input_argument_ fields. Add them to constructor. Change all
11606 callers.
11607 * script.cc: Include "target-select.h".
11608 (class Parser_closure): Add skip_on_incompatible_target_ and
11609 found_incompatible_target_ fields. Add
11610 skip_on_incompatible_target parameter to constructor. Change all
11611 callers. Add methods skip_on_incompatible_target,
11612 clear_skip_on_incompatible_target, found_incompatible_target, and
11613 set_found_incompatible_target.
11614 (read_input_script): Add dirindex parameter. Change all callers.
11615 If parser finds an incompatible target, requeue Read_symbols
11616 task.
11617 (script_set_symbol): Clear skip_on_incompatible_target in
11618 closure.
11619 (script_add_assertion, script_parse_option): Likewise.
11620 (script_start_sections, script_add_phdr): Likewise.
11621 (script_check_output_format): New function.
11622 * script.h (read_input_script): Update declaration.
11623 * script-c.h (script_check_output_format): Declare.
11624 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11625 (ignore_cmd): Remove OUTPUT_FORMAT.
11626 * fileread.cc (Input_file::Input_file): Add explicit this.
11627 (Input_file::will_search_for): New function.
11628 (Input_file::open): Add pindex parameter. Change all callers.
11629 * fileread.h (class Input_file): Add input_file_argument method.
11630 Declare will_search_for. Update declarations.
11631 * object.cc (make_elf_object): Add punconfigured parameter.
11632 Change all callers.
11633 * object.h (class Object): Make input_file public. Add
11634 searched_for method.
11635 (make_elf_object): Update declaration.
11636 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11637 restart search.
11638 * dirsearch.h (class Dirsearch): Update declaration.
11639 * options.h (class General_options): Add --warn-search-mismatch.
11640 * parameters.cc (Parameters::is_compatible_target): New function.
11641 * parameters.h (class Parameters): Declare is_compatible_target.
11642 * workqueue.cc (Workqueue::add_blocker): New function.
11643 * workqueue.h (class Workqueue): Declare add_blocker.
11644
f1ed28fb
ILT
11645 * fileread.cc (Input_file::open): Remove options parameter.
11646 Change all callers.
11647 (Input_file::open_binary): Likewise.
11648 * script.cc (read_input_script): Likewise.
11649 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11650 options parameter from constructor. Change all callers.
11651 (class Read_script): Likewise.
11652 * fileread.h (class Input_file): Update declarations.
11653 * script.h (read_input_script): Update declaration.
11654
34dd024a
NC
116552009-03-10 Nick Clifton <nickc@redhat.com>
11656
11657 * po/es.po: New Spanish translation.
11658
6d71b17c
CC
116592009-03-06 Cary Coutant <ccoutant@google.com>
11660
11661 * options.cc (parse_short_option): Keep dash_z from registering itself.
11662
031cdbed
ILT
116632009-03-03 Ian Lance Taylor <iant@google.com>
11664
11665 PR 9918
11666 * target-reloc.h (relocate_section): Pass output_section to
11667 relocate.
11668 * i386.cc (Target_i386::should_apply_static_reloc): Add
11669 output_section parameter. Change all callers.
11670 (Target_i386::Relocate::relocate): Add output_section parameter.
11671 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11672 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11673 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11674 * testsuite/two_file_shared.sh: New script.
11675 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11676 (check_DATA): Add two_file_shared.dbg.
11677 (two_file_shared.dbg): New target.
11678 * testsuite/Makefile.in: Rebuild.
11679
15d5fa16
ILT
116802009-03-01 Ian Lance Taylor <iant@google.com>
11681
11682 * configure.ac: Check for byteswap.h.
11683 * configure: Rebuild.
11684 * config.in: Rebuild.
11685
8a4c0b0d
ILT
116862009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11687
11688 * layout.cc (Layout::find_or_add_kept_section): New function.
11689 (Layout::add_comdat): Removed.
11690 * layout.h (struct Kept_section): Move out of class Layout.
11691 Remove trailing underscores from field names. Add group_sections
11692 field. Rename group_ field to is_group. Change all uses.
11693 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11694 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11695 comdat_groups_ field.
11696 (Sized_relobj::include_section_group): Use
11697 find_or_add_kept_section and Kept_section::group_sections.
11698 (Sized_relobj::include_linkonce_section): Likewise.
11699 * object.cc (class Sized_relobj): Don't define Comdat_group or
11700 Comdat_group_table. Remove find_comdat_group and
11701 add_comdat_group. Remove comdat_groups_ field.
11702 * plugin.cc (include_comdat_group): Use
11703 Layout::find_or_add_kept_section.
11704
b4ecf66b
ILT
117052009-02-28 Ian Lance Taylor <iant@google.com>
11706
14359ca0
ILT
11707 * README: --gc-sections and map files are now supported. Document
11708 some build requirements.
11709
b4ecf66b
ILT
11710 PR 6992
11711 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11712 relocatable link set the value of the section symbol to zero.
11713 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11714 relocatable link don't include the section address in the local
11715 symbol value.
11716
0602e05a
ILT
117172009-02-27 Ian Lance Taylor <iant@google.com>
11718
fd9d194f
ILT
11719 PR 6811
11720 * options.h (class Search_directory): Add is_system_directory.
11721 (class General_options): Declare is_in_system_directory.
11722 * options.cc (get_relative_sysroot): Make static.
11723 (get_default_sysroot): Make static.
11724 (General_optoins::is_in_system_directory): New function.
11725 * fileread.cc (Input_file::is_in_system_directory): New function.
11726 * fileread.h (class Input_file): Declare is_in_system_directory.
11727 * object.h (class Object): Add is_in_system_directory.
11728 (class Input_objects): Remove system_library_directory_ field.
11729 * object.cc (Input_objects::add_object): Don't set
11730 system_library_directory_.
11731 (input_objects::found_in_system_library_directory): Remove.
11732 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11733 parameter. Change all callers.
11734 (Symbol_table::sized_write_globals): Likewise.
11735 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11736 Call Object::is_in_system_directory.
11737 * symtab.h (class Symbol_table): Update declarations.
11738
61edd21f
ILT
11739 PR 5990
11740 * descriptors.h (Open_descriptor): Add is_on_stack field.
11741 * descriptors.cc (Descriptors::open): If the descriptor is on the
11742 top of the stack, remove it. Initialize is_on_stack field.
11743 (Descriptors::release): Only add pod to stack if it is not on the
11744 stack already.
11745 (Descriptors::close_some_descriptor): Clear stack_next and
11746 is_on_stack fields.
11747
e29e076a
ILT
11748 PR 7091
11749 * output.cc (Output_section::find_starting_output_address): Rename
11750 from starting_output_address; add PADDR parameter; change return
11751 type.
11752 * output.h (class Output_section): Declare
11753 find_starting_output_address instead of starting_output_address.
11754 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11755 section symbol for which we can't find a merge section.
11756
0602e05a
ILT
11757 PR 9836
11758 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11759 hidden or internal, force the symbol to be local.
11760 * resolve.cc (Symbol::override_visibility): Define.
11761 (Symbol::override_base): Use override_visibility.
11762 (Symbol_table::resolve): Likewise.
11763 (Symbol::override_base_with_special): Likewise.
11764 (Symbol_table::override_with_special): If the visibility is hidden
11765 or internal, force the symbol to be local.
11766 * symtab.h (class Symbol): Add set_visibility and
11767 override_visibility.
11768 * testsuite/ver_test_1.sh: New file.
11769 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11770 (check_DATA): Add ver_test_1.syms.
11771 (ver_test_1.syms): New target.
11772 * testsuite/Makefile.in: Rebuild.
11773
401a9a73
CC
117742009-02-25 Cary Coutant <ccoutant@google.com>
11775
11776 * layout.cc (Layout::choose_output_section): Don't rename sections
11777 when using a linker script that has a SECTIONS clause.
11778 * Makefile.in: Regenerate.
11779
11780 * testsuite/Makefile.am (script_test_5.sh): New test case.
11781 * testsuite/Makefile.in: Regenerate.
11782 * testsuite/script_test_5.cc: New file.
11783 * testsuite/script_test_5.sh: New file.
11784 * testsuite/script_test_5.t: New file.
11785
f488e4b0
CC
117862009-02-13 Rafael Avila de Espindola <espindola@google.com>
11787
11788 * archive.cc (Archive::include_member): Update calls to add_symbols.
11789 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11790 the Layout argument.
11791 * dynobj.h (do_add_symbols): Add the Layout argument.
11792 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11793 Layout argument.
11794 * object.h (Object::add_symbols): Add the Layout argument.
11795 (Object::do_add_symbols): Add the Layout argument.
11796 (Sized_relobj::do_add_symbols): Add the Layout argument.
11797 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11798 Unify the two versions.
11799 (Add_plugin_symbols): Remove.
11800 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11801 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11802 (Add_plugin_symbols): Remove.
11803 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11804 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11805 (Add_symbols::run): Make it work with Pulginobj.
11806
89dd1680
ILT
118072009-02-06 Ian Lance Taylor <iant@google.com>
11808
11809 * object.cc (Sized_relobj::do_layout): Make info message start
11810 with lower case letter.
11811
266d0a74
ILT
118122009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11813
602b464e
ILT
11814 * binary.cc: Fix file comment.
11815
266d0a74
ILT
11816 * options.h (enum Incremental_disposition): Define.
11817 (class General_options): Add new options: --incremental,
11818 --incremental_changed, --incremental_unchanged,
11819 --incremental_unknown. Add incremental_disposition_ and
11820 implicit_incremental_ fields.
11821 (General_options::incremental_disposition): New function.
11822 (class Position_dependent_options): Add incremental_disposition
11823 option.
11824 (Position_dependent_options::copy_from_options): Set incremental
11825 dispositions.
11826 * options.cc (General_options::parse_incremental_changed): New
11827 function.
2e702c99
RM
11828 (General_options::parse_incremental_unchanged): New function.
11829 (General_options::parse_incremental_unknown): New function.
11830 (General_options::General_options): Initialize new fields
266d0a74 11831 incremental_disposition_ and implicit_incremental_.
2e702c99 11832 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11833 without --incremental.
11834
f073bbf7
CD
118352009-02-06 Chris Demetriou <cgd@google.com>
11836
11837 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11838 pointer and to report location as the file name associated with
11839 the symbol.
11840 (gold_undefined_symbol_at_location): New function to replace the
11841 old gold_undefined_symbol functionality.
11842 * target-reloc.h (relocate_section): Update to use
11843 gold_undefined_symbol_at_location.
11844 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11845 Call gold_undefined_symbol function rather than gold_error.
11846 * errors.h (Errors::undefined_symbol): Take location as a
11847 string, rather than calculating it from a relocation.
11848 * errors.cc (Errors::fatal): Print "fatal error:" before the
11849 formatted message.
11850 (Errors::error, Errors::error_at_location): Print "error: "
11851 before the formatted message.
11852 (Errors::undefined_symbol): Take location as a string, rather
11853 than calculating it from a relocation.
11854 (gold_undefined_symbol_at_location): New function akin to
11855 old gold_undefined_symbol, calculates location from relocation.
11856 (gold_undefined_symbol): Change to take only a Symbol pointer
11857 and to report location as the file name associated with the symbol.
11858 * testsuite/debug_msg.sh: Update for changed error messages.
11859 * testsuite/undef_symbol.sh: Likewise.
11860
8e94a90c
ILT
118612009-02-04 Duncan Sands <baldrick@free.fr>
11862
11863 PR 9812
11864 * reduced_debug_output.h
11865 (Output_reduced_debug_abbrev_section::failed): Use format for
11866 gold_warning.
11867 (Output_reduced_debug_info_section::faild): Likewise.
11868
88a0e15b
ILT
118692009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11870
11871 * script.cc (Lazy_demangler): New class.
2e702c99 11872 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11873 symbol only once.
11874
5efc7cd2
CC
118752009-01-29 Cary Coutant <ccoutant@google.com>
11876
11877 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11878 to __tls_get_addr.
11879 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11880
e0ebcf42
ILT
118812009-01-28 Ian Lance Taylor <iant@google.com>
11882
5efc7cd2 11883 * version.cc (version_string): Bump to 1.9.
75fe7426 11884
e0ebcf42
ILT
11885 * gold.h: Include <cstring> and <stdint.h>.
11886 * version.cc: Include <cstdio>.
11887 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11888 warning.
11889 * reduced_debug_output.cc (insert_into_vector): Rename from
11890 Insert_into_vector; change all callers. Use Swap_unaligned to
11891 avoid aliasing issue; remove union since it is unnecessary.
11892
8e2813be 118932009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11894
11895 * Makefile.am (CCFILES): Add gc.cc.
11896 (HFILES): Add gc.h.
11897 * Makefile.in: Regenerate.
11898 * gold.cc (Gc_runner): New class.
11899 (queue_initial_tasks): Call garbage collection related tasks
11900 when corresponding options are invoked.
11901 (queue_middle_gc_tasks): New function.
11902 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11903 processed early before laying out sections during garbage collection.
11904 * gold.h (queue_middle_gc_tasks): New function.
11905 (is_prefix_of): Move from "layout.cc".
11906 * i386.cc (Target_i386::gc_process_relocs): New function.
11907 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11908 * main.cc (main): Create object of class "Garbage_collection".
11909 * object.cc (Relobj::copy_symbols_data): New function.
11910 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11911 (Sized_relobj::do_layout): Allow this function to be called twice
11912 during garbage collection and defer layout of section during the
6d03d481
ST
11913 first call.
11914 * object.h (Relobj::get_symbols_data): New function.
11915 (Relobj::is_section_name_included): New function.
11916 (Relobj::copy_symbols_data): New function.
11917 (Relobj::set_symbols_data): New function.
11918 (Relobj::get_relocs_data): New function.
11919 (Relobj::set_relocs_data): New function.
11920 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11921 (Relobj::gc_process_relocs): New function.
11922 (Relobj::do_gc_process_relocs): New pure virtual function.
11923 (Relobj::sd_): New data member.
11924 (Sized_relobj::is_output_section_offset_invalid): New function.
11925 (Sized_relobj::do_gc_process_relocs): New function.
11926 * options.h (General_options::gc_sections): Modify to not be a no-op.
11927 (General_options::print_gc_sections): New option.
11928 * plugin.cc (Plugin_finish::run): Remove function call to
11929 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11930 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11931 * reloc.cc (Read_relocs::run): Add task to process relocs and
11932 determine unreferenced sections when doing garbage collection.
11933 (Gc_process_relocs): New class.
11934 (Sized_relobj::do_gc_process_relocs): New function.
11935 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11936 sections that are garbage collected.
11937 * reloc.h (Gc_process_relocs): New class.
11938 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11939 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11940 symbols whose corresponding sections are garbage collected.
11941 (Symbol_table::Symbol_table): Add new parameter for the garbage
11942 collection object.
11943 (Symbol_table::gc_mark_undef_symbols): New function.
11944 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11945 (Symbol_table::gc_mark_dyn_syms): New function.
11946 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11947 as garbage.
11948 (Symbol_table::add_from_object): Likewise.
11949 (Symbol_table::add_from_relobj): When building shared objects, do not
11950 treat externally visible symbols as garbage.
11951 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11952 table information for static and relocatable links.
11953 * symtab.h (Symbol_table::set_gc): New function.
11954 (Symbol_table::gc): New function.
11955 (Symbol_table::gc_mark_undef_symbols): New function.
11956 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11957 (Symbol_table::gc_mark_dyn_syms): New function.
11958 (Symbol_table::gc_): New data member.
e1df38aa 11959 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11960 function.
11961 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11962 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11963
3b293544
CF
119642009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11965
11966 * options.h (General_options::gc_sections): Define as a no-op for now.
11967 (General_options::no_keep_memory): Ditto.
11968 (General_options::Bshareable): Define.
11969 * options.cc (General_options::finalize): Honor -Bshareable.
11970
83d22aa8
AS
119712009-01-20 Andreas Schwab <schwab@suse.de>
11972
11973 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11974 read the value in the contents, since we don't use it. Use the
11975 template endianness when writing.
11976 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11977
cd536b21
AS
119782009-01-19 Andreas Schwab <schwab@suse.de>
11979
11980 * configure.tgt (powerpc64-*): Fix targ_obj.
11981
99e9a495
ILT
119822009-01-15 Ian Lance Taylor <iant@google.com>
11983
11984 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11985 local symbols when stripping all symbols.
11986
bbbfea06
CC
119872009-01-14 Cary Coutant <ccoutant@google.com>
11988
99e9a495 11989 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11990
0f7c0701
CC
119912009-01-14 Cary Coutant <ccoutant@google.com>
11992
11993 * archive.cc (Archive::get_elf_object_for_member): Remove call
11994 to File_read::claim_for_plugin.
11995 * descriptors.cc (Descriptors::open): Remove reference to
11996 is_claimed.
11997 (Descriptors::claim_for_plugin): Remove.
11998 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11999 (Descriptors::is_claimed): Remove.
12000 (claim_descriptor_for_plugin): Remove.
12001 * fileread.cc (File_read::claim_for_plugin): Remove.
12002 * fileread.h (File_read::claim_for_plugin): Remove.
12003 (File_read::descriptor): Reopen descriptor if necessary.
12004 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12005 (Plugin_manager::all_symbols_read): Add task parameter. Change
12006 all callers.
12007 (Plugin_manager::get_input_file): New function.
12008 (Plugin_manager::release_input_file): New function.
12009 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12010 corresponding data member.
12011 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12012 and pass to base constructor. Change all callers.
12013 (get_input_file, release_input_file): New functions.
12014 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12015 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12016 (Plugin_manager::all_symbols_read): Add task parameter.
12017 (Plugin_manager::get_input_file): New function.
12018 (Plugin_manager::release_input_file): New function.
12019 (Plugin_manager::task_): New data member.
12020 (Pluginobj::Pluginobj): Add filesize parameter.
12021 (Pluginobj::filename): New function.
12022 (Pluginobj::descriptor): New function.
12023 (Pluginobj::filesize): New function.
12024 (Pluginobj::filesize_): New data member.
12025 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12026 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12027 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12028
12029 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12030 with archive libraries.
12031 * testsuite/Makefile.in: Regenerate.
12032 * testsuite/plugin_test.c (struct sym_info): New type.
12033 (get_input_file, release_input_file): New static variables.
12034 (onload): Capture new transfer vector entries.
12035 (claim_file_hook): Stop reading at end of file according to filesize.
12036 Factor out parsing of readelf output into separate function.
12037 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12038 APIs and get the source file name from the symbol table. Convert
12039 source file name to corresponding object file name. Print info
12040 message when adding new input files.
12041 (parse_readelf_line): New function.
12042 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12043 * testsuite/plugin_test_2.sh: Likewise.
12044 * testsuite/plugin_test_3.sh: Likewise.
12045 * testsuite/plugin_test_4.sh: New test case.
12046
62a6d109
ILT
120472009-01-07 Ian Lance Taylor <iant@google.com>
12048
12049 * version.cc (version_string): Bump to 1.8.
12050
483620e8
CC
120512008-12-23 Cary Coutant <ccoutant@google.com>
12052
12053 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12054 * plugin.cc (Plugin_manager::finish): Rename as
12055 layout_deferred_objects. Move cleanup to separate function.
12056 (Plugin_manager::cleanup): New function.
12057 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12058 separately.
12059 * plugin.h (Plugin_manager::finish): Rename as
12060 layout_deferred_objects.
12061 (Plugin_manager::cleanup): New function.
12062 (Plugin_manager::cleanup_done): New field.
12063
d66a9eb3
CC
120642008-12-23 Cary Coutant <ccoutant@google.com>
12065
12066 * plugin.cc (is_visible_from_outside): New function.
12067 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12068 so we don't return "IR only" status for exported symbols or -r links.
12069
12070 * testsuite/Makefile.am (plugin_test_3): New test case.
12071 * testsuite/Makefile.in: Regenerate.
12072 * testsuite/plugin_test_3.sh: New file.
12073
5995b570
CC
120742008-12-22 Cary Coutant <ccoutant@google.com>
12075
12076 * object.cc (Sized_relobj::layout_section): New function.
12077 (Sized_relobj::do_layout): Defer layout of input sections until after
12078 plugin has provided replacement files.
12079 (Sized_relobj::do_layout_deferred_sections): New function.
12080 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12081 (Relobj::layout_deferred_sections): New function.
12082 (Relobj::do_layout_deferred_sections): New function.
12083 (Sized_relobj::do_layout_deferred_sections): New function.
12084 (Sized_relobj::layout_section): New function.
12085 (Sized_relobj::Deferred_layout): New structure.
12086 (Sized_relobj::deferred_layout_): New field.
12087 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12088 Change all callers. Layout deferred sections.
12089 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12090 references.
12091 (Plugin_hook::run): Move code from do_plugin_hook inline.
12092 (Plugin_hook::do_plugin_hook): Remove.
12093 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12094 (Plugin_manager::finish): Renamed, was cleanup.
12095 (Plugin_manager::should_defer_layout): New function.
12096 (Plugin_manager::add_deferred_layout_object): New function.
12097 (Plugin_manager::Deferred_layout_list): New type.
12098 (Plugin_manager::deferred_layout_objects_): New field.
12099 (Plugin_hook::do_plugin_hook): Remove.
12100
ee769c88
ILT
121012008-12-17 Ian Lance Taylor <iant@google.com>
12102
12103 * options.h (class General_options): Add --no case for
12104 --export-dynamic.
12105
abc8dcba
CC
121062008-12-16 Cary Coutant <ccoutant@google.com>
12107
12108 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12109 vector.
12110 (Plugin_manager::claim_file): Create plugin object even if
12111 plugin did not call the add_symbols callback.
12112 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12113 asking for more symbols than were added.
12114 * testsuite/Makefile.am (plugin_test_1): Add test case with
12115 no global symbols.
12116 (empty.syms): New target.
12117 * testsuite/Makefile.in: Regenerate.
12118 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12119 message. Don't call add_symbols if no globals.
12120 (all_symbols_read_hook): Don't provide replacement for empty
12121 claimed file.
12122
b0074644
ILT
121232008-12-12 Ian Lance Taylor <iant@google.com>
12124
68943102
ILT
12125 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12126 r_type == 0 for a local symbol with r_sym == 0.
12127 (scan_relocatable_relocs): Pass r_sym to
12128 local_non_section_strategy.
12129 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12130 r_sym parameter.
12131
b0074644
ILT
12132 * configure.ac: Update test for TLS descriptors: they are
12133 supported as of glibc 2.9.
12134 * configure: Rebuild.
12135
c2508178
ILT
121362008-12-11 Ian Lance Taylor <iant@google.com>
12137
12138 PR 7091
12139 * target-reloc.h (Default_scan_relocatable_relocs): For each
12140 function, map r_type == 0 to RELOC_DISCARD.
12141
2756a258
CC
121422008-12-10 Cary Coutant <ccoutant@google.com>
12143
12144 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12145 object to override a kept COMDAT group from a plugin object.
12146
bb6f53d3
ILT
121472008-12-09 Ian Lance Taylor <iant@google.com>
12148
fbc558e1
ILT
12149 PR 7088
12150 * yyscript.y (file_cmd): Handle INPUT.
12151
bb6f53d3
ILT
12152 * testsuite/initpri1.c: Change all declarations to be full
12153 prototypes by adding void, to avoid compiler warnings.
12154
4674ecfc
CC
121552008-12-05 Rafael Avila de Espindola <espindola@google.com>
12156
12157 * options.cc (General_options::parse_plugin_opt): New.
12158 (General_options::add_plugin): The argument now is just the filename.
12159 (General_options::add_plugin_option): New.
12160 * options.h (plugin_opt): New.
12161 (add_plugin): Change argument name.
12162 (add_plugin_option): New.
12163 * plugin.cc (Plugin::load): Don't parse the plugin option.
12164 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12165 (Plugin::add_option): New.
12166 (Plugin::args_): Change type.
12167 (Plugin::filename_): New.
12168 (Plugin_manager::add_plugin_option): New.
12169 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12170 * testsuite/Makefile.in: Regenerate.
12171
fd06b4aa
CC
121722008-12-05 Cary Coutant <ccoutant@google.com>
12173
12174 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12175 Handle --strip-lto-sections option.
12176 * options.h (strip_lto_sections): New option.
12177
6c52134c
CC
121782008-12-01 Cary Coutant <ccoutant@google.com>
12179
12180 * plugin.cc (ld_plugin_message): Change format parameter to const.
12181 Fix mismatch between new[] and delete.
12182
a45248e0
CC
121832008-11-14 Cary Coutant <ccoutant@google.com>
12184
12185 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12186 instead of -1U.
12187
c82fbeee
CS
121882008-11-05 Craig Silverstein <csilvers@google.com>
12189
12190 * options.cc (General_options::parse_dynamic_list): New function.
12191 * options.h (General_options): New flags dynamic_list,
12192 dynamic_list_data, dynamic_list_cpp_new, and
12193 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12194 (General_options::in_dynamic_list): New function.
12195 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12196 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12197 (Lex::can_continue_name): Likewise.
12198 (yylex): Likewise.
12199 (read_script_file): New parameter script_options.
12200 (read_dynamic_list): New function.
12201 (Script_options::define_dynamic_list): New function.
12202 (dynamic_list_keyword_parsecodes): New variable.
12203 (dynamic_list_keywords): New variable.
12204 * script.h (Script_options::define_dynamic_list): New function
12205 prototype.
12206 (read_dynamic_list): New function prototype.
12207 * symtab.cc (strprefix): New macro.
12208 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12209 dynamic_list_data, dynamic_list_cpp_new, and
12210 dynamic_list_cpp_typeinfo.
12211 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12212 (dynamic_list_expr): New rule.
12213 (dynamic_list_nodes): Likewise.
12214 (dynamic_list_node): Likewise.
12215 * testsuite/Makefile.am (dynamic_list): New test.
12216 * testsuite/Makefile.in: Regenerated.
12217 * testsuite/dynamic_list.t: New file.
12218 * testsuite/dynamic_list.sh: New file.
12219
e0bb29a5
CS
122202008-11-05 Craig Silverstein <csilvers@google.com>
12221
12222 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12223 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12224 (t11_last): Likewise.
12225 * testsuite/ver_test_6.c (main): Likewise.
12226
4e1e25e0
CC
122272008-10-07 Cary Coutant <ccoutant@google.com>
12228
12229 * options.c (General_options::finalize): Add check for -static and
12230 -shared.
12231 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12232 is not empty.
12233
92f03fcb
CC
122342008-10-02 Cary Coutant <ccoutant@google.com>
12235
12236 * plugin.cc (make_sized_plugin_object): Fix conditional
12237 compilation to work when not all targets are enabled.
12238
fbd8a257
CC
122392008-09-29 Cary Coutant <ccoutant@google.com>
12240
12241 * archive.cc (Archive::get_file_and_offset): Use filename instead
12242 of name to get library path.
12243 (Archive::include_member): Unlock external member of a thin archive.
12244
12245 * testsuite/Makefile.am (TEST_AR): New variable.
12246 (thin_archive_test_1): New test.
12247 (thin_archive_test_2): New test.
81636b3f
CC
12248 * testsuite/Makefile.in: Regenerate.
12249 * testsuite/thin_archive_main.cc: New file.
12250 * testsuite/thin_archive_test_1.cc: New file.
12251 * testsuite/thin_archive_test_2.cc: New file.
12252 * testsuite/thin_archive_test_3.cc: New file.
12253 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12254
eff45813
CC
122552008-09-29 Cary Coutant <ccoutant@google.com>
12256
12257 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12258 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12259 instead of -1U.
12260 (Sized_relobj::do_finalize_local_symbols): Likewise.
12261 (Sized_relobj::map_to_kept_section): Likewise.
12262 * object.h (Sized_relobj::invalid_address): New constant.
12263 (Sized_relobj::do_output_section_offset): Check for invalid_address
12264 and return -1ULL.
12265 * output.cc (Output_reloc::local_section_offset): Use constant
12266 invalid_address instead of -1U.
12267 (Output_reloc::get_address): Likewise.
12268 (Output_section::output_address): Change -1U to -1ULL.
12269 * output.h (Output_reloc::invalid_address): New constant.
12270 * reloc.cc (Sized_relobj::write_sections): Use constant
12271 invalid_address instead of -1U.
12272 (Sized_relobj::relocate_sections): Likewise.
12273 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12274 values for merge sections.
12275 * target-reloc.h (relocate_for_relocatable): Use constant
12276 invalid_address instead of -1U.
12277
89fc3421
CC
122782008-09-19 Cary Coutant <ccoutant@google.com>
12279
12280 Add plugin functionality for link-time optimization (LTO).
12281 * configure.ac (plugins): Add --enable-plugins option.
12282 * configure: Regenerate.
12283 * config.in: Regenerate.
12284 * Makefile.am (LIBDL): New variable.
12285 (CCFILES): Add plugin.cc.
12286 (HFILES): Add plugin.h.
12287 (ldadd_var): Add LIBDL.
12288 * Makefile.in: Regenerate.
12289
12290 * archive.cc: Include "plugin.h".
12291 (Archive::setup): Don't preread archive symbols when using a plugin.
12292 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12293 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12294 files.
12295 (Archive::include_member): Add symbols from plugin objects.
12296 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12297 * descriptors.cc (Descriptors::open): Check for file descriptors
12298 abandoned by plugins.
12299 (Descriptors::claim_for_plugin): New function.
12300 * descriptors.h (Descriptors::claim_for_plugin): New function.
12301 (Open_descriptor::is_claimed): New field.
12302 (claim_descriptor_for_plugin): New function.
12303 * fileread.cc (File_read::claim_for_plugin): New function.
12304 * fileread.h (File_read::claim_for_plugin): New function.
12305 (File_read::descriptor): New function.
12306 * gold.cc: Include "plugin.h".
12307 (queue_initial_tasks): Add task to call plugin hooks for generating
12308 new object files.
12309 * main.cc: Include "plugin.h".
12310 (main): Load plugin libraries.
12311 * object.h (Pluginobj): Declare.
12312 (Object::pluginobj): New function.
12313 (Object::do_pluginobj): New function.
12314 (Object::set_target): New function.
12315 * options.cc: Include "plugin.h".
12316 (General_options::parse_plugin): New function.
12317 (General_options::General_options): Initialize plugins_ field.
12318 (General_options::add_plugin): New function.
12319 * options.h (Plugin_manager): Declare.
12320 (General_options): Add --plugin option.
12321 (General_options::has_plugins): New function.
12322 (General_options::plugins): New function.
12323 (General_options::add_plugin): New function.
12324 (General_options::plugins_): New field.
12325 * plugin.cc: New file.
12326 * plugin.h: New file.
12327 * readsyms.cc: Include "plugin.h".
12328 (Read_symbols::do_read_symbols): Check for archive before checking
12329 for ELF file. Call plugin hooks to claim files.
12330 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12331 from a real object file; force override when processing replacement
12332 files.
12333 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12334 (Symbol::init_base_object): Likewise.
12335 (Symbol::init_base_output_data): Likewise.
12336 (Symbol::init_base_output_segment): Likewise.
12337 (Symbol::init_base_constant): Likewise.
12338 (Symbol::init_base_undefined): Likewise.
12339 (Symbol::output_section): Assert that object is not a plugin.
12340 (Symbol_table::add_from_pluginobj): New function.
12341 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12342 undefined.
12343 (Symbol_table::sized_write_globals): Likewise.
12344 (Symbol_table::add_from_pluginobj): Instantiate template.
12345 * symtab.h (Sized_pluginobj): Declare.
12346 (Symbol::in_real_elf): New function.
12347 (Symbol::set_in_real_elf): New function.
12348 (Symbol::in_real_elf_): New field.
12349 (Symbol_table::add_from_pluginobj): New function.
12350
12351 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12352 (LIBDL): New variable.
12353 (LDADD): Add LIBDL.
12354 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12355 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12356 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12357 (MOSTLYCLEANFILES): Likewise.
12358 * testsuite/Makefile.in: Regenerate.
12359 * testsuite/plugin_test.c: New file.
12360 * testsuite/plugin_test_1.sh: New file.
12361 * testsuite/plugin_test_2.sh: New file.
12362
de31bda5
ILT
123632008-09-16 Ian Lance Taylor <iant@google.com>
12364
9c2d0ef9
ILT
12365 * target-reloc.h (relocate_section): Check whether a symbol is
12366 defined by the ABI before reporting an undefined symbol error.
12367 * target.h (Target::is_defined_by_abi): Make parameter const.
12368 (Target::do_is_defined_by_abi): Likewise.
12369 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12370 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12371 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12372 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12373 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12374 * testsuite/Makefile.in: Rebuild.
12375
de31bda5
ILT
12376 * fileread.cc (make_view): Add casts to avoid warning.
12377
9fa33bee
AO
123782008-09-16 Alexandre Oliva <aoliva@redhat.com>
12379
12380 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12381 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12382
183fd0e3
AO
123832008-09-16 Alexandre Oliva <aoliva@redhat.com>
12384
12385 * options.h (General_options::output_is_executable): New.
12386 (General_options::output_is_pie): New.
12387 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12388 for shared libraries.
12389 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12390
7be8330a
CD
123912008-09-11 Chris Demetriou <cgd@google.com>
12392
12393 * options.h (origin): New -z option.
12394 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12395 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12396 in DT_FLAGS_1.
12397
a9caad02
CC
123982008-09-05 Cary Coutant <ccoutant@google.com>
12399
12400 * fileread.cc (File_read::make_view): Add check for attempt to map
12401 beyond end of file.
12402
ae6dce4d
CC
124032008-09-05 Cary Coutant <ccoutant@google.com>
12404
12405 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12406 explicit instantiations.
12407
d7ab2a47
KVH
124082008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12409
12410 PR gold/6858
12411 * options.cc (General_options::finalize): Allow undefined symbols
12412 in shlibs if linking -shared.
12413
12414 PR gold/6859
12415 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12416 symbols as not needing a dynsym entry.
12417
1e52a9c1
CS
124182008-08-20 Craig Silverstein <csilvers@google.com>
12419
12420 * fileread.cc (File_read::open): Do not lock the file unless it
12421 was successfully opened.
12422
d85c80a3
CC
124232008-08-14 Cary Coutant <ccoutant@google.com>
12424
12425 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12426 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12427 * testsuite/tls_test.cc (struct int128): 128-bit struct
12428 for testing TLS relocs with non-zero addend.
12429 (v12): New TLS variable.
12430 (t12): New test.
12431 (t_last): Add check for v12.
12432 * testsuite/tls_test.h (t12): New function.
12433 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12434
2d924fd9
ILT
124352008-08-13 Ian Lance Taylor <iant@google.com>
12436
12437 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12438 set tls_segment_ or relro_segment_.
12439 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12440 when appropriate.
12441 * output.h (Output_section::clear_is_relro): New function.
12442 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12443 sections specially even when output_data_ is empty.
12444 (Output_segment::maximum_alignment): When first section is relro,
12445 only force alignment for PT_LOAD segments.
12446 * script.cc (script_data_segment_align): New function.
12447 (script_data_segment_relro_end): New function.
12448 * script-c.h (script_data_segment_align): Declare.
12449 (script_data_segment_relro_end): Declare.
12450 * script-sections.h (class Script_sections): Declare
12451 data_segment_align and data_segment_relro_end. Add fields
12452 segment_align_index_ and saw_relro_end_.
12453 * script-sections.cc (class Sections_element): Add set_is_relro
12454 virtual function. Add new bool* parameter to place_orphan_here.
12455 Add get_output_section virtual function.
12456 (class Output_section_definition): Add set_is_relro. Add new
12457 bool* parameter to place_orphan_here. Add get_output_section.
12458 Add is_relro_ field.
12459 (Output_section_definition::Output_section_definition): Initialize
12460 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12461 and is_relro_ fields.
12462 (Output_section_definition::place_orphan_here): Add is_relro
12463 parameter.
12464 (Output_section_definition::set_section_addresses): Set relro for
12465 output section.
12466 (Output_section_definition::alternate_constraint): Likewise.
12467 (class Orphan_output_section): Add new bool* parameter to
12468 place_orphan_here. Add get_output_section.
12469 (Orphan_output_section::place_orphan_here): Add is_relro
12470 parameter.
12471 (Script_sections::Script_sections): Initialize
12472 data_segment_align_index_ and saw_relro_end_.
12473 (Script_sections::data_segment_align): New function.
12474 (Script_sections::data_segment_relro_end): New function.
12475 (Script_sections::place_orphan): Set or clear is_relro.
12476 (Script_sections::set_section_addresses): Force alignment of first
12477 TLS section.
12478 * yyscript.y (exp): Call script_data_segment_align and
12479 script_data_segment_relro_end.
12480 * testsuite/relro_script_test.t: New file.
12481 * testsuite/relro_test.cc (using_script): Declare.
12482 (t1, t2): Test using_script.
12483 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12484 (relro_script_test_SOURCES): Define.
12485 (relro_script_test_DEPENDENCIES): Define.
12486 (relro_script_test_LDFLAGS): Define.
12487 (relro_script_test_LDADD): Define.
12488 (relro_script_test.so): New target.
12489 * testsuite/Makefile.in: Rebuild.
12490
f827c9a9
CC
124912008-08-06 Cary Coutant <ccoutant@google.com>
12492
12493 * archive.cc (Archive::total_archives, Archive::total_members)
12494 (Archive::total_members_loaded): New variables.
12495 (Archive::setup): Add parameter. Add option to preread
12496 archive symbols.
12497 (Archive::read_armap): Add counter.
12498 (Archive::get_file_and_offset): New function.
12499 (Archive::get_elf_object_for_member): New function.
12500 (Archive::read_all_symbols): New function.
12501 (Archive::read_symbols): New function.
12502 (Archive::add_symbols): Add counters.
12503 (Archive::include_all_members): Use armap to find members if it's
12504 already built.
12505 (Archive::include_member): Skip reading symbols if already read.
12506 Factored code into Archive::get_file_and_offset and
12507 Archive::get_elf_object_for_member. Changed call to
12508 Mapfile::report_include_archive_member.
12509 (Archive::print_stats): New function.
12510 * archive.h: Declare Object and Read_symbols_data classes.
12511 (Archive::Archive): Add initializers for new members.
12512 (Archive::setup): Add parameter.
12513 (Archive::print_stats): New function.
12514 (Archive::total_archives, Archive::total_members)
12515 (Archive::total_members_loaded): New variables.
12516 (Archive::get_file_and_offset): New function.
12517 (Archive::get_elf_object_for_member): New function.
12518 (Archive::read_all_symbols): New function.
12519 (Archive::read_symbols): New function.
12520 (Archive::Archive_member): New class.
12521 (Archive::members_): New member.
12522 (Archive::num_members_): New member.
12523 * main.cc: Include archive.h.
12524 (main): Call Archive::print_stats.
12525 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12526 archive parameter; member_name is now the fully-decorated name.
12527 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12528 * options.h: (General_options): Add --preread-archive-symbols option.
12529 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12530 Archive::setup.
12531
de4c45bd
ILT
125322008-08-04 Ian Lance Taylor <iant@google.com>
12533
12534 * symtab.h (Symbol::use_plt_offset): New function.
12535 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12536 * powerpc.cc (Relocate::relocate): Likewise.
12537 * sparc.cc (Relocate::relocate): Likewise.
12538 * x86_64.cc (Relocate::relocate): Likewise.
12539 * testsuite/weak_plt.sh: New test.
12540 * testsuite/weak_plt_main.cc: New test.
12541 * testsuite/weak_plt_shared.cc: New test.
12542 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12543 (check_PROGRAMS): Add weak_plt.
12544 (check_DATA): Add weak_plt_shared.so.
12545 (weak_plt_main_pic.o, weak_plt): New targets.
12546 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12547 * testsuite/Makefile.in: Rebuild.
12548
12549 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12550 gcctestdir/ld.
12551 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12552 * testsuite/Makefile.in: Rebuild.
12553
323ee3f4
AM
125542008-08-04 Alan Modra <amodra@bigpond.net.au>
12555
12556 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12557 * Makefile.in: Regenerate.
12558 * po/POTFILES.in: Regenerate.
12559
7c07ecec
ILT
125602008-07-29 Ian Lance Taylor <iant@google.com>
12561
12562 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12563 symbols before other symbols.
12564 * testsuite/script_test_2.cc (test_addr): Declare.
12565 (test_addr_alias): Declare.
12566 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12567 values.
7c07ecec
ILT
12568 * testsuite/script_test_2.t: Define test_addr_alias and
12569 test_addr.
12570
5778530e
ILT
125712008-07-24 Ian Lance Taylor <iant@google.com>
12572
2a00e4fb
ILT
12573 PR 5990
12574 * descriptors.cc: New file.
12575 * descriptors.h: New file.
12576 * gold-threads.h (class Hold_optional_lock): New class.
12577 * fileread.cc: Include "descriptors.h".
12578 (File_read::~File_read): Release descriptor rather than closing
12579 it.
12580 (File_read::open) [file]: Call open_descriptor rather than open.
12581 Set is_descriptor_opened_.
12582 (File_read::open) [memory]: Assert that descriptor is not open.
12583 (File_read::reopen_descriptor): New function.
12584 (File_read::release): Release descriptor.
12585 (File_read::do_read): Make non-const. Reopen descriptor.
12586 (File_read::read): Make non-const.
12587 (File_read::make_view): Reopen descriptor.
12588 (File_read::do_readv): Likewise.
12589 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12590 Update declarations.
12591 * layout.cc: Include "descriptors.h".
12592 (Layout::create_build_id): Use open_descriptor rather than open.
12593 * output.cc: Include "descriptors.h".
12594 (Output_file::open): Use open_descriptor rather than open.
12595 * archive.cc (Archive::const_iterator): Change Archive to be
12596 non-const.
12597 (Archive::begin, Archive::end): Make non-const.
12598 (Archive::count_members): Likewise.
12599 * archive.h (class Archive): Update declarations.
12600 * object.h (Object::read): Make non-const.
12601 * Makefile.am (CCFILES): Add descriptors.cc.
12602 (HFILES): Add descriptors.h.
12603 * Makefile.in: Rebuild.
12604
801647d1
ILT
12605 PR 6716
12606 * gold.h: Always include <clocale>. Add Solaris workarounds
12607 following code in binutils/sysdep.h.
12608
5edd166e
ILT
12609 PR 6048
12610 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12611 this->eh_frame_hdr_ is NULL before using it.
12612
c89ad728
ILT
12613 * dynobj.cc (Versions::Versions): Update comment.
12614
aa86f06b
ILT
12615 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12616 the base version name.
12617
5778530e
ILT
12618 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12619 array size plus one.
12620 (Stringpool_template::set_string_offsets): Subtract one from key
12621 before using it as an array index.
12622 (Stringpool_template::get_offset_with_length): Likewise.
12623 (Stringpool_template::write_to_buffer): Likewise.
12624 * stringpool.h (Stringpool_template::get_offset_from_key):
12625 Likewise.
12626
057ead22
ILT
126272008-07-23 Ian Lance Taylor <iant@google.com>
12628
7f649c59
ILT
12629 PR 6658
12630 * object.h (Merged_symbol_value::value): Do our best to handle a
12631 negative addend.
12632
057ead22
ILT
12633 PR 6647
12634 * script.cc (Version_script_info::get_versions): Don't add empty
12635 version tag to return value.
12636 (Version_script_info::get_symbol_version_helper): Change return
12637 type to bool. Add pversion parameter. Change all callers.
12638 (script_register_vers_node): Don't require a non-NULL tag.
12639 * script.h (class Version_script_info): Update declarations.
12640 (Version_script_info::get_symbol_version): Change return type to
12641 bool. Add version parameter. Change all callers.
12642 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12643 handling. Handle an empty version from a version script.
12644 (Symbol_table::define_special_symbol): Likewise.
12645 * testsuite/ver_test_10.script: New file.
12646 * testsuite/ver_test_10.sh: New file.
12647 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12648 (check_DATA): Add ver_test_10.syms.
12649 (ver_test_10.syms, ver_test_10.so): New target.
12650 * testsuite/Makefile.in: Rebuild.
12651
58e54ac2
CD
126522008-07-23 Simon Baldwin <simonb@google.com>
12653
12654 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12655 to zero for undefined symbols from dynamic libraries.
12656
95d14cd3
ILT
126572008-07-23 Ian Lance Taylor <iant@google.com>
12658
12659 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12660 Change all callers.
12661 * symtab.h (class Symbol_table): Update declaration.
12662 * testsuite/ver_test_9.cc: New file.
12663 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12664 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12665 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12666 (ver_test_9.so, ver_test_9.o): New targets.
12667 * testsuite/Makefile.in: Rebuild.
12668
92de84a6
ILT
126692008-07-22 Ian Lance Taylor <iant@google.com>
12670
34810851
ILT
12671 * options.h (class General_options): Define --check-sections.
12672 * layout.cc (Layout::set_segment_offsets): Handle
12673 --check-sections.
12674
af6156ef
ILT
12675 * options.h (class General_options): Define -n/--nmagic and
12676 -N/--omagic.
12677 * options.cc (General_options::finalize): For -n/--nmagic or
12678 -N/--omagic, set -static.
12679 * layout.cc (Layout::attach_allocated_section_to_segment): If
12680 -N/--omagic, don't put read-only and read-write sections in
12681 different segments.
12682 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12683 finding a read-only segment.
12684 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12685 don't set the minimum segment alignment to the common page size,
12686 and don't set the file offset to the address modulo the page size.
12687 * script-sections.cc (Script_sections::create_segments): If
12688 -n/--omagic, don't put read-only and read-write sections in
12689 different segments.
12690
92de84a6
ILT
12691 * cref.cc: New file.
12692 * cref.h: New file.
12693 * options.h (class General_options): Add --print-symbol-counts.
12694 * main.cc (main): Issue defined symbol report if requested.
12695 * archive.cc (Archive::interpret_header): Make into a const member
12696 function.
12697 (Archive::add_symbols): Call Input_objects::archive_start and
12698 archive_stop.
12699 (Archive::const_iterator): Define new class.
12700 (Archive::begin, Archive::end): New functions.
12701 (Archive::include_all_members): Rewrite to use iterator.
12702 (Archive::count_members): New function.
12703 * archive.h (class Archive): Update declarations.
12704 (Archive::filename): New function.
12705 * object.cc: Include "cref.h".
12706 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12707 (Sized_relobj::do_get_global_symbol_counts): New function.
12708 (Input_objects::add_object): Add object to cross-referencer.
12709 (Input_objects::archive_start): New function.
12710 (Input_objects::archive_stop): New function.
12711 (Input_objects::print_symbol_counts): New function.
12712 * object.h: Declare Cref and Archive.
12713 (Object::get_global_symbol_counts): New function.
12714 (Object::do_get_global_symbol_counts): New pure virtual function.
12715 (class Sized_relobj): Add defined_count_ field. Update
12716 declarations.
12717 (class Input_objects): Add cref_ field. Update constructor.
12718 Update declarations.
12719 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12720 defined_count_.
12721 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12722 symbol counts.
12723 (Sized_dynobj::do_get_global_symbol_counts): New function.
12724 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12725 defined_count_. Update declarations. Define Symbols typedef.
12726 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12727 parameter. Change all callers.
12728 (Symbol_table::add_from_dynobj): Add sympointers and defined
12729 parameters. Change all callers.
12730 * symtab.h (class Symbol_table): Update declarations.
12731 * Makefile.am (CCFILES): Add cref.cc.
12732 (HFILES): Add cref.h.
12733 * Makefile.in: Rebuild.
12734
3f7c5e1d
CD
127352008-07-22 Simon Baldwin <simonb@google.com>
12736
12737 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12738 to zero when writing undefined symbols.
12739
e0b64032
ILT
127402008-07-22 Ian Lance Taylor <iant@google.com>
12741
12742 * output.cc (Output_section::add_input_section): Don't try to
12743 merge empty merge sections.
12744
096b02cf
CS
127452008-07-21 Craig Silverstein <csilvers@google.com>
12746
12747 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12748 Include symbol version in error message.
cd536b21 12749
1d1f116d
CD
127502008-07-20 Chris Demetriou <cgd@google.com>
12751
cd536b21 12752 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12753 (RANDOM_SEED_CFLAGS): New substituted variable.
12754 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12755 * configure: Rebuild.
12756 * Makefile.in: Likewise.
12757 * testsuite/Makefile.in: Likewise.
12758
a18f591e
ILT
127592008-07-18 Ian Lance Taylor <iant@google.com>
12760
12761 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12762 where we see NAME/NULL and NAME/VERSION as separate symbols.
12763 * testsuite/ver_test_main.cc (main): Call t4.
12764 (t4, t4_2a): Define.
12765 * testsuite/ver_test_2.cc (t4_2): Define.
12766 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12767 * testsuite/ver_test_4.cc (t4_2a): Define.
12768 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12769 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12770
c6e3f6ed
ILT
127712008-07-17 Ian Lance Taylor <iant@google.com>
12772
12773 * dynobj.cc (Versions::add_def): If we give an error about a
12774 missing version, go ahead and create the version anyhow.
12775
ef9beddf
ILT
127762008-07-10 Ian Lance Taylor <iant@google.com>
12777
12778 Handle output sections with more than 0x7fffffff bytes.
12779 * object.h (class Relobj): Change map_to_output_ to
12780 output_sections_, and just keep a section pointer. Change all
12781 uses. Move comdat group support to Sized_relobj.
12782 (Relobj::is_section_specially_mapped): Remove.
12783 (Relobj::output_section): Remove poff parameter. Change all
12784 callers.
12785 (Relobj::output_section_offset): New function.
12786 (Relobj::set_section_offset): Rewrite.
12787 (Relobj::map_to_output): Remove.
12788 (Relobj::output_sections): New function.
12789 (Relobj::do_output_section_offset): New pure virtual function.
12790 (Relobj::do_set_section_offset): Likewise.
12791 (class Sized_relobj): Add section_offsets_ field. Add comdat
12792 group support from Relobj. Update declarations.
12793 (Sized_relobj::get_output_section_offset): New function.
12794 (Sized_relobj::do_output_section_offset): New function.
12795 (Sized_relobj::do_set_section_offset): New function.
12796 * object.cc (Relobj::output_section_address): Remove.
12797 (Sized_relobj::Sized_relobj): Initialize new fields.
12798 (Sized_relobj::include_section_group): Cast find_kept_object to
12799 Sized_relobj.
12800 (Sized_relobj::include_linkonce_section): Likewise.
12801 (Sized_relobj::do_layout): Use separate arrays for output section
12802 and output offset.
12803 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12804 output_sections.
12805 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12806 output_sections and section_offsets.
12807 (Sized_relobj::write_local_symbols): Likewise.
12808 (map_to_kept_section): Compute output address directly.
12809 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12810 output_sections and section_offsets.
12811 (Sized_relobj::write_sections): Likewise.
12812 (Sized_relobj::relocate_sections): Likewise.
12813 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12814 * output.h (class Output_reloc): Update declarations. Change
12815 u2_.relobj to Sized_relobj*.
12816 (class Output_data_reloc): Change add functions to use
12817 Sized_relobj*.
12818 * output.cc (Output_reloc::Output_reloc): Change relobj to
12819 Sized_relobj*.
12820 (Output_reloc::local_section_offset): Change return type to
12821 Elf_Addr. Use get_output_section_offset.
12822 (Output_reloc::get_address): Likewise.
12823 (Output_section::is_input_address_mapped): Don't call
12824 is_section_specially_mapped.
12825 (Output_section::output_offset): Likewise.
12826 (Output_section::output_address): Likewise.
12827 (Output_section::starting_output_address): Likewise.
12828 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12829 parameter to Sized_relobj*.
12830 (Copy_relocs::need_copy_reloc): Likewise.
12831 (Copy_relocs::save): Likewise.
12832 * copy-relocs.h (class Copy_relocs): Update declarations.
12833 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12834 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12835 * target-reloc.h (relocate_for_relocatable): Change
12836 offset_in_output_section type to Elf_Addr. Change code that uses
12837 it as well.
12838 * layout.cc (Layout::layout): Always set *off.
12839 * mapfile.cc (Mapfile::print_input_section): Use
12840 output_section_offset.
12841 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12842 Sized_relobj*.
12843 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12844 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12845 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12846
5cb66f97
ILT
128472008-07-03 Ian Lance Taylor <iant@google.com>
12848
12849 * layout.cc (Layout::include_section): Do not discard unrecognized
12850 SHT_STRTAB sections.
12851
afe47622
CS
128522008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12853
12854 * script.cc (Lex::can_continue_name): Make '?' allowable in
12855 version-script names.
12856 * testsuite/version_script.map: Change glob pattern to use '?'
12857
5adf9721
ILT
128582008-06-30 Manish Singh <yosh@gimp.org>
12859
12860 PR 6585
12861 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12862 Correct typo.
12863
e6fde208
ILT
128642008-06-30 Ian Lance Taylor <iant@google.com>
12865
12866 PR 6660
12867 PR 6682
12868 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12869 versions]: Don't try to read the value in the contents, since we
12870 don't use it. Use the template endianness when writing.
12871
3f2e6a2d
CC
128722008-06-25 Cary Coutant <ccoutant@google.com>
12873
12874 * fileread.cc (File_read::make_view): Assert on zero-length view.
12875 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12876 symbol table when there are no symbols to read.
12877
c43d3a48
CS
128782008-06-23 Craig Silverstein <csilvers@google.com>
12879
12880 * version.cc (version_string): Bump to 1.7
12881
5f494ea0
CS
128822008-06-18 Craig Silverstein <csilvers@google.com>
12883
12884 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12885 constant 0xFFFF to type Valtype.
12886 (Powerpc_relocate_functions::rel16_ha): Likewise.
12887
c42e122e
ILT
128882008-06-17 Ian Lance Taylor <iant@google.com>
12889
f34787f8
ILT
12890 * output.h (Output_section::Input_section): Initialize p2align_ to
12891 zero for Output_section_data constructors.
12892 (Output_section::Input_section::addralign): If not an input
12893 section, return the alignment of the Output_section_data.
12894 * testsuite/copy_test.cc: New file.
12895 * testsuite/copy_test_1.cc: New file.
12896 * testsuite/copy_test_2.cc: New file.
12897 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12898 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12899 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12900 (copy_test_1_pic.o, copy_test_1.so): New targets.
12901 (copy_test_2_pic.o, copy_test_2.so): New targets.
12902 * testsuite/Makefile.in: Rebuild.
12903
c42e122e
ILT
12904 * script-sections.cc (Script_sections::place_orphan): Initialize
12905 local variable exact.
12906
ce3ac18a
DE
129072008-06-13 David Edelsohn <edelsohn@gnu.org>
12908
12909 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12910
42cacb20
DE
129112008-06-12 David Edelsohn <edelsohn@gnu.org>
12912 David S. Miller <davem@davemloft.net>
12913
12914 * powerpc.cc: New file.
12915 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12916 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12917 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12918 * Makefile.in: Rebuild.
12919
7b308235
ILT
129202008-06-09 Ian Lance Taylor <iant@google.com>
12921
12922 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12923 <exception>.
12924 (throwing, orig_terminate): New static variables.
12925 (terminate_handler): New static function.
12926 (t2): Set terminate handler.
12927
f0b886e3
ILT
129282008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12929
12930 PR 6584
cd536b21 12931 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12932 alignment.
12933
3e90f135
CC
129342008-05-30 Cary Coutant <ccoutant@google.com>
12935
12936 * archive.cc (Archive::include_all_members) Correct to step
12937 over symbol table and extended name table in thin archives.
12938
e09ad04a
ILT
129392008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12940
12941 PR 6407
12942 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12943 calculation.
12944
62b01cb5
ILT
129452008-05-28 Caleb Howe <cshowe@google.com>
12946
12947 * reduced_debug_output.cc: New file.
12948 * reduced_debug_output.h: New file.
92de84a6 12949 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12950 * options.cc (General_options::finalize): Add strip_debug_non_line
12951 to the strip heirarchy.
12952 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12953 fields.
12954 * layout.cc: Include "reduced_debug_output.h".
12955 (Layout::Layout): Initialize new fields.
12956 (line_only_debug_sections): New static array.
12957 (is_lines_only_debug_sections): New static inline function.
12958 (Layout::include_section): Handle --strip-debug-non-line.
12959 (Layout::make_output_section): If --strip-debug-non-line, build
12960 new output sections for .debug_abbrev and .debug_info.
12961 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12962 gold. Warn about possible overflow.
12963 (read_signed_LEB_128): Likewise.
12964 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12965 (read_signed_LEB_128): Declare.
12966 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12967 (HFILES): Add reduced_debug_output.h.
12968 * Makefile.in: Rebuild.
12969
7d9e3d98
ILT
129702008-05-21 Ian Lance Taylor <iant@google.com>
12971
12972 * mapfile.cc: New file.
12973 * mapfile.h: New file.
12974 * options.h (class General_options): Add -M/--print-map and -Map.
12975 * options.cc (General_options::finalize): Make -M equivalent to
12976 -Map -.
12977 * main.cc: Include <cstdio> and "mapfile.h".
12978 (main): Open mapfile if requested.
12979 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12980 constructor. Change caller.
12981 (queue_initial_tasks): Add mapfile parameter. Change caller.
12982 (queue_middle_tasks): Likewise.
12983 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12984 declarations.
12985 * archive.cc: Include "mapfile.h".
12986 (Archive::add_symbols): Add mapfile parameter. Change all
12987 callers. Pass mapfile, symbol, and reason to include_member.
12988 (Archive::include_all_members): Add mapfile parameter. Change all
12989 callers.
12990 (Archive::include_member): Add mapfile, sym, and why parameters.
12991 Change all callers. Report inclusion to map file.
12992 * archive.h: Include "fileread.h".
12993 (class Archive): Update declarations.
12994 (Archive::file): New const method.
12995 (class Add_archive_symbols): Add mapfile_ field. Update
12996 constructor. Change all callers.
12997 * readsyms.h (class Read_symbols): Likewise.
12998 (class Finish_group): Likewise.
12999 (class Read_script): Likewise.
13000 * common.cc: Include "mapfile.h".
13001 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13002 all callers.
13003 (Symbol_table::do_allocate_commons): Likewise.
13004 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13005 symbol allocation to mapfile.
13006 * common.h (class Allocate_commons_task): Add mapfile_ field.
13007 Update constructor. Change all callers.
13008 * symtab.h (class Symbol_table): Update declarations.
13009 * layout.cc: Include "mapfile.h".
13010 (Layout_task_runner::run): Print information to mapfile.
13011 (Layout::create_gold_note): Change Output_data_fixed_space to
13012 Output_data_zero_fill.
13013 (Layout::create_build_id): Likewise.
13014 (Layout::print_to_mapfile): New function.
13015 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13016 constructor. Change caller.
13017 (class Layout): Declare print_to_mapfile.
13018 * output.cc (Output_section::Input_section::print_to_mapfile): New
13019 function.
13020 (Output_section::add_input_section): If producing a map, always
13021 add to input_sections_ list.
13022 (Output_section::do_print_to_mapfile): New function.
13023 (Output_segment::print_sections_to_mapfile): New function.
13024 (Output_segment::print_section_list_to_mapfile): New function.
13025 * output.h: Include "mapfile.h".
13026 (Output_data::print_to_mapfile): New function.
13027 (Output_data::do_print_to_mapfile): New virtual function.
13028 (Output_segment_headers::do_print_to_mapfile): New function.
13029 (Output_file_header::do_print_to_mapfile): New function.
13030 (Output_data_const::do_print_to_mapfile): New function.
13031 (class Output_data_const_buffer): Add map_name_ field. Update
13032 constructor. Change all callers. Add do_print_to_mapfile
13033 function.
13034 (class Output_data_fixed_space): Likewise.
13035 (class Output_data_space): Likewise.
13036 (class Output_data_zero_fill): New class.
13037 (Output_data_strtab::do_print_to_mapfile): New function.
13038 (Output_data_reloc_base::do_print_to_mapfile): New function.
13039 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13040 (Output_data_group::do_print_to_mapfile): New function.
13041 (Output_data_got::do_print_to_mapfile): New function.
13042 (Output_data_dynamic::do_print_to_mapfile): New function.
13043 (Output_symtab_xindex::do_print_to_mapfile): New function.
13044 (class Output_section): Declare do_print_to_mapflie. Declare
13045 print_to_mapfile in Input_section.
13046 (class Output_segment): Declare new functions.
13047 * object.h (Sized_relobj::symbol_count): New function.
13048 * script-sections.cc
13049 (Output_section_element_dot_assignment::set_section_addresses):
13050 Change Output_data_fixed_space to Output_data_zero_fill.
13051 (Output_data_expression::do_print_to_mapfile): New function.
13052 * script.cc (read_input_script): Add mapfile parameter. Change
13053 all callers.
13054 * script.h (read_input_script): Update declaration.
13055 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13056 (Eh_frame::do_print_to_mapfile): New function.
13057 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13058 (Output_merge_string::do_print_to_mapfile): New function.
13059 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13060 function.
13061 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13062 function.
13063 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13064 function.
13065 * Makefile.am (CCFILES): Add mapfile.cc.
13066 (HFILES): Add mapfile.h.
13067 * Makefile.in: Rebuild.
13068
9f1d377b
ILT
130692008-05-19 Ian Lance Taylor <iant@google.com>
13070
13071 * options.h (class General_options): Add -z relro.
13072 * layout.cc (Layout::Layout): Initialize relro_segment_.
13073 (Layout::add_output_section_data): Return the output section.
13074 (Layout::make_output_section): Rcognize relro sections and mark
13075 them appropriately.
13076 (Layout::attach_allocated_section_to_segment): Put relro sections
13077 in a PT_GNU_RELRO segment.
13078 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13079 section as relro.
13080 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13081 PT_TLS segments.
13082 (Layout::linkonce_mapping): Map d.rel.ro.local to
13083 .data.rel.ro.local.
13084 (Layout::output_section_name): Us .data.rel.ro.local for any
13085 section which begins with that.
13086 * layout.h (class Layout): Update add_output_section_data
13087 declaration. Add relro_segment_ field.
13088 * output.cc (Output_section::Output_section): Initialize is_relro_
13089 and is_relro_local_ fields.
13090 (Output_segment::add_output_section): Group relro sections.
13091 (Output_segment::is_first_section_relro): New function.
13092 (Output_segment::maximum_alignment): If there is a relro section,
13093 align the segment to the common page size.
13094 (Output_segment::set_section_addresses): Track whether we are
13095 looking at relro sections. If the last section is a relro
13096 section, align to the common page size.
13097 (Output_segment::set_section_list_addresses): Add in_relro
13098 parameter. Change all callers. Align to the page size when
13099 moving from relro to non-relro section.
13100 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13101 segment.
13102 * output.h (class Output_section): Add is_relro_ and
13103 is_relro_local_ fields.
13104 (Output_section::is_relro): New function.
13105 (Output_section::set_is_relro): New function.
13106 (Output_section::is_relro_local): New function.
13107 (Output_section::set_is_relro_local): New function.
13108 (class Output_segment): Update declarations.
13109 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13110 * sparc.cc (Target_sparc::got_section): Likewise.
13111 * x86_64.cc (Target_x86_64::got_section): Likewise.
13112 * testsuite/relro_test_main.cc: New file.
13113 * testsuite/relro_test.cc: New file.
13114 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13115 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13116 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13117 (relro_test.so, relro_test_pic.o): New targets.
13118 * testsuite/Makefile.in: Rebuild.
13119
a984ee1d
ILT
131202008-05-16 Ian Lance Taylor <iant@google.com>
13121
01676dcd
ILT
13122 * output.cc (Output_segment::add_output_section): Remove front
13123 parameter.
13124 * output.h (class Output_segment): Remove
13125 add_initial_output_section and overloaded add_output_section.
13126 Update declaration of remaining add_output_section.
13127 * layout.cc (Layout::create_interp): Call add_output_section
13128 rather than add_initial_output_section.
13129 (Layout::finish_dynamic_section): Likewise.
13130
497897f9
ILT
13131 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13132 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13133 know the dynamic type.
13134 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13135 field. Initialize it in constructor.
13136 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13137 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13138 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13139 reloc.
13140
a984ee1d
ILT
13141 * output.cc (Output_reloc::get_address): Change return type to
13142 Elf_Addr.
13143 * output.h (class Output_reloc): Update get_address declaration.
13144 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13145 for section addresses.
13146
55ba0940
ILT
131472008-05-09 Ian Lance Taylor <iant@google.com>
13148
13149 PR 6493
13150 * gold.cc (gold_nomem): Use return value of write.
13151
75517b77
ILT
131522008-05-08 Ian Lance Taylor <iant@google.com>
13153
13154 * symtab.c (Symbol::init_base_output_data): Add version
13155 parameter. Change all callers.
13156 (Symbol::init_base_output_segment): Likewise.
13157 (Symbol::init_base_constant): Likewise.
13158 (Symbol::init_base_undefined): Likewise.
13159 (Sized_symbol::init_output_data): Likewise.
13160 (Sized_symbol::init_output_segment): Likewise.
13161 (Sized_symbol::init_constant): Likewise.
13162 (Sized_symbol::init_undefined): Likewise.
13163 (Symbol_table::do_define_in_output_data): If the new symbol has a
13164 version, mark it as the default.
13165 (Symbol_table::do_define_in_output_segment): Likewise.
13166 (Symbol_table::do_define_as_constant): Likewise.
13167 * symtab.h (class Symbol): Update declarations.
13168 (class Sized_symbol): Likewise.
13169 * resolve.cc (Symbol::override_version): New function.
c42e122e 13170 (Symbol::override_base): Call override_version.
75517b77
ILT
13171 (Symbol::override_base_with_special): Likewise.
13172 * testsuite/ver_script_8.script: New file.
13173 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13174 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13175 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13176 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13177
f1f70eae
ILT
131782008-05-06 Ian Lance Taylor <iant@google.com>
13179
f3e9c5c5
ILT
13180 PR 6049
13181 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13182 functions.
13183 (class General_options): Remove existing --undefined, and add
13184 --no-undefined instead. Add new --undefined as synonym for -u.
13185 * archive.cc (Archive::add_symbols): Check whether symbol was
13186 named with -u.
13187 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13188 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13189 all uses. Add IS_UNDEFINED. Update declarations to split
13190 different versions of init_base. Declare init_base_undefined.
13191 (Symbol::is_defined): Handle IS_UNDEFINED.
13192 (Symbol::is_undefined): Likewise.
13193 (Symbol::is_weak_undefined): Call is_undefined.
13194 (Symbol::is_absolute): Handle IS_CONSTANT.
13195 (class Sized_symbol): Update declarations to split different
13196 versions of init. Declare init_undefined.
13197 (class Symbol_table): Declare new functions.
13198 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13199 Change all callers.
13200 (Symbol::init_base_output_data): Likewise.
13201 (Symbol::init_base_output_segment): Likewise.
13202 (Symbol::init_base_constant): Likewise.
13203 (Symbol::init_base_undefined): New function.
13204 (Sized_symbol::init_object): Rename from init. Change all
13205 callers.
13206 (Sized_symbol::init_output_data): Likewise.
13207 (Sized_symbol::init_output_segment): Likewise.
13208 (Sized_symbol::init_constant): Likewise.
13209 (Sized_symbol::init_undefined): New function.
13210 (Symbol_table::add_undefined_symbols_from_command_line): New
13211 function.
13212 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13213 function.
13214 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13215 (Symbol::output_section): Likewise.
13216 (Symbol::set_output_section): Likewise.
13217 (Symbol_table::sized_finalize_symbol): Likewise.
13218 (Symbol_table::sized_write_globals): Likewise.
13219 * resolve.cc (Symbol_table::should_override): Likewise.
13220 (Symbol::override_base_with_special): Likewise.
13221
8bdcdf2c
ILT
13222 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13223 symbol, change it to have default visibility.
13224 * testsuite/protected_1.cc: New file.
13225 * testsuite/protected_2.cc: New file.
13226 * testsuite/protected_3.cc: New file.
13227 * testsuite/protected_main_1.cc: New file.
13228 * testsuite/protected_main_2.cc: New file.
13229 * testsuite/protected_main_3.cc: New file.
13230 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13231 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13232 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13233 (protected_1.so): New target.
13234 (protected_1_pic.o, protected_2_pic.o): New targets.
13235 (protected_3_pic.o): New target.
13236 (check_PROGRAMS): Add protected_2.
13237 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13238 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13239 * testsuite/Makefile.in: Rebuild.
13240
2b706932
ILT
13241 * options.h (DEFINE_var): Add set_user_set_##varname__.
13242 (DEFINE_bool_alias): New macro.
13243 (class General_options): Define -Bstatic using DEFINE_bool_alias
13244 rather than DEFINE_special. Add --undefined as an alias for -z
13245 defs.
13246 * options.cc (General_options::parse_Bstatic): Remove.
13247
d82a5bcc
ILT
13248 * options.h (class General_options): Add --fatal-warnings.
13249 * main.cc (main): Implement --fatal-warnings.
13250 * errors.h (Errors::warning_count): New function.
13251
f1f70eae
ILT
13252 * options.h (class General_options): Add -Bsymbolic-functions.
13253 * symtab.h (Symbol::is_preemptible): Check for
13254 -Bsymbolic-functions.
13255
8825ac63
ILT
132562008-05-05 Ian Lance Taylor <iant@google.com>
13257
d98bc257
ILT
13258 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13259 as noVARNAME rather than no-VARNAME.
13260 (class General_options): Add option -z combreloc.
13261 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13262 get_address.
13263 (Output_reloc::sort_before) [SHT_REL]: New function.
13264 (Output_reloc::sort_before) [SHT_RELA]: New function.
13265 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13266 Sort_relocs_comparison.
13267 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13268 parameter. Change all callers.
13269 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13270 sort_relocs parameter. Change all callers.
13271 * output.cc (Output_reloc::get_address): New function, broken out
13272 of write_rel.
13273 (Output_reloc::write_rel): Call it.
13274 (Output_reloc::compare): New function.
13275 (Output_data_reloc_base::do_write): Optionally sort relocs.
13276
60b2b4e7
ILT
13277 * configure.ac: If targ_extra_obj is set, link it in.
13278 * configure.tgt: Initialize all variables.
13279 (x86_64*): Set targ_extra_obj and targ_extra_size.
13280 * configure: Rebuild.
13281
8825ac63
ILT
13282 * object.cc (Sized_relobj::include_section_group): Adjust section
13283 indexes read from group data. Build vector to pass to
13284 layout_group.
13285 * layout.cc (Layout::layout_group): Add flags and shndxes
13286 parameters. Remove contents parameter. Change caller. Update
13287 explicit instantiations.
13288 * layout.h (class Layout): Update layout_group declaration.
13289 * output.cc (Output_data_group::Output_data_group): Add flags and
13290 input_shndxes parameters. Remove contents parameter. Change
13291 caller.
13292 (Output_data_group::do_write): Change input_sections_ to
13293 input_shndxes_.
13294 * output.h (class Output_data_group): Update constructor
13295 declaration. Rename input_sections_ to input_shndxes_.
13296 * testsuite/many_sections_test.cc: Add template.
13297
e94cf127
CC
132982008-04-30 Cary Coutant <ccoutant@google.com>
13299
4418b2d5
CC
13300 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13301
e94cf127
CC
13302 * layout.cc (Layout::include_section): Refactored check for debug
13303 info section.
13304 (Layout::add_comdat): Add new parameters. Change type
13305 of signature parameter. Add object and shndx to signatures table.
13306 (Layout::find_kept_object): New function.
13307 * layout.h: Include <cstring>.
13308 (Layout::is_debug_info_section): New function.
13309 (Layout::add_comdat): Add new parameters.
13310 (Layout::find_kept_object): New function.
13311 (Layout::Kept_section): New struct.
13312 (Layout::Signatures): Change type of map range.
13313 * object.cc (Relobj::output_section_address): New function.
13314 (Sized_relobj::include_section_group): Add new parameters. Change
13315 calls to Layout::add_comdat. Change to build table of kept comdat
13316 groups and table mapping discarded sections to kept sections.
13317 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13318 (Sized_relobj::do_layout): Change calls to include_section_group and
13319 include_linkonce_section.
13320 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13321 value to zero when section is discarded.
13322 (Sized_relobj::map_to_kept_section): New function.
13323 * object.h (Relobj::output_section_address): New function.
13324 (Relobj::Comdat_group): New type.
13325 (Relobj::find_comdat_group): New function.
13326 (Relobj::Comdat_group_table): New type.
13327 (Relobj::Kept_comdat_section): New type.
13328 (Relobj::Kept_comdat_section_table): New type.
13329 (Relobj::add_comdat_group): New function.
13330 (Relobj::set_kept_comdat_section): New function.
13331 (Relobj::get_kept_comdat_section): New function.
13332 (Relobj::comdat_groups_): New field.
13333 (Relobj::kept_comdat_sections_): New field.
13334 (Symbol_value::input_value): Update comment.
13335 (Sized_relobj::map_to_kept_section) New function.
13336 (Sized_relobj::include_linkonce_section): Add new parameter.
13337 * target-reloc.h (Comdat_behavior): New type.
13338 (get_comdat_behavior): New function.
13339 (relocate_section): Add code to map a discarded section to the
13340 corresponding kept section when applying a relocation.
13341
e4e5049b
CS
133422008-04-30 Craig Silverstein <csilvers@google.com>
13343
13344 * dwarf_reader.cc (next_generation_count): New static var.
13345 (Addr2line_cache_entry): New struct.
13346 (addr2line_cache): New static var.
13347 (Dwarf_line_info::one_addr2line): Added caching.
13348 (Dwarf_line_info::clear_addr2line_cache): New function.
13349 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13350 cache-size parameter.
13351 (Dwarf_line_info::one_addr2line_cache): New function.
13352 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13353 new cache-size argument to one_addr2line(), and clear cache.
13354
d09e9154
CC
133552008-04-28 Cary Coutant <ccoutant@google.com>
13356
13357 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13358 R_386_PC8 relocations.
13359
7ef73768
ILT
133602008-04-23 Ian Lance Taylor <iant@google.com>
13361
55438702
ILT
13362 * object.cc (Sized_relobj::include_section_group): Check for
13363 invalid section group.
13364
c165fb93
ILT
13365 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13366 header size.
13367
7ef73768
ILT
13368 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13369 than read for file header.
13370 * archive.cc (Archive::include_member): Likewise.
13371
6194aaab
L
133722008-04-23 Paolo Bonzini <bonzini@gnu.org>
13373
13374 * aclocal.m4: Regenerate.
13375 * configure: Regenerate.
13376
d491d34e
ILT
133772008-04-19 Ian Lance Taylor <iant@google.com>
13378
5ea2bac6
ILT
13379 * version.cc (version_string): Bump to 1.6.
13380
7bc3e21a
ILT
13381 * testsuite/Makefile.am (many_sections_r_test): New target.
13382 (many_sections_r_test_SOURCES): Remove.
13383 (many_sections_r_test_DEPENDENCIES): Remove.
13384 (many_sections_r_test_LDFLAGS): Remove.
13385 (many_sections_r_test_LDADD): Remove.
13386
7fcd3aa9
ILT
13387 * object.cc (Sized_relobj::do_add_symbols): Always pass
13388 local_symbol_count_ to add_from_relobj.
13389
4c94d6ae
ILT
13390 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13391 every thousand variables.
13392 * testsuite/Makefile.in: Rebuild.
13393
d491d34e
ILT
13394 * object.cc (Xindex::initialize_symtab_xindex): New function.
13395 (Xindex::read_symtab_xindex): New function.
13396 (Xindex::sym_xindex_to_shndx): New function.
13397 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13398 available.
13399 (Sized_relobj::do_initialize_xindex): New function.
13400 (Sized_relobj::do_read_symbols): Adjust section links.
13401 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13402 parameter. Change all callers.
13403 (Sized_relobj::include_section_group): Adjust section links and
13404 symbol section indexes.
13405 (Sized_relobj::do_layout): Adjust section links.
13406 (Sized_relobj::do_count_local_symbols): Adjust section links and
13407 symbol section indexes.
13408 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13409 ordinary and special symbols.
13410 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13411 dynsym_xindex parameters. Change all callers. Adjust section
13412 links. Use SHN_XINDEX when needed.
13413 (Sized_relobj::get_symbol_location_info): Adjust section links.
13414 Don't get fooled by special symbols.
13415 * object.h (class Xindex): Define.
13416 (class Object): Add xindex_ parameter. Declare virtual functoin
13417 do_initialize_xindex.
13418 (Object::adjust_sym_shndx): New function.
13419 (Object::set_xindex): New protected function.
13420 (class Symbol_value): Add is_ordinary_shndx_ field.
13421 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13422 (Symbol_value::value): Assert ordinary section.
13423 (Symbol_value::initialize_input_to_output_map): Likewise.
13424 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13425 Change all callers.
13426 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13427 all callers.
13428 (class Sized_relobj): Update declarations.
13429 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13430 parameter. Change all callers.
13431 (Sized_relobj::adjust_shndx): New function.
13432 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13433 field.
13434 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13435 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13436 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13437 (Sized_dynobj::read_dynsym_section): Adjust section links.
13438 (Sized_dynobj::read_dynamic): Likewise.
13439 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13440 section links.
13441 (Sized_dynobj::do_initialize_xindex): New function.
13442 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13443 do_initialize_xindex.
13444 (Sized_dynobj::adjust_shndx): New function.
13445 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13446 dynsym_xindex_ fields.
13447 (Layout::finalize): Add a call to set_section_indexes before
13448 creating the symtab sections.
13449 (Layout::set_section_indexes): Don't do anything if the section
13450 already has a section index.
13451 (Layout::create_symtab_sections): Add shnum parameter. Change
13452 caller. Create .symtab_shndx section if needed.
13453 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13454 caller.
13455 (Layout::allocated_output_section_count): New function.
13456 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13457 needed.
13458 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13459 fields. Update declarations.
13460 (Layout::symtab_xindex): New function.
13461 (Layout::dynsym_xindex): New function.
13462 (class Write_symbols_task): Add layout_ field.
13463 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13464 Change caller.
13465 * output.cc (Output_section_headers::Output_section_headers): Add
13466 shstrtab_section parameter. Change all callers.
13467 (Output_section_headers::do_sized_write): Store overflow values
13468 for section count and section string table section index in
13469 section header zero.
13470 (Output_file_header::do_sized_write): Check for overflow of
13471 section count and section string table section index.
13472 (Output_symtab_xindex::do_write): New function.
13473 (Output_symtab_xindex::endian_do_write): New function.
13474 * output.h (class Output_section_headers): Add shstrtab_section_.
13475 Update declarations.
13476 (class Output_symtab_xindex): Define.
13477 (Output_section::has_out_shndx): New function.
13478 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13479 field.
13480 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13481 Change all callers.
13482 (Sized_symbol::init): Likewise.
13483 (Symbol::output_section): Check for ordinary symbol.
13484 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13485 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13486 callers.
13487 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13488 Change all callers. Simplify handling of symbols from sections
13489 not included in the link.
13490 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13491 distinction.
13492 (Weak_alias_sorter::operator()): Assert that symbols are
13493 ordinary.
13494 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13495 distinction.
13496 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13497 parameters. Change all callers.
13498 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13499 symbol distinction. Use SHN_XINDEX when needed.
13500 (Symbol_table::write_section_symbol): Add symtab_xindex
13501 parameter. Change all callers.
13502 (Symbol_table::sized_write_section_symbol): Likewise. Use
13503 SHN_XINDEX when needed.
13504 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13505 declarations.
13506 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13507 (Symbol::is_defined): Check is_ordinary.
13508 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13509 (Symbol::is_absolute, Symbol::is_common): Likewise.
13510 (class Sized_symbol): Update declarations.
13511 (class Symbol_table): Update declarations.
13512 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13513 parameters. Change all callers.
13514 (Sized_symbol::override): Likewise.
13515 (Symbol_table::override): Likewise.
13516 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13517 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13518 is_ordinary, and orig_st_shndx parameters. Change all callers.
13519 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13520 to be in an ordinary section.
13521 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13522 object and is_ordinary parameters. Change all callers.
13523 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13524 Change all callers. Don't add undefined or non-ordinary symbols
13525 to reloc_map_.
13526 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13527 Change all callers.
13528 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13529 declarations.
13530 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13531 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13532 (Sized_relobj::relocate_sections): Likewise.
13533 * target-reloc.h (scan_relocs): Adjust section symbol index.
13534 (scan_relocatable_relocs): Likewise.
13535 * i386.cc (Scan::local): Check for ordinary symbols.
13536 * sparc.cc (Scan::local): Likewise.
13537 * x86_64.cc (Scan::local): Likewise.
13538 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13539 to symbol_section_and_value.
13540 * testsuite/many_sections_test.cc: New file.
13541 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13542 (check_PROGRAMS): Add many_sections_test.
13543 (many_sections_test_SOURCES): Define.
13544 (many_sections_test_DEPENDENCIES): Define.
13545 (many_sections_test_LDFLAGS): Define.
13546 (BUILT_SOURCES): Add many_sections_define.h.
13547 (many_sections_define.h): New target.
13548 (BUILT_SOURCES): Add many_sections_check.h.
13549 (many_sections_check.h): New target.
13550 (check_PROGRAMS): Add many_sections_r_test.
13551 (many_sections_r_test_SOURCES): Define.
13552 (many_sections_r_test_DEPENDENCIES): Define.
13553 (many_sections_r_test_LDFLAGS): Define.
13554 (many_sections_r_test_LDADD): Define.
13555 (many_sections_r_test.o): New target.
13556 * testsuite/Makefile.in: Rebuild.
13557
c5818ff1
CC
135582008-04-17 Cary Coutant <ccoutant@google.com>
13559
13560 * errors.cc (Errors::info): New function.
13561 (gold_info): New function.
13562 * errors.h (Errors::info): New function.
13563 * gold.h (gold_info): New function.
13564 * object.cc (Input_objects::add_object): Print trace output.
13565 * options.cc (options::parse_set): New function.
13566 (General_options::parse_wrap): Deleted.
13567 (General_options::General_options): Deleted initializer.
13568 * options.h (options::String_set): New typedef.
13569 (options::parse_set): New function.
13570 (DEFINE_set): New macro.
13571 (General_options::wrap): Changed to use DEFINE_set. Changed
13572 callers of any_wrap_symbols and is_wrap_symbol.
13573 (General_options::trace, General_options::trace_symbol):
13574 New options.
13575 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13576 (General_options::wrap_symbols_): Deleted.
13577 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13578
b5be4a7c
DM
135792008-04-17 David S. Miller <davem@davemloft.net>
13580
13581 * options.cc (General_options::parse_V): New function.
13582 * options.h: Add entries for -V and -Qy.
13583
155a0dd7
ILT
135842008-04-17 Ian Lance Taylor <iant@google.com>
13585
13586 * common.cc (Symbol_table::allocate_commons): Remove options
13587 parameter. Change caller.
13588 (Symbol_table::do_allocate_commons): Remove options parameter.
13589 Change caller. Just call do_allocate_commons_list twice.
13590 (Symbol_table::do_allocate_commons_list): New function, broken out
13591 of do_allocate_commons.
13592 * common.h (class Allocate_commons_task): Remove options_ field.
13593 Update constructor.
13594 * symtab.cc (Symbol_table::Symbol_table): Initialize
13595 tls_commons_.
13596 (Symbol_table::add_from_object): Put TLS common symbols on
13597 tls_commons_ list.
13598 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13599 which are IN_OUTPUT_DATA.
13600 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13601 allocate_commons and do_allocate_commons declarations. Declare
13602 do_allocate_commons_list.
13603 * gold.cc (queue_middle_tasks): Update creation of
13604 Allocate_commons_task to not pass options.
13605 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13606 (TLS_TEST_C_FLAGS): New variable.
13607 (tls_test_c_pic.o): New target.
13608 (tls_test_shared.so): Link in tls_test_c_pic.o.
13609 (tls_test_c_pic_ie.o): New target.
13610 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13611 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13612 (tls_test_c.o): New target.
13613 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13614 (tls_pic_test_LDADD): Likewise.
13615 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13616 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13617 (tls_test_c_gnu2.o): New target.
13618 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13619 tls_test_c_gnu2.o.
13620 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13621 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13622 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13623 * testsuite/tls_test.cc: Include "config.h".
13624 (t_last): Call t11_last.
13625 * testsuite/tls_test.h (t11, t11_last): Declare.
13626 * testsuite/tls_test_c.c: New file.
13627 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13628 * configure.ac: Check for OpenMP support.
13629 * configure, config.in, Makefile.in: Rebuild.
13630 * testsuite/Makefile.in: Rebuild.
13631
edfbb029
CC
136322008-04-16 Cary Coutant <ccoutant@google.com>
13633
13634 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13635 (Target_i386::tls_base_symbol_defined_): New field.
13636 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13637 (Target_i386::Scan::global): Likewise.
13638 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13639 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13640 (Target_x86_64::tls_base_symbol_defined_): New field.
13641 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13642 (Target_x86_64::Scan::global): Likewise.
13643
f3c69fca
CC
136442008-04-16 Cary Coutant <ccoutant@google.com>
13645
13646 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13647 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13648 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13649 building shared libraries.
13650 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13651 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13652 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13653 * testsuite/Makefile.in: Rebuild.
13654 * testsuite/weak_undef.h: New file.
13655 * testsuite/weak_undef_file1.cc: Add extra test cases.
13656 * testsuite/weak_undef_file2.cc: Likewise.
13657 * testsuite/weak_undef_test.cc: Likewise.
13658
7c414435
DM
136592008-04-16 David S. Miller <davem@davemloft.net>
13660
32b769e1
DM
13661 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13662 Add issued_non_pic_error_ field. Declare check_non_pic.
13663 (Target_sparc::Scan::check_non_pic): New function.
13664 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13665 (Target_sparc::Scan::global): Likewise.
13666
11936fb1
DM
13667 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13668 * configure: Rebuild.
13669
7c414435
DM
13670 * options.h (DEFINE_enable): New macro.
13671 (new_dtags): New enable option.
13672 (initfirst, interpose, loadfltr, nodefaultlib,
13673 nodelete, nodlopen, nodump): New -z options.
13674 * layout.cc (Layout:finish_dynamic_section): If new
13675 dtags enabled, emit DT_RUNPATH. Also, emit a
13676 DT_FLAGS_1 containing any specified -z flags.
13677
85c7bf8b
ILT
136782008-04-16 Ian Lance Taylor <iant@google.com>
13679
12c0daef
ILT
13680 * copy-relocs.cc: New file.
13681 * copy-relocs.h: New file.
13682 * reloc.cc: Remove Copy_relocs code.
13683 * reloc.h: Likewise.
13684 * reloc-types.h (struct Reloc_types) [both versions]: Add
13685 get_reloc_addend_noerror.
13686 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13687 variants of add_global which take an addend which must be zero.
13688 * i386.cc: Include "copy-relocs.h".
13689 (class Target_i386): Change type of copy_relocs_ to variable,
13690 update initializer.
13691 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13692 Change all callers.
13693 (Target_i386::do_finalize_sections): Change handling of
13694 copy_relocs_.
13695 * sparc.cc: Include "copy-relocs.h".
13696 (class Target_sparc): Change type of copy_relocs_ to variable,
13697 update initializer.
13698 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13699 Change all callers.
13700 (Target_sparc::do_finalize_sections): Change handling of
13701 copy_relocs_.
13702 * x86_64.cc: Include "copy-relocs.h".
13703 (class Target_x86_64): Change type of copy_relocs_ to variable,
13704 update initializer.
13705 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13706 class. Change all callers.
13707 (Target_x86_64::do_finalize_sections): Change handling of
13708 copy_relocs_.
13709 * Makefile.am (CCFILES): Add copy-relocs.cc.
13710 (HFILES): Add copy-relocs.h.
13711
4f4995b6
ILT
13712 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13713
85c7bf8b
ILT
13714 * testsuite/script_test_4.sh: Permit leading zeroes.
13715
4f2a9edd
ILT
137162008-04-15 Ian Lance Taylor <iant@google.com>
13717
e6188289
ILT
13718 * script-sections.cc (Script_sections::create_segments): Use
13719 header_size_adjustment even when there is enough room for the
13720 headers.
13721 * testsuite/script_test_4.sh: New file.
13722 * testsuite/script_test_4.t: New file.
13723 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13724 (check_DATA): Add script_test_4.stdout.
13725 (MOSTLYCLEANFILES): Likewise.
13726 (script_test_4): New target.
13727 (script_test_4.stdout): New target.
13728 * testsuite/Makefile.in: Rebuild.
13729
4f2a9edd
ILT
13730 * sparc.cc: Add definitions for Output_data_plt_sparc class
13731 constants.
13732
f5314dd5
DM
137332008-04-14 David S. Miller <davem@davemloft.net>
13734
13735 * sparc.cc: New file.
13736 * Makefile.am (TARGETSOURCES): Add sparc.cc
13737 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13738 * configure.tgt: Document targ_extra_size and
13739 targ_extra_big_endian. Add entries for sparc-* and
13740 sparc64-*.
13741 * configure.ac: Handle targ_extra_size and
13742 targ_extra_big_endian.
13743 * Makefile.in: Rebuild.
13744 * configure: Likewise.
13745 * po/POTFILES.in: Likewise.
13746 * po/gold.pot: Likewise.
13747
154e0e9a
ILT
137482008-04-14 Ian Lance Taylor <iant@google.com>
13749
13750 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13751 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13752 in the name/type/flags to section mapping. Don't call
13753 allocate_output_section.
13754 (Layout::choose_output_section): Change parameter from adjust_name
13755 to is_input_section. Don't permit input sections after sections
13756 are attached to segments. Don't call allocate_output_section.
13757 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13758 not write_enable_output_section.
13759 (Layout::make_output_section): Don't push to
13760 unattached_section_list_ nor call attach_to_segment. Call
13761 attach_section_to_segment if sections are attached.
13762 (Layout::attach_sections_to_segments): New function.
13763 (Layout::attach_section_to_segment): New function.
13764 (Layout::attach_allocated_section_to_segment): Rename from
13765 attach_to_segment. Remove flags parameter.
13766 (Layout::allocate_output_section): Remove function.
13767 (Layout::write_enable_output_section): Remove function.
13768 * layout.h (class Layout): Update for above changes. Add new
13769 field sections_are_attached_.
13770 * output.h (Output_section::update_flags_for_input_section): New
13771 function.
13772 * output.cc (Output_section::add_input_section): Call
13773 update_flags_for_input_section.
13774 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13775
009a67a2
CC
137762008-04-11 Cary Coutant <ccoutant@google.com>
13777
13778 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13779 thought unnecessary.
13780 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13781
759b1a24
ILT
137822008-04-11 Ian Lance Taylor <iant@google.com>
13783
13784 * output.h (class Output_section_data): Remove inline definition
13785 of set_addralign.
13786 * output.cc (Output_section_data::set_addralign): New function.
13787
c2b45e22
CC
137882008-04-11 Cary Coutant <ccoutant@google.com>
13789
13790 Add support for TLS descriptors for i386 and x86_64.
13791 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13792 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13793 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13794 GOT_TYPE_TLS_DESC.
13795 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13796 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13797 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13798 relocations.
13799 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13800 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13801 Fix problem with initial-exec relocations.
13802 (Target_i386::Relocate::relocate_tls): Likewise.
13803 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13804 relaxation.
13805 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13806 support for section-plus-offset dynamic table entries.
13807 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13808 (Output_data_dynamic::Dynamic_entry): Add support for
13809 section-plus-offset dynamic table entries.
13810 (Output_data_dynamic::Classification): Likewise.
13811 (Output_data_dynamic::classification_): Renamed offset_.
13812 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13813 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13814 (Target_x86_64::make_plt_section): New function.
13815 (Target_x86_64::reserve_tlsdesc_entries): New function.
13816 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13817 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13818 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13819 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13820 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13821 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13822 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13823 add extra PLT entry for TLS descriptors.
13824 (Output_data_plt_x86_64::got_): New field.
13825 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13826 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13827 fields.
13828 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13829 descriptors.
13830 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13831 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13832 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13833 R_386_TLS_DESC_CALL relocations.
13834 (Target_x86_64::Scan::global): Likewise.
13835 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13836 for TLS descriptors.
13837 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13838 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13839 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13840 GD-to-IE relaxation.
13841 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13842 and TLS_DESCRIPTORS.
13843 * Makefile.in: Rebuild.
13844 * configure: Rebuild.
13845 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13846 (tls_test_shared2.so): New target.
13847 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13848 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13849 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13850 (tls_shared_gd_to_ie_test_LDADD): New variable.
13851 (tls_shared_gnu2_gd_to_ie_test): New target.
13852 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13853 New targets.
13854 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13855 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13856 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13857 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13858 (tls_shared_gnu2_test): New target.
13859 (tls_test_gnu2_shared.so): New target.
13860 (tls_shared_gnu2_test_SOURCES): New variable.
13861 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13862 (tls_shared_gnu2_test_LDFLAGS): New variable.
13863 (tls_shared_gnu2_test_LDADD): New variable.
13864 * testsuite/Makefile.in: Rebuild.
13865 * testsuite/Makefile.
13866
83bfb6b7
ILT
138672008-04-11 Ian Lance Taylor <iant@google.com>
13868
13869 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13870 justsyms.t.
13871 * testsuite/Makefile.in: Rebuild.
13872
13873 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13874 long.
13875 * testsuite/script_test_2.cc (main): Adjust test.
13876
706e1f5e
ILT
138772008-04-11 David S. Miller <davem@davemloft.net>
13878 Ian Lance Taylor <iant@google.com>
13879
13880 * options.h (General_options): Add entries for '-Y' and
13881 '-relax'.
13882 * options.cc (General_options:finalize): If -Y was used, add those
13883 entries to the library path instead of the default "/lib" and
13884 "/usr/lib".
13885
7c98e6bb
DM
138862008-04-11 David S. Miller <davem@davemloft.net>
13887
13888 * testsuite/justsyms.t: Start at 0x100.
13889 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13890 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13891 long.
13892 * testsuite/script_test_2.cc: Adjust string and section length
13893 checks.
7c98e6bb 13894
99a37bfd
ILT
138952008-04-09 Ian Lance Taylor <iant@google.com>
13896
2cefc357
ILT
13897 PR gold/5996
13898 * script-sections.cc (Sections_element::allocate_to_segment): Add
13899 orphan parameter.
13900 (Output_section_definition::allocate_to_segment): Likewise.
13901 (Orphan_output_section::allocate_to_segment): Likewise.
13902 (Script_sections::attach_sections_using_phdrs_clause): Don't
13903 propagate non-PT_LOAD segments to orphan sections.
13904 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13905 readelf rather than objdump.
13906 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13907 .interp section and PT_INTERP segment are the same size.
13908 * testsuite/Makefile.in: Rebuild.
13909
99a37bfd
ILT
13910 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13911 aliases for symbols defined in the same object.
13912 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13913 (weak_alias_test_SOURCES): New variable.
13914 (weak_alias_test_DEPENDENCIES): New variable.
13915 (weak_alias_test_LDFLAGS): New variable.
13916 (weak_alias_test_LDADD): New variable.
13917 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13918 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13919 (weak_alias_test_3.o): New target.
13920 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13921 * testsuite/weak_alias_test_main.cc: New file.
13922 * testsuite/weak_alias_test_1.cc: New file.
13923 * testsuite/weak_alias_test_2.cc: New file.
13924 * testsuite/weak_alias_test_3.cc: New file.
13925
780e49c5
ILT
139262008-04-08 Ian Lance Taylor <iant@google.com>
13927
cdb0b8f5
ILT
13928 * options.h (class General_options): Add --noinhibit-exec option.
13929 * main.cc (main): Check --noinhibit-exec.
13930
0864d551
ILT
13931 * options.h (class General_options): Define --wrap as a special
13932 option. Add wrap_symbols_ field.
13933 (General_options::any_wrap_symbols): New function.
13934 (General_options::is_wrap_symbol): New function.
13935 * options.cc (General_options::parse_wrap): New function.
13936 (General_options::General_options): Initialize wrap_symbols_.
13937 * symtab.cc (Symbol_table::wrap_symbol): New function.
13938 (Symbol_table::add_from_object): Handle --wrap.
13939 * symtab.h (class Symbol_table): Declare wrap_symbol.
13940 * target.h (Target::wrap_char): New function.
13941 (Target::Target_info): Add wrap_char field.
13942 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13943 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13944 * testsuite/testfile.cc (Target_test::test_target_info):
13945 Likewise.
13946
789aa6de
ILT
13947 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13948 there is one.
13949
2c38906f
ILT
13950 * layout.h (class Layout): Add added_eh_frame_data_ field.
13951 * layout.cc (Layout::Layout): Initialize new field.
13952 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13953 output section until we find a section we merged successfully.
13954 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13955 that the size be non-zero.
13956
780e49c5
ILT
13957 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13958 qualifier.
13959
7fcd0256
ILT
139602008-04-08 Craig Silverstein <csilvers@google.com>
13961
13962 * configure.ac: Export new conditional variable HAVE_ZLIB.
13963 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13964 on HAVE_ZLIB.
13965 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13966 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13967
6835af53
ILT
139682008-04-07 Ian Lance Taylor <iant@google.com>
13969
e24f324c
ILT
13970 * version.cc (version_string): Set to "1.5".
13971
a036edd8
ILT
13972 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13973 Add issued_non_pic_error_ field. Declare check_non_pic.
13974 (Target_x86_64::Scan::check_non_pic): New function.
13975 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13976 (Target_x86_64::Scan::global): Likewise.
13977
624f8810
ILT
13978 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13979 addend parameter. Change caller. Handle merge sections.
13980 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13981 Address to Addend. Don't add in the result of
13982 local_section_offset, pass down the addend and use the returned
13983 value.
13984 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13985 Update declarations of local_section_offset and symbol_value.
13986 * testsuite/two_file_test_1.cc (t18): New function.
13987 * testsuite/two_file_test_2.cc (f18): New function.
13988 * testsuite/two_file_test_main.cc (main): Call t18.
13989 * testsuite/two_file_test.h (t18, f18): Declare.
13990
6835af53
ILT
13991 * configure.ac: Don't test for objdump, c++filt, or readelf.
13992 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13993 conditionals.
13994 (TEST_READELF): New variable.
13995 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13996 (check_PROGRAMS): Add two_file_strip_test.
13997 (two_file_strip_test): New target.
13998 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13999 (two_file_same_shared_strip_test_SOURCES): New variable.
14000 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14001 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14002 (two_file_same_shared_strip_test_LDADD): New variable.
14003 (two_file_shared_strip.so): New target.
14004 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14005 (ver_test_5.syms, ver_test_7.syms): Likewise.
14006 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14007 (strip_test_3.stdout): Use TEST_OBJDUMP.
14008 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14009
86925eef
CC
140102008-04-04 Cary Coutant <ccoutant@google.com>
14011
14012 * symtab.h (Symbol::is_weak_undefined): New function.
14013 (Symbol::is_strong_undefined): New function.
14014 (Symbol::is_absolute): New function.
14015 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14016 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14017 absolute symbols.
14018 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14019 (weak_undef_test): New target.
14020 * testsuite/Makefile.in: Rebuild.
14021 * testsuite/weak_undef_file1.cc: New file.
14022 * testsuite/weak_undef_file2.cc: New file.
14023 * testsuite/weak_undef_test.cc: New file.
14024
126f3ece
ILT
140252008-04-03 Craig Silverstein <csilvers@google.com>
14026
14027 * compressed_output.h (class Output_compressed_section): Use
14028 unsigned buffer.
14029 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14030 add zlib header.
14031 (zlib_compressed_suffix): Removed.
14032 (Output_compressed_section::set_final_data_size): Use unsigned
14033 buffers.
14034 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14035 Fix linker invocation.
14036 (flagstest_o_specialfile_and_compress_debug_sections):
14037 Likewise.
14038 * testsuite/Makefile.in: Regenerated.
14039
deae2a14
DM
140402008-04-02 David S. Miller <davem@davemloft.net>
14041
14042 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14043 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14044
70752818
ILT
140452008-04-02 Craig Silverstein <csilvers@google.com>
14046
14047 * TODO: New file.
14048
39d0cb0e
ILT
140492008-04-02 Ian Lance Taylor <iant@google.com>
14050
14051 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14052 parameters. Update for new key type to views_. Change all
14053 callers.
14054 (File_read::read): Adjust for byteshift in returned view.
14055 (File_read::add_view): New function, broken out of
14056 find_and_make_view.
14057 (File_read::make_view): New function, broken out of
14058 find_and_make_view.
14059 (File_read::find_or_make_view): Add offset and aligned
14060 parameters. Rewrite accordingly. Change all callers.
14061 (File_read::get_view): Add offset and aligned parameters. Adjust
14062 for byteshift in return value.
14063 (File_read::get_lasting_view): Likewise.
14064 * fileread.h (class File_read): Update declarations.
14065 (class File_read::View): Add byteshift_ field. Add byteshift to
14066 constructor. Add byteshift method.
14067 * archive.h (Archive::clear_uncached_views): New function.
14068 (Archive::get_view): Add aligned parameter. Change all callers.
14069 * object.h (Object::get_view): Add aligned parameter. Change all
14070 callers.
14071 (Object::get_lasting_view): Likewise.
14072
14073 * fileread.cc (File_read::release): Don't call clear_views if
14074 there are multiple objects.
14075 * fileread.h (File_read::clear_uncached_views): New function.
14076 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14077 on the archive.
14078
a1207466
CC
140792008-03-31 Cary Coutant <ccoutant@google.com>
14080
14081 Add thin archive support.
14082 * archive.cc (Archive::armagt): New const.
14083 (Archive::setup): Remove task parameter and calls to unlock.
14084 (Archive::unlock_nested_archives): New function.
14085 (Archive::read_header): Add nested_off parameter. Change
14086 all callers.
14087 (Archive::interpret_header): Likewise.
14088 (Archive::include_all_members): Change to handle thin
14089 archives.
14090 (Archive::include_member): Likewise.
14091 * archive.h (Archive::Archive): Add new parameters and
14092 initializers.
14093 (Archive::armagt): New const.
14094 (Archive::setup): Remove task parameter.
14095 (Archive::unlock_nested_archives): New function.
14096 (Archive::read_header): Add nested_off parameter.
14097 (Archive::interpret_header): Likewise.
14098 (Archive::Nested_archive_table): New typedef.
14099 (Archive::is_thin_archive_): New field.
14100 (Archive::nested_archives_): New field.
14101 (Archive::options_): New field.
14102 (Archive::dirpath_): New field.
14103 (Archive::task_): New field.
14104 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14105 for thin archives. Pass additional parameters to
14106 Archive::Archive. Unlock the archive file after calling
14107 Archive::setup.
cd536b21 14108
479f6503
ILT
141092008-03-29 Ian Lance Taylor <iant@google.com>
14110
686c8caf
ILT
14111 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14112 version symbol to be local.
14113 * testsuite/ver_test_4.sh: New file.
14114 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14115 (check_DATA): Add ver_test_4.syms.
14116 (ver_test_4.syms): New target.
14117 * testsuite/Makefile.in: Rebuild.
14118
ab794b6b
ILT
14119 * output.cc
14120 (Output_section::Input_section_sort_entry::has_priority): New
14121 function.
14122 (Output_section::Input_section_sort_entry::match_file_name): New
14123 function.
14124 (Output_section::Input_section_sort_entry::match_section_name):
14125 Remove.
14126 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14127 Remove.
14128 (Output_section::Input_section_sort_entry::match_section_file):
14129 Remove.
14130 (Output_section::Input_section_sort_compare::operator()): Rewrite
14131 using new Input_section_sort_entry functions. Sort crtbegin and
14132 crtend first. Sort sections with no priority before sections with
14133 a priority.
14134 * testsuite/initpri1.c (d3): Check j != 4.
14135 (cd5): New constructor/destructor function.
14136 (main): Check j != 2.
14137
479f6503
ILT
14138 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14139 new symbol when resolving, don't call set_is_default.
14140 * testsuite/ver_test_7.cc: New file.
14141 * testsuite/ver_test_7.sh: New file.
14142 * testsuite/Makefile.am (ver_test_7.so): New target.
14143 (ver_test_7.o): New target.
14144 (check_SCRIPTS): Add ver_test_7.sh.
14145 (check_DATA): Add ver_test_7.syms.
14146 (ver_test_7.syms): New target.
14147
2fd32231
ILT
141482008-03-28 Ian Lance Taylor <iant@google.com>
14149
14150 * layout.cc (Layout::layout): If we see an input section with a
14151 name that needs sorting, set the must_sort flag for the output
14152 section.
14153 (Layout::make_output_section): If the name of the output section
14154 indicates that it might require sorting, set the may_sort flag.
14155 * output.h (Output_section::may_sort_attached_input_sections): New
14156 function.
14157 (Output_section::set_may_sort_attached_input_sections): New
14158 function.
14159 (Output_section::must_sort_attached_input_sections): New
14160 function.
14161 (Output_section::set_must_sort_attached_input_sections): New
14162 function.
14163 (class Output_section): Declare Input_section_sort_entry. Define
14164 Input_section_sort_compare. Declare
14165 sort_attached_input_sections. Add new fields:
14166 may_sort_attached_input_sections_,
14167 must_sort_attached_input_sections_,
14168 attached_input_sections_are_sorted_.
14169 * output.cc (Output_section::Output_section): Initialize new
14170 fields.
14171 (Output_section::add_input_section): Add an entry to
14172 input_sections_ if may_sort or must_sort are true.
14173 (Output_section::set_final_data_size): Call
14174 sort_attached_input_sections if necessary.
14175 (Output_section::Input_section_sort_entry): Define new class.
14176 (Output_section::Input_section_sort_compare::operator()): New
14177 function.
14178 (Output_section::sort_attached_input_sections): New function.
14179 * configure.ac: Check whether the compiler supports constructor
14180 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14181 * testsuite/initpri1.c: New file.
14182 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14183 CONSTRUCTOR_PRIORITY.
14184 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14185 (initpri1_LDFLAGS): New variable.
14186 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14187
18e6b24e
ILT
141882008-03-27 Ian Lance Taylor <iant@google.com>
14189
49bdd526
ILT
14190 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14191 * testsuite/common_test_1.c: New file.
14192 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14193 (common_test_1_SOURCES): New variable.
14194 (common_test_1_DEPENDENCIES): New variable.
14195 (common_test_1_LDFLAGS): New variable.
14196
18e6b24e
ILT
14197 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14198 and commons_ correctly when NAME/VERSION does not override
14199 NAME/NULL.
14200 * testsuite/ver_test_6.c: New file.
14201 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14202 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14203 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14204
04bf7072
ILT
142052008-03-26 Ian Lance Taylor <iant@google.com>
14206
5871526f
ILT
14207 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14208 of an undefined symbol from a version script.
14209 * testsuite/Makefile.am (ver_test_5.so): New target.
14210 (ver_test_5.o): New target.
14211 (check_SCRIPTS): Add ver_test_5.sh.
14212 (check_DATA): Add ver_test_5.syms.
14213 (ver_test_5.syms): New target.
14214 * testsuite/ver_test_5.cc: New file.
14215 * testsuite/ver_test_5.script: New file.
14216 * testsuite/ver_test_5.sh: New file.
14217 * Makefile.in, testsuite/Makefile.in: Rebuild.
14218
04bf7072
ILT
14219 PR gold/5986
14220 Fix problems building gold with gcc 4.3.0.
14221 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14222 (gold_error_at_location, gold_warning_at_location): Use it.
14223 * configure.ac: Check whether we can compile and use a template
14224 function with a printf attribute.
14225 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14226 when jumping over bytes.
14227 * object.cc: Instantiate Object::read_section_data.
14228 * debug.h: Include <cstring>
14229 * dwarf_reader.cc: Include <algorithm>
14230 * main.cc: Include <cstring>.
14231 * options.cc: Include <cstring>.
14232 * output.cc: Include <cstring>.
14233 * script.cc: Include <cstring>.
14234 * script.h: Include <string>.
14235 * symtab.cc: Include <cstring> and <algorithm>.
14236 * target-select.cc: Include <cstring>.
14237 * version.cc: Include <string>.
14238 * testsuite/testmain.cc: Include <cstdlib>.
14239 * configure, config.in: Rebuild.
14240
874c5b28
ILT
142412008-03-25 Ian Lance Taylor <iant@google.com>
14242
819d6c3a
ILT
14243 * options.cc: Include "../bfd/bfdver.h".
14244 (options::help): Print bug reporting address.
14245
f4b2c6f5
ILT
14246 * version.cc (print_version): Adjust output for current value of
14247 BFD_VERSION_STRING.
14248
14249 * NEWS: New file.
14250
e96caa79
ILT
14251 * options.cc (options::help): Print list of supported targets.
14252 * target-select.h: Include <vector>.
14253 (class Target_selector): Make machine_, size_, and is_big_endian_
14254 fields const. Add bfd_name_ and instantiated_target_ fields.
14255 (Target_selector::Target_selector): Add bfd_name parameter.
14256 (Target_selector::recognize): Make non-virtual, call
14257 do_recognize.
14258 (Target_selector::recognize_by_name): Make non-virtual, call
14259 do_recognize_by_name.
14260 (Target_selector::supported_names): New function.
14261 (Target_selector::bfd_name): New function.
14262 (Target_selector::do_instantiate_target): New pure virtual
14263 function.
14264 (Target_selector::do_recognize): New virtual function.
14265 (Target_selector::do_recognize_by_name): New virtual function.
14266 (Target_selector::instantiate_target): New private function.
14267 (supported_target_names): Declare.
14268 * target-select.cc (Target_selector::Target_selector): Update for
14269 new parameter and fields.
14270 (select_target_by_name): Check that the name matches before
14271 calling recognize_by_name.
14272 (supported_target_names): New function.
14273 * i386.cc (class Target_selector_i386): Update Target_selector
14274 constructor call. Remove recognize and recognize_by_name. Add
14275 do_instantiate_target.
14276 * x86_64.cc (class Target_selector_x86_64): Likewise.
14277 * testsuite/testfile.cc (class Target_selector_test): Update for
14278 changes to Target_selector.
14279
874c5b28
ILT
14280 * README: Rewrite, with some notes on unsupported features.
14281
0a65a3a7
CC
142822008-03-24 Cary Coutant <ccoutant@google.com>
14283
14284 * i386.cc (Target_i386::Got_type): New enum declaration.
14285 (Target_i386::Scan::local): Updated callers of Output_data_got
14286 member functions.
14287 (Target_i386::Scan::global): Likewise.
14288 (Target_i386::Relocate::relocate): Likewise.
14289 (Target_i386::Relocate::relocate_tls): Likewise.
14290 * object.h (Got_offset_list): New class.
14291 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14292 (Sized_relobj::local_got_offset): Likewise.
14293 (Sized_relobj::set_local_got_offset): Likewise.
14294 (Sized_relobj::local_has_tls_got_offset): Removed.
14295 (Sized_relobj::local_tls_got_offset): Removed.
14296 (Sized_relobj::set_local_tls_got_offset): Removed.
14297 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14298 * output.cc (Output_data_got::add_global): Added got_type parameter.
14299 (Output_data_got::add_global_with_rel): Likewise.
14300 (Output_data_got::add_global_with_rela): Likewise.
14301 (Output_data_got::add_global_pair_with_rel): New function.
14302 (Output_data_got::add_global_pair_with_rela): New function.
14303 (Output_data_got::add_local): Added got_type parameter.
14304 (Output_data_got::add_local_with_rel): Likewise.
14305 (Output_data_got::add_local_with_rela): Likewise.
14306 (Output_data_got::add_local_pair_with_rel): New function.
14307 (Output_data_got::add_local_pair_with_rela): New function.
14308 (Output_data_got::add_global_tls): Removed.
14309 (Output_data_got::add_global_tls_with_rel): Removed.
14310 (Output_data_got::add_global_tls_with_rela): Removed.
14311 (Output_data_got::add_local_tls): Removed.
14312 (Output_data_got::add_local_tls_with_rel): Removed.
14313 (Output_data_got::add_local_tls_with_rela): Removed.
14314 * output.h (Output_data_got::add_global): Added got_type parameter.
14315 (Output_data_got::add_global_with_rel): Likewise.
14316 (Output_data_got::add_global_with_rela): Likewise.
14317 (Output_data_got::add_global_pair_with_rel): New function.
14318 (Output_data_got::add_global_pair_with_rela): New function.
14319 (Output_data_got::add_local): Added got_type parameter.
14320 (Output_data_got::add_local_with_rel): Likewise.
14321 (Output_data_got::add_local_with_rela): Likewise.
14322 (Output_data_got::add_local_pair_with_rel): New function.
14323 (Output_data_got::add_local_pair_with_rela): New function.
14324 (Output_data_got::add_global_tls): Removed.
14325 (Output_data_got::add_global_tls_with_rel): Removed.
14326 (Output_data_got::add_global_tls_with_rela): Removed.
14327 (Output_data_got::add_local_tls): Removed.
14328 (Output_data_got::add_local_tls_with_rel): Removed.
14329 (Output_data_got::add_local_tls_with_rela): Removed.
14330 * resolve.cc (Symbol::override_base_with_special): Removed
14331 reference to has_got_offset_ field.
14332 * symtab.cc (Symbol::init_fields): Replaced initialization
14333 of got_offset_ with got_offsets_. Removed initialization
14334 of has_got_offset_
53fcba31 14335 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14336 (Symbol::got_offset): Likewise.
14337 (Symbol::set_got_offset): Likewise.
14338 (Symbol::has_tls_got_offset): Removed.
14339 (Symbol::tls_got_offset): Removed.
14340 (Symbol::set_tls_got_offset): Removed.
14341 (Symbol::got_offset_): Removed.
14342 (Symbol::tls_mod_got_offset_): Removed.
14343 (Symbol::tls_pair_got_offset_): Removed.
14344 (Symbol::got_offsets_): New field.
14345 (Symbol::has_got_offset): Removed.
14346 (Symbol::has_tls_mod_got_offset): Removed.
14347 (Symbol::has_tls_pair_got_offset): Removed.
14348 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14349 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14350 member functions.
14351 (Target_x86_64::Scan::global): Likewise.
14352 (Target_x86_64::Relocate::relocate): Likewise.
14353 (Target_x86_64::Relocate::relocate_tls): Likewise.
14354
bd52eafb
BE
143552008-03-25 Ben Elliston <bje@au.ibm.com>
14356
14357 * yyscript.y: Fix spelling error in comment.
14358
8b105e34
ILT
143592008-03-24 Ian Lance Taylor <iant@google.com>
14360
8ed814a9
ILT
14361 * options.h (class General_options): Define build_id option.
14362 * layout.h (class Layout): Declare write_build_id, create_note,
14363 create_build_id. Add build_id_note_ member.
14364 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14365 "libiberty.h", "md5.h", "sha1.h".
14366 (Layout::Layout): Initialize eh_frame_data_,
14367 eh_frame_hdr_section_, and build_id_note_.
14368 (Layout::finalize): Call create_build_id.
14369 (Layout::create_note): New function, broken out of
14370 Layout::create_gold_note.
14371 (Layout::create_gold_note): Call create_note.
14372 (Layout::create_build_id): New function.
14373 (Layout::write_build_id): New function.
14374 (Close_task_runner::run): Call write_build_id.
14375
8b105e34
ILT
14376 * x86_64.cc: Correct license to GPLv3.
14377
086a1841
ILT
143782008-03-23 Ian Lance Taylor <iant@google.com>
14379
14380 * options.cc: Include "demangle.h".
14381 (parse_optional_string): New function.
14382 (parse_long_option): Handle takes_optional_argument.
14383 (parse_short_option): Update dash_z initializer. Handle
14384 takes_optional_argument.
14385 (General_options::General_options): Initialize do_demangle_.
14386 (General_options::finalize): Set do_demangle_. Handle demangling
14387 style.
14388 * options.h (parse_optional_string): Declare.
14389 (struct One_option): Add optional_arg field. Update constructor.
14390 Update call constructor calls. Add takes_optional_argument
14391 function.
14392 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14393 (DEFINE_optional_string): Define.
14394 (General_options::demangle): Change from DEFINE_bool to
14395 DEFINE_optional_string.
14396 (General_options::no_demangle): New function.
14397 (General_options::do_demangle): New function.
14398 (General_options::set_do_demangle): New function.
14399 (General_options::execstack_status_): Move definition to end of
14400 class definition.
14401 (General_options::static_): Likewise.
14402 (General_options::do_demangle_): New field.
14403 * object.cc (big_endian>::get_symbol_location_info): Call
14404 Options::do_demangle, not Options::demangle.
14405 * symtab.cc (demangle): Likewise.
14406
cbb93e63
ILT
144072008-03-22 Ian Lance Taylor <iant@google.com>
14408
14409 * gold.h: Include <cstddef> and <sys/types.h>
14410 * options.h: Include <cstring>.
14411
ec531623
ILT
144122008-03-21 Ian Lance Taylor <iant@google.com>
14413
14414 * Added source code to GNU binutils.
752937aa
NC
14415\f
14416Copyright (C) 2008-2012 Free Software Foundation, Inc.
14417
14418Copying and distribution of this file, with or without modification,
14419are permitted in any medium without royalty provided the copyright
14420notice and this notice are preserved.
14421
14422Local Variables:
14423mode: change-log
14424left-margin: 8
14425fill-column: 74
14426version-control: never
14427End:
This page took 1.980591 seconds and 4 git commands to generate.