*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c6ac678d
ST
12013-01-24 Sriraman Tallam <tmsriram@google.com>
2
3 * layout.cc (Layout::layout): Check for option text_reorder.
4 (Layout::make_output_section): Ditto.
5 * options.h (text_reorder): New option.
6 * output.cc (Input_section_sort_compare): Remove special ordering
7 of section names.
8 (Output_section::
9 Input_section_sort_section_name_special_ordering_compare::
10 operator()): New function.
11 (Output_section::sort_attached_input_sections): Use new sort function
12 for .text.
13 * output.h (Input_section_sort_section_name_special_ordering_compare):
14 New struct.
15 * testsuite/Makefile.am (text_section_grouping): Test option
16 --no-text-reorder
17 * testsuite/Makefile.in: Regenerate.
18 * testsuite/text_section_grouping.sh: Check order of functions without
19 default text reordering.
20
50701cc1
MF
212013-01-18 Mike Frysinger <vapier@gentoo.org>
22
23 * options.h (General_options): Change default to true for new_dtags.
24
b1b00fcc
MF
252013-01-18 Mike Frysinger <vapier@gentoo.org>
26
27 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
28 when enable_new_dtags is false. Only add DT_RUNPATH when
29 enable_new_dtags is true.
30
ec5b8187
AM
312013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
32
33 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
34 used in declaration and definition consistent.
35 (Target_powerpc::symval_for_branch): Ditto.
36
a880d4c4
ST
372013-01-16 Sriraman Tallam <tmsriram@google.com>
38
39 * testsuite/plugin_final_layout.cc: Fix comment.
40
7c381248
ST
412013-01-16 Sriraman Tallam <tmsriram@google.com>
42
43 * layout.cc (Layout::layout): Do not do default sorting for
44 text sections when section ordering is specified.
45 (make_output_section): Ditto.
46 * testsuite/plugin_final_layout.cc: Name the function sections
47 to catch reordering issues.
48
e2458743
AM
492013-01-15 Alan Modra <amodra@gmail.com>
50
51 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
52 plt-thread-safe.
53
431ed302
AM
542013-01-15 Alan Modra <amodra@gmail.com>
55
56 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
57 * testsuite/Makefile.in: Regenerate.
58
0ec6429b
AM
592013-01-14 Alan Modra <amodra@gmail.com>
60
61 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
62 * testsuite/Makefile.in: Regenerate.
63
0bf402d5
ILT
642013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
65
66 Fix mingw gold build with plugins enabled
67 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
68 * configure.ac: Export DLOPEN_LIBS and add headers check.
69 * plugin.cc: Handle non-dlfcn case.
70 * Makefile.in: Regenerate.
71 * config.in: Regenerate.
72 * configure: Regenerate.
73 * testsuite/Makefile.in: Regenerate.
74
9e9143bc
ST
752013-01-09 Sriraman Tallam <tmsriram@google.com>
76
77 * output.h (sort_attached_input_sections): Change to be public.
78 * script-sections.cc
79 (Output_section_definition::set_section_addresses): Sort
80 attached input sections according to section order before linker
81 script assigns section addresses.
82 (Orphan_output_section::set_section_addresses): Sort
83 attached input sections according to section order before linker
84 script assigns section addresses.
85 * Makefile.am (final_layout.sh): Use a simple linker script to
86 check if section ordering still works.
87 * Makefile.in: Regenerate.
88
679af368
ILT
892013-01-09 Ben Cheng <bccheng@google.com>
90
91 * arm.cc (Target_arm::attributes_accept_div): New function.
92 (Target_arm::attributes_forbid_div): New function.
93 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
94 attribute using the same new functions as what bfd/elf32_arm.c
95 does.
96
3136a00e
CC
972013-01-07 Cary Coutant <ccoutant@google.com>
98
99 PR gold/14993
100 * output.cc (Output_section::add_input_section): For incremental
101 updates, don't track input sections that are allocated from patch
102 space.
103
f2a6224b
L
1042013-01-07 H.J. Lu <hongjiu.lu@intel.com>
105 Ian Lance Taylor <iant@google.com>
106
107 PR gold/14897
108 * configure.ac (--enable-ld): Removed.
109 (install_as_default): Set to yes only for --enable-gold=default
110 or --disable-ld.
111 * configure: Regenerated.
112
4f46f626
L
1132013-01-07 H.J. Lu <hongjiu.lu@intel.com>
114
115 * options.h (General_options): Add -fuse-ld= for GCC linker
116 option compatibility.
117
26e4ef59
CC
1182013-01-04 Cary Coutant <ccoutant@google.com>
119
120 * configure.ac: Fix typo restoring CXXFLAGS.
121 * configure: Regenerate.
122
3d587466
CC
1232013-01-04 Cary Coutant <ccoutant@google.com>
124
4f46f626
L
125 * testsuite/Makefile.am (CXXLINK_S): New macro.
126 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
127 * testsuite/Makefile.in: Regenerate.
3d587466 128
44db6695
L
1292013-01-02 H.J. Lu <hongjiu.lu@intel.com>
130
131 * version.cc (print_version): Update copyright year to 2013.
132
edcac0c1
ILT
1332012-12-20 Ian Lance Taylor <iant@google.com>
134
135 * layout.cc (Layout::special_ordering_of_input_section): New
136 function.
137 (Layout::layout): If input section requires special ordering, must
138 sort input sections.
139 (Layout::make_output_section): May sort .text input sections.
140 (Layout::is_section_name_prefix_grouped): Remove.
141 * layout.h (class Layout): Declare
142 special_ordering_of_input_section. Don't declare
143 is_section_name_prefix_grouped.
144 * output.cc (Output_section::add_input_section): Revert last
145 change.
146 (Output_section::Input_section_sort::match_file_name): Don't crash
147 if called on output section data.
148 (Output_section::Input_section_sort_compare): Sort based on
149 special ordering.
150 (Output_section::Input_section_sort_section_order_index_compare):
151 Revert last patch.
152 (Output_section::sort_attached_input_sections): Likewise.
153
28f2a4ac
ST
1542012-12-18 Sriraman Tallam <tmsriram@google.com>
155
edcac0c1 156 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
157 * layout.h (Layout::is_section_name_prefix_grouped): New function.
158 * output.cc (Output_section::add_input_section): Check if section
159 name contains special prefix. Keep input sections to sort such
160 sections.
161 (Output_section::Input_section_sort_section_order_index_compare
162 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
163 (Output_section::sort_attached_input_sections): Add condition to
164 Input_section_entry constructor call.
28f2a4ac
ST
165 * testsuite/Makefile.am (text_section_grouping): New test.
166 * testsuite/Makefile.in: Regenerate.
167 * testsuite/text_section_grouping.cc: New file.
168 * testsuite/text_section_grouping.sh: New file.
169
5bf135a7
NC
1702012-12-17 Nick Clifton <nickc@redhat.com>
171
172 * Makefile.am: Add copyright notice.
173 * NEWS: Likewise.
174 * README: Likewise.
175 * configure.ac: Likewise.
176 * ftruncate.c: Likewise.
177 * Makefile.in: Regenerate.
178
59965708
CC
1792012-12-14 Cary Coutant <ccoutant@google.com>
180
181 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
182 --no-as-needed flag.
183 (exception_separate_shared_12_test): Likewise.
184 (incremental_copy_test): Likewise.
185 * testsuite/Makefile.in: Regenerate.
186
2a77e2ab
CC
1872012-12-14 Cary Coutant <ccoutant@google.com>
188
189 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
190 (Dwp_output_file::Dwp_index::enter_set): Add assert.
191
e3deeb9c
AM
1922012-12-12 Alan Modra <amodra@gmail.com>
193
194 * powerpc.cc (class Track_tls): New.
195 (class Relocate, class Scan): Inherit Track_tls.
196 (Target_powerpc::Scan::local, global): Track tls optimization
197 and avoid creating plt entry for __tls_get_addr if all uses
198 are optimized away.
199 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
200
d8f5a274
AM
2012012-12-12 Alan Modra <amodra@gmail.com>
202
203 * options.h (General_options): Add --toc-sort/--no-toc-sort.
204 Replace no_toc_optimize with toc_optimize.
205 * output.h (Output_section::input_sections): Provide non-const variant.
206 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
207 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
208 accessors.
209 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
210 (class Sort_toc_sections): New.
211 (Target_powerpc::do_finalize_sections): Sort toc sections.
212 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
213
4c8a1de1
RM
2142012-12-10 Roland McGrath <mcgrathr@google.com>
215
216 * testsuite/binary_unittest.cc (read_all): New function.
217 (Sized_binary_test): Use it instead of ::read.
218 * fileread.cc (do_read): Don't assume pread always reads the whole
219 amount in a single call.
220
edc27beb
AM
2212012-12-10 Alan Modra <amodra@gmail.com>
222
223 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
224 Set EM_PPC64 or EM_PPC here.
225 (Target_selector_powerpc::do_recognize): Delete.
226
906b9150
AM
2272012-12-10 Alan Modra <amodra@gmail.com>
228
229 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
230 stub_table_.
231 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
232
418c15ae
RM
2332012-12-07 Roland McGrath <mcgrathr@google.com>
234
235 * testsuite/binary_unittest.cc (Sized_binary_test):
236 Use open_descriptor rather than ::open.
237
decdd3bc
AM
2382012-12-07 Alan Modra <amodra@gmail.com>
239
240 * powerpc.cc (Stub_table::do_write): Delete redundant Address
241 typedef and invalid_address constant.
242 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
243 instantiate constants.
244
db399005
ILT
2452012-12-06 Roland McGrath <mcgrathr@google.com>
246
247 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
248 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
249 * aclocal.m4: Regenerate.
250 * configure: Regenerate.
251 * Makefile.in: Regenerate.
252 * testsuite/Makefile.in: Regenerate.
253
aba6bc71
AM
2542012-12-07 Alan Modra <amodra@gmail.com>
255
256 * options.h (General_options): Add no_toc_optimize.
257 * powerpc.cc (ok_lo_toc_insn): New function.
258 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
259
9e69ed50
AM
2602012-12-06 Alan Modra <amodra@gmail.com>
261
262 * options.h (General_options): Add plt_align, plt_static_chain,
263 plt_thread_safe. Update stub_group_size help text.
264 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
265 for new plt_thread_safe_ var.
266 (use_plt_offset): Correct comments.
267 (Target_powerpc::do_relax): Look for thread creation symbols to
268 determine default plt_thread_safe value. Clear plt call stubs
269 as well as branch stubs each iteration.
270 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
271 insn constants.
272 (l, hi, ha, write_insn): Move earlier.
273 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
274 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
275 plt stubs too.
276 (Stub_table::update_size): Adjust.
277 (Stub_table::prev_size, set_prev_size): Delete.
278 (Stub_table::stub_align): Let --plt-align affect result.
279 (Stub_table::plt_call_size): Calculate sizes for various stubs.
280 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
281 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
282 (Stub_table::do_write): Support more stub variants.
283
f43ba157
AM
2842012-12-04 Alan Modra <amodra@gmail.com>
285
286 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
287 (Target_powerpc::do_define_standard_symbols): New function.
288
34171bc5
AM
2892012-12-03 Alan Modra <amodra@gmail.com>
290
291 * output.h: Formatting, whitespace.
292
dc9589e9 2932012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
294
295 * layout.h (Layout::get_executable_sections): Declare.
296 * layout.cc (Layout::get_executable_sections): New function.
297 * arm.cc (Target_arm::group_sections): Use it.
298 (Arm_output_section::group_sections): Delete now redundant test.
299 * output.cc (Output_reloc::Output_reloc): Add is_relative.
300 param to handle relative relocs.
301 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
302 (Output_data_reloc::add_absolute): Adjust.
303 (Output_data_reloc::add_relative): New function.
304 (Output_data::reset_data_size): New function.
305 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
306 (Output_section::set_addralign): New function.
307 (Output_section::checkpoint_set_addralign): New function.
308 (Output_section::clear_section_offsets_need_adjustment): New function.
309 (Output_section::input_sections): Make public.
310 * powerpc.cc (class Output_data_brlt_powerpc): New.
311 (class Stub_table, class Stub_control): New.
312 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
313 stub_table_, set_stub_table, stub_table): New vectors and accessor
314 functions.
315 (Target_powerpc::do_may_relax, do_relax, push_branch,
316 new_stub_table, stub_tables, brlt_section, group_sections,
317 add_branch_lookup_table, find_branch_lookup_table,
318 write_branch_lookup_table, make_brlt_section): New functions.
319 (Target_powerpc::struct Sort_sections, class Branch_info): New.
320 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
321 branch_info_): New vars.
322 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
323 make call stubs here.
324 (Output_data_glink): Remove all call stub handling from this class.
325 (Target_powerpc::Scan::local, global): Save interesting branch
326 relocs and relocs for ifunc. Adjust calls to plt entry functions.
327 (Target_powerpc::do_finalize_sections): Only make reg save/restore
328 functions on final link.
329 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
330 Handle long branch destinations too.
331 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
332 do_plt_address_for_local): Adjust lookup of plt call stubs.
333
627b30b7
AM
3342012-11-30 Alan Modra <amodra@gmail.com>
335
336 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
337 relocs against protected symbols when building 32-bit shared libs.
338
40b469d7
AM
3392012-11-30 Alan Modra <amodra@gmail.com>
340
341 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
342 param. Call got_section() to make .got. Update all callers
343 and their callers and so on.
344
bb66a627
AM
3452012-11-30 Alan Modra <amodra@gmail.com>
346
347 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
348 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
349 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
350 value if it already exists.
351
d2cf1c6c
L
3522012-11-19 H.J. Lu <hongjiu.lu@intel.com>
353
354 PR gold/14858
355 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
356
edccdf7c
RM
3572012-11-14 Roland McGrath <mcgrathr@google.com>
358
359 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
360 than bfc instruction for data sandboxing.
361
6febeb74
AM
3622012-11-08 Alan Modra <amodra@gmail.com>
363
364 * po/POTFILES.in: Regenerate.
365
0a6f1bf2
AM
3662012-11-05 Alan Modra <amodra@gmail.com>
367
368 * configure.ac: Apply 2012-09-10 change to config.in here.
369 * configure: Regenerate.
370
26a4e9cb
AM
3712012-11-05 Alan Modra <amodra@gmail.com>
372
373 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
374 (struct Opd_ent): Use "Address" rather than "Offset".
375 (Output_data_got_powerpc::got_base_offset): Return Valtype.
376 (Target_powerpc::got_section): Make public.
377 (Target_powerpc::scan_relocs): Move code setting symbols..
378 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
379 Create _SDA_BASE_ only when referenced.
380
cc928013
RM
3812012-11-02 Roland McGrath <mcgrathr@google.com>
382
383 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
384 from last change.
385
50ed5eb1
RM
3862012-11-01 Roland McGrath <mcgrathr@google.com>
387
62fe925a
RM
388 * target.h (Sized_target::relocate_relocs): Use Elf_Off
389 for offset_in_output_section parameter.
390 (Sized_target::relocate_special_relocatable): Likewise.
391 * arm.cc (Target_arm::relocate_relocs): Likewise.
392 (Target_arm::relocate_special_relocatable): Likewise.
393 * i386.cc (Target_i386::relocate_relocs): Likewise.
394 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
395 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
396 * target-reloc.h (relocate_relocs): Likewise.
397 * testsuite/testfile.cc (Target_test): Likewise.
398 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
399 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
400
401 * system.h: Move inclusion of <clocale> to after <libintl.h> in
402 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
403
404 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
405 parameter, which is unused in the [!F_SETFD] case.
406
50ed5eb1
RM
407 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
408 SYMNDX to off_t before comparing it to this->data_size().
409 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
410 * incremental.cc (Output_section_incremental_inputs::do_write):
411 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
412
2cadc0bf
RM
413 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
414
3bfcb652
NC
4152012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
416
417 * gold.cc (Target_arm::do_adjust_elf_header): Add the
418 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
419 in EABI_VER5.
420
c1a8d56e
CC
4212012-10-29 Cary Coutant <ccoutant@google.com>
422
423 * dwp.cc (usage): Add file and exit status parameters;
424 add --help and --version options.
425 (print_version): New function.
426 (main): Add --help and --version options.
427
b2490a7b
L
4282012-10-25 H.J. Lu <hongjiu.lu@intel.com>
429
430 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
431 final_layout_sequence.txt.
432 * testsuite/Makefile.in: Regenerated.
433
aa543512
L
4342012-10-25 H.J. Lu <hongjiu.lu@intel.com>
435
436 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
437 COMPILE generated by automake.
438 (LINK1): Likewise.
439 (CXXCOMPILE1): Likewise.
440 (CXXLINK1): Likewise.
441 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
442 (LINK): Likewise.
443 (CXXCOMPILE): Likewise.
444 (CXXLINK): Likewise.
445 * testsuite/Makefile.in: Regenerated.
446
d361fafb
L
4472012-10-25 H.J. Lu <hongjiu.lu@intel.com>
448
449 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
450 on bad fwrite return.
451
598c7410
L
4522012-10-25 H.J. Lu <hongjiu.lu@intel.com>
453
454 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
455 on val.
456
35c813e2
CC
4572012-10-23 Cary Coutant <ccoutant@google.com>
458
459 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
460 * testsuite/Makefile.in: Regenerate.
461 * testsuite/dwp_test.h: New source file.
462 * testsuite/dwp_test_1.cc: New source file.
463 * testsuite/dwp_test_1.s: New source file.
464 * testsuite/dwp_test_1.sh: New source file.
465 * testsuite/dwp_test_1b.cc: New source file.
466 * testsuite/dwp_test_1b.s: New source file.
467 * testsuite/dwp_test_2.cc: New source file.
468 * testsuite/dwp_test_2.s: New source file.
469 * testsuite/dwp_test_2.sh: New source file.
470 * testsuite/dwp_test_main.cc: New source file.
471 * testsuite/dwp_test_main.s: New source file.
472
77429909
CC
4732012-10-23 Cary Coutant <ccoutant@google.com>
474
475 * dwp.h: New header file.
476 * dwp.cc: New source file.
477 * gold.h: Move shared declarations to system.h.
478 * system.h: New header file.
479 * Makefile.am: Add dwp.
480 * Makefile.in: Regenerate.
481
ed5d6712
CC
4822012-10-23 Cary Coutant <ccoutant@google.com>
483
484 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
485 Dwarf_info_reader::read_from_pointer.
486 (Dwarf_pubnames_table::read_header): Likewise.
487 (Dwarf_pubnames_table::next_name): Likewise.
488 (Dwarf_die::read_attributes): Likewise.
489 (Dwarf_die::skip_attributes): Likewise.
490 (Dwarf_info_reader::read_from_pointer): New function template.
491 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
492 (Dwarf_pubnames_table): Likewise.
493 (Dwarf_info_reader::read_from_pointer): New function template.
494 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
495 Dwarf_pubnames_table ctor.
496
8787852d
CC
4972012-10-23 Cary Coutant <ccoutant@google.com>
498
499 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
500 abbrev_shndx.
501 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
502 abbrev_shndx_.
503 (Dwarf_info_reader::set_abbrev_shndx): New method.
504 (Dwarf_info_reader::abbrev_shndx_): New data member.
505
9fc236f3
CC
5062012-10-23 Cary Coutant <ccoutant@google.com>
507
508 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
509 from object, not parameters.
510 (Dwarf_info_reader::parse): Likewise.
511 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
512 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
513 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
514 methods.
515
effe8365
CC
5162012-10-23 Cary Coutant <ccoutant@google.com>
517
518 * fileread.cc (Input_file::Input_file): New constructor.
519 * fileread.h (class Input_file): Add new constructor.
520
1698990d
AM
5212012-10-18 Alan Modra <amodra@gmail.com>
522
523 PR gold/14727
524 * object.cc (Relobj::is_section_name_included): Also match
525 .sdata personality section.
526
168a4726
AM
5272012-10-18 Alan Modra <amodra@gmail.com>
528
529 * target-reloc.h (class Default_comdat_behavior): New, package up..
530 (get_comdat_behaviour): ..this.
531 (relocate_section): Add Relocate_comdat_behavior template arg,
532 adjust code to suit.
533 * arm.cc (Target_arm::relocate_section): Adjust to suit.
534 (Target_arm::scan_reloc_section): Likewise.
535 * i386.cc (Target_i386::relocate_section): Likewise.
536 * sparc.cc (Target_sparc::relocate_section): Likewise.
537 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
538 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
539 * powerpc.cc (class Relocate_comdat_behavior): New.
540 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
541 gold::relocate_section with new template arg.
542
acc276d8
AM
5432012-10-18 Alan Modra <amodra@gmail.com>
544
545 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
546 dynamic relocs for GOT_TPREL got entries, without symbol if
547 resolving locally.
548 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
549 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
550 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
551
e10f9870
AM
5522012-10-17 Alan Modra <amodra@gmail.com>
553
554 PR gold/14726
555 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
556
ae034989
ST
5572012-10-16 Sriraman Tallam <tmsriram@google.com>
558
559 * layout.cc (Layout::include_section): Keep sections marked
560 SHF_EXCLUDE when doing relocatable links.
561
f3a0ed29
AM
5622012-10-16 Alan Modra <amodra@gmail.com>
563
564 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
565 (Target_powerpc::do_finalize_sections): Call it.
566 (Output_data_save_res): New class and supporting functions.
567 (Target_powerpc::symval_for_branch): Only look up .opd entry for
568 normal symbols defined in object files.
569
c6de8ed4
AM
5702012-10-12 Alan Modra <amodra@gmail.com>
571
572 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
573 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
574 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
575 section if scan_opd_relocs not yet called.
576 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
577
03e25981
AM
5782012-10-12 Alan Modra <amodra@gmail.com>
579
580 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
581 add_local_ifunc_entry): Revert last change.
582 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
583
c9824451
AM
5842012-10-05 Alan Modra <amodra@gmail.com>
585
586 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
587 do_plt_address_for_global): New functions.
588 (Output_data_got_powerpc::do_write): Don't segfault when linking
589 statically.
590 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
591 add_local_ifunc_entry): Return true on adding entry..
592 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
593 glink->add_entry call. Remove unused symtab param. Adjust calls.
594 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
595 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
596 set up symbols here.
597 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
598 syms here. Do so even when no .iplt. Don't segfault when linking
599 statically.
600 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
601 new variants without reloc param.
602 (Glink_sym_ent::Glink_sym_ent): Likewise.
603 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
604 reloc when refs will resolve to plt call stub.
605 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
606 R_PPC_PLTREL24 to resolve locally.
607 (Target_powerpc::Scan::global): Correct ifunc handling.
608 (Target_powerpc::Relocate::relocate): Correct local sym glink
609 lookup. Don't destroy "value" when we have a plt call stub,
610 and when checking plt call validity.
611 (Target_powerpc::do_dynsym_value): Simplify.
612
19fec8c1
AM
6132012-10-05 Alan Modra <amodra@gmail.com>
614
615 * i386.cc (Output_data_plt_i386::address_for_global,
616 address_for_local): Add plt offset to returned value. Adjust uses.
617 * sparc.cc (Output_data_plt_sparc::address_for_global,
618 address_for_local): Likewise.
619 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
620 address_for_local): Likewise.
621 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
622 address_for_local): Likewise.
623 * target.h (Target::plt_address_for_global, plt_address_for_local):
624 Update comment.
625 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
626 (Output_data_got::Got_entry::write): Nor here.
627 * output.h: Comment fix.
628
e867b647
WL
6292012-10-02 Jiong Wang <jiwang@tilera.com>
630
631 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
632 global_offset_table_ value for larget got.
633 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
634
e5d5f5ed
AM
6352012-09-29 Alan Modra <amodra@gmail.com>
636
637 * powerpc.cc (Target_powerpc::iplt_): New output section.
638 (Target_powerpc::iplt_section, make_iplt_section,
639 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
640 (Target_powerpc::make_plt_entry): Handle ifunc syms.
641 Target_powerpc::plt_entry_count): Count iplt entries too.
642 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
643 reloc section in constructor. New params.
644 (Target_powerpc::make_plt_section): Create reloc section here instead.
645 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
646 functions.
647 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
648 (Output_data_glink::add_entry, find_entry): New functions to
649 deal with local syms.
650 (Glink_sym_ent): Add support for local syms.
651 (Output_data_glink::do_write): Handle ifunc plt entries.
652 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
653 (Target_powerpc::Scan::local, global): Handle ifunc syms.
654 (Target_powerpc::Relocate::relocate): Likewise.
655 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
656
ec4dbad3
AM
6572012-09-25 Alan Modra <amodra@gmail.com>
658
659 * object.h (Sized_relobj_file::adjust_local_symbol,
660 do_adjust_local_symbol): New functions.
661 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
662 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
663 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
664 and irregular opd entry spacing.
665 (Powerpc_relobj::do_read_relocs): Add opd size checks.
666 (Global_symbol_visitor_opd): New functor.
667 (Target_powerpc::do_finalize_sections): Omit global symbols defined
668 on deleted opd entries.
669
5c0b3823
WL
6702012-09-15 Jiong Wang <jiwang@tilera.com>
671
672 * tilegx.cc: New file.
673 * Makefile.am (TARGETSOURCES): Add tilegx.cc
674 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
675 * configure.tgt: Add entries for tilegx*.
676 * configure.ac: Likewise.
677 * Makefile.in: Rebuild.
678 * configure: Likewise.
679 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
680 tilegx.
681
bfdfa4cd
AM
6822012-09-13 Alan Modra <amodra@gmail.com>
683
684 * target-reloc.h (scan_relocs): Call scan.local for relocs
685 against symbols in discarded sections. Pass is_discarded
686 param.
687 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
688 Add is_discarded param.
689 * powerpc (Target_powerpc::Scan::local): Likewise. Use
690 is_discarded to flag opd entry as discarded. Don't emit dyn
691 relocs on such entries.
692 (Target_powerpc::Scan::global): Similarly detect and handle
693 such opd entries.
694 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
695 opd_ent_. Update all uses.
696 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
697 (Target_powerpc::relocate_section): Zero out discarded opd
698 entry relocs.
699
d77a0555
ILT
7002012-09-12 Ian Lance Taylor <iant@google.com>
701
702 PR gold/14570
703 * output.cc: Rename Output_data_got template parameter from size
704 to got_size for all functions. Compile all variants of
705 Output_data_got.
706 (Output_data_got::Got_entry::write): Correct use of size for
707 symbol value. Use local_is_tls rather than casting to
708 Sized_relobj_file.
709 * object.h (class Object): Add local_is_tls and do_local_is_tls.
710 (class Sized_relobj_file): Add do_local_is_tls.
711 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
712
815a1205
AM
7132012-09-11 Alan Modra <amodra@gmail.com>
714
715 PR gold/14566
716 * layout.cc (Layout::set_segment_offsets): When using
717 common-page-size alignment, ensure we are on a new max-page-size
718 page.
719 * output.cc (Output_segment::set_section_addresses): Use
720 abi_pagesize, not common_pagesize for relro boundary.
721 (Output_segment::set_offset): Likewise.
722
bd73a62d
AM
7232012-09-11 Alan Modra <amodra@gmail.com>
724
725 * output.h (Output_data_got::add_global_tls, add_local_tls,
726 add_local_tls_pair): New functions.
727 (Output_data_got::add_local_pair_with_rel): Remove second
728 reloc param. Expand comment.
729 (Output_data_got::Got_entry): Rename use_plt_offset_ to
730 use_plt_or_tls_offset_, similarly for constructor param.
731 (Output_data_got::Got_entry::write): Add got_index param.
732 * output.cc (Output_data_got::add_global_tls, add_local_tls,
733 add_local_tls_pair): New functions.
734 (Output_data_got::Got_entry::write): Handle tls symbols
735 with use_plt_or_tls_offset_ set specially.
736 (Output_data_got::add_local_pair_with_rel): Only one reloc.
737 (Output_data_got::do_write): Replace iterator with index, pass
738 index to entry write function.
739 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
740 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
741 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
742 call.
743 * i386.cc (Target_i386::Scan::local): Likewise.
744 * sparc.cc (Target_sparc::Scan::local): Likewise.
745 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
746 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
747 do_tls_offset_for_global): New functions.
748 (Target_powerpc::Scan::local): Correct TLS relocations and got
749 entry values.
750 (Target_powerpc::Scan::global): Don't emit unnecessary
751 dynamic relocations on TLS GOT entries.
752
00716ab1
AM
7532012-09-10 Matthias Klose <doko@ubuntu.com>
754
755 * config.in: Disable sanity check for kfreebsd.
756
c891b3f9
SA
7572012-09-10 Sterling Augustine <saugustine@google.com>
758
759 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
760 (Gdb_index::pubtypes_read): New parameter.
761 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
762 to calls.
763 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
764 pubtypes_object_.
765
e81fea4d
AM
7662012-09-09 Alan Modra <amodra@gmail.com>
767
768 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
769 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
770 * gc.h (gc_process_relocs): Call target gc_add_reference.
771 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
772 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
773 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
774 unnecessary cast.
775 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
776 to cater for when we don't need code offset. Update use.
777 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
778 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
779 set_opd_valid): New functions.
780 (Target_powerpc::do_gc_add_reference): New function.
781 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
782 stashed refs.
783 (Target_powerpc::do_gc_mark_symbol): New function.
784
d2d60eef
CC
7852012-09-06 Cary Coutant <ccoutant@google.com>
786
787 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
788 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
789 (Dwarf_die::skip_attributes): Likewise.
790 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
791 * testsuite/gdb_index_test.cc (inline_func_1): New function.
792 (main): Call it.
793 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
794
32ed4573
L
7952012-09-05 H.J. Lu <hongjiu.lu@intel.com>
796
797 * testsuite/script_test_3.t: Add .got.plt output section
798 statement.
799 * testsuite/script_test_4.t: Likewise.
800
f4baf0d4
AM
8012012-09-05 Alan Modra <amodra@gmail.com>
802
803 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
804 update all uses and lose "enum" when using type.
805
864a1b56
AM
8062012-09-05 Alan Modra <amodra@gmail.com>
807
808 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
809 * configure: Regenerate.
810 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
811 (plugin_final_layout.stdout): Likewise.
812 (memory_test): Set page sizes to 0x1000.
813 * testsuite/Makefile.in: Regenerate.
814 * testsuite/discard_locals_test.sh: Add FIXME comment.
815 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
816 * testsuite/pr14265.t: Add .got output section statement.
817 * testsuite/script_test_2.t: Likewise.
818 * testsuite/script_test_3.t: Likewise.
819 * testsuite/script_test_4.t: Likewise.
820 * testsuite/script_test_5.t: Likewise.
821 * testsuite/script_test_6.t: Likewise.
822 * testsuite/script_test_7.t: Likewise.
823 * testsuite/script_test_9.t: Likewise.
824
3ea0a085
AM
8252012-09-05 Alan Modra <amodra@gmail.com>
826
827 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
828 (Powerpc_relocate_functions::Status): New typedef.
829 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
830 (Target_powerpc::Scan::local): Handle REL64.
831 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
832 for REL32 and REL64.
833 (Target_powerpc::symval_for_branch): New function, extracted from..
834 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
835 checks. Report overflow errors.
836
7404fe1b
AM
8372012-09-05 Alan Modra <amodra@gmail.com>
838
839 * object.h (Sized_relobj_file::emit_relocs): Delete.
840 (Sized_relobj_file::emit_relocs_reltype): Delete.
841 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
842 relocate_relocs for --emit-relocs.
843 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
844 * output.h: Update comment.
845 (Output_segment::first_section): New function.
846 (Output_segment::first_section_load_address): Use first_section.
847 * output.cc (Output_segment::first_section): New function extracted..
848 (Output_segment::first_section_load_address): ..from here. Delete.
849 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
850 * target.h (Sized_target::relocate_for_relocatable): Likewise.
851 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
852 adjust call to target.h function.
853 * i386.cc (Target_i386): Likewise.
854 * sparc.cc (Target_sparc): Likewise.
855 * x86_64.cc (Target_x86_64): Likewise.
856 * powerpc.cc (Target_powerpc): Likewise.
857 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
858 first tls section has section symbol for optimised local dynamic
859 output relocs.
860 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
861 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
862 optimised tls code.
863 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
864 Rename to relocate_relocs. Update error message.
865
957564c9
AS
8662012-09-04 Andreas Schwab <schwab@linux-m68k.org>
867
868 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
869 --just-symbols.
870
dd93cd0a
AM
8712012-08-31 Alan Modra <amodra@gmail.com>
872
873 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
874 (Powerpc_relobj::toc_base_offset): New stub function.
875 (Target_powerpc): Add tp_offset, dtp_offset. Rename
876 got_mod_index_offset to tlsld_got_offset. Update all refs.
877 (Target_powerpc::Relocate::enum skip_tls): New.
878 (Target_powerpc::call_tls_get_addr_): New var.
879 (Target_powerpc::is_branch_reloc): Move to file scope.
880 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
881 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
882 New functions.
883 (Target_powerpc::enum Got_type): Delete old values, add new ones.
884 (powerpc_info): Correct common_pagesize for ppc64.
885 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
886 (Powerpc_relocate_functions): Add overflow check enums and functions.
887 Add non-shift version of rela, rela_ua. Delete all rel public
888 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
889 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
890 addr16_ha3, addr14 functions.
891 (Output_data_got_powerpc::add_constant_pair): New function.
892 (Output_data_got_powerpc::got_base_offset): Likewise.
893 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
894 (instruction constants): Sort, add some more.
895 (Output_data_glink::do_write): Add and use Address typedef. Use
896 object->toc_base_offset() stub for 64-bit.
897 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
898 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
899 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
900 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
901 Always treat .opd relocs as against locally defined symbol.
902 Correct condition for RELATIVE relocs.
903 (Target_powerpc::do_finalize_sections): Test for NULL sections.
904 (Target_powerpc::Relocate::relocate): Use plt call stub as value
905 for 32-bit syms with a plt entry. Correct ppc64 toc base
906 calculations. Handle TLS relocs, and more. Add overflow
907 checking and adjust for Powerpc_relocate_functions changes.
908 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
909 Reinstate --emit-relocs code with FIXME.
910
a1373b60
AM
9112012-08-30 Alan Modra <amodra@gmail.com>
912
913 * layout.cc (Layout::set_segment_offsets): Set p_align to
914 abi_pagesize, not common_pagesize.
915 (Layout::relaxation_loop_body): Similarly use abi_pagesize
916 to determine whether file header can go in segment.
917
703d02da
AM
9182012-08-30 Alan Modra <amodra@gmail.com>
919
920 * output.h (Output_reloc::Output_reloc <output section>): Add
921 is_relative param. Adjust calls.
922 (Output_reloc::add_output_section_relative): New functions.
923 * output.cc (Output_reloc::Output_reloc <output section>): Handle
924 is_relative.
925 (Output_reloc::symbol_value): Handle SECTION_CODE.
926
16164a6b
ST
9272012-08-24 Sriraman Tallam <tmsriram@google.com>
928
929 * gold.cc (queue_middle_tasks): Call layout again when unique
930 segments for sections is desired.
931 * layout.cc (Layout::Layout): Initialize new members.
932 (Layout::get_output_section_flags): New function.
933 (Layout::choose_output_section): Call get_output_section_flags.
934 (Layout::layout): Make output section for mapping to a unique segment.
935 (Layout::insert_section_segment_map): New function.
936 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 937 output sections marked so.
16164a6b
ST
938 (Layout::segment_precedes): Check for unique segments when sorting.
939 * layout.h (Layout::Unique_segment_info): New struct.
940 (Layout::Section_segment_map): New typedef.
941 (Layout::insert_section_segment_map): New function.
942 (Layout::get_output_section_flags): New function.
943 (Layout::is_unique_segment_for_sections_specified): New function.
944 (Layout::set_unique_segment_for_sections_specified): New function.
945 (Layout::unique_segment_for_sections_specified_): New member.
946 (Layout::section_segment_map_): New member.
947 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
948 Rename is_gc_pass_one to is_pass_one.
949 Rename is_gc_pass_two to is_pass_two.
950 Rename is_gc_or_icf to is_two_pass.
951 Check for which pass based on whether symbols data is present.
952 Make it two pass when unique segments for sections is desired.
953 * output.cc (Output_section::Output_section): Initialize new
954 members.
955 * output.h (Output_section::is_unique_segment): New function.
956 (Output_section::set_is_unique_segment): New function.
957 (Output_section::is_unique_segment_): New member.
958 (Output_section::extra_segment_flags): New function.
959 (Output_section::set_extra_segment_flags): New function.
960 (Output_section::extra_segment_flags_): New member.
961 (Output_section::segment_alignment): New function.
962 (Output_section::set_segment_alignment): New function.
963 (Output_section::segment_alignment_): New member.
964 (Output_segment::Output_segment): Initialize is_unique_segment_.
965 (Output_segment::is_unique_segment): New function.
966 (Output_segment::set_is_unique_segment): New function.
967 (Output_segment::is_unique_segment_): New member.
968 * plugin.cc (allow_unique_segment_for_sections): New function.
969 (unique_segment_for_sections): New function.
970 (Plugin::load): Add new functions to transfer vector.
971 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
972 * Makefile.in: Regenerate.
973 * testsuite/plugin_final_layout.sh: Check if unique segment
974 functionality works.
975 * testsuite/plugin_section_order.c (onload): Check if new interfaces
976 are available.
977 (allow_unique_segment_for_sections): New global.
978 (unique_segment_for_sections): New global.
979 (claim_file_hook): Call allow_unique_segment_for_sections.
980 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 981
1e2bee4f
CC
9822012-08-22 Cary Coutant <ccoutant@google.com>
983
984 * layout.cc (Layout::include_section): Don't assert on GROUP
985 sections with --emit-relocs.
986
1d5dfe78
CC
9872012-08-21 Cary Coutant <ccoutant@google.com>
988
989 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
990 if --export-dynamic-symbol names an undef symbol.
991
c9269dff
AM
9922012-08-18 Alan Modra <amodra@gmail.com>
993
994 * powerpc.cc: Formatting and white space.
995 (Powerpc_relobj): Rename got2_section_ to special_.
996 Add opd_ent_shndx_ and opd_ent_off_ vectors.
997 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
998 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
999 (Target_powerpc): Add Address typedef and invalid_address. Use
1000 throughout.
1001 (Target_powerpc::is_branch_reloc): New function.
1002 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1003 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1004 for dst_mask, value and addend.
1005 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1006 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1007 (Output_data_glink::do_write): Correct toc base. Don't try to use
1008 uint16_t for 24-bit offset. Use get_output_section_offset and
1009 check return.
1010 (Target_powerpc::Scan::local): Handle more relocs.
1011 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1012 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1013 Plug in toc restoring insn after plt calls. Translate branches
1014 to function descriptor symbols to corresponding entry point.
1015 (Target_powerpc::relocate_for_relocatable): Check return from
1016 get_output_section_offset.
1017 * symtab.h: Comment typo.
1018
b1759dce
ILT
10192012-08-14 Ian Lance Taylor <iant@google.com>
1020
1021 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1022 unsupported_relocal_local to call unsupported_reloc_global.
1023
b9b2ae8b
NC
10242012-08-14 Nick Clifton <nickc@redhat.com>
1025
1026 PR ld/14265
1027 * script-sections.cc (Sections_element::output_section_name): Add
1028 keep return parameter.
1029 (Output_section_element::match_name): Add keep return parameter.
1030 Return the value of the keep_ member.
1031 * script-sections.h (class Output_section): Update
1032 output_section_name prototype.
1033 * layout.cc (Layout::keep_input_section): New public member
1034 function.
1035 (Layout::choose_output_section): Pass keep parameter to
1036 output_section_name.
1037 * layout.h (class Layout): Add keep_input_section.
1038 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1039 sections.
1040 * testsuite/Makefile.am: Add a test.
1041 * testsuite/Makefile.in: Regenerate.
1042 * testsuite/pr14265.c: Source file for the test.
1043 * testsuite/pr14265.t: Linker script for the test.
1044 * testsuite/pr14265.sh: Shell script for the test.
1045
921b5322
AM
10462012-08-14 Alan Modra <amodra@gmail.com>
1047
1048 * target.h (Target::output_section_name): New function.
1049 (Target::do_output_section_name): New function.
1050 * layout.cc (Layout::choose_output_section): Call the above.
1051 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1052
6ce78956
AM
10532012-08-14 Alan Modra <amodra@gmail.com>
1054
1055 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1056 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1057 for replace_constant call.
1058 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1059 (Output_data_glink::do_print_to_mapfile): New function.
1060 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1061 (Target_powerpc::Relocate::relocate): Likewise.
1062
d1a8cabd
AM
10632012-08-14 Alan Modra <amodra@gmail.com>
1064
1065 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1066 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1067 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1068 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1069 all references to shndx_. Handle special case for R_PPC_PLTREL24
1070 here.
1071 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1072 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1073 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1074 here.
1075 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1076 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1077
d83ce4e3
AM
10782012-08-12 Alan Modra <amodra@gmail.com>
1079
1080 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1081 (glink insn constants): Use uint32_t.
1082 (Output_data_glink::add_entry): Use insert, not [] operator.
1083
cf43a2fe
AM
10842012-08-11 Alan Modra <amodra@gmail.com>
1085
1086 * object.h (Sized_relobj_file::find_shdr): New function.
1087 (Sized_relobj_file::find_special_sections): New function.
1088 * object.cc (Sized_relobj_file::find_shdr): New function.
1089 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1090 (Sized_relobj_file::find_special_sections): New function, split out..
1091 (Sized_relobj_file::do_read_symbols): ..from here.
1092 * output.h (Output_data_got::replace_constant): New function.
1093 (Output_data_got::num_entries): New function.
1094 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1095 (Output_data_got::got_offset): Protected rather than private.
1096 (Output_data_got::replace_got_entry): New function.
1097 * output.cc (Output_data_got::replace_got_entry): New function.
1098 * powerpc.cc (class Powerpc_relobj): New.
1099 (class Powerpc_relocate_functions): Delete all psymval variants or
1100 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1101 Implement _ha functions using corresponding _hi function.
1102 (Powerpc_relobj::find_special_sections): New function.
1103 (Target_powerpc::do_make_elf_object): New function.
1104 (class Output_data_got_powerpc): New.
1105 (class Output_data_glink): New.
1106 (class Powerpc_scan_relocatable_reloc): New.
1107 Many more changes througout file.
1108
3c892704
NC
11092012-08-09 Nick Clifton <nickc@redhat.com>
1110
1111 * po/vi.po: Updated Vietnamese translation.
1112
82435b3b
ILT
11132012-08-07 Ian Lance Taylor <iant@google.com>
1114
1115 * layout.cc (Layout::add_target_dynamic_tags): If
1116 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1117 plt_rel.
1118
a6dc81d2
NC
11192012-07-30 Nick Clifton <nickc@redhat.com>
1120
1121 * po/gold.pot: Updated template.
1122 * po/es.po: Updated Spanish translation.
1123
f1415016
CC
11242012-07-18 Cary Coutant <ccoutant@google.com>
1125
1126 PR gold/14344
1127 * configure.ac: Add check for -gpubnames support.
1128 * configure: Regenerate.
1129 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1130 support; force -gno-pubnames.
1131 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1132 support.
1133 (gdb_index_test_4): New test.
1134 * testsuite/Makefile.in: Regenerate.
1135 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1136 * testsuite/gdb_index_test_2.sh: Likewise.
1137 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1138 * testsuite/gdb_index_test_4.sh: New script.
1139 * testsuite/gdb_index_test_comm.sh: New script with common code;
1140 don't look for space after colon.
1141
b7fd7c37
ST
11422012-07-16 Sriraman Tallam <tmsriram@google.com>
1143
1144 * gold.cc (queue_middle_tasks): Update function order only after
1145 deferred objects due to plugins are processed.
1146
1f3212db
ILT
11472012-07-11 Ian Lance Taylor <iant@google.com>
1148
1149 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1150 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1151 (Target_arm::scan_reloc_for_stub): Likewise.
1152 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1153 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1154 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1155 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1156 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1157
81c82a68
ILT
11582012-07-10 Dodji Seketeli <dodji@redhat.com>
1159 Ian Lance Taylor <iant@google.com>
1160
1161 PR gold/14309
1162 * configure.ac: Test whether std::tr1::hash<off_t> works.
1163 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1164 needed.
1165 * output.h (class Output_fill): Add virtual destructor.
1166 * configure, config.in: Rebuild.
1167
eabc84f4
RM
11682012-06-22 Roland McGrath <mcgrathr@google.com>
1169
1170 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1171
370e30b6
RÁE
11722012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1173
1174 * plugin.cc (Plugin::load): Handle position independent executables.
1175
fb1b895d
CC
11762012-06-06 Cary Coutant <ccoutant@google.com>
1177
1178 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1179 add .debug_macro.
1180 (lines_only_debug_sections): Likewise.
1181 (gdb_fast_lookup_sections): New static array.
1182 (is_gdb_debug_section): Rename formal parameter.
1183 (is_lines_only_debug_section): Likewise.
1184 (is_gdb_fast_lookup_section): New function.
1185 (Layout::include_section): Check for ".zdebug_" prefix; pass
1186 section name suffix to is_gdb_debug_section, et al.; check for
1187 fast-lookup sections when building .gdb_index.
1188 * options.h (--strip-debug-gdb): Update GDB version number.
1189
7c0640fa
CC
11902012-06-06 Cary Coutant <ccoutant@google.com>
1191
1192 * configure.ac: Add check for fallocate.
1193 * configure: Regenerate.
1194 * config.in: Regenerate.
1195
1196 * options.h (class General_options): Add --mmap-output-file and
1197 --posix-fallocate options.
1198 * output.cc: (posix_fallocate): Remove; replace with...
1199 (gold_fallocate): New function.
1200 (Output_file::map_no_anonymous): Call gold_fallocate.
1201 (Output_file::map): Check --mmap-output-file option.
1202
2a49eb69
DK
12032012-06-05 Jing Yu <jingyu@google.com>
1204
1205 * gold.h (textdomain): Add do {} to empty while(0).
1206 (bindtextdomain): Likewise.
1207
fad072ac
CC
12082012-06-04 Cary Coutant <ccoutant@google.com>
1209
1210 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1211 has_dynsym_index.
1212
8cc69fb6
ST
12132012-05-25 Sriraman Tallam <tmsriram@google.com>
1214
1215 * symtab.cc (Symbol_table::define_special_symbol):
1216 Initialize *poldsym to prevent uninitialized variable errors.
1217
1be75daa
CC
12182012-05-23 Cary Coutant <ccoutant@google.com>
1219
1220 * layout.cc (Layout::section_name_mapping): Add rules to handle
1221 exact match on .data.rel.ro.local or .data.rel.ro.
1222 (Layout::output_section_name): Check for exact matches.
1223
9b689de0
CC
12242012-05-23 Cary Coutant <ccoutant@google.com>
1225
1226 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1227 more carefully.
1228
b24fdbf5
CC
12292012-05-22 Cary Coutant <ccoutant@google.com>
1230
1231 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1232 object before exporting symbol.
1233
e550e1a2
L
12342012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1235
1236 * testsuite/tls_test.cc: Include "config.h" first.
1237 * testsuite/tls_test_c.c: Likewise.
1238
df7b86aa
NC
12392012-05-17 Daniel Richard G. <skunk@iskunk.org>
1240 Nick Clifton <nickc@redhat.com>
1241
1242 PR 14072
1243 * configure.in: Add check that sysdep.h has been included before
1244 any system header files.
1245 * configure: Regenerate.
1246 * config.in: Regenerate.
1247
1007b503
CC
12482012-05-14 Cary Coutant <ccoutant@google.com>
1249
1250 * layout.cc (Layout::make_output_section): Mark .tdata section
1251 as RELRO.
1252 * testsuite/relro_test.cc: Add a TLS variable.
1253
fd885f3a
L
12542012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1255
1256 PR gold/14091
1257 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1258 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1259 R_X86_64_64.
1260
80f5885c
CC
12612012-05-08 Cary Coutant <ccoutant@google.com>
1262
1263 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1264 (lines_only_debug_sections): Likewise.
1265
2e702c99
RM
12662012-05-02 Roland McGrath <mcgrathr@google.com>
1267
1268 * nacl.cc: New file.
1269 * nacl.h: New file.
1270 * Makefile.am (CCFILES, HFILES): Add them.
1271 * Makefile.in: Regenerate.
1272 * i386.cc (Output_data_plt_i386_nacl): New class.
1273 (Output_data_plt_i386_nacl_exec): New class.
1274 (Output_data_plt_i386_nacl_dyn): New class.
1275 (Target_i386_nacl): New class.
1276 (Target_selector_i386_nacl): New class.
1277 (target_selector_i386): Use it instead of Target_selector_i386.
1278 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1279 (Target_x86_64_nacl): New class.
1280 (Target_selector_x86_64_nacl): New class.
1281 (target_selector_x86_64, target_selector_x32): Use it instead of
1282 Target_selector_x86_64.
1283 * arm.cc (Output_data_plt_arm_nacl): New class.
1284 (Target_arm_nacl): New class.
1285 (Target_selector_arm_nacl): New class.
1286 (target_selector_arm, target_selector_armbe): Use it instead of
1287 Target_selector_arm.
1288
1289 * target-select.cc (select_target): Take new Input_file* and off_t
1290 arguments, pass them on to recognize method of selector.
1291 * object.cc (make_elf_sized_object): Update caller.
1292 * parameters.cc (parameters_force_valid_target): Likewise.
1293 * incremental.cc (make_sized_incremental_binary): Likewise.
1294 * target-select.h: Update decl.
1295 (Target_selector::recognize): Take new Input_file* argument,
1296 pass it on to do_recognize.
1297 (Target_selector::do_recognize): Take new Input_file* argument.
1298 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1299 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1300 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1301 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1302
1303 * target.h (Target::Target_info): New members isolate_execinstr
1304 and rosegment_gap.
1305 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1306 * arm.cc (Target_arm::arm_info): Update initializer.
1307 * i386.cc (Target_i386::i386_info): Likewise.
1308 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1309 * sparc.cc (Target_sparc::sparc_info): Likewise.
1310 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1311 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1312 * layout.cc (Layout::attach_allocated_section_to_segment):
1313 Take new const Target* argument. If target->isolate_execinstr(), act
1314 like --rosegment.
1315 (Layout::find_first_load_seg): Take new const Target* argument;
1316 if target->isolate_execinstr(), reject PF_X segments.
1317 (Layout::relaxation_loop_body): Update caller.
1318 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1319 reset file offset to zero when we hit LOAD_SEG, and then do a second
1320 loop over the segments before LOAD_SEG to reassign offsets after
1321 addresses have been determined. Handle target->rosegment_gap().
1322 (Layout::attach_section_to_segment): Take new const Target* argument;
1323 pass it to attach_allocated_section_to_segment.
1324 (Layout::make_output_section): Update caller.
1325 (Layout::attach_sections_to_segments): Take new const Target* argument;
1326 pass it to attach_section_to_segment.
1327 * gold.cc (queue_middle_tasks): Update caller.
1328 * layout.h (Layout): Update method decls with new arguments.
1329
1330 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1331 Target_info pointer to use.
1332 (Target_arm::do_make_data_plt): New virtual method.
1333 (Target_arm::make_data_plt): New method that calls it.
1334 (Target_arm::make_plt_entry): Use it.
1335 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1336 for the section alignment.
1337 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1338 method.
1339 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1340 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1341 method.
1342 (Output_data_plt_arm::get_plt_entry_size): Call it.
1343 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1344 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1345 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1346 method.
1347 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1348 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1349 method instead of sizeof(plt_entry).
1350 (Output_data_plt_arm::add_entry): Likewise.
1351 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1352 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1353 than static method.
1354 (Target_arm::plt_entry_size): Likewise.
1355 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1356 Move to ...
1357 (Output_data_plt_arm_standard): ... here, new class.
1358 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1359 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1360 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1361
1362 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1363 Take additional argument for the PLT entry size.
1364 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1365 Use get_plt_entry_size method rather than plt_entry_size variable.
1366 (Output_data_plt_x86_64::reserve_slot): Likewise.
1367 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1368 (Output_data_plt_x86_64::add_entry): Likewise.
1369 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1370 (Output_data_plt_x86_64::address_for_global): Likewise.
1371 (Output_data_plt_x86_64::address_for_local): Likewise.
1372 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1373 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1374 Make method non-static.
1375 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1376 method.
1377 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1378 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1379 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1380 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1381 virtual method.
1382 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1383 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1384 virtual method.
1385 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1386 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1387 virtual method.
1388 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1389 (Output_data_plt_x86_64::plt_entry_size)
1390 (Output_data_plt_x86_64::first_plt_entry)
1391 (Output_data_plt_x86_64::plt_entry)
1392 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1393 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1394 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1395 (Output_data_plt_x86_64_standard): ... here, new class.
1396 (Target_x86_64::Target_x86_64): Take optional argument for the
1397 Target_info pointer to use.
1398 (Target_x86_64::do_make_data_plt): New virtual method.
1399 (Target_x86_64::make_data_plt): New method to call it.
1400 (Target_x86_64::init_got_plt_for_update): Use that.
1401 Call this->plt_->add_eh_frame method here.
1402 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1403 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1404 rather than static method.
1405 (Target_x86_64::plt_entry_size): Likewise.
1406 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1407 rather than plt_entry_size variable. Move guts of PLT filling to...
1408 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1409 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1410 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1411
1412 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1413 additional argument for the section alignment.
1414 Don't do add_eh_frame_for_plt here.
1415 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1416 non-static. Use get_plt_entry_size method rather than plt_entry_size
1417 variable.
1418 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1419 method.
1420 (Output_data_plt_i386::get_plt_entry_size): Call it.
1421 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1422 (Output_data_plt_i386::add_eh_frame): New method to call it.
1423 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1424 method.
1425 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1426 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1427 method.
1428 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1429 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1430 method instead of plt_entry_size.
1431 (Output_data_plt_i386::plt_entry_size)
1432 (Output_data_plt_i386::plt_eh_frame_fde_size)
1433 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1434 (Output_data_plt_i386_standard): ... here, new class.
1435 (Output_data_plt_i386_exec): New class.
1436 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1437 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1438 (Output_data_plt_i386::exec_plt_entry): Move to ...
1439 (Output_data_plt_i386_exec::plt_entry): ... here.
1440 (Output_data_plt_i386_dyn): New class.
1441 (Output_data_plt_i386::first_plt_entry): Move to ...
1442 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1443 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1444 (Output_data_plt_i386_dyn::plt_entry): ... here.
1445 (Target_i386::Target_i386): Take optional argument for the Target_info
1446 pointer to use.
1447 (Target_i386::do_make_data_plt): New virtual method.
1448 (Target_i386::make_data_plt): New method to call it.
1449 (Target_i386::make_plt_section): Use that.
1450 Call this->plt_->add_eh_frame method here.
1451 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1452 rather than plt_entry_size variable.
1453 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1454 (Output_data_plt_i386::address_for_local): Likewise.
1455 (Output_data_plt_i386::do_write): Likewise.
1456 Move guts of PLT filling to...
1457 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1458 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1459 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1460 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1461
b9b9f2ee
CC
14622012-05-01 Cary Coutant <ccoutant@google.com>
1463
1464 * dwarf_reader.cc (Dwarf_die::read_attributes)
1465 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1466 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1467 * reduced_debug_output.cc
1468 (Output_reduced_debug_info_section::get_die_end): Remove
1469 DW_FORM_GNU_ref_index. Add default case.
1470
57923f48
MW
14712012-04-26 Mark Wielaard <mjw@redhat.com>
1472
1473 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1474 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1475 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1476 DW_AT_high_pc as offset from DW_AT_low_pc.
1477
1478 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1479 * testsuite/Makefile.in: Regenerate.
1480 * testsuite/gdb_index_test_3.c: New test source file.
1481 * testsuite/gdb_index_test_3.sh: New test source file.
1482
2c54b4f4
ILT
14832012-04-25 Ian Lance Taylor <iant@google.com>
1484
1485 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1486 pointer.
1487 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1488 as a class, not a struct.
1489 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1490 (Target_arm::apply_cortex_a8_workaround): Likewise.
1491 * gc.h: Declare Reloc_types as a struct, not a class.
1492 * object.h: Declare Symbols_data as a struct.
1493 * reloc.h: Declare Read_relocs_data as a struct.
1494 * target.h: Declare Relocate_info as a struct.
1495
a5a5f7a3
DM
14962012-04-24 David S. Miller <davem@davemloft.net>
1497
1498 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1499 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1500 and R_SPARC_WPLT30.
1501
f038d496
CC
15022012-04-24 Cary Coutant <ccoutant@google.com>
1503
1504 * incremental-dump.cc (find_input_containing_global): Replace
1505 magic number with symbolic constant.
1506 (dump_incremental_inputs): Update version number.
1507 * incremental.cc (Output_section_incremental_inputs): Update version
1508 number; import symbolic constants from Incremental_inputs_reader.
1509 (Incremental_inputs::create_data_sections): Align relocations
1510 section correctly for 64-bit targets.
1511 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1512 constants; add padding.
1513 (Output_section_incremental_inputs::write_header): Add assert for
1514 header_size.
1515 (Output_section_incremental_inputs::write_input_files): Add assert
1516 for input_entry_size.
1517 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1518 add assert for object_info_size, input_section_entry_size,
1519 global_sym_entry_size.
1520 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1521 for data structure sizes; use them.
1522 (Incremental_input_entry_reader): Import symbolic constants from
1523 Incremental_inputs_reader; use them.
1524
a4d85145
DM
15252012-04-23 David S. Miller <davem@davemloft.net>
1526
1527 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1528 and elf_flags_set_.
1529 (Target_sparc::Target_sparc): Initialize new fields.
1530 (Target_sparc::do_make_elf_object): New function.
1531 (Target_sparc::do_adjust_elf_header): New function.
1532
1d509098
CC
15332012-04-23 Cary Coutant <ccoutant@google.com>
1534
1535 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1536 CU range table of gdb index.
1537
7ebeff7f
DM
15382012-04-20 David S. Miller <davem@davemloft.net>
1539
1540 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1541 instead of false.
1542
13cf9988
DM
15432012-04-16 David S. Miller <davem@davemloft.net>
1544
2a1079e8
DM
1545 * sparc.cc (Target_sparc::got_address): New function.
1546 (Sparc_relocate_functions::gdop_hix22): New function.
1547 (Sparc_relocate_functions::gdop_lox10): New function.
1548 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1549 relocs.
1550 (Target_sparc::Scan::local): Likewise if the global symbol is not
1551 preemptible and is not IFUNC.
1552 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1553 transformations for local and non-preemptible non-IFUNC global
1554 symbols.
1555
0bc964fc
DM
1556 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1557 writing out 64-bit part of ranges.
1558
661d7a80
DM
1559 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1560 -fpic and -fpie respectively.
1561 * Makefile.in: Regenerate.
1562
8c2bf391
DM
1563 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1564 (Target_sparc::Target_sparc): Initialize new field.
1565 (Target_sparc::do_plt_section_for_global): New function.
1566 (Target_sparc::do_plt_section_for_local): New function.
1567 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1568 (Target_sparc::make_plt_section): New function, broken out of
1569 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1570 (Target_sparc::make_plt_entry): Call make_plt_section.
1571 (Target_sparc::make_local_ifunc_plt_entry): New function.
1572 (Target_sparc::rela_ifunc_section): New function.
1573 (Target_sparc::plt_section): Remove const.
1574 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1575 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1576 and ifunc_count_ fields.
1577 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1578 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1579 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1580 (Output_data_plt_sparc::rela_ifunc): New function.
1581 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1582 (Output_data_plt_sparc::has_ifunc_section): New function.
1583 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1584 (Output_data_plt_sparc::address_for_global): New function.
1585 (Output_data_plt_sparc::address_for_local): New function.
1586 (Output_data_plt_sparc::plt_index_to_offset): New function.
1587 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1588 and entry_count.
1589 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1590 entry_count.
1591 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1592 R_SPARC_JMP_IREL to switch.
1593 (Target_sparc::Scan::check_non_pic): Likewise.
1594 (Target_sparc::Scan::local): Handle IFUNC symbols.
1595 (Target_sparc::Scan::local): Likewise.
1596 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1597 and plt_address_for_local.
1598 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1599 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1600
13cf9988
DM
1601 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1602 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1603 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1604 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1605 global relocs too.
1606 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1607 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1608 calls.
1609 * sparc.cc (Target_sparc::Scan::global): Likewise.
1610 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1611
31821be0
CC
16122012-04-16 Cary Coutant <ccoutant@google.com>
1613
1614 * archive.cc (Library_base::should_include_member): Check for
1615 --export-dynamic-symbol.
1616 * options.h (class General_options): Add --export-dynamic-symbol.
1617 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1618 --export-dynamic-symbol.
1619 (Symbol_table::gc_mark_undef_symbols): Likewise.
1620 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1621
2615994e
DM
16222012-04-12 David S. Miller <davem@davemloft.net>
1623
1624 * sparc.cc (Reloc::wdisp10): New relocation method.
1625 (Reloc::h34): Likewise.
1626 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1627 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1628 R_SPARC_WDISP10.
1629 (Target_sparc::Scan::local): Likewise.
1630 (Target_sparc::Scan::global): Likewise.
1631 (Target_sparc::Relocate::relocate): Likewise.
1632
6782735d
CC
16332012-04-09 Cary Coutant <ccoutant@google.com>
1634
1635 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1636 low_pc == 0.
1637
8c7a0b00
ILT
16382012-04-06 Ian Lance Taylor <iant@google.com>
1639
1640 * timer.cc: #include <unistd.h>.
1641
58797674
RM
16422012-04-06 Roland McGrath <mcgrathr@google.com>
1643
1644 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1645 * config.in: Regenerate.
1646 * configure: Regenerate.
1647
44350750
NC
16482012-04-05 Nick Clifton <nickc@redhat.com>
1649
1650 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1651 (AM_LC_MESSAGES): Add.
1652 * aclocal.m4: Regenerate.
1653 * config.in: Regenerate.
1654 * configure: Regenerate.
1655
c1027032
CC
16562012-03-21 Cary Coutant <ccoutant@google.com>
1657
1658 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1659 * Makefile.in: Regenerate.
1660 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1661 (Sized_elf_reloc_mapper::symbol_section): New function.
1662 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1663 (make_elf_reloc_mapper): New function.
1664 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1665 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1666 (Dwarf_abbrev_table::do_get_abbrev): New function.
1667 (Dwarf_ranges_table::read_ranges_table): New function.
1668 (Dwarf_ranges_table::read_range_list): New function.
1669 (Dwarf_pubnames_table::read_section): New function.
1670 (Dwarf_pubnames_table::read_header): New function.
1671 (Dwarf_pubnames_table::next_name): New function.
1672 (Dwarf_die::Dwarf_die): New function.
1673 (Dwarf_die::read_attributes): New function.
1674 (Dwarf_die::skip_attributes): New function.
1675 (Dwarf_die::set_name): New function.
1676 (Dwarf_die::set_linkage_name): New function.
1677 (Dwarf_die::attribute): New function.
1678 (Dwarf_die::string_attribute): New function.
1679 (Dwarf_die::int_attribute): New function.
1680 (Dwarf_die::uint_attribute): New function.
1681 (Dwarf_die::ref_attribute): New function.
1682 (Dwarf_die::child_offset): New function.
1683 (Dwarf_die::sibling_offset): New function.
1684 (Dwarf_info_reader::check_buffer): New function.
1685 (Dwarf_info_reader::parse): New function.
1686 (Dwarf_info_reader::do_parse): New function.
1687 (Dwarf_info_reader::do_read_string_table): New function.
1688 (Dwarf_info_reader::lookup_reloc): New function.
1689 (Dwarf_info_reader::get_string): New function.
1690 (Dwarf_info_reader::visit_compilation_unit): New function.
1691 (Dwarf_info_reader::visit_type_unit): New function.
1692 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1693 Sized_elf_reloc_mapper.
1694 (Sized_dwarf_line_info::symbol_section): Remove function.
1695 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1696 (Sized_dwarf_line_info::read_line_mappings): Remove object
1697 parameter, adjust callers.
1698 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1699 * dwarf_reader.h: Include <sys/types.h>.
1700 (class Track_relocs): Remove forward declaration.
1701 (class Elf_reloc_mapper): New class.
1702 (class Sized_elf_reloc_mapper): New class.
1703 (class Dwarf_abbrev_table): New class.
1704 (class Dwarf_range_list): New class.
1705 (class Dwarf_ranges_table): New class.
1706 (class Dwarf_pubnames_table): New class.
1707 (class Dwarf_die): New class.
1708 (class Dwarf_info_reader): New class.
1709 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1710 (Sized_dwarf_line_info::symbol_section): Remove member function.
1711 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1712 base class.
1713 * gdb-index.cc: New source file.
1714 * gdb-index.h: New source file.
1715 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1716 and .debug_types sections, call Layout::add_to_gdb_index.
1717 (Sized_relobj_incr::do_section_name): Implement.
1718 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1719 return type; Implement.
1720 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1721 return type.
1722 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1723 parameter list and return type.
1724 (Sized_incr_dynobj::do_section_contents): Likewise.
1725 * layout.cc: Include gdb-index.h.
1726 (Layout::Layout): Initialize gdb_index_data_.
1727 (Layout::init_fixed_output_section): Check for .gdb_index section.
1728 (Layout::add_to_gdb_index): New function. Instantiate.
1729 * layout.h: Add forward declaration for class Gdb_index.
1730 (Layout::add_to_gdb_index): New member function.
1731 (Layout::gdb_index_data_): New data member.
1732 * main.cc: Include gdb-index.h.
1733 (main): Print statistics for gdb index.
1734 * object.cc (Object::section_contents): Move code into
1735 do_section_contents.
1736 (need_decompressed_section): Check for sections needed when building
1737 gdb index.
1738 (build_compressed_section_map): Likewise.
1739 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1740 gdb index.
1741 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1742 sections; call Layout::add_to_gdb_index.
1743 (Sized_relobj_file::do_decompressed_section_contents): Call
1744 do_section_contents directly.
1745 * object.h (Object::do_section_contents): Adjust parameter list and
1746 return type.
1747 (Object::do_decompressed_section_contents): Call do_section_contents
1748 directly.
1749 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1750 return type.
1751 * options.h (class General_options): Add --gdb-index option.
1752 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1753 list and return type.
1754 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1755 * reloc.h (Track_relocs::checkpoint): New function.
1756 (Track_relocs::reset): New function.
1757
1758 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1759 New test cases.
1760 * testsuite/Makefile.in: Regenerate.
1761 * testsuite/gdb_index_test.cc: New test source file.
1762 * testsuite/gdb_index_test_1.sh: New test source file.
1763 * testsuite/gdb_index_test_2.sh: New test source file.
1764
647f1574
DK
17652012-03-19 Doug Kwan <dougkwan@google.com>
1766
1767 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1768 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1769 __exidx_start and __exidx_end. Make symbol table parameter
1770 anonymous as it is not used.
1771 * gold.cc (queue_middle_tasks): Call target hook to define any
1772 target-specific symbols.
1773 * target.h (Target::define_standard_symbols): New method.
1774 (Target::do_define_standard_symbols): Same.
1775 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1776 * testsuite/Makefile.in: Regenerate.
1777 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1778 and __exidx_end.
1779 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1780 relocations are generated for __exidx_start and __exidx_end.
1781
7c6109da
DK
17822012-03-16 Doug Kwan <dougkwan@google.com>
1783
1784 * testsuite/Makefile.am: Disable test initpri3b.
1785 * testsuite/Makefile.in: Regenerate.
1786
7b8957f8
DK
17872012-03-15 Doug Kwan <dougkwan@google.com>
1788
1789 * arm.cc (Target_arm::got_section): Make .got section read-only
1790 if -z now is given.
1791
14dc9ef7
ILT
17922012-03-15 Ian Lance Taylor <iant@google.com>
1793
1794 PR gold/13850
1795 * layout.cc (Layout::make_output_section): Correctly mark
1796 SHT_INIT_ARRAY, et. al., as relro.
1797
fa40b62a
DK
17982012-03-14 Doug Kwan <dougkwan@google.com>
1799
1800 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1801 dynamic relocations for protected symbols in shared objects.
1802
fd325007
ILT
18032012-03-13 Ian Lance Taylor <iant@google.com>
1804
1805 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1806 keep the larger alignment.
1807
e8dd54e1
CC
18082012-03-12 Cary Coutant <ccoutant@google.com>
1809
1810 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1811 handling of DW_LNE_define_file.
1812
feb5f3b0
CC
18132012-03-12 Cary Coutant <ccoutant@google.com>
1814
1815 * reduced_debug_output.cc
1816 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1817 codes to switch.
1818
a1fb4256
CC
18192012-02-29 Cary Coutant <ccoutant@google.com>
1820
1821 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1822
5dd8762a
CC
18232012-02-29 Cary Coutant <ccoutant@google.com>
1824
1825 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1826 Call Object::decompressed_section_contents.
1827 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1828 New dtor.
1829 (Sized_dwarf_line_info::buffer_start_): New data member.
1830 * merge.cc (Output_merge_data::do_add_input_section): Call
1831 Object::decompressed_section_contents.
1832 (Output_merge_string::do_add_input_section): Likewise.
1833 * object.cc (need_decompressed_section): New function.
1834 (build_compressed_section_map): Decompress sections needed later.
1835 (Sized_relobj_file::do_decompressed_section_contents): New function.
1836 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1837 * object.h (Object::decompressed_section_contents): New function.
1838 (Object::discard_decompressed_sections): New function.
1839 (Object::do_decompressed_section_contents): New function.
1840 (Object::do_discard_decompressed_sections): New function.
1841 (Compressed_section_info): New type.
1842 (Compressed_section_map): Include decompressed section contents.
1843 (Sized_relobj_file::do_decompressed_section_contents): New function.
1844 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1845
7b5de7ee
CC
18462012-02-16 Cary Coutant <ccoutant@google.com>
1847
1848 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1849 * testsuite/Makefile.in: Regenerate.
1850
f9fa4a63
CC
18512012-02-14 Cary Coutant <ccoutant@google.com>
1852
1853 * options.cc (General_options::finalize): Disallow -pie and -static.
1854
2c175ebc
DK
18552012-02-03 Doug Kwan <dougkwan@google.com>
1856
1857 * arm.cc (Arm_relocate_functions::abs8,
1858 Arm_relocate_functions::abs16): Use
1859 Bits::has_signed_unsigned_overflow32.
1860 (Arm_relocate_functions::thm_abs8): Correct range of
1861 overflow check.
1862 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1863 in assertions.
1864
90cff06f
DK
18652012-02-02 Doug Kwan <dougkwan@google.com>
1866
1867 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1868 position independent outputs, not just shared objects.
1869
63887f3d
L
18702012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1871
1872 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1873 * configure: Regenerated.
1874
bef2b434
ILT
18752012-01-27 Ian Lance Taylor <iant@google.com>
1876
1877 * reloc.h (Bits): New class with static functions, copied from
1878 namespace utils in arm.cc.
1879 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1880 instead.
1881
c335b55d
L
18822012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1883
1884 * incremental.cc (write_info_blocks): Correct relocation offset.
1885
41194d9f
L
18862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1887
1888 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1889 (Relocate::tls_gd_to_le): Likewise.
1890
1bae613c
L
18912012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1892
1893 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1894
24482ca0
L
18952012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1896
1897 * configure.ac: Check if -mcmodel=medium works.
1898 * configure: Regenerated.
1899
c2c7840a
CC
19002012-01-24 Cary Coutant <ccoutant@google.com>
1901
1902 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1903 definition and ...
1904 (read_unsigned_LEB_128_x): ... this new function.
1905 (read_signed_LEB_128): Replaced with inline definition and ...
1906 (read_signed_LEB_128_x): ... this new function.
1907 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1908 (read_unsigned_LEB_128): Add inline definition.
1909 (read_signed_LEB_128_x): New function.
1910 (read_signed_LEB_128): Add inline definition.
1911 * testsuite/Makefile.am (leb128_unittest): New unit test.
1912 * testsuite/Makefile.in: Regenerate.
1913 * testsuite/leb128_unittest.cc: New unit test.
1914
833de760 19152012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1916
1917 PR gold/13617
1918 * i386.cc (Target_i386::do_code_fill): When using a jmp
1919 instruction, pad with nop instructions.
1920 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1921
618d6666
L
19222012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1923
1924 * x86_64.cc (gc_process_relocs): Add typename on types used in
1925 template.
1926 (scan_relocs): Likewise.
1927 (relocate_section): Likewise.
1928 (apply_relocation): Likewise.
1929
3660ff06
L
19302012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1931
1932 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1933 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1934 under x32.
1935
fc51264f
L
19362012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1937
1938 * x86_64.cc: Initial support for x32.
1939
dd74ae06
CC
19402012-01-03 Cary Coutant <ccoutant@google.com>
1941
1942 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1943 Use abstract base class for GOT.
1944 * gold/output.h (class Output_data_got_base): New abstract base class.
1945 (class Output_data_got): Derive from new base class, adjust ctors.
1946 (Output_data_got::reserve_slot): Make virtual; rename to
1947 do_reserve_slot; Adjust callers.
1948 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1949 pointer to abstract base class.
1950 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1951
83896202
ILT
19522011-12-18 Ian Lance Taylor <iant@google.com>
1953
1954 * object.h (Relobj::local_symbol_value): New function.
1955 (Relobj::local_plt_offset): New function.
1956 (Relobj::local_has_got_offset): New function.
1957 (Relobj::local_got_offset): New function.
1958 (Relobj::set_local_got_offset): New function.
1959 (Relobj::do_local_symbol_value): New pure virtual function.
1960 (Relobj::do_local_plt_offset): Likewise.
1961 (Relobj::do_local_has_got_offset): Likewise.
1962 (Relobj::do_local_got_offset): Likewise.
1963 (Relobj::do_set_local_got_offset): Likewise.
1964 (Sized_relobj::do_local_has_got_offset): Rename from
1965 local_has_got_offset.
1966 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1967 (Sized_relobj::do_set_local_got_offset): Rename from
1968 set_local_got_offset.
1969 (Sized_relobj_file::do_local_plt_offset): Rename from
1970 local_plt_offset.
1971 (Sized_relobj_file::do_local_symbol_value): New function.
1972 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1973 local_plt_offset.
1974 * output.cc (Output_data_got::Got_entry::write): Change object to
1975 Relobj. Use local_symbol_value.
1976 (Output_data_got::add_global_with_rel): Change rel_dyn to
1977 Output_data_reloc_generic*. Use add_global_generic.
1978 (Output_data_got::add_global_with_rela): Remove. Change all
1979 callers to use add_global_with_rel.
1980 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1981 Output_data_reloc_generic*. Use add_global_generic.
1982 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1983 callers to use add_global_pair_with_rel.
1984 (Output_data_got::add_local): Change object to Relobj*.
1985 (Output_data_got::add_local_plt): Likewise.
1986 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1987 change rel_dyn to Output_data_reloc_generic*. Use
1988 add_local_generic.
1989 (Output_data_got::add_local_with_rela): Remove. Change all
1990 callers to use all_local_with_rel.
1991 (Output_data_got::add_local_pair_with_rel): Change object to
1992 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1993 add_output_section_generic.
1994 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1995 callers to use add_local_pair_with_rel.
1996 (Output_data_got::reserve_local): Change object to Relobj*.
1997 * output.h: (class Output_data_reloc_generic): Add pure virtual
1998 declarations for add_global_generic, add_local_generic,
1999 add_output_section_generic.
2000 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2001 functions for Output_data_reloc_generic. Update declarations for
2002 changes listed in output.cc.
2003 (class Output_data_got): Change template parameter to got_size.
2004 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2005 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2006 function.
2007 (Sized_relobj_incr::do_local_plt_offset): New function.
2008 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2009 add_global_generic.
2010
76677ad0
CC
20112011-12-17 Cary Coutant <ccoutant@google.com>
2012
2013 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2014 * resolve.cc (Symbol_table::resolve): Likewise.
2015 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2016 arrays.
2017 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2018
8b8dd8d5
ILT
20192011-12-16 Ian Lance Taylor <iant@google.com>
2020
2021 * output.h (Output_data_reloc_generic::add): Only call
2022 add_dynamic_reloc if this is a dynamic reloc section.
2023
d55525b9
L
20242011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2025
2026 PR gold/13505
2027 * target-reloc.h (apply_relocation): Replace <64, false> with
2028 <size, big_endian>.
2029
ff81c7c1
NC
20302011-11-25 Nick Clifton <nickc@redhat.com>
2031
2032 * po/it.po: New Italian translation.
2033
628f39be
SA
20342011-11-17 Sterling Augustine <saugustine@google.com>
2035
2036 * script.cc (script_include_directive): Implement.
2037 (read_script_file): New local variables name and search_path. Update
2038 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2039 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2040 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2041
98ef3ea4
SA
20422011-11-11 Sterling Augustine <saugustine@google.com>
2043
2044 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2045 (file_or_sections_cmd): Likewise.
2046
f4a8b6d7
DK
20472011-11-11 Doug Kwan <dougkwan@google.com>
2048
2049 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2050 if --just-symbols is given.
2051
29ab395d
DK
20522011-11-10 Doug Kwan <dougkwan@google.com>
2053
2054 PR gold/13362
2055 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2056 when processing data relocs.
2057 * reloc.h (Relocate_functions::rel_unaligned): New method.
2058 (Relocate_functions::pcrel_unaligned): Ditto.
2059 (Relocate_functions::rel32_unaligned): Ditto.
2060 (Relocate_functions::pcrel32_unaligned): Ditto.
2061
2c339f71
DK
20622011-11-09 Doug Kwan <dougkwan@google.com>
2063
2064 PR gold/13362
2065 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2066 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2067 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2068 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2069 (Relocate_functions::rel_unaligned): New.
2070 (Relocate_functions::rel32_unaligned): New.
2071 * target-reloc.h (relocate_for_relocatable): Add code to handle
2072 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2073 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2074 arm_unaligned_reloc_r): New targets.
2075 * testsuite/Makefile.in: Regenerate.
2076 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2077 linking.
2078
3f3cddf1
ILT
20792011-11-02 Ian Lance Taylor <iant@google.com>
2080
2081 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2082 NATIVE_LINKER.
2083 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2084 * options.cc (General_options::finalize): Use library search path
2085 from configure script if specified. If not native and no sysroot,
2086 only search TOOLLIBDIR.
2087 * options.h (Search_directory::Search_directory): Change name to
2088 const std::string&.
2089 (General_options::add_to_library_path_with_sysroot): Change arg to
2090 const std::string&.
2091 * configure, Makefile.in, config.in: Rebuild.
2092
a8e2273b
ILT
20932011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2094
2095 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2096 we are working around the ARM1176 Erratum.
2097 * options.h (General_options::fix_arm1176): Add option.
2098 * testsuite/Makefile.am: Add testcases, and keep current ones
2099 working.
2100 * testsuite/Makefile.in: Regenerate.
2101 * testsuite/arm_fix_1176.s: New file.
2102 * testsuite/arm_fix_1176.sh: Likewise.
2103
cd6eab1c
ILT
21042011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2105
2106 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2107 may_use_blx_.
2108 (Target_arm::may_use_blx): Remove method.
2109 (Target_arm::set_may_use_blx): Likewise.
2110 (Target_arm::may_use_v4t_interworking): New method.
2111 (Target_arm::may_use_v5t_interworking): Likewise.
2112 (Target_arm::may_use_blx_): Remove member variable.
2113 (Arm_relocate_functions::arm_branch_common): Check for v5T
2114 interworking.
2115 (Arm_relocate_functions::thumb_branch_common): Likewise.
2116 (Reloc_stub::stub_type_for_reloc): Likewise.
2117 (Target_arm::do_finalize_sections): Correct interworking checks.
2118 * testsuite/Makefile.am: Add new tests.
2119 * testsuite/Makefile.in: Regenerate.
2120 * testsuite/arm_farcall_arm_arm.s: New test.
2121 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2122 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2123 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2124 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2125 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2126 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2127 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2128
286adcf4
CC
21292011-10-31 Cary Coutant <ccoutant@google.com>
2130
2131 PR gold/13023
2132 * expression.cc (Expression::eval_with_dot): Add
2133 is_section_dot_assignment parameter.
2134 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2135 absolute and assigning to dot within a section.
2136 * script-sections.cc
2137 (Output_section_element_assignment::set_section_addresses): Pass
2138 dot_section to set_if_absolute.
2139 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2140 as is_section_dot_assignment flag to eval_with_dot.
2141 (Output_section_element_dot_assignment::set_section_addresses):
2142 Likewise.
2143 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2144 parameter. Also set value if relative to dot_section; set the
2145 symbol's output_section.
2146 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2147 parameter. Adjust all callers.
2148 (Expression::eval_maybe_dot): Likewise.
2149 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2150 Adjust all callers.
2151 * testsuite/script_test_2.t: Test assignment of an absolute value
2152 to dot within an output section element.
2153
9634ed06
CC
21542011-10-31 Cary Coutant <ccoutant@google.com>
2155
2156 * options.h (class General_options): Add --[no-]gnu-unique options.
2157 * symtab.cc (Symbol_table::sized_write_globals): Convert
2158 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2159
de4101c7
CC
21602011-10-31 Cary Coutant <ccoutant@google.com>
2161
2162 PR gold/13359
2163 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2164 unnecessary assertion.
2165 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2166
7257cc92
ST
21672011-10-31 Sriraman Tallam <tmsriram@google.com>
2168
2169 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2170 gc_mark_symbol.
2171 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2172 gc_mark_symbol.
2173 Change to just keep the section associated with symbol.
2174 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2175 they are externally visible and --export-dynamic is turned on.
2176 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2177
bfc34b3f
ILT
21782011-10-19 Ian Lance Taylor <iant@google.com>
2179
2180 PR gold/13163
2181 * script-sections.cc
2182 (Output_section_element_dot_assignment::needs_output_section): New
2183 function.
2184
ea0d8c47
ILT
21852011-10-19 Ian Lance Taylor <iant@google.com>
2186
2187 PR gold/13204
2188 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2189 --section-start option was seen.
2190 * options.h (General_options::any_section_start): New function.
2191
abd242a9
DM
21922011-10-18 David S. Miller <davem@davemloft.net>
2193
2194 PR binutils/13301
2195 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2196 member to track relocation locations that have moved during TLS
2197 reloc optimizations.
2198 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2199 (Target_sparc::Relocate::relocate): Adjust view down by 4
2200 bytes if it matches reloc_adjust_addr_.
2201 (Target_sparc::Relocate::relocate_tls): Always move the
2202 __tls_get_addr call delay slot instruction forward 4 bytes when
2203 performing relaxation.
2204
bab9090f
CC
22052011-10-18 Cary Coutant <ccoutant@google.com>
2206
2207 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2208 (Output_file::map_no_anonymous): Check for non-zero
2209 return code from posix_fallocate.
2210
f7c5b166
CC
22112011-10-17 Cary Coutant <ccoutant@google.com>
2212
2213 PR gold/13245
2214 * plugin.cc (is_visible_from_outside): Check for symbols
2215 referenced from dynamic objects.
2216 * resolve.cc (Symbol_table::resolve): Don't count references
2217 from dynamic objects as references from real ELF files.
2218 * testsuite/plugin_test_2.sh: Adjust expected result.
2219
b490c0bb
CC
22202011-10-17 Cary Coutant <ccoutant@google.com>
2221
2222 * gold.cc: Include timer.h.
2223 (queue_middle_tasks): Stamp time.
2224 (queue_final_tasks): Likewise.
2225 * main.cc (main): Store timer in parameters. Print timers
2226 for each pass.
2227 * parameters.cc (Parameters::Parameters): Initialize timer_.
2228 (Parameters::set_timer): New function.
2229 (set_parameters_timer): New function.
2230 * parameters.h (Parameters::set_timer): New function.
2231 (Parameters::timer): New function.
2232 (Parameters::timer_): New data member.
2233 (set_parameters_timer): New function.
2234 * timer.cc (Timer::stamp): New function.
2235 (Timer::get_pass_time): New function.
2236 * timer.h (Timer::stamp): New function.
2237 (Timer::get_pass_time): New function.
2238 (Timer::pass_times_): New data member.
2239
f475cf7b
CC
22402011-10-17 Cary Coutant <ccoutant@google.com>
2241
2242 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2243 task for members of lib groups.
2244
cdd7e244
CC
22452011-10-17 Cary Coutant <ccoutant@google.com>
2246
2247 PR gold/13288
4f95c8b4 2248 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2249 (File_read::make_view): Move bounds check (replace with assert)...
2250 (File_read::find_or_make_view): ... to here.
2251
dfb45471
CC
22522011-10-12 Cary Coutant <ccoutant@google.com>
2253
4f95c8b4 2254 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2255 ::read returns less than requested size.
2256
53bbcc1b
CC
22572011-10-10 Cary Coutant <ccoutant@google.com>
2258
4f95c8b4 2259 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2260 Initialize defined_count_.
2261 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2262 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2263 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2264 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2265 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2266 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2267 member.
2268 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2269 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2270 Return zeroes instead of internal error.
2271
397b129b
CC
22722011-10-10 Cary Coutant <ccoutant@google.com>
2273
2274 PR gold/13249
4f95c8b4 2275 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2276 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2277 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2278 (Output_reloc::type_): Adjust size of bit field.
2279 (Output_reloc::use_plt_offset_): New bit field.
2280 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2281 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2282 flag. Adjust all callers.
4f95c8b4 2283 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2284 creating RELATIVE relocations.
2285
d5698657
NC
22862011-10-10 Nick Clifton <nickc@redhat.com>
2287
2288 * po/es.po: Updated Spanish translation.
2289 * po/fi.po: Updated Finnish translation.
2290
6a59a5c2
DN
22912011-10-03 Diego Novillo <dnovillo@google.com>
2292
2293 * options.cc (parse_uint): Fix dereference of RETVAL.
2294
f0558624
ST
22952011-09-29 Sriraman Tallam <tmsriram@google.com>
2296
2297 * layout.h (section_order_map_): New member.
2298 (get_section_order_map): New member function.
2299 * output.cc (Output_section::add_input_section): Check for patterns
2300 only when --section-ordering-file is specified.
2301 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2302 output_sections have been formed.
2303 * layout.cc (Layout_Layout): Initialize section_order_map_.
2304 * plugin.cc (update_section_order): Store order in order_map. Do not
2305 update the order.
2306 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2307 * testsuite/Makefile.in: Regenerate.
2308 * testsuite/plugin_section_order.c: New file.
2309 * testsuite/plugin_final_layout.cc: New file.
2310 * testsuite/plugin_final_layout.sh: New file.
2311
a7dac153
CC
23122011-09-29 Cary Coutant <ccoutant@google.com>
2313
4f95c8b4 2314 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2315 Check for NULL.
4f95c8b4 2316 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2317 symbols during incremental update.
2318 (Symbol_table::add_from_dynobj): Likewise.
2319
eebd87a5
ILT
23202011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2321 Ian Lance Taylor <iant@google.com>
2322
2323 * symtab.cc (Symbol_table::define_special_symbol): Always
2324 canonicalize version string.
2325
403a3331
CC
23262011-09-26 Cary Coutant <ccoutant@google.com>
2327
4f95c8b4
CC
2328 * gold.cc (queue_initial_tasks): Move option checks ...
2329 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2330 some options; make others fatal.
2331
235061c2
CC
23322011-09-26 Cary Coutant <ccoutant@google.com>
2333
2334 gcc PR lto/47247
2335 * plugin.cc (get_symbols_v2): New function.
2336 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2337 (is_referenced_from_outside): New function.
2338 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2339 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2340 (get_symbols): Pass version parameter.
2341 (get_symbols_v2): New function.
2342 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2343 parameter.
2344 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2345 (onload): Add LDPT_GET_SYMBOLS_V2.
2346 (all_symbols_read_hook): Use get_symbols_v2; check for
2347 LDPR_PREVAILING_DEF_IRONLY_EXP.
2348 * testsuite/plugin_test_3.sh: Update expected results.
2349
dc87f620
ILT
23502011-09-23 Simon Baldwin <simonb@google.com>
2351
2352 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2353 configuration options.
2354 * configure: Regenerate.
2355 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2356 * Makefile.in: Regenerate.
2357 * testsuite/Makefile.in: Regenerate.
2358
a8279f82
ST
23592011-09-19 Sriraman Tallam <tmsriram@google.com>
2360
2361 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2362
0c9350c8
CC
23632011-09-19 Cary Coutant <ccoutant@google.com>
2364
2365 * incremental.cc (can_incremental_update): Fix typo in comment.
2366 * incremental.h (can_incremental_update): Likewise.
2367
aa06ae28
CC
23682011-09-18 Cary Coutant <ccoutant@google.com>
2369
2370 * incremental.cc (can_incremental_update): New function.
2371 * incremental.h (can_incremental_update): New function.
2372 * layout.cc (Layout::init_fixed_output_section): Call it.
2373 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2374 * object.cc (Sized_relobj_file::do_layout): Call
2375 can_incremental_update.
2376
ebb300b2
CC
23772011-09-13 Cary Coutant <ccoutant@google.com>
2378
2379 * configure.ac: Check for glibc support for gnu_indirect_function
2380 support with static linking, setting automake conditional
2381 IFUNC_STATIC.
2382 * Makefile.in: Regenerate.
2383 * configure: Regenerate.
2384
2385 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2386 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2387 for IFUNC_STATIC.
2388 * testsuite/Makefile.in: Regenerate.
2389
1206d0d5
CC
23902011-09-13 Cary Coutant <ccoutant@google.com>
2391
2392 * incremental.cc (Sized_relobj_incr::do_layout): Call
2393 report_comdat_group for kept comdat sections.
2394 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2395 * testsuite/Makefile.in: Regenerate.
2396 * testsuite/incr_comdat_test_1.cc: New source file.
2397 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2398 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2399 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2400
40b29874
ILT
24012011-09-13 Ian Lance Taylor <iant@google.com>
2402
2403 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2404 variable external_symbols_offset.
2405
1b045aac
ILT
24062011-09-12 Ian Lance Taylor <iant@google.com>
2407
2408 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2409 triggered if object has no symbols.
2410
24c6c55a
DM
24112011-09-09 David S. Miller <davem@davemloft.net>
2412
2413 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2414 (Output_fill_debug_line::do_write): Likewise.
2415
66570254
CC
24162011-08-29 Cary Coutant <ccoutant@google.com>
2417
2418 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2419 casts to match formatting specs.
2420 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2421
8ea8cd50
CC
24222011-08-26 Cary Coutant <ccoutant@google.com>
2423
2424 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2425 remaining hole size when allocating.
2426 (Layout::make_output_section): Set fill methods for debug sections.
2427 * layout.h (Free_list::Free_list_node): Move from private to
2428 public.
2429 (Free_list::set_min_hole_size): New function.
2430 (Free_list::begin, Free_list::end): New functions.
2431 (Free_list::min_hole_): New data member.
2432 * output.cc: Include dwarf.h.
2433 (Output_fill_debug_info::do_minimum_hole_size): New function.
2434 (Output_fill_debug_info::do_write): New function.
2435 (Output_fill_debug_line::do_minimum_hole_size): New function.
2436 (Output_fill_debug_line::do_write): New function.
2437 (Output_section::Output_section): Initialize new data member.
2438 (Output_section::set_final_data_size): Ensure patch space is larger
2439 than minimum hole size.
2440 (Output_section::do_write): Fill holes in debug sections.
2441 * output.h (Output_fill): New class.
2442 (Output_fill_debug_info): New class.
2443 (Output_fill_debug_line): New class.
2444 (Output_section::set_free_space_fill): New function.
2445 (Output_section::free_space_fill_): New data member.
2446 * testsuite/Makefile.am (incremental_test_3): Add
2447 --incremental-patch option.
2448 (incremental_test_4): Likewise.
2449 (incremental_test_5): Likewise.
2450 (incremental_test_6): Likewise.
2451 (incremental_copy_test): Likewise.
2452 (incremental_common_test_1): Likewise.
2453 * testsuite/Makefile.in: Regenerate.
2454
7cf80422
NC
24552011-08-26 Nick Clifton <nickc@redhat.com>
2456
2457 * po/es.po: Updated Spanish translation.
2458
c3f7b0e5
CC
24592011-08-01 Cary Coutant <ccoutant@google.com>
2460
2461 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2462 * gold/testsuite/Makefile.in: Regenerate.
2463 * gold/testsuite/justsyms_exec.c: New source file.
2464 * gold/testsuite/justsyms_lib.c: New source file.
2465
9590bf25
CC
24662011-08-01 Cary Coutant <ccoutant@google.com>
2467
2468 * layout.cc (Layout::set_segment_offsets): Don't realign text
2469 segment if -Ttext was specified.
2470 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2471 file type.
2472 * object.h (Sized_relobj_file::e_type): New function.
2473 (Sized_relobj_file::e_type_): New data member.
2474 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2475 base address for ET_EXEC files.
2476 * target.cc (Target::do_make_elf_object_implementation): Allow
2477 ET_EXEC files with --just-symbols option.
2478
dcd8d12e
CC
24792011-07-28 Cary Coutant <ccoutant@google.com>
2480
2481 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2482 Add thread_number parameter.
2483 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2484 * workqueue-threads.cc
2485 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2486 current thread if its thread number is greater than desired thread
2487 count.
2488 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2489 Add thread_number parameter.
2490 (Workqueue::should_cancel_thread): Likewise.
2491 (Workqueue::find_runnable_or_wait): Pass thread_number to
2492 should_cancel_thread.
2493 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2494 parameter.
2495
804eb480
ST
24962011-07-22 Sriraman Tallam <tmsriram@google.com>
2497
2498 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2499 only after checking if it cannot be forced local.
2500 * symtab.h (is_externally_visible): Check if the symbol is not forced
2501 local.
2502
f1ddb600
ILT
25032011-07-15 Ian Lance Taylor <iant@google.com>
2504
2505 * options.h (class General_options): Add --print-output-format.
2506 Move -EL next to -EB, for better --help output.
2507 * target-select.cc: Include <cstdio>, "options.h", and
2508 "parameters.h".
2509 (Target_selector::do_target_bfd_name): New function.
2510 (print_output_format): New function.
2511 * target-select.h (class Target_selector): Update declarations.
2512 (Target_selector::target_bfd_name): New function.
2513 (print_output_format): Declare.
2514 * main.cc: Include "target-select.h".
2515 (main): Handle --print-output-format.
2516 * gold.cc: Include "target-select.h".
2517 (queue_initial_tasks): Handle --print-output-format when there are
2518 no input files.
2519 * parameters.cc (parameters_force_valid_target): Give a better
2520 error message if -EB/-EL does not match target.
2521 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2522 function.
2523
7d172687
ILT
25242011-07-15 Ian Lance Taylor <iant@google.com>
2525
2526 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2527 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2528 (Output_data_plt_i386::do_write): Write address of .dynamic
2529 section to first entry in .got.plt section.
2530 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2531 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2532 Initialize layout_.
2533 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2534 section to first entry in .got.plt section.
2535 * layout.h (Layout::dynamic_section): New function.
2536
e9552f7e
ST
25372011-07-13 Sriraman Tallam <tmsriram@google.com>
2538
2539 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2540 to claim_file call.
2541 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2542 input_section_position_, and input_section_glob_.
2543 (read_layout_from_file): Call function section_ordering_specified.
2544 * layout.h (is_section_ordering_specified): New function.
2545 (section_ordering_specified): New function.
2546 (section_ordering_specified_): New boolean member.
2547 * main.cc(main): Call load_plugins after layout object is defined.
2548 * output.cc (Output_section::add_input_section): Use
2549 function section_ordering_specified to check if section ordering is
2550 needed.
2551 * output.cc (Output_section::add_relaxed_input_section): Use
2552 function section_ordering_specified to check if section ordering is
2553 needed.
2554 (Output_section::update_section_layout): New function.
2555 (Output_section::sort_attached_input_sections): Check if input section
2556 must be reordered.
2557 * output.h (Output_section::update_section_layout): New function.
2558 * plugin.cc (get_section_count): New function.
2559 (get_section_type): New function.
2560 (get_section_name): New function.
2561 (get_section_contents): New function.
2562 (update_section_order): New function.
58797674 2563 (allow_section_ordering): New function.
e9552f7e
ST
2564 (Plugin::load): Add the new interfaces to the transfer vector.
2565 (Plugin_manager::load_plugins): New parameter.
2566 (Plugin_manager::all_symbols_read): New parameter.
2567 (Plugin_manager::claim_file): New parameter. Save the elf object for
2568 unclaimed objects.
2569 (Plugin_manager::get_elf_object): New function.
2570 (Plugin_manager::get_view): Change to directly use the bool to check
2571 if get_view is called from claim_file_hook.
2572 * plugin.h (input_objects): New function
2573 (Plugin__manager::load_plugins): New parameter.
2574 (Plugin_manager::claim_file): New parameter.
2575 (Plugin_manager::get_elf_object): New function.
2576 (Plugin_manager::in_claim_file_handler): New function.
2577 (Plugin_manager::in_claim_file_handler_): New member.
2578 (layout): New function.
2579 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2580 handler with an extra parameter. Make the elf object before calling
2581 claim_file handler.
2582 * testsuite/plugin_test.c (get_section_count): New function pointer.
2583 (get_section_type): New function pointer.
2584 (get_section_name): New function pointer.
2585 (get_section_contents): New function pointer.
2586 (update_section_order): New function pointer.
2587 (allow_section_ordering): New function pointer.
2588 (onload): Check if the new interfaces exist.
2589
9446efde
ILT
25902011-07-13 Ian Lance Taylor <iant@google.com>
2591
2592 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2593 relro section.
2594 * x86_64.cc (Target_x86_64::got_section): Likewise.
2595 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2596 (relro_now_test_SOURCES): New variable.
2597 (relro_now_test_DEPENDENCIES): New variable.
2598 (relro_now_test_LDFLAGS): New variable.
2599 (relro_now_test_LDADD): New variable.
2600 (relro_now_test.so): New target.
2601 * testsuite/Makefile.in: Rebuild.
2602
07aa62f2
ILT
26032011-07-12 Ian Lance Taylor <iant@google.com>
2604
2605 PR gold/12980
2606 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2607 GLOB_DAT relocation rather than a RELATIVE relocation for a
2608 protected symbol when creating a shared library.
2609 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2610 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2611 * testsuite/protected_main_1.cc (main): Test that protected
2612 function has same address.
2613
e2153196
ILT
26142011-07-11 Ian Lance Taylor <iant@google.com>
2615
2616 PR gold/12979
2617 * options.h (class General_options): Add -Bgroup.
2618 * options.cc (General_options::finalize): If -Bgroup is set,
2619 default to --unresolved-symbols=report-all.
2620 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2621 * target-reloc.h (issue_undefined_symbol_error): Handle
2622 --unresolved-symbols=report-all.
2623
6daf5215
ILT
26242011-07-08 Ian Lance Taylor <iant@google.com>
2625
2626 PR gold/11985
2627 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2628 if linker script discards key sections.
2629 (Layout::create_dynamic_symtab): Likewise.
2630 (Layout::assign_local_dynsym_offsets): Likewise.
2631 (Layout::sized_create_version_sections): Likewise.
2632 (Layout::create_interp): Likewise.
2633 (Layout::finish_dynamic_section): Likewise.
2634 (Layout::set_dynamic_symbol_size): Likewise.
2635
beabb2c6
ILT
26362011-07-08 Ian Lance Taylor <iant@google.com>
2637
2638 PR gold/12386
2639 * options.h (class General_options): Add --unresolved-symbols.
2640 * target-reloc.h (issue_undefined_symbol_error): Check
2641 --unresolved-symbols. Add comments.
2642
9c16daf1
ILT
26432011-07-08 Ian Lance Taylor <iant@google.com>
2644
2645 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2646 expression more complex.
2647
191f1a2d
ILT
26482011-07-08 Ian Lance Taylor <iant@google.com>
2649
2650 PR gold/11317
2651 * target-reloc.h (issue_undefined_symbol_error): New inline
2652 function, broken out of relocate_section.
2653 (relocate_section): Call issue_undefined_symbol_error.
2654 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2655 there is no TLS segment if we are about to issue an undefined
2656 symbol error.
2657 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2658
62855347
ILT
26592011-07-08 Ian Lance Taylor <iant@google.com>
2660
2661 PR gold/12279
2662 * resolve.cc (Symbol_table::should_override): Add fromtype
2663 parameter. Change all callers. Give error when linking together
2664 TLS and non-TLS symbol.
2665 (Symbol_table::should_override_with_special): Add fromtype
2666 parameter. Change all callers.
2667 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2668 there is no TLS segment if we have reported some errors.
2669 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2670
67181c72
ILT
26712011-07-08 Ian Lance Taylor <iant@google.com>
2672
2673 PR gold/12372
2674 * target.h (Target::plt_address_for_global): New function.
2675 (Target::plt_address_for_local): New function.
2676 (Target::plt_section_for_global): Remove.
2677 (Target::plt_section_for_local): Remove.
2678 (Target::do_plt_address_for_global): New virtual function.
2679 (Target::do_plt_address_for_local): New virtual function.
2680 (Target::do_plt_section_for_global): Remove.
2681 (Target::do_plt_section_for_local): Remove.
2682 (Target::register_global_plt_entry): Add Symbol_table and Layout
2683 parameters.
2684 * output.cc (Output_data_got::Got_entry::write): Use
2685 plt_address_for_global and plt_address_for_local.
2686 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2687 address of output section.
2688 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2689 got_irelative_, and irelative_count_ fields. Update
2690 declarations.
2691 (Output_data_plt_i386::has_irelative_section): New function.
2692 (Output_data_plt_i386::entry_count): Add irelative_count_.
2693 (Output_data_plt_i386::set_final_data_size): Likewise.
2694 (class Target_i386): Add got_irelative_ and rel_irelative_
2695 fields. Update declarations.
2696 (Target_i386::Target_i386): Initialize new fields.
2697 (Target_i386::do_plt_address_for_global): New function replacing
2698 do_plt_section_for_global.
2699 (Target_i386::do_plt_address_for_local): New function replacing
2700 do_plt_section_for_local.
2701 (Target_i386::got_section): Create got_irelative_.
2702 (Target_i386::rel_irelative_section): New function.
2703 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2704 fields. Don't define __rel_iplt_{start,end}.
2705 (Output_data_plt_i386::add_entry): Add symtab and layout
2706 parameters. Change all callers. Use different PLT and GOT for
2707 IFUNC symbols.
2708 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2709 layout parameters. Change all callers. Use different PLT and
2710 GOT.
2711 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2712 (Output_data_plt_i386::rel_irelative): New function.
2713 (Output_data_plt_i386::address_for_global): New function.
2714 (Output_data_plt_i386::address_for_local): New function.
2715 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2716 IRELATIVE GOT when changing IFUNC GOT entries.
2717 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2718 reloc.
2719 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2720 if we didn't create an IRELATIVE GOT.
2721 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2722 plt_address_for_local.
2723 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2724 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2725 got_irelative_, and irelative_count_ fields. Update
2726 declarations.
2727 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2728 Initialize new fields. Remove symtab parameter. Change all
2729 callers.
2730 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2731 irelative_count_.
2732 (Output_data_plt_x86_64::has_irelative_section): New function.
2733 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2734 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2735 fields. Update declarations.
2736 (Target_x86_64::Target_x86_64): Initialize new fields.
2737 (Target_x86_64::do_plt_address_for_global): New function replacing
2738 do_plt_section_for_global.
2739 (Target_x86_64::do_plt_address_for_local): New function replacing
2740 do_plt_section_for_local.
2741 (Target_x86_64::got_section): Create got_irelative_.
2742 (Target_x86_64::rela_irelative_section): New function.
2743 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2744 all callers. Don't create __rel_iplt_{start,end}.
2745 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2746 parameters. Change all callers. Use different PLT and GOT for
2747 IFUNC symbols.
2748 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2749 layout parameters. Change all callers. Use different PLT and
2750 GOT.
2751 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2752 parameters. Change all callers. Use different PLT and GOT for
2753 IFUNC symbols.
2754 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2755 (Output_data_plt_x86_64::rela_irelative): New function.
2756 (Output_data_plt_x86_64::address_for_global): New function.
2757 (Output_data_plt_x86_64::address_for_local): New function.
2758 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2759 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2760 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2761 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2762 parameters.
2763 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2764 reloc.
2765 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2766 symbols if we didn't create an IRELATIVE GOT.
2767 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2768 plt_address_for_local.
2769 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2770 * testsuite/ifuncvar1.c: New test file.
2771 * testsuite/ifuncvar2.c: New test file.
2772 * testsuite/ifuncvar3.c: New test file.
2773 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2774 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2775 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2776 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2777 * testsuite/Makefile.in: Rebuild.
2778
33c15b45
CC
27792011-07-07 Cary Coutant <ccoutant@google.com>
2780
2781 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2782 (two_file_test_1_ndebug.o): Likewise.
2783 (two_file_test_1b_ndebug.o): Likewise.
2784 (two_file_test_2_ndebug.o): Likewise.
2785 (two_file_test_main_ndebug.o): Likewise.
2786 (incremental_test_2): Link with no-debug versions.
2787
f48b5fb7
CC
27882011-07-06 Cary Coutant <ccoutant@google.com>
2789
2790 * gold/incremental.cc
2791 (Output_section_incremental_inputs::write_info_blocks): Check for
2792 hidden and internal symbols.
2793
221597a5
CC
27942011-07-06 Cary Coutant <ccoutant@google.com>
2795
2796 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2797 Check disposition for startup file.
2798 (Incremental_inputs::report_command_line): Ignore
2799 --incremental-startup-unchanged option.
2800 * options.cc (General_options::parse_incremental_startup_unchanged):
2801 New function.
2802 (General_options::General_options): Initialize new data member.
2803 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2804 (General_options): Add --incremental-startup-unchanged option.
2805 (General_options::incremental_startup_disposition): New function.
2806 (General_options::incremental_startup_disposition_): New data member.
2807
e24719f6
CC
28082011-07-06 Cary Coutant <ccoutant@google.com>
2809
2810 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2811 input file index to Script_info ctor.
2812 (Sized_incremental_binary::do_file_has_changed): Find the
2813 command-line argument for files named in scripts.
2814 * incremental.h (Script_info::Script_info): New ctor
2815 with input file index.
2816 (Script_info::input_file_index): New function.
2817 (Script_info::input_file_index_): New data member.
2818 (Incremental_binary::get_library): Add const.
2819 (Incremental_binary::get_script_info): Add const.
2820 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2821 * testsuite/Makefile.am (incremental_test_5): New test case.
2822 (incremental_test_6): New test case.
2823 * testsuite/Makefile.in: Regenerate.
2824
8f7c81e8
CC
28252011-07-06 Cary Coutant <ccoutant@google.com>
2826
2827 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2828 debug output when command lines differ.
2829
9fbd3822
CC
28302011-07-06 Cary Coutant <ccoutant@google.com>
2831
2832 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2833 --incremental-patch option.
2834 * layout.cc (Free_list::allocate): Extend allocation beyond original
2835 end if enabled.
2836 (Layout::make_output_section): Mark sections that should get
2837 patch space.
2838 * options.cc (parse_percent): New function.
2839 * options.h (parse_percent): New function.
2840 (DEFINE_percent): New macro.
2841 (General_options): Add --incremental-patch option.
2842 * output.cc (Output_section::Output_section): Initialize new data
2843 members.
2844 (Output_section::add_input_section): Print section name when out
2845 of patch space.
2846 (Output_section::add_output_section_data): Likewise.
2847 (Output_section::set_final_data_size): Add patch space when
2848 doing --incremental-full.
2849 (Output_section::do_reset_address_and_file_offset): Remove patch
2850 space.
2851 (Output_segment::set_section_list_addresses): Print debug output
2852 only if --incremental-update.
2853 * output.h (Output_section::set_is_patch_space_allowed): New function.
2854 (Output_section::is_patch_space_allowed_): New data member.
2855 (Output_section::patch_space_): New data member.
2856 * parameters.cc (Parameters::incremental_full): New function.
2857 * parameters.h (Parameters::incremental_full): New function
2858 * testsuite/Makefile.am (incremental_test_2): Add test for
2859 --incremental-patch option.
2860 * testsuite/Makefile.in: Regenerate.
2861 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2862 (t18): Remove function body.
2863
f6cccc2c
DK
28642011-07-05 Doug Kwan <dougkwan@google.com>
2865
2866 PR gold/12771
2867 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2868 Arm_Address type for relocation result.
2869 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2870 overflow check.
2871 (Arm_relocate_functions::abs32): Use unaligned access.
2872 (Arm_relocate_functions::rel32): Ditto.
2873 (Arm_relocate_functions::prel31): Ditto.
2874 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2875 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2876 static data relocations.
2877 * testsuite/Makefile.in: Regnerate.
2878 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2879
28a13fec
ILT
28802011-07-05 Ian Lance Taylor <iant@google.com>
2881
2882 PR gold/12392
2883 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2884 symbols if necessary.
2885 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2886
24d47b34
ILT
28872011-07-05 Ian Lance Taylor <iant@google.com>
2888
2889 PR gold/12952
2890 * resolve.cc (Symbol::override_base_with_special): Simply override
2891 version with special symbol version, ignoring previous version.
2892
41f9cbbe
ILT
28932011-07-05 Ian Lance Taylor <iant@google.com>
2894
2895 * object.cc (Sized_relobj_file::include_section_group): Add
2896 information to comment about signature location.
2897
886288f1
ILT
28982011-07-02 Ian Lance Taylor <iant@google.com>
2899
2900 PR gold/12957
2901 * options.h (class General_options): Add -f and -F.
2902 * options.cc (General_options::finalize): Fatal error if -f/-F
2903 are used without -shared.
2904 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2905
ae3a6d4f
ILT
29062011-07-02 Ian Lance Taylor <iant@google.com>
2907
2908 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2909
21131061
ILT
29102011-07-01 Ian Lance Taylor <iant@google.com>
2911
2912 PR gold/12525
2913 PR gold/12952
2914 * resolve.cc (Symbol::override_base_with_special): Don't override
2915 the version if the overriding symbol has a different name.
2916 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2917 all callers. If we give an error about an undefined version,
2918 define the base version if necessary.
2919 * dynobj.h (class Versions): Update declaration.
2920 * testsuite/weak_alias_test_5.cc: New file.
2921 * testsuite/weak_alias_test.script: New file.
2922 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2923 and versioned_alias have the right value, and call t2.
2924 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2925 weak_alias_test_5.so.
2926 (weak_alias_test_LDADD): Likewise.
2927 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2928 * testsuite/Makefile.in: Rebuild.
2929
611062c0
ILT
29302011-07-01 Ian Lance Taylor <iant@google.com>
2931
2932 PR gold/12525
2933 * options.h (class General_options): Support -z notext.
2934 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2935 -Wl,-z,notext.
2936 (two_file_shared_nonpic.so): Likewise.
2937 (two_file_shared_mixed.so): Likewise.
2938 (two_file_shared_mixed_1.so): Likewise.
2939 (weak_undef_lib_nonpic.so): Likewise.
2940 (alt/weak_undef_lib_nonpic.so): Likewise.
2941 (tls_test_shared_nonpic.so): Likewise.
2942 * testsuite/Makefile.in: Rebuild.
2943
328c7c2f
ILT
29442011-07-01 Ian Lance Taylor <iant@google.com>
2945
2946 PR gold/12525
2947 * configure.ac: Test whether static linking works, setting
2948 the automake conditional HAVE_STATIC.
2949 * testsuite/Makefile.am: Disable tests using -static if
2950 HAVE_STATIC is not true.
2951 * configure, testsuite/Makefile.in: Rebuild.
2952
02d7cd44
ILT
29532011-07-01 Ian Lance Taylor <iant@google.com>
2954
2955 PR gold/12525
2956 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2957 Assert if we see DW_EH_PE_indirect.
2958 * target.h (Target::ehframe_datarel_base): New function.
2959 (Target::do_ehframe_datarel_base): New target function.
2960 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2961 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2962 function.
2963
07a60597
ILT
29642011-07-01 Ian Lance Taylor <iant@google.com>
2965
2966 PR gold/12571
2967 * options.h (class General_options): Add
2968 --ld-generated-unwind-info.
2969 * ehframe.cc (Fde::write): Add address parameter. Change all
2970 callers. If associated with PLT, fill in address and size.
2971 (Cie::set_output_offset): Only add merge mapping if there is an
2972 object.
2973 (Cie::write): Add address parameter. Change all callers.
2974 (Eh_frame::add_ehframe_for_plt): New function.
2975 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2976 input_offset_ fields into union u_, with new plt field.
2977 (Fde::Fde): Adjust for new union field.
2978 (Fde::Fde) [Output_data version]: New constructor.
2979 (Fde::add_mapping): Only add merge mapping if there is an object.
2980 (class Cie): Update declarations.
2981 (class Eh_frame): Declare add_ehframe_for_plt.
2982 * layout.cc (Layout::layout_eh_frame): Break out code into
2983 make_eh_frame_section, and call it.
2984 (Layout::make_eh_frame_section): New function.
2985 (Layout::add_eh_frame_for_plt): New function.
2986 * layout.h (class Layout): Update declarations.
2987 * merge.cc (Merge_map::add_mapping): Add assertion.
2988 * i386.cc: Include "dwarf.h".
2989 (class Output_data_plt_i386): Make first_plt_entry,
2990 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2991 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2992 and plt_eh_frame_fde.
2993 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2994 boundary. Call add_eh_frame_for_plt if appropriate.
2995 * x86_64.cc: Include "dwarf.h".
2996 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2997 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2998 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2999 and plt_eh_frame_fde.
3000 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3001 appropriate.
3002
14788a3f
ILT
30032011-06-29 Ian Lance Taylor <iant@google.com>
3004
3005 PR gold/12629
3006 * object.cc (Sized_relobj_file::layout_section): Change shdr
3007 parameter to be const.
3008 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3009 out of do_layout.
3010 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3011 appropriate. Call layout_eh_frame_section.
3012 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3013 sections.
3014 * object.h (class Sized_relobj_file): Update declarations.
3015
6c21fce1
ILT
30162011-06-29 Ian Lance Taylor <iant@google.com>
3017
37e41b03 3018 PR gold/12652
6c21fce1
ILT
3019 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3020 modifier.
3021 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3022
4d5e4e62
ILT
30232011-06-29 Ian Lance Taylor <iant@google.com>
3024
3025 PR gold/12675
3026 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3027 SHT_X86_64_UNWIND.
3028 * layout.cc (Layout::layout_eh_frame): Likewise.
3029
886f533a
ILT
30302011-06-29 Ian Lance Taylor <iant@google.com>
3031
3032 PR gold/12695
3033 * layout.cc (Layout::symtab_section_shndx): New function.
3034 * layout.h (class Layout): Declare symtab_section_shndx.
3035 * output.cc (Output_section::write_header): Call it.
3036
f3ae1b28
ILT
30372011-06-29 Ian Lance Taylor <iant@google.com>
3038
3039 PR gold/12818
3040 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3041 symbols which are not used in a relocation.
3042
aecf301f
ILT
30432011-06-28 Ian Lance Taylor <iant@google.com>
3044
3045 PR gold/12898
3046 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3047 script create indistinguishable segments.
3048 (Layout::set_segment_offsets): Use stable_sort when sorting
3049 segments. Pass this to Compare_segments constructor.
3050 * layout.h (class Layout): Make segment_precedes non-static.
3051 (class Compare_segments): Change from struct to class. Add
3052 layout_ field. Add constructor.
3053 * script-sections.cc
3054 (Script_sections::attach_sections_using_phdrs_clause): Rename
3055 local orphan to is_orphan. Don't report failure to put empty
3056 section in segment. On attachment failure, report name of
3057 section, and attach to first PT_LOAD segment.
3058
03ef7571
ILT
30592011-06-28 Ian Lance Taylor <iant@google.com>
3060
3061 PR gold/12934
3062 * target-select.cc (Target_selector::Target_selector): Add
3063 emulation parameter. Change all callers.
3064 (select_target_by_bfd_name): Rename from select_target_by_name.
3065 Change all callers.
3066 (select_target_by_emulation): New function.
3067 (supported_emulation_names): New function.
3068 * target-select.h (class Target_selector): Add emulation_ field.
3069 Update declarations.
3070 (Target_selector::recognize_by_bfd_name): Rename from
3071 recognize_by_name. Change all callers.
3072 (Target_selector::supported_bfd_names): Rename from
3073 supported_names. Change all callers.
3074 (Target_selector::recognize_by_emulation): New function.
3075 (Target_selector::supported_emulations): New function.
3076 (Target_selector::emulation): New function.
3077 (Target_selector::do_recognize_by_bfd_name): Rename from
3078 do_recognize_by_name. Change all callers.
3079 (Target_selector::do_supported_bfd_names): Rename from
3080 do_supported_names. Change all callers.
3081 (Target_selector::do_recognize_by_emulation): New function.
3082 (Target_selector::do_supported_emulations): New function.
3083 (select_target_by_bfd_name): Change name in declaration.
3084 (select_target_by_emulation): Declare.
3085 (supported_emulation_names): Declare.
3086 * parameters.cc (parameters_force_valid_target): Try to find
3087 target based on emulation from -m option.
3088 * options.h (class General_options): Change doc string for -m.
3089 * options.cc (help): Print emulations.
3090 (General_options::parse_V): Likewise.
3091 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3092 Add emulation parameter. Change all callers.
3093
200b2bb9
ILT
30942011-06-28 Ian Lance Taylor <iant@google.com>
3095
3096 * target.h (class Target): Add osabi_ field.
3097 (Target::osabi): New function.
3098 (Target::set_osabi): New function.
3099 (Target::Target): Initialize osabi_.
3100 (Target::do_adjust_elf_header): Make pure virtual.
3101 (Sized_target::do_adjust_elf_header): Declare.
3102 * target.cc (Sized_target::do_adjust_elf_header): New function.
3103 (class Sized_target): Instantiate all versions.
3104 * freebsd.h (class Target_freebsd): Remove.
3105 (Target_selector_freebsd::do_recognize): Call set_osabi on
3106 Target.
3107 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3108 (Target_selector_freebsd::set_osabi): Remove.
3109 * i386.cc (class Target_i386): Inherit from Sized_target rather
3110 than Target_freebsd.
3111 * x86_64.cc (class Target_x86_64): Likewise.
3112
b3ce541e
ILT
31132011-06-28 Ian Lance Taylor <iant@google.com>
3114
3115 * target.h (Target::can_check_for_function_pointers): Rewrite.
3116 Make non-virtual.
3117 (Target::can_icf_inline_merge_sections): Likewise.
3118 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3119 (Target::Target_info): Add can_icf_inline_merge_sections field.
3120 (Target::do_can_check_for_function_pointers): New virtual
3121 function.
3122 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3123 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3124 from can_check_for_function_pointers, move in file.
3125 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3126 section_may_have_icf_unsafe_poineters, move in file.
3127 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3128 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3129 Rename from can_check_for_function_pointers, move in file.
3130 (Target_i386::can_icf_inline_merge_sections): Remove.
3131 (Target_i386::i386_info): Initialize
3132 can_icf_inline_merge_sections.
3133 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3134 Initialize can_icf_inline_merge_sections.
3135 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3136 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3137 Rename from can_check_for_function_pointers, move in file.
3138 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3139 (Target_x86_64::x86_64_info): Initialize
3140 can_icf_inline_merge_sections.
3141 * testsuite/testfile.cc (Target_test::test_target_info):
3142 Likewise.
3143 * icf.cc (get_section_contents): Correct formatting.
3144
6d1c4efb
ILT
31452011-06-27 Ian Lance Taylor <iant@google.com>
3146
3147 * symtab.cc (Symbol::versioned_name): New function.
3148 (Symbol_table::add_to_final_symtab): Use versioned_name when
3149 appropriate.
3150 (Symbol_table::sized_write_symbol): Likewise.
3151 * symtab.h (class Symbol): Declare versioned_name.
3152 * stringpool.h (class Stringpool_template): Add variant of add
3153 which takes a std::basic_string.
3154 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3155 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3156 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3157 (ver_test_12.o): New target.
3158 * testsuite/Makefile.in: Rebuild.
3159
57eb9b50
DK
31602011-06-27 Doug Kwan <dougkwan@google.com>
3161
3162 * arm.cc (Arm_relocate_functions::thm_jump8,
3163 Arm_relocate_functions::thm_jump11): Use a wider signed
3164 type to compute offset.
3165 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3166 arm_thm_jump8.
3167 * testsuite/Makefile.in: Regenerate.
3168 * testsuite/arm_branch_in_range.sh: Check test results of
3169 arm_thm_jump11 and arm_thm_jump8.
3170 * testsuite/arm_thm_jump11.s: New test source file.
3171 * testsuite/arm_thm_jump11.t: New linker script.
3172 * testsuite/arm_thm_jump8.s: New test source file.
3173 * testsuite/arm_thm_jump8.t: New linker script.
3174
487b39df
ILT
31752011-06-24 Ian Lance Taylor <iant@google.com>
3176
3177 * layout.cc: Include "object.h".
3178 (ctors_sections_in_init_array): New static variable.
3179 (Layout::is_ctors_in_init_array): New function.
3180 (Layout::layout): Add entry to ctors_sections_in_init_array if
3181 appropriate.
3182 * layout.h (class Layout): Declare is_ctors_in_init_array.
3183 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3184 is_ctors_reverse_view is set.
3185 (Sized_relobj_file::write_sections): Add layout parameter. Change
3186 all callers. Set is_ctors_reverse_view field of View_size.
3187 (Sized_relobj_file::reverse_words): New function.
3188 * object.h (Sized_relobj_file::View_size): Add
3189 is_ctors_reverse_view field.
3190 (class Sized_relobj_file): Update declarations.
3191 * testsuite/initpri3.c: New test.
3192 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3193 initpri3b.
3194 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3195 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3196 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3197 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3198 * testsuite/Makefile.in: Rebuild.
3199
472076e4
CC
32002011-06-24 Cary Coutant <ccoutant@google.com>
3201
3202 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3203 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3204 (debug_msg_cdebug.err): New targets.
3205 * testsuite/Makefile.in: Regenerate.
3206 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3207 Fix checks for link with shared library.
3208
a60af0db
DK
32092011-06-24 Doug Kwan <dougkwan@google.com>
3210
3211 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3212 skip empty text sections.
3213 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3214
5393d741
ILT
32152011-06-22 Ian Lance Taylor <iant@google.com>
3216
3217 PR gold/12910
3218 * options.h (class General_options): Add --ctors-in-init-array.
3219 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3220 friends as SHT_PROGBITS for merging sections.
3221 (Layout::layout): Remove special handling of .init_array and
3222 friends. Don't sort if doing relocatable link. Sort for .ctors
3223 and .dtors if ctors_in_init_array.
3224 (Layout::make_output_section): Force correct section types for
3225 .init_array and friends. Don't sort if doing relocatable link,
3226 Don't sort .ctors and .dtors if ctors_in_init_array.
3227 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3228 (Layout::output_section_name): Add relobj parameter. Change all
3229 callers. Handle .ctors. and .dtors. in code rather than table.
3230 Handle .ctors and .dtors if ctors_in_init_array.
3231 (Layout::match_file_name): New function, moved from output.cc.
3232 * layout.h (class Layout): Update declarations.
3233 * output.cc: Include "layout.h".
3234 (Input_section_sort_entry::get_priority): New function.
3235 (Input_section_sort_entry::match_file_name): Just call
3236 Layout::match_file_name.
3237 (Output_section::Input_section_sort_init_fini_compare::operator()):
3238 Handle .ctors and .dtors. Sort by explicit priority rather than
3239 by name.
3240 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3241 * testsuite/initpri2.c: New test.
3242 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3243 (check_PROGRAMS): Add initpri2.
3244 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3245 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3246 * configure, testsuite/Makefile.in: Rebuild.
3247
e1f74f98
ILT
32482011-06-19 Ian Lance Taylor <iant@google.com>
3249
3250 PR gold/12880
3251 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3252 .interp section to a PT_INTERP segment even if we have seen a
3253 --dynamic-linker option. Don't do it if we have seen a PHDRS
3254 clause in a linker script.
3255 (Layout::finalize): Don't create a .interp section if we've
3256 already create a PT_INTERP segment.
3257 (Layout::create_interp): Always call choose_output_section (revert
3258 patch of 2011-06-17). Don't create PT_INTERP segment.
3259 * script-sections.cc
3260 (Script_sections::create_note_and_tls_segments): Add a .interp
3261 section to a PT_INTERP segment even if we have seen a
3262 --dynamic-linker option.
3263
766f91bb
ILT
32642011-06-18 Ian Lance Taylor <iant@google.com>
3265
3266 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3267 merely because a non-PT_LOAD segment has a dynamic reloc.
3268
0d212c3a
ILT
32692011-06-18 Ian Lance Taylor <iant@google.com>
3270
3271 * layout.cc (Layout::finish_dynamic_section): Don't create
3272 DT_FLAGS entry if not needed.
3273
911a5072
ILT
32742011-06-18 Ian Lance Taylor <iant@google.com>
3275
3276 PR gold/12745
3277 * layout.cc (Layout::layout_eh_frame): Correct handling of
3278 writable .eh_frame section.
3279
534b4e5f
ILT
32802011-06-17 Ian Lance Taylor <iant@google.com>
3281
3282 PR gold/12893
3283 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3284 symbol is redefined with the exact same object and value.
3285
10b4f102
ILT
32862011-06-17 Ian Lance Taylor <iant@google.com>
3287
3288 PR gold/12880
3289 * layout.h (class Layout): Add interp_segment_ field.
3290 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3291 (Layout::attach_allocated_section_to_segment): If making shared
3292 library, put .interp section in PT_INTERP segment.
3293 (Layout::finalize): Also call create_interp if -dynamic-linker
3294 option was used.
3295 (Layout::create_interp): Assert that there is no PT_INTERP
3296 segment. If not using a SECTIONS clause, use make_output_section.
3297 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3298 * script-sections.cc
3299 (Script_sections::create_note_and_tls_segments): If making shared
3300 library, put .interp section in PT_INTERP segment.
3301
a29b0dad
ILT
33022011-06-17 Ian Lance Taylor <iant@google.com>
3303
e588ea8d
ILT
3304 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3305 when making a shared library.
3306
33072011-06-17 Ian Lance Taylor <iant@google.com>
3308
3309 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3310 parameter. Change all callers. Don't issue warning about PC32
3311 against locally defined symbol.
a29b0dad 3312
9d3b0698
ILT
33132011-06-16 Ian Lance Taylor <iant@google.com>
3314
3315 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3316 occurs in same object.
3317
85b0f90c
AM
33182011-06-14 Alan Modra <amodra@gmail.com>
3319
3320 * po/POTFILES.in: Regenerate.
3321
a94907d9
ILT
33222011-06-09 Ian Lance Taylor <iant@google.com>
3323
3324 * script-sections.cc
3325 (Orphan_output_section::set_section_addresses): For a relocatable
3326 link set address to 0.
3327
4fb3a1c3
CC
33282011-06-09 Cary Coutant <ccoutant@google.com>
3329
3330 PR gold/12804
3331 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3332 used with --compress-debug-sections.
3333 * gold/object.cc (Sized_relobj_file::do_layout): Report
3334 uncompressed size of compressed input sections.
3335
61220854
CC
33362011-06-08 Cary Coutant <ccoutant@google.com>
3337
3338 PR gold/12804
3339 * testsuite/two_file_test_2_v1.cc: Change initialization of
3340 v2 to keep it in .data.
3341
e6455dfb
CC
33422011-06-07 Cary Coutant <ccoutant@google.com>
3343
3344 * common.cc (Symbol_table::do_allocate_commons_list): Call
3345 gold_fallback.
3346 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3347 (Errors::fallback): New function.
3348 (gold_fallback): New function.
3349 * errors.h (Errors::fallback): New function.
3350 * gold.cc (gold_exit): Change status parameter to enum; adjust
3351 all callers.
3352 (queue_initial_tasks): Call gold_fallback.
3353 * gold.h: Include cstdlib.
3354 (Exit_status): New enum type.
3355 (gold_exit): Change status parameter to enum.
3356 (gold_fallback): New function.
3357 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3358 (Layout::create_symtab_sections): Likewise.
3359 (Layout::create_shdrs): Likewise.
3360 * main.cc (main): Adjust call to gold_exit.
3361 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3362 (Output_data_got::add_got_entry_pair): Likewise.
3363 (Output_section::add_input_section): Likewise.
3364 (Output_section::add_output_section_data): Likewise.
3365 (Output_segment::set_section_list_addresses): Likewise.
3366 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3367
fb0e076f
CC
33682011-06-07 Cary Coutant <ccoutant@google.com>
3369
3370 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3371 for incremental links.
3372 * output.cc (Output_segment::set_section_list_addresses): Remove
3373 FIXME and test for TLS or BSS.
3374
a5ee4d5d
CC
33752011-06-07 Cary Coutant <ccoutant@google.com>
3376
3377 * testsuite/Makefile.am: Add incremental_copy_test,
3378 incremental_common_test_1.
3379 * testsuite/Makefile.in: Regenerate.
3380 * testsuite/common_test_1_v1.c: New source file.
3381 * testsuite/common_test_1_v2.c: New source file.
3382 * testsuite/copy_test_v1.cc: New source file.
3383
5146f448
CC
33842011-06-07 Cary Coutant <ccoutant@google.com>
3385
3386 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3387 update, allocate common from bss section's free list.
3388 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3389 linker-defined symbols.
3390 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3391 Skip GOT and PLT entries that are no longer referenced.
3392 (Output_section_incremental_inputs::write_info_blocks): Mark
3393 linker-defined symbols.
3394 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3395 * output.cc (Output_section::allocate): New function.
3396 * output.h (Output_section::allocate): New function.
3397 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3398 linker-defined symbols.
3399 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3400 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3401 (Symbol::init_base_output_data): Likewise.
3402 (Symbol::init_base_output_segment): Likewise.
3403 (Symbol::init_base_constant): Likewise.
3404 (Sized_symbol::init_output_data): Likewise.
3405 (Sized_symbol::init_output_segment): Likewise.
3406 (Sized_symbol::init_constant): Likewise.
3407 (Symbol_table::do_define_in_output_data): Likewise.
3408 (Symbol_table::do_define_in_output_segment): Likewise.
3409 (Symbol_table::do_define_as_constant): Likewise.
3410 * symtab.h (Symbol::is_predefined): New function.
3411 (Symbol::init_base_output_data): Add is_predefined parameter.
3412 (Symbol::init_base_output_segment): Likewise.
3413 (Symbol::init_base_constant): Likewise.
3414 (Symbol::is_predefined_): New data member.
3415 (Sized_symbol::init_output_data): Add is_predefined parameter.
3416 (Sized_symbol::init_output_segment): Likewise.
3417 (Sized_symbol::init_constant): Likewise.
3418 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3419
26d3c67d
CC
34202011-06-07 Cary Coutant <ccoutant@google.com>
3421
3422 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3423 instead of emit_copy_reloc.
3424 (Copy_relocs::emit_copy_reloc): Refactor.
3425 (Copy_relocs::make_copy_reloc): New function.
3426 (Copy_relocs::add_copy_reloc): Remove.
3427 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3428 section.
3429 (Copy_relocs::make_copy_reloc): New function.
3430 (Copy_relocs::add_copy_reloc): Remove.
3431 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3432 unchanged input files.
3433 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3434 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3435 Reserve BSS space for COPY relocations.
3436 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3437 (Output_section_incremental_inputs::write_info_blocks): Record
3438 whether a symbol is copied from a shared object.
3439 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3440 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3441 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3442 (Incremental_input_entry_reader::get_output_symbol_index): Add
3443 is_copy parameter.
3444 (Incremental_binary::emit_copy_relocs): New function.
3445 (Incremental_binary::do_emit_copy_relocs): New function.
3446 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3447 new data member.
3448 (Sized_incremental_binary::add_copy_reloc): New function.
3449 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3450 (Sized_incremental_binary::Copy_reloc): New struct.
3451 (Sized_incremental_binary::Copy_relocs): New typedef.
3452 (Sized_incremental_binary::copy_relocs_): New data member.
3453 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3454 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3455 * target.h (Sized_target::emit_copy_reloc): New function.
3456 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3457
7cdb37d9
CC
34582011-06-02 Cary Coutant <ccoutant@google.com>
3459
3460 PR gold/12163
3461 * gold/archive.cc (Archive::Archive): Initialize new data member.
3462 (Archive::include_all_members): Return if archive has already been
3463 included.
3464 * gold/archive.h (Archive::include_all_members_): New data member.
3465
cc643b88
NC
34662011-06-02 Nick Clifton <nickc@redhat.com>
3467
3468 * dynobj.h: Fix spelling mistake in comment.
3469 * output.cc: Likewise.
3470
f62a3ca7 34712011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3472 Asier Llano
f62a3ca7
DK
3473
3474 PR gold/12826
cc643b88 3475 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3476 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3477 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3478 redundant arm_exidx_test.so.
3479 * testsuite/Makefile.in: Regenerate.
3480 (check_SCRIPTS): Add pr12826.sh
3481 (check_DATA): Add pr12826.stdout
3482 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3483 * testsuite/pr12826.sh: New file.
3484 * testsuite/pr12826_1.s: Ditto.
3485 * testsuite/pr12826_1.s: Ditto.
3486
8dbe1edc
ILT
34872011-05-30 Ian Lance Taylor <iant@google.com>
3488
3489 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3490 sections.
3491
c49875be
ILT
34922011-05-29 Ian Lance Taylor <iant@google.com>
3493
3494 PR gold/12804
3495 * testsuite/Makefile.am: Use different file name for two_file_test
3496 temporary file for each incremental test.
3497 * testsuite/Makefile.in: Rebuild.
3498
69d53f7a
ILT
34992011-05-29 Ian Lance Taylor <iant@google.com>
3500
3501 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3502 binary input file is empty.
3503
41d0ab5f
ILT
35042011-05-27 Ian Lance Taylor <iant@google.com>
3505
3506 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3507 (ver_test_9.so): Likewise.
3508 * testsuite/Makefile.in: Rebuild.
3509
89d8a36b
CC
35102011-05-26 Cary Coutant <ccoutant@google.com>
3511
3512 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3513 * incremental.cc (Incremental_inputs::report_input_section): Fix
3514 comment, indentation.
3515 (Incremental_inputs::report_comdat_group): New function.
3516 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3517 of data for incremental input file entry.
3518 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3519 group count, COMDAT group signatures.
3520 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3521 an unchanged input file.
3522 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3523 Initialize new data member.
3524 (Incremental_object_entry::add_comdat_group): New function.
3525 (Incremental_object_entry::get_comdat_group_count): New function.
3526 (Incremental_object_entry::get_comdat_signature_key): New function.
3527 (Incremental_object_entry::groups_): New data member.
3528 (Incremental_inputs::report_comdat_group): New function.
3529 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3530 data for incremental input file entry.
3531 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3532 (Incremental_input_entry_reader::get_input_section): Adjust size of
3533 data for incremental input file entry.
3534 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3535 (Incremental_input_entry_reader::get_comdat_group_signature): New
3536 function.
3537 * object.cc (Sized_relobj::include_section_group): Report kept
3538 COMDAT groups for incremental links.
3539
1706a06f
ILT
35402011-05-24 David Meyer <pdox@google.com>
3541
3542 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3543 with name parameter. Add found_name parameter.
3544 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3545 * dirsearch.h (class Dirsearch): Update declaration.
3546
a10ae760
ILT
35472011-05-24 Ian Lance Taylor <iant@google.com>
3548
3549 * archive.cc (Library_base::should_include_member): Pull in object
3550 from archive if it defines the entry symbol.
3551 * parameters.cc (Parameters::entry): New function.
3552 * parameters.h (class Parameters): Declare entry.
3553 * output.h (class Output_file_header): Remove entry_ field.
3554 * output.cc (Output_file_header::Output_file_header): Remove entry
3555 parameter. Change all callers.
3556 (Output_file_header::entry): Use parameters->entry.
3557 * gold.cc (queue_middle_tasks): Likewise.
3558 * plugin.cc (Plugin_hook::run): Likewise.
3559
aa92d6ed
CC
35602011-05-24 Cary Coutant <ccoutant@google.com>
3561
3562 * gold.cc (queue_initial_tasks): Pass incremental base filename
3563 to Output_file::open_base_file; don't print error message.
3564 * incremental-dump.cc (main): Adjust call to
3565 Output_file::open_for_modification.
3566 * incremental-dump.cc (main): Likewise.
3567 * incremental.cc (Incremental_inputs::report_command_line):
3568 Ignore --incremental-base option when comparing command lines.
3569 Ignore parameter when given as separate argument.
3570 * options.h (class General_options): Add --incremental-base.
3571 * output.cc (Output_file::Output_file):
3572 (Output_file::open_base_file): Add base_name and writable parameters;
3573 read base file into new file; print error message here.
3574 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3575 callers.
3576 * output.h (Output_file::open_for_modification): Rename to...
3577 (Output_file::open_base_file): ...this; add base_name and
3578 writable parameters; adjust all callers.
3579 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3580 callers.
3581 * testsuite/Makefile.am (incremental_test_4): Test
3582 --incremental-base.
3583 * testsuite/Makefile.in: Regenerate.
3584
2eedd706
CC
35852011-05-24 Cary Coutant <ccoutant@google.com>
3586
3587 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3588 incremental_test_4.
3589 * testsuite/Makefile.in: Regenerate.
3590 * testsuite/two_file_test_1_v1.cc: New test source file.
3591 * testsuite/two_file_test_1b_v1.cc: New test source file.
3592 * testsuite/two_file_test_2_v1.cc: New test source file.
3593
0f1c85a6
CC
35942011-05-24 Cary Coutant <ccoutant@google.com>
3595
3596 * dynobj.h (Dynobj::do_dynobj): New function.
3597 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3598 flag and soname for shared objects.
3599 * incremental.cc (Incremental_inputs::report_object): Make
3600 either Incremental_object_entry or Incremental_dynobj_entry; add
3601 soname to string table.
3602 (Incremental_inputs::report_input_section): Add assertion.
3603 (Output_section_incremental_inputs::set_final_data_size): Adjust
3604 type of input file entry for shared libraries; adjust size of
3605 shared library info entry.
3606 (Output_section_incremental_inputs::write_input_files): Write
3607 as_needed flag for shared libraries.
3608 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3609 of input file entry for shared libraries; write soname.
3610 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3611 soname from incremental info.
3612 * incremental.h (enum Incremental_input_flags): Add
3613 INCREMENTAL_INPUT_AS_NEEDED.
3614 (Incremental_input_entry::Incremental_input_entry): Initialize new
3615 data member.
3616 (Incremental_input_entry::set_as_needed): New function.
3617 (Incremental_input_entry::as_needed): New function.
3618 (Incremental_input_entry::do_dynobj_entry): New function.
3619 (Incremental_input_entry::as_needed_): New data member.
3620 (Incremental_object_entry::Incremental_object_entry): Don't check
3621 for shared library.
3622 (Incremental_object_entry::do_type): Likewise.
3623 (class Incremental_dynobj_entry): New class.
3624 (Incremental_input_entry_reader::as_needed): New function.
3625 (Incremental_input_entry_reader::get_soname): New function.
3626 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3627 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3628 size of shared library info entry.
58797674 3629 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3630 incremental link when adding DT_NEEDED entries.
3631 * object.h (Object::Object): Initialize new data member.
3632 (Object::dynobj): New function.
3633 (Object::set_as_needed): New function.
3634 (Object::as_needed): New function.
3635 (Object::do_dynobj): New function.
3636 (Object::as_needed_): New data member.
3637
6fa2a40b
CC
36382011-05-24 Cary Coutant <ccoutant@google.com>
3639
3640 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3641 info; adjust display of GOT entries.
3642 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3643 vector of input objects; remove file_status_.
3644 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3645 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3646 got_plt reader; call target hooks to reserve GOT entries.
3647 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3648 of input file info header and GOT info entry.
3649 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3650 relocation info.
3651 (Got_plt_view_info::got_descriptor): Remove.
3652 (Got_plt_view_info::sym_index): New data member.
3653 (Got_plt_view_info::input_index): New data member.
3654 (Local_got_offset_visitor::visit): Write input file index.
3655 (Global_got_offset_visitor::visit): Write 0 for input file index.
3656 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3657 with sym_index and input_index.
3658 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3659 incremental info GOT entry; replace got_descriptor with input_index.
3660 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3661 map from input file index to object.
3662 (Sized_relobj_incr::do_layout): Replace direct data member reference
3663 with accessor function.
3664 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3665 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3666 Adjust size of input file info header.
3667 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3668 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3669 (Incremental_input_entry_reader::get_input_section): Adjust size of
3670 input file info header.
3671 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3672 of incremental info GOT entry.
3673 (Incremental_got_plt_reader::get_got_desc): Remove.
3674 (Incremental_got_plt_reader::get_got_symndx): New function.
3675 (Incremental_got_plt_reader::get_got_input_index): New function.
3676 (Sized_incremental_binary::Sized_incremental_binary): Remove
3677 file_status_; add input_objects_.
3678 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3679 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3680 (Sized_incremental_binary::file_is_unchanged): Remove.
3681 (Sized_incremental_binary::set_input_object): New function.
3682 (Sized_incremental_binary::input_object): New function.
3683 (Sized_incremental_binary::file_status_): Remove.
3684 (Sized_incremental_binary::input_objects_): New data member.
3685 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3686 references.
3687 (Sized_relobj_incr::invalid_address): Move to base class.
3688 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3689 class.
3690 (Sized_relobj_incr::do_output_section_offset): Likewise.
3691 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3692 (Sized_relobj_incr::section_offsets_): Likewise.
3693 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3694 function.
3695 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3696 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3697 with accessor function.
3698 (Sized_relobj_file::do_layout): Likewise.
3699 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3700 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3701 (Sized_relobj_file::compute_final_local_value): Replace refs to
3702 section_offsets_ with accessor function.
3703 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3704 * object.h (Relobj::Relobj): Initialize new data members.
3705 (Relobj::add_dyn_reloc): New function.
3706 (Relobj::first_dyn_reloc): New function.
3707 (Relobj::dyn_reloc_count): New function.
3708 (Relobj::first_dyn_reloc_): New data member.
3709 (Relobj::dyn_reloc_count_): New data member.
3710 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3711 references.
3712 (Sized_relobj::Address): New typedef.
3713 (Sized_relobj::invalid_address): Move here from child class.
3714 (Sized_relobj::Sized_relobj): Initialize new data members.
3715 (Sized_relobj::sized_relobj): New function.
3716 (Sized_relobj::is_output_section_offset_invalid): Move here from
3717 child class.
3718 (Sized_relobj::get_output_section_offset): Likewise.
3719 (Sized_relobj::local_has_got_offset): Likewise.
3720 (Sized_relobj::local_got_offset): Likewise.
3721 (Sized_relobj::set_local_got_offset): Likewise.
3722 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3723 (Sized_relobj::clear_got_offsets): New function.
3724 (Sized_relobj::section_offsets): Move here from child class.
3725 (Sized_relobj::do_output_section_offset): Likewise.
3726 (Sized_relobj::do_set_section_offset): Likewise.
3727 (Sized_relobj::Local_got_offsets): Likewise.
3728 (Sized_relobj::local_got_offsets_): Likewise.
3729 (Sized_relobj::section_offsets_): Likewise.
3730 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3731 references.
3732 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3733 class.
3734 (Sized_relobj_file::sized_relobj): New function
3735 (Sized_relobj_file::local_has_got_offset): Move to base class.
3736 (Sized_relobj_file::local_got_offset): Likewise.
3737 (Sized_relobj_file::set_local_got_offset): Likewise.
3738 (Sized_relobj_file::get_output_section_offset): Likewise.
3739 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3740 (Sized_relobj_file::do_output_section_offset): Likewise.
3741 (Sized_relobj_file::do_set_section_offset): Likewise.
3742 (Sized_relobj_file::Local_got_offsets): Likewise.
3743 (Sized_relobj_file::local_got_offsets_): Likewise.
3744 (Sized_relobj_file::section_offsets_): Likewise.
3745 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3746 (all constructors).
3747 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3748 (Output_reloc::get_symbol_index): Likewise.
3749 (Output_reloc::local_section_offset): Likewise.
3750 (Output_reloc::get_address): Likewise.
3751 (Output_reloc::symbol_value): Likewise.
3752 (Output_data_got::reserve_slot): Move to class definition.
3753 (Output_data_got::reserve_local): New function.
3754 (Output_data_got::reserve_slot_for_global): Remove.
3755 (Output_data_got::reserve_global): New function.
3756 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3757 (all constructors, two instantiations).
3758 (Output_reloc::get_relobj): New function (two instantiations).
3759 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3760 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3761 (Output_data_reloc::add_global): Adjust type of relobj.
3762 (Output_data_reloc::add_global_relative): Likewise.
3763 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3764 (Output_data_reloc::add_local): Likewise.
3765 (Output_data_reloc::add_local_relative): Likewise.
3766 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3767 (Output_data_reloc::add_local_section): Likewise.
3768 (Output_data_reloc::add_output_section): Likewise.
3769 (Output_data_reloc::add_absolute): Likewise.
3770 (Output_data_reloc::add_target_specific): Likewise.
3771 (Output_data_got::reserve_slot): Move definition here.
3772 (Output_data_got::reserve_local): New function.
3773 (Output_data_got::reserve_global): New function.
3774 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3775 section_offsets_ with accessor function.
3776 (Sized_relobj_file::write_sections): Likewise.
3777 (Sized_relobj_file::do_relocate_sections): Likewise.
3778 * target.h (Sized_target::reserve_local_got_entry): New function.
3779 (Sized_target::reserve_global_got_entry): New function.
3780 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3781 (Target_x86_64::reserve_global_got_entry): New function.
3782 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3783
4829d394
CC
37842011-05-23 Cary Coutant <ccoutant@google.com>
3785
3786 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3787 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3788 bit when checking got_type.
3789 * incremental.cc (Sized_incremental_binary::setup_readers):
3790 Store symbol table and string table locations; initialize bit vector
3791 of file status flags.
3792 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3793 unchanged files.
3794 (Sized_incremental_binary::do_process_got_plt): New function.
3795 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3796 (Output_section_incremental_inputs::set_final_data_size): Record
3797 file index for each input file.
3798 (Output_section_incremental_inputs::write_got_plt): Store file index
3799 instead of input entry offset for each GOT entry.
3800 * incremental.h
3801 (Incremental_input_entry::Incremental_input_entry): Initialize new
3802 data member.
3803 (Incremental_input_entry::set_offset): Store file index.
3804 (Incremental_input_entry::get_file_index): New function.
3805 (Incremental_input_entry::file_index_): New data member.
3806 (Incremental_binary::process_got_plt): New function.
3807 (Incremental_binary::do_process_got_plt): New function.
3808 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3809 data members.
3810 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3811 (Sized_incremental_binary::set_file_is_unchanged): New function.
3812 (Sized_incremental_binary::file_is_unchanged): New function.
3813 (Sized_incremental_binary::do_process_got_plt): New function.
3814 (Sized_incremental_binary::file_status_): New data member.
3815 (Sized_incremental_binary::main_symtab_loc_): New data member.
3816 (Sized_incremental_binary::main_strtab_loc_): New data member.
3817 * output.cc (Output_data_got::Got_entry::write): Add case
3818 RESERVED_CODE.
3819 (Output_data_got::add_global): Call add_got_entry.
3820 (Output_data_got::add_global_plt): Likewise.
3821 (Output_data_got::add_global_with_rel): Likewise.
3822 (Output_data_got::add_global_with_rela): Likewise.
3823 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3824 (Output_data_got::add_global_pair_with_rela): Likewise.
3825 (Output_data_got::add_local): Call add_got_entry.
3826 (Output_data_got::add_local_plt): Likewise.
3827 (Output_data_got::add_local_with_rel): Likewise.
3828 (Output_data_got::add_local_with_rela): Likewise.
3829 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3830 (Output_data_got::add_local_pair_with_rela): Likewise.
3831 (Output_data_got::reserve_slot): New function.
3832 (Output_data_got::reserve_slot_for_global): New function.
3833 (Output_data_got::add_got_entry): New function.
3834 (Output_data_got::add_got_entry_pair): New function.
3835 (Output_section::add_output_section_data): Edit FIXME.
3836 * output.h
3837 (Output_section_data_build::Output_section_data_build): New
3838 constructor with size parameter.
3839 (Output_data_space::Output_data_space): Likewise.
3840 (Output_data_got::Output_data_got): Initialize new data member; new
3841 constructor with size parameter.
3842 (Output_data_got::add_constant): Call add_got_entry.
3843 (Output_data_got::reserve_slot): New function.
3844 (Output_data_got::reserve_slot_for_global): New function.
3845 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3846 (Output_data_got::add_got_entry): New function.
3847 (Output_data_got::add_got_entry_pair): New function.
3848 (Output_data_got::free_list_): New data member.
3849 * target.h (Sized_target::init_got_plt_for_update): New function.
3850 (Sized_target::register_global_plt_entry): New function.
3851 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3852 Initialize new data member; call init; add constructor with PLT count.
3853 (Output_data_plt_x86_64::init): New function.
3854 (Output_data_plt_x86_64::add_relocation): New function.
3855 (Output_data_plt_x86_64::reserve_slot): New function.
3856 (Output_data_plt_x86_64::free_list_): New data member.
3857 (Target_x86_64::init_got_plt_for_update): New function.
3858 (Target_x86_64::register_global_plt_entry): New function.
3859 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3860 incremental updates.
3861 (Output_data_plt_x86_64::add_relocation): New function.
3862 * testsuite/object_unittest.cc (Object_test): Set default options.
3863
ec69d6da
ILT
38642011-05-16 Ian Lance Taylor <iant@google.com>
3865
3866 * options.h (class General_options): Make -i a synonym for -r.
3867
732e31de
ILT
38682011-05-16 Ian Lance Taylor <iant@google.com>
3869
3870 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3871
403676b5
CC
38722011-05-10 Cary Coutant <ccoutant@google.com>
3873
3874 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3875 strip_all (-s).
3876
5b7b7d6e
ILT
38772011-05-06 Ian Lance Taylor <iant@google.com>
3878
3879 * layout.cc (Layout::layout): If the output section flags change,
3880 update the ordering.
3881
f0f9babf
CC
38822011-04-25 Cary Coutant <ccoutant@google.com>
3883
3884 * incremental-dump.cc (dump_incremental_inputs): Print local
3885 symbol info for each input file.
3886 * incremental.cc
3887 (Output_section_incremental_inputs::set_final_data_size): Add local
3888 symbol info to input file entries in incremental info.
3889 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3890 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3891 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3892 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3893 implementation.
3894 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3895 (Sized_incr_relobj::do_relocate): Write the local symbols.
3896 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3897 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3898 Adjust size of input file header.
3899 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3900 (Incremental_inputs_reader::get_local_symbol_count): New function.
3901 (Incremental_inputs_reader::get_input_section): Adjust size of input
3902 file header.
3903 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3904 (Sized_incr_relobj::This): New typedef.
3905 (Sized_incr_relobj::sym_size): New const data member.
3906 (Sized_incr_relobj::Local_symbol): New struct.
3907 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3908 (Sized_incr_relobj::do_local_symbol_offset): New function.
3909 (Sized_incr_relobj::local_symbol_count_): New data member.
3910 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3911 (Sized_incr_relobj::local_symbol_index_): New data member.
3912 (Sized_incr_relobj::local_symbol_offset_): New data member.
3913 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3914 (Sized_incr_relobj::local_symbols_): New data member.
3915 * object.h (Relobj::output_local_symbol_count): New function.
3916 (Relobj::local_symbol_offset): New function.
3917 (Relobj::do_output_local_symbol_count): New function.
3918 (Relobj::do_local_symbol_offset): New function.
3919 (Sized_relobj::do_output_local_symbol_count): New function.
3920 (Sized_relobj::do_local_symbol_offset): New function.
3921
d0a9ace3
ILT
39222011-04-22 Vladimir Simonov <sv@sw.ru>
3923
3924 * descriptors.cc (set_close_on_exec): New function.
3925 (Descriptors::open): Use set_close_on_exec.
3926 * output.cc (S_ISLNK): Define if not defined.
3927
94a3fc8b
CC
39282011-04-22 Cary Coutant <ccoutant@google.com>
3929
3930 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3931 global symbol map.
3932 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3933 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3934 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3935 relocations.
3936 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3937 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3938 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3939 * incremental.h
3940 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3941 function.
3942 (Incremental_binary::apply_incremental_relocs): New function.
3943 (Incremental_binary::do_apply_incremental_relocs): New function.
3944 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3945 data member.
3946 (Sized_incremental_binary::add_global_symbol): New function.
3947 (Sized_incremental_binary::global_symbol): New function.
3948 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3949 (Sized_incremental_binary::symbol_map_): New data member.
3950 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3951 * target.h (Sized_target::apply_relocation): New function.
3952 * target-reloc.h (apply_relocation): New function.
3953 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3954
c87e4302
DK
39552011-04-22 Doug Kwan <dougkwan@google.com>
3956
3957 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3958 flag of a SHT_ARM_EXIDX section.
2e702c99 3959 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3960 * testsuite/Makefile.in: Regenerate.
3961 * testsuite/arm_exidx_test.s: New file.
3962 * testsuite/arm_exidx_test.sh: Same.
3963
e7782cf6
CC
39642011-04-20 Cary Coutant <ccoutant@google.com>
3965
3966 PR gold/12689
3967 * archive.h (Incremental_archive_entry::Archive_member):
3968 Initialize arg_serial_ (second constructor).
3969
308ecdc7
ILT
39702011-04-17 Ian Lance Taylor <iant@google.com>
3971
3972 * object.cc (Relocate_info::location): Simplify location string.
3973 * errors.cc (Errors::error_at_location): Don't print program
3974 name.
3975 (Errors::warning_at_location): Likewise.
3976 (Errors::undefined_symbol): Likewise.
3977 * testsuite/debug_msg.sh: Update accordingly.
3978
bec5b579
CC
39792011-04-14 Cary Coutant <ccoutant@google.com>
3980
3981 * gold/layout.cc (Layout::symtab_section_offset): New function.
3982 * gold/layout.h (Layout::symtab_section_offset): New function.
3983 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3984
88597d34
ILT
39852011-04-12 Ian Lance Taylor <iant@google.com>
3986
3987 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3988 with MREMAP_MAYMOVE.
3989 * output.h (class Output_file): Add map_is_allocated_ field.
3990 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3991 not available, provide stubs. If mremap is not available, #define
3992 it to gold_mremap.
3993 (MREMAP_MAYMOVE): Define if not defined.
3994 (Output_file::Output_file): Initialize map_is_allocated_.
3995 (Output_file::resize): Check map_is_allocated_.
3996 (Output_file::map_anonymous): If mmap fails, use malloc.
3997 (Output_file::unmap): Don't do anything for an anonymous map.
3998 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3999 is not available, provide stubs.
4000 (File_read::View::~View): Use free rather than delete[].
4001 (File_read::make_view): Use malloc rather than new[]. If mmap
4002 fails, use malloc.
4003 (File_read::find_or_make_view): Use malloc rather than new[].
4004 * gold.h: Remove HAVE_REMAP code.
4005 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4006 exists. Rename mremap to gold_mremap. If mmap is not available
4007 don't do anything.
4008 * configure, config.in: Rebuild.
4009
11e361bc
ILT
40102011-04-11 Ian Lance Taylor <iant@google.com>
4011
4012 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4013 initialize local variable v.
4014
cdc29364
CC
40152011-04-11 Cary Coutant <ccoutant@google.com>
4016
4017 * archive.cc (Archive::include_member): Adjust call to
4018 report_object.
4019 (Add_archive_symbols::run): Track argument serial numbers.
4020 (Lib_group::include_member): Likewise.
4021 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4022 * archive.h (Incremental_archive_entry::Archive_member):
4023 Initialize arg_serial_.
4024 (Archive_member::arg_serial_): New data member.
4025 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4026 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4027 incremental link.
4028 (Sized_dynobj::do_for_all_local_got_entries): New function.
4029 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4030 function.
4031 * fileread.cc (get_mtime): New function.
4032 * fileread.h (get_mtime): New function.
4033 * gold.cc (queue_initial_tasks): Check for incremental update.
4034 (process_incremental_input): New function.
4035 (queue_middle_tasks): Don't force valid target for incremental
4036 update.
4037 * incremental-dump.cc (find_input_containing_global): Adjust
4038 size of symbol info entry.
4039 (dump_incremental_inputs): Dump argument serial number and
4040 in_system_directory flag; bias shndx by 1; print symbol names
4041 when dumping per-file symbol lists; use new symbol info readers.
4042 * incremental.cc
4043 (Output_section_incremental_inputs:update_data_size): New function.
4044 (Sized_incremental_binary::setup_readers): Setup input readers
4045 for each input file; build maps for files added from libraries
4046 and scripts.
4047 (Sized_incremental_binary::check_input_args): New function.
4048 (Sized_incremental_binary::do_check_inputs): Build map of argument
4049 serial numbers to input arguments.
4050 (Sized_incremental_binary::do_file_has_changed): Rename
4051 do_file_is_unchanged to this; compare file modification times.
4052 (Sized_incremental_binary::do_init_layout): New function.
4053 (Sized_incremental_binary::do_reserve_layout): New function.
4054 (Sized_incremental_binary::do_get_input_reader): Remove.
4055 (Sized_incremental_binary::get_symtab_view): New function.
4056 (Incremental_checker::can_incrementally_link_output_file): Remove.
4057 (Incremental_inputs::report_command_line): Exclude --debug options.
4058 (Incremental_inputs::report_archive_begin): Add parameter; track
4059 argument serial numbers; don't put input file entry for archive
4060 before archive members.
4061 (Incremental_inputs::report_archive_end): Put input file entry
4062 for archive after archive members.
4063 (Incremental_inputs::report_object): Add parameter; track argument
4064 serial numbers and in_system_directory flag.
4065 (Incremental_inputs::report_script): Add parameter; track argument
4066 serial numbers.
4067 (Output_section_incremental_inputs::set_final_data_size): Adjust
4068 size of symbol info entry; check for forwarding symbols.
4069 (Output_section_incremental_inputs::write_input_files): Write
4070 in_system_directory flag and argument serial number.
4071 (Output_section_incremental_inputs::write_info_blocks): Map section
4072 indices between incremental info and original input file; store
4073 input section index for each symbol.
4074 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4075 change operator() to visit().
4076 (class Global_got_offset_visitor): Likewise.
4077 (class Global_symbol_visitor_got_plt):
4078 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4079 classes.
4080 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4081 (Sized_incr_relobj::do_read_symbols): New function.
4082 (Sized_incr_relobj::do_layout): New function.
4083 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4084 (Sized_incr_relobj::do_add_symbols): New function.
4085 (Sized_incr_relobj::do_should_include_member): New function.
4086 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4087 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4088 (Sized_incr_relobj::do_section_size): New function.
4089 (Sized_incr_relobj::do_section_name): New function.
4090 (Sized_incr_relobj::do_section_contents): New function.
4091 (Sized_incr_relobj::do_section_flags): New function.
4092 (Sized_incr_relobj::do_section_entsize): New function.
4093 (Sized_incr_relobj::do_section_address): New function.
4094 (Sized_incr_relobj::do_section_type): New function.
4095 (Sized_incr_relobj::do_section_link): New function.
4096 (Sized_incr_relobj::do_section_info): New function.
4097 (Sized_incr_relobj::do_section_addralign): New function.
4098 (Sized_incr_relobj::do_initialize_xindex): New function.
4099 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4100 (Sized_incr_relobj::do_read_relocs): New function.
4101 (Sized_incr_relobj::do_gc_process_relocs): New function.
4102 (Sized_incr_relobj::do_scan_relocs): New function.
4103 (Sized_incr_relobj::do_count_local_symbols): New function.
4104 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4105 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4106 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4107 (Sized_incr_relobj::do_relocate): New function.
4108 (Sized_incr_relobj::do_set_section_offset): New function.
4109 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4110 (Sized_incr_dynobj::do_read_symbols): New function.
4111 (Sized_incr_dynobj::do_layout): New function.
4112 (Sized_incr_dynobj::do_add_symbols): New function.
4113 (Sized_incr_dynobj::do_should_include_member): New function.
4114 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4115 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4116 (Sized_incr_dynobj::do_section_size): New function.
4117 (Sized_incr_dynobj::do_section_name): New function.
4118 (Sized_incr_dynobj::do_section_contents): New function.
4119 (Sized_incr_dynobj::do_section_flags): New function.
4120 (Sized_incr_dynobj::do_section_entsize): New function.
4121 (Sized_incr_dynobj::do_section_address): New function.
4122 (Sized_incr_dynobj::do_section_type): New function.
4123 (Sized_incr_dynobj::do_section_link): New function.
4124 (Sized_incr_dynobj::do_section_info): New function.
4125 (Sized_incr_dynobj::do_section_addralign): New function.
4126 (Sized_incr_dynobj::do_initialize_xindex): New function.
4127 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4128 (make_sized_incremental_object): New function.
4129 (Incremental_library::copy_unused_symbols): New function.
4130 (Incremental_library::do_for_all_unused_symbols): New function.
4131 * incremental.h (enum Incremental_input_flags): New type.
4132 (class Incremental_checker): Remove.
4133 (Incremental_input_entry::Incremental_input_entry): Add argument
4134 serial number.
4135 (Incremental_input_entry::arg_serial): New function.
4136 (Incremental_input_entry::set_is_in_system_directory): New function.
4137 (Incremental_input_entry::is_in_system_directory): New function.
4138 (Incremental_input_entry::arg_serial_): New data member.
4139 (Incremental_input_entry::is_in_system_directory_): New data member.
4140 (class Script_info): Move here from script.h.
4141 (Script_info::Script_info): Add filename parameter.
4142 (Script_info::filename): New function.
4143 (Script_info::filename_): New data member.
4144 (Incremental_script_entry::Incremental_script_entry): Add argument
4145 serial number.
4146 (Incremental_object_entry::Incremental_object_entry): Likewise.
4147 (Incremental_object_entry::add_input_section): Build list of input
4148 sections with map to original shndx.
4149 (Incremental_object_entry::get_input_section_index): New function.
4150 (Incremental_object_entry::shndx_): New data member.
4151 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4152 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4153 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4154 serial number.
4155 (Incremental_inputs::report_archive_begin): Likewise.
4156 (Incremental_inputs::report_object): Likewise.
4157 (Incremental_inputs::report_script): Likewise.
4158 (class Incremental_global_symbol_reader): New class.
4159 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4160 and store flags and input file type.
4161 (Incremental_input_entry_reader::arg_serial): New function.
4162 (Incremental_input_entry_reader::type): Extract type from flags.
4163 (Incremental_input_entry_reader::is_in_system_directory): New function.
4164 (Incremental_input_entry_reader::get_input_section_count): Call
4165 accessor function for type.
4166 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4167 function for type; adjust size of global symbol entry.
4168 (Incremental_input_entry_reader::get_global_symbol_count): Call
4169 accessor function for type.
4170 (Incremental_input_entry_reader::get_object_count): Likewise.
4171 (Incremental_input_entry_reader::get_object_offset): Likewise.
4172 (Incremental_input_entry_reader::get_member_count): Likewise.
4173 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4174 (Incremental_input_entry_reader::get_member_offset): Likewise.
4175 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4176 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4177 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4178 (Incremental_input_entry_reader::get_global_symbol_reader): New
4179 function.
4180 (Incremental_input_entry_reader::get_output_symbol_index): New
4181 function.
4182 (Incremental_input_entry_reader::type_): Remove.
4183 (Incremental_input_entry_reader::flags_): New data member.
4184 (Incremental_inputs_reader::input_file_offset): New function.
4185 (Incremental_inputs_reader::input_file_index): New function.
4186 (Incremental_inputs_reader::input_file): Call input_file_offset.
4187 (Incremental_inputs_reader::input_file_at_offset): New function.
4188 (Incremental_relocs_reader::get_r_type): Reformat.
4189 (Incremental_relocs_reader::get_r_shndx): Reformat.
4190 (Incremental_relocs_reader::get_r_offset): Reformat.
4191 (Incremental_relocs_reader::data): New function.
4192 (Incremental_binary::Incremental_binary): Initialize new data members.
4193 (Incremental_binary::check_inputs): Add cmdline parameter.
4194 (Incremental_binary::file_is_unchanged): Remove.
4195 (Input_reader::arg_serial): New function.
4196 (Input_reader::get_unused_symbol_count): New function.
4197 (Input_reader::get_unused_symbol): New function.
4198 (Input_reader::do_arg_serial): New function.
4199 (Input_reader::do_get_unused_symbol_count): New function.
4200 (Input_reader::do_get_unused_symbol): New function.
4201 (Incremental_binary::input_file_count): New function.
4202 (Incremental_binary::get_input_reader): Change signature to use
4203 index instead of filename.
4204 (Incremental_binary::file_has_changed): New function.
4205 (Incremental_binary::get_input_argument): New function.
4206 (Incremental_binary::get_library): New function.
4207 (Incremental_binary::get_script_info): New function.
4208 (Incremental_binary::init_layout): New function.
4209 (Incremental_binary::reserve_layout): New function.
4210 (Incremental_binary::output_file): New function.
4211 (Incremental_binary::do_check_inputs): New function.
4212 (Incremental_binary::do_file_is_unchanged): Remove.
4213 (Incremental_binary::do_file_has_changed): New function.
4214 (Incremental_binary::do_init_layout): New function.
4215 (Incremental_binary::do_reserve_layout): New function.
4216 (Incremental_binary::do_input_file_count): New function.
4217 (Incremental_binary::do_get_input_reader): Change signature.
4218 (Incremental_binary::input_args_map_): New data member.
4219 (Incremental_binary::library_map_): New data member.
4220 (Incremental_binary::script_map_): New data member.
4221 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4222 new data members.
4223 (Sized_incremental_binary::output_section): New function.
4224 (Sized_incremental_binary::inputs_reader): Add const.
4225 (Sized_incremental_binary::symtab_reader): Add const.
4226 (Sized_incremental_binary::relocs_reader): Add const.
4227 (Sized_incremental_binary::got_plt_reader): Add const.
4228 (Sized_incremental_binary::get_symtab_view): New function.
4229 (Sized_incremental_binary::Inputs_reader): New typedef.
4230 (Sized_incremental_binary::Input_entry_reader): New typedef.
4231 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4232 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4233 (Sized_incremental_binary::do_file_has_changed): New function.
4234 (Sized_incremental_binary::do_init_layout): New function.
4235 (Sized_incremental_binary::do_reserve_layout): New function.
4236 (Sized_input_reader::Inputs_reader): Remove.
4237 (Sized_input_reader::Input_entry_reader): Remove.
4238 (Sized_input_reader::do_arg_serial): New function.
4239 (Sized_input_reader::do_get_unused_symbol_count): New function.
4240 (Sized_input_reader::do_get_unused_symbol): New function.
4241 (Sized_incremental_binary::do_input_file_count): New function.
4242 (Sized_incremental_binary::do_get_input_reader): Change signature;
4243 use index instead of filename.
4244 (Sized_incremental_binary::section_map_): New data member.
4245 (Sized_incremental_binary::input_entry_readers_): New data member.
4246 (class Sized_incr_relobj): New class.
4247 (class Sized_incr_dynobj): New class.
4248 (make_sized_incremental_object): New function.
4249 (class Incremental_library): New class.
4250 * layout.cc (Free_list::num_lists): New static data member.
4251 (Free_list::num_nodes): New static data member.
4252 (Free_list::num_removes): New static data member.
4253 (Free_list::num_remove_visits): New static data member.
4254 (Free_list::num_allocates): New static data member.
4255 (Free_list::num_allocate_visits): New static data member.
4256 (Free_list::init): New function.
4257 (Free_list::remove): New function.
4258 (Free_list::allocate): New function.
4259 (Free_list::dump): New function.
4260 (Free_list::print_stats): New function.
4261 (Layout_task_runner::run): Resize output file for incremental updates.
4262 (Layout::Layout): Initialize new data members.
4263 (Layout::set_incremental_base): New function.
4264 (Layout::init_fixed_output_section): New function.
4265 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4266 incremental updates.
4267 (Layout::create_gold_note): Do not create gold note section for
4268 incremental updates.
4269 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4270 for incremental updates.
4271 (Layout::set_section_offsets): For incremental updates, allocate space
4272 from free list.
4273 (Layout::create_symtab_sections): Layout with offsets relative to
4274 start of section; for incremental updates, allocate space from free
4275 list.
4276 (Layout::create_shdrs): For incremental updates, allocate space from
4277 free list.
4278 (Layout::finish_dynamic_section): For incremental updates, do not
4279 check --as-needed (fixed in subsequent patch).
4280 * layout.h (class Free_list): New class.
4281 (Layout::set_incremental_base): New function.
4282 (Layout::incremental_base): New function.
4283 (Layout::init_fixed_output_section): New function.
4284 (Layout::allocate): New function.
4285 (Layout::incremental_base_): New data member.
4286 (Layout::free_list_): New data member.
4287 * main.cc (main): Print Free_list statistics.
4288 * object.cc (Relobj::finalize_incremental_relocs): Add
4289 clear_counts parameter; clear counts only when clear_counts is set.
4290 (Sized_relobj::Sized_relobj): Initialize new base class.
4291 (Sized_relobj::do_layout): Don't report special sections.
4292 (Sized_relobj::do_for_all_local_got_entries): New function.
4293 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4294 symtab_off to all symbol table offsets.
4295 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4296 * object.h (class Got_offset_list): Move to top of file.
4297 (Object::Object): Allow case where input_file == NULL.
4298 (Object::~Object): Likewise.
4299 (Object::input_file): Assert that input_file != NULL.
4300 (Object::lock): Allow case where input_file == NULL.
4301 (Object::unlock): Likewise.
4302 (Object::is_locked): Likewise.
4303 (Object::token): Likewise.
4304 (Object::release): Likewise.
4305 (Object::is_incremental): New function.
4306 (Object::get_mtime): New function.
4307 (Object::for_all_local_got_entries): New function.
4308 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4309 (Object::set_is_in_system_directory): New function.
4310 (Object::is_in_system_directory): New function.
4311 (Object::do_is_incremental): New function.
4312 (Object::do_get_mtime): New function.
4313 (Object::do_for_all_local_got_entries): New function.
4314 (Object::is_in_system_directory_): New data member.
4315 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4316 (class Sized_relobj_base): New class.
4317 (class Sized_relobj): Derive from Sized_relobj_base.
4318 (class Sized_relobj::Symbols): Redeclare from base class.
4319 (class Sized_relobj::local_got_offset_list): Remove.
4320 (class Sized_relobj::Output_sections): Redeclare from base class.
4321 (class Sized_relobj::do_for_all_local_got_entries): New function.
4322 (class Sized_relobj::write_local_symbols): Add offset parameter.
4323 (class Sized_relobj::local_symbol_offset_): Update comment.
4324 (class Sized_relobj::local_dynsym_offset_): Update comment.
4325 * options.cc (Input_arguments::add_file): Remove const.
4326 * options.h (Input_file_argument::Input_file_argument):
4327 Initialize arg_serial_ (all constructors).
4328 (Input_file_argument::set_arg_serial): New function.
4329 (Input_file_argument::arg_serial): New function.
4330 (Input_file_argument::arg_serial_): New data member.
4331 (Input_arguments::Input_arguments): Initialize file_count_.
4332 (Input_arguments::add_file): Remove const.
4333 (Input_arguments::number_of_input_files): New function.
4334 (Input_arguments::file_count_): New data member.
4335 (Command_line::number_of_input_files): Call
4336 Input_arguments::number_of_input_files.
4337 * output.cc (Output_segment_headers::Output_segment_headers):
4338 Set current size.
4339 (Output_section::Input_section::current_data_size): New function.
4340 (Output_section::Output_section): Initialize new data members.
4341 (Output_section::add_input_section): Don't do merge sections for
4342 an incremental link; allocate space from free list for an
4343 incremental update.
4344 (Output_section::add_output_section_data): Allocate space from
4345 free list for an incremental update.
4346 (Output_section::update_data_size): New function.
4347 (Output_section::set_fixed_layout): New function.
4348 (Output_section::reserve): New function.
4349 (Output_segment::set_section_addresses): Remove const.
4350 (Output_segment::set_section_list_addresses): Remove const; allocate
4351 space from free list for an incremental update.
4352 (Output_segment::set_offset): Adjust size of RELRO segment for an
4353 incremental update.
4354 * output.h (Output_data::current_data_size): Move here from
4355 child classes.
4356 (Output_data::pre_finalize_data_size): New function.
4357 (Output_data::update_data_size): New function.
4358 (Output_section_headers::update_data_size): new function.
4359 (Output_section_data_build::current_data_size): Move to Output_data.
4360 (Output_data_strtab::update_data_size): New function.
4361 (Output_section::current_data_size): Move to Output_data.
4362 (Output_section::set_fixed_layout): New function.
4363 (Output_section::has_fixed_layout): New function.
4364 (Output_section::reserve): New function.
4365 (Output_section::update_data_size): New function.
4366 (Output_section::has_fixed_layout_): New data member.
4367 (Output_section::free_list_): New data member.
4368 (Output_segment::set_section_addresses): Remove const.
4369 (Output_segment::set_section_list_addresses): Remove const.
4370 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4371 New function.
4372 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4373 New function.
4374 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4375 parameter when calling Add_symbols constructor; store argument
4376 serial number for members of a lib group.
4377 (Add_symbols::locks): Allow case where token == NULL.
4378 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4379 (Read_member::~Read_member): New function.
4380 (Read_member::is_runnable): New function.
4381 (Read_member::locks): New function.
4382 (Read_member::run): New function.
4383 (Check_script::~Check_script): New function.
4384 (Check_script::is_runnable): New function.
4385 (Check_script::locks): New function.
4386 (Check_script::run): New function.
4387 (Check_library::~Check_library): New function.
4388 (Check_library::is_runnable): New function.
4389 (Check_library::locks): New function.
4390 (Check_library::run): New function.
4391 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4392 (Add_symbols::library_): New data member.
4393 (class Read_member): New class.
4394 (class Check_script): New class.
4395 (class Check_library): New class.
4396 * reloc.cc (Read_relocs::is_runnable): Allow case where
4397 token == NULL.
4398 (Read_relocs::locks): Likewise.
4399 (Scan_relocs::locks): Likewise.
4400 (Relocate_task::locks): Likewise.
4401 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4402 to clear counters.
4403 (Sized_relobj::incremental_relocs_scan): Fix comment.
4404 (Sized_relobj::do_relocate): Pass output file offset to
4405 write_local_symbols.
4406 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4407 from class declaration.
4408 * script.cc (read_input_script): Allocate Script_info; pass
4409 argument serial number to report_script.
4410 * script.h (class Script_info): Move to incremental.h.
4411 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4412 * symtab.h (Symbol_table::add_from_incrobj): New function.
4413 (Symbol_table::set_file_offset): New function.
4414
b961d0d7
CC
44152011-04-05 Cary Coutant <ccoutant@google.com>
4416
4417 * incremental-dump.cc (dump_incremental_inputs): Change signature
4418 to take a Sized_incremental_binary; change caller. Use readers
4419 in Sized_incremental_binary.
4420 * incremental.cc
4421 (Sized_incremental_binary::find_incremental_inputs_sections):
4422 Rename do_find_incremental_inputs_sections to this.
4423 (Sized_incremental_binary::setup_readers): New function.
4424 (Sized_incremental_binary::do_check_inputs): Check
4425 has_incremental_info_ flag; move setup code to setup_readers;
4426 use input readers.
4427 (Sized_incremental_binary::do_file_is_unchanged): New function.
4428 (Sized_incremental_binary::do_get_input_reader): New function.
4429 * incremental.h (class Incremental_binary): Move to end of file.
4430 (Incremental_binary::file_is_unchanged): New function.
4431 (Incremental_binary::do_file_is_unchanged): New function.
4432 (Incremental_binary::Input_reader): New class.
4433 (Incremental_binary::get_input_reader): New function.
4434 (class Sized_incremental_binary): Move to end of file.
4435 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4436 input section reader classes.
4437 (Sized_incremental_binary::has_incremental_info): New function.
4438 (Sized_incremental_binary::inputs_reader): New function.
4439 (Sized_incremental_binary::symtab_reader): New function.
4440 (Sized_incremental_binary::relocs_reader): New function.
4441 (Sized_incremental_binary::got_plt_reader): New function.
4442 (Sized_incremental_binary::do_file_is_unchanged): New function.
4443 (Sized_incremental_binary::Sized_input_reader): New class.
4444 (Sized_incremental_binary::get_input_reader): New function.
4445 (Sized_incremental_binary::find_incremental_inputs_sections):
4446 Rename do_find_incremental_inputs_sections to this.
4447 (Sized_incremental_binary::setup_readers): New function.
4448 (Sized_incremental_binary::has_incremental_info_): New data member.
4449 (Sized_incremental_binary::inputs_reader_): New data member.
4450 (Sized_incremental_binary::symtab_reader_): New data member.
4451 (Sized_incremental_binary::relocs_reader_): New data member.
4452 (Sized_incremental_binary::got_plt_reader_): New data member.
4453 (Sized_incremental_binary::current_input_file_): New data member.
4454
a869183f
PP
44552011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4456
4457 PR gold/12640
4458 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4459 violation.
4460
44612011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4462
4463 * archive.cc (Archive::include_member): Adjust call to report_object.
4464 (Add_archive_symbols::run): Add script_info to call to
4465 report_archive_begin.
4466 (Lib_group::include_member): Adjust call to report_object.
4467 (Add_lib_group_symbols::run): Adjust call to report_object.
4468 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4469 blocks. Add object count for script input files.
4470 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4471 script_info parameter; change all callers.
4472 (Incremental_inputs::report_object): Add script_info parameter;
4473 change all callers.
4474 (Incremental_inputs::report_script): Store backpointer to
4475 incremental info entry.
4476 (Output_section_incremental_inputs::set_final_data_size): Record
4477 additional information for scripts.
4478 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4479 * incremental.h (Incremental_script_entry::add_object): New function.
4480 (Incremental_script_entry::get_object_count): New function.
4481 (Incremental_script_entry::get_object): New function.
4482 (Incremental_script_entry::objects_): New data member; adjust
4483 constructor.
4484 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4485 (Incremental_inputs::report_object): Add script_info parameter.
4486 (Incremental_inputs_reader::get_object_count): New function.
4487 (Incremental_inputs_reader::get_object_offset): New function.
4488 * options.cc (Input_arguments::add_file): Return reference to
4489 new input argument.
4490 * options.h (Input_argument::set_script_info): New function.
4491 (Input_argument::script_info): New function.
4492 (Input_argument::script_info_): New data member; adjust all
4493 constructors.
4494 (Input_file_group::add_file): Return reference to new input argument.
4495 (Input_file_lib::add_file): Likewise.
4496 (Input_arguments::add_file): Likewise.
4497 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4498 * script.cc (Parser_closure::Parser_closure): Add script_info
4499 parameter; adjust all callers.
4500 (Parser_closure::script_info): New function.
4501 (Parser_closure::script_info_): New data member.
4502 (read_input_script): Report scripts earlier to incremental info.
4503 (script_add_file): Set script_info in Input_argument.
4504 (script_add_library): Likewise.
4505 * script.h (Script_options::Script_info): Rewrite class.
4506
a869183f 45072011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4508
4509 * archive.cc (Library_base::should_include_member): Move
4510 method here from class Archive.
4511 (Archive::Archive): Initialize base class.
4512 (Archive::should_include_member): Move to base class.
4513 (Archive::do_for_all_unused_symbols): New function.
4514 (Add_archive_symbols::run): Remove redundant access to
4515 incremental_inputs.
4516 (Lib_group::Lib_group): Initialize base class.
4517 (Lib_group::do_filename): New function.
4518 (Lib_group::include_member): Pass pointer to Lib_group to
4519 report_object.
4520 (Lib_group::do_for_all_unused_symbols): New function.
4521 (Add_lib_group_symbols::run): Report archive information for
4522 incremental links.
4523 * archive.h (class Library_base): New base class.
4524 (class Archive): Derive from Library_base.
4525 (Archive::filename): Move to base class.
4526 (Archive::set_incremental_info): Likewise.
4527 (Archive::incremental_info): Likewise.
4528 (Archive::Should_include): Likewise.
4529 (Archive::should_include_member): Likewise.
4530 (Archive::Armap_entry): Remove.
4531 (Archive::Unused_symbol_iterator): Remove.
4532 (Archive::unused_symbols_begin): Remove.
4533 (Archive::unused_symbols_end): Remove.
4534 (Archive::do_filename): New function.
4535 (Archive::do_get_mtime): New function.
4536 (Archive::do_for_all_unused_symbols): New function.
4537 (Archive::task_): Move to base class.
4538 (Archive::incremental_info_): Likewise.
4539 (class Lib_group): Derive from Library_base.
4540 (Lib_group::do_filename): New function.
4541 (Lib_group::do_get_mtime): New function.
4542 (Lib_group::do_for_all_unused_symbols): New function.
4543 (Lib_group::task_): Move to base class.
4544 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4545 function.
4546 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4547 function.
4548 * incremental.cc (Incremental_inputs::report_archive_begin):
4549 Use Library_base; call library's get_mtime; add incremental inputs
4550 entry before members.
4551 (class Unused_symbol_visitor): New class.
4552 (Incremental_inputs::report_archive_end): Use Library_base; use
4553 visitor class to record unused symbols; don't add incremental inputs
4554 entry after members.
4555 (Incremental_inputs::report_object): Use Library_base.
4556 * incremental.h
4557 (Incremental_archive_entry::Incremental_archive_entry): Remove
4558 unused Archive parameter.
4559 (Incremental_inputs::report_archive_begin): Use Library_base.
4560 (Incremental_inputs::report_archive_end): Likewise.
4561 (Incremental_inputs::report_object): Likewise.
4562 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4563 function.
4564 * object.h (Object::for_all_global_symbols): New function.
4565 (Object::do_for_all_global_symbols): New function.
4566 (Sized_relobj::do_for_all_global_symbols): New function.
4567 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4568 function.
4569 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4570 function.
4571
61ab3e40
ILT
45722011-03-27 Ian Lance Taylor <iant@google.com>
4573
4574 * archive.cc (Archive::interpret_header): Return -1 if something
4575 goes wrong. Change callers accordingly.
4576
30e1f9e6
CC
45772011-03-25 Cary Coutant <ccoutant@google.com>
4578
4579 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4580 * testsuite/Makefile.in: Regenerate.
4581
9370ce59 45822011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4583
4584 * plugin.cc (get_view): New.
4585 (Plugin::load): Pass get_view to the plugin.
4586 (Plugin_manager::get_view): New.
4587
9312bb0a
ILT
45882011-03-21 Ian Lance Taylor <iant@google.com>
4589
4590 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4591 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4592
7e12ba9e
ST
45932011-03-21 Sriraman Tallam <tmsriram@google.com>
4594
4595 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4596 Change == to -eq.
4597 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4598 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4599 Change == to -eq.
4600 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4601 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4602
fd7a005d
ILT
46032011-03-14 Ian Lance Taylor <iant@google.com>
4604
4605 * script-sections.cc (Sort_output_sections::script_compare):
4606 Rename from is_before, change return type.
4607 (Sort_output_sections::operator()): Adjust accordingly.
4608
ed16fd1b
ILT
46092011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4610
4611 PR gold/12572
4612 * testsuite/odr_violation2.cc: Add comment to make all error line
4613 numbers double digits.
4614 * testsuite/debug_msg.sh: Adjust expected errors.
4615
71ff8986
ILT
46162011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4617
4618 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4619 but mark earlier ones as non-canonical
4620 (offset_to_iterator): Update search target and example
4621 (do_addr2line): Return extra lines in a vector*
4622 (format_file_lineno): Extract from do_addr2line
4623 (one_addr2line): Add vector* out-param
4624 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4625 when a lineno entry appeared last for its instruction
4626 (Dwarf_line_info): Add vector* out-param
4627 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4628 * symtab.cc (Odr_violation_compare): Include the lineno in the
4629 comparison again.
4630 (linenos_from_loc): New. Combine the canonical line for an
4631 address with its other lines.
4632 (True_if_intersect): New. Helper functor to make
4633 std::set_intersection a query.
4634 (detect_odr_violations): Compare sets of lines instead of just
4635 one line for each function. This became less deterministic, but
4636 has fewer false positives.
4637 * symtab.h: Declarations.
4638 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4639 mix an optimized and non-optimized object in the same binary
4640 (odr_violation2.so): Same.
4641 * testsuite/Makefile.in: Regenerate from Makefile.am.
4642 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4643 * testsuite/debug_msg.sh: Update line numbers and add
4644 assertions.
4645 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4646 non-optimized context.
4647 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4648 isn't inlined, and use OdrDerived in an optimized context.
4649 * testsuite/odr_header1.h: Defines OdrDerived, where
4650 optimization will change the
4651 first-instruction-in-the-destructor's file and line number.
4652 * testsuite/odr_header2.h: Defines OdrBase.
4653
a19fefdc
ILT
46542011-03-09 Ian Lance Taylor <iant@google.com>
4655
4656 * fileread.cc (File_read::clear_views): Don't delete the whole
4657 file view.
4658
ecb351e9
ILT
46592011-03-08 Ian Lance Taylor <iant@google.com>
4660
4661 PR gold/12525
4662 * fileread.cc: #include <climits>.
4663 (GOLD_IOV_MAX): Define.
4664 (File_read::read_multiple): Limit number of entries by iov_max.
4665 * fileread.h (class File_read): Always set max_readv_entries to
4666 128.
4667
b821d13c
ILT
46682011-03-07 Ian Lance Taylor <iant@google.com>
4669
4670 PR gold/12525
4671 * options.h (class General_options): Add -dy and -dn.
4672
89243142
CC
46732011-03-02 Cary Coutant <ccoutant@google.com>
4674
4675 * testsuite/script_test_9.t: Add TLS segment.
4676
d0773f31
ILT
46772011-03-02 Simon Baldwin <simonb@google.com>
4678
4679 * configure.ac: Add check for gnu_indirect_function support in
4680 the toolchain building binutils.
4681 * configure: Rebuild.
4682
9370ce59 46832011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4684
4685 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4686 plugin only symbols.
4687 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4688 in plugin files as not needed in the symbol table.
4689
4cf7a849
ST
46902011-02-11 Sriraman Tallam <tmsriram@google.com>
4691
4692 * output.cc (Output_section::add_input_section): Delay fill
4693 generation for section ordering.
4694
b578bd7d
ILT
46952011-02-09 Ian Lance Taylor <iant@google.com>
4696
4697 PR gold/12316
4698 * object.h (class Sized_relobj): Remove clear_local_symbols.
4699 * reloc.cc (Sized_relobj::do_relocate): Don't call
4700 clear_local_symbols.
4701
9370ce59 47022011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4703
4704 * plugin.cc (is_visible_from_outside): Return true for symbols
4705 in the -u option.
4706
55382fb7
ILT
47072011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4708
4709 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4710 filename.
4711
4e271fff
ST
47122011-02-02 Sriraman Tallam <tmsriram@google.com>
4713
4714 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4715 to std::string.
4e271fff 4716 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4717 section_name to be std::string.
4e271fff
ST
4718 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4719
d433c3ac
ILT
47202011-01-25 Ian Lance Taylor <iant@google.com>
4721
4722 * script.cc (script_add_extern): Rewrite to use
4723 add_symbol_reference.
4724
880473a6
DK
47252011-01-25 Doug Kwan <dougkwan@google.com>
4726
d433c3ac 4727 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4728
f30f86fa
ILT
47292011-01-24 Ian Lance Taylor <iant@google.com>
4730
4731 * options.h (class General_options): Accept
4732 --no-detect-odr-violations.
4733
8e51a0b9
ILT
47342011-01-24 Ian Lance Taylor <iant@google.com>
4735
4736 * version.cc (version_string): Bump to 1.11.
4737
0f3b89d8
ILT
47382011-01-24 Ian Lance Taylor <iant@google.com>
4739
4740 * plugin.cc (class Plugin_rescan): Define new class.
4741 (Plugin_manager::claim_file): Set any_claimed_.
4742 (Plugin_manager::save_archive): New function.
4743 (Plugin_manager::save_input_group): New function.
4744 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4745 necessary.
4746 (Plugin_manager::new_undefined_symbol): New function.
4747 (Plugin_manager::rescan): New function.
4748 (Plugin_manager::rescannable_defines): New function.
4749 (Plugin_manager::add_input_file): Set any_added_.
4750 * plugin.h (class Plugin_manager): define new fields rescannable_,
4751 undefined_symbols_, any_claimed_, and any_added_. Declare
4752 Plugin_rescan as friend. Declare new functions.
4753 (Plugin_manager::Rescannable): Define type.
4754 (Plugin_manager::Rescannable_list): Define type.
4755 (Plugin_manager::Undefined_symbol_list): Define type.
4756 (Plugin_manager::Plugin_manager): Initialize new fields.
4757 * archive.cc (Archive::defines_symbol): New function.
4758 (Add_archive_symbols::run): Pass archive to plugins if any.
4759 * archive.h (class Archive): Declare defines_symbol.
4760 * readsyms.cc (Input_group::~Input_group): New function.
4761 (Finish_group::run): Pass input_group to plugins if any.
4762 * readsyms.h (class Input_group): Declare destructor.
4763 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4764 any.
4765
3bb951e5
ILT
47662011-01-10 Ian Lance Taylor <iant@google.com>
4767
4768 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4769 section as relro.
4770 (Layout::set_segment_offsets): Reset increase_relro before calling
4771 set_section_addresses a second time.
4772
0aa45fac
CC
47732011-01-04 Cary Coutant <ccoutant@google.com>
4774
4775 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4776 sections before NOBITS sections.
4777
0db46eb4
L
47782011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4779
4780 * version.cc (print_version): Update copyright to 2011.
4781
829c9745
CC
47822010-12-23 Cary Coutant <ccoutant@google.com>
4783
4784 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4785 of OS to this->add. Add OD parameter to second form of the function.
4786
7500420b
ILT
47872010-12-20 Ian Lance Taylor <iant@google.com>
4788
4789 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4790 second of two consecutive entries with same offset.
4791
f8e9a930
RW
47922010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4793
4794 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4795 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4796 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4797 to avoid unneeded links against $(LDADD).
4798 * testsuite/Makefile.in: Regenerate.
4799
2fbb4320
ILT
48002010-12-15 Ian Lance Taylor <iant@google.com>
4801
4802 PR gold/12324
4803 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4804 for R_X86_64_32 and R_X86_64_PC32.
4805 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4806 ver_matching_def_pic.o.
4807 (ver_matching_def_pic.o): New target.
4808
fedb228d
RW
48092010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4810
4811 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4812 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4813 Move definition before File_read::View member definitions.
4814 (File_read::View::~View): Initialize and hold lock before
4815 updating current_mapped_bytes.
4816
9b547ce6
RW
48172010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4818
4819 * dwarf_reader.cc: Remove outdated comment.
4820 * gold-threads.cc: Fix typo in error message.
4821 * archive.cc: Fix typos in comments.
4822 * archive.h: Likewise.
4823 * arm-reloc-property.cc: Likewise.
4824 * arm-reloc-property.h: Likewise.
4825 * arm-reloc.def: Likewise.
4826 * arm.cc: Likewise.
4827 * attributes.h: Likewise.
4828 * cref.cc: Likewise.
4829 * ehframe.cc: Likewise.
4830 * fileread.h: Likewise.
4831 * gold.h: Likewise.
4832 * i386.cc: Likewise.
4833 * icf.cc: Likewise.
4834 * incremental.h: Likewise.
4835 * int_encoding.cc: Likewise.
4836 * layout.h: Likewise.
4837 * main.cc: Likewise.
4838 * merge.h: Likewise.
4839 * object.cc: Likewise.
4840 * object.h: Likewise.
4841 * options.cc: Likewise.
4842 * readsyms.cc: Likewise.
4843 * reduced_debug_output.cc: Likewise.
4844 * reloc.cc: Likewise.
4845 * script-sections.cc: Likewise.
4846 * sparc.cc: Likewise.
4847 * symtab.h: Likewise.
4848 * target-reloc.h: Likewise.
4849 * target.cc: Likewise.
4850 * target.h: Likewise.
4851 * timer.cc: Likewise.
4852 * timer.h: Likewise.
4853 * x86_64.cc: Likewise.
4854
83e17bd5
CC
48552010-12-09 Cary Coutant <ccoutant@google.com>
4856
4857 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4858 stack.
4859 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4860 parameter; change all callers.
4861 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4862 * options.h (warn_execstack): New option.
4863
017257f8
DK
48642010-12-07 Doug Kwan <dougkwan@google.com>
4865
4866 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4867 like function call relocations.
4868
c20cbc06
ILT
48692010-12-07 Ian Lance Taylor <iant@google.com>
4870
4871 * archive.cc (Archive::get_elf_object_for_member): Permit
4872 punconfigured to be NULL.
4873 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4874 (Archive::include_member): Pass NULL to get_elf_object_for_member
4875 if we searched for the archive and this is the first included
4876 object.
4877
4dbfafcc
ILT
48782010-12-01 Ian Lance Taylor <iant@google.com>
4879
4880 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4881 track_relocs_type_ field.
4882 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4883 Set track_relocs_type_.
4884 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4885 contents when using RELA relocs.
4886 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4887 reloc_map_.
4888 * reloc.cc (Track_relocs::next_addend): New function.
4889 * reloc.h (class Track_relocs): Declare next_addend.
4890
e5e19edd
ILT
48912010-12-01 Ian Lance Taylor <iant@google.com>
4892
4893 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4894 virtual destructor.
4895
9a5ce24c
ILT
48962010-12-01 Ian Lance Taylor <iant@google.com>
4897
4898 * README: Update compilers known to work and fail.
4899
c7791212
NC
49002010-11-23 Matthias Klose <doko@ubuntu.com>
4901
4902 * configure.in: For --enable-gold, handle value `default' instead of
4903 `both*'. Always install ld as ld.bfd, install as ld if gold is
4904 not the default.
4905 * configure: Regenerate.
4906
0ad220c9
DK
49072010-11-18 Doug Kwan <dougkwan@google.com>
4908
4909 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4910 and right_alignment to be zero. Store result alignment only if it is
4911 greater than existing alignment.
4912
ab8056e0
CC
49132010-11-16 Cary Coutant <ccoutant@google.com>
4914
4915 PR gold/12220
4916 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4917 Check for ".zdebug_line".
4918
fd064a5b
CC
49192010-11-16 Doug Kwan <dougkwan@google.com>
4920 Cary Coutant <ccoutant@google.com>
4921
4922 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4923 by reference; adjust all callers.
4924 * output.cc (Output_segment::set_section_addresses): Adjust references
4925 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4926 list is empty.
4927 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4928 end at page boundary.
4929
6fc6ea19
CC
49302010-11-16 Cary Coutant <ccoutant@google.com>
4931
4932 PR gold/12220
4933 * layout.cc (Layout::choose_output_section): Transform names of
4934 compressed sections even when using a script with a SECTIONS clause.
4935 (Layout::output_section_name): Remove code to transform
4936 compressed debug section names.
4937 * output.cc (Output_section::add_input_section): Use uncompressed
4938 section size when tracking input sections.
4939
95a2c8d6
RS
49402010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4941
4942 * symtab.h (Symbol::NON_PIC_REF): Remove.
4943 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4944 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4945 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4946 (Symbol::use_plt_offset): Take a flags argument and pass it
4947 directly to needs_dynamic_reloc. Restrict check for undefined
4948 weak symbols to function calls.
4949 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4950 (Target_arm::Scan::global): Use it.
4951 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4952 (Target_arm::Relocate::relocate): Likewise.
4953 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4954 parameter with an r_type parameter. Use get_reference_flags
4955 to get the flags.
4956 (Target_arm::Relocate::relocate): Update accordingly.
4957 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4958 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4959 (Target_i386::Scan::global): Likewise.
4960 (Target_i386::Relocate::relocate): Likewise.
4961 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4962 parameter with an r_type parameter. Use get_reference_flags
4963 to get the flags.
4964 (Target_i386::Relocate::relocate): Update accordingly.
4965 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4966 (Target_powerpc::Scan::global): Use it.
4967 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4968 (Target_powerpc::Relocate::relocate): Likewise.
4969 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4970 (Target_sparc::Scan::global): Use it.
4971 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4972 (Target_sparc::Relocate::relocate): Likewise.
4973 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4974 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4975 (Target_x86_64::Scan::global): Likewise.
4976 (Target_x86_64::Relocate::relocate): Likewise.
4977
f625ae50
DK
49782010-11-08 Doug Kwan <dougkwan@google.com>
4979 Cary Coutant <ccoutant@google.com>
4980
4981 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4982 (Arm_exidx_merge_section::section_contents_): New data member.
4983 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4984 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4985 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4986 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4987 in parameters instead of calling Object::section_contents without
4988 locking.
4989 (Arm_output_section::group_section): New parameter TASK. Pass it
4990 to callees that need locking objects.
4991 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4992 to lock EXIDX input sections. Fix a formatting issue. Call
4993 Arm_exidx_merged_section::build_contents to create merged section
4994 contents.
4995 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4996 to lock object of stub table owner.
4997 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4998 TEXT_SIZE to initialize data member TEXT_SIZE_.
4999 (Arm_exidx_input_section::addralign): Fix typo in comment.
5000 (Arm_exidx_input_section::text_size): New method.
5001 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5002 that require locking objects. Lock objects before scanning for stubs
5003 and updating local symbols.
5004 (Arm_input_section<big_endian>::init): Copy contents of original
5005 input section.
2e702c99 5006 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5007 original input section instead of calling Object::section_contents
5008 without locking.
5009 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5010 size without calling Object::section_size().
5011 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5012 for size. Allocate a buffer for merged EXIDX entries.
5013 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5014 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5015 building code to Arm_exidx_merged_section::build_contetns. Write
5016 out contetns in buffer instead of building it on the fly.
5017 (Arm_relobj::make_exidx_input_section): Also pass text section size
5018 to Arm_exidx_input_section constructor.
5019 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5020 (Arm_dynobj::do_read_symbols): Fix memory leak.
5021 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5022 * target.h: (class Task): Add forward declaration.
5023 (Target::relax): Add new parameter TASK and pass it to
5024 Target::do_relax().
5025 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5026
5f9bcf58
CC
50272010-11-05 Cary Coutant <ccoutant@google.com>
5028
5029 PR gold/10708
5030 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5031 object when reading from the file.
5032 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5033 second layout pass.
5034 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5035 when reading section contents.
5036 (get_section_contents): Likewise.
5037 (icf::find_identical_sections): Likewise.
5038 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5039 object when reading from the file.
5040 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5041 the object when doing deferred section layout.
5042
e597fa08
NC
50432010-11-03 Nick Clifton <nickc@redhat.com>
5044
5045 PR gold/12001
5046 * script.h (class Symbol_assignment: name): New member. Returns
5047 the name of the symbol.
5048 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5049 Returns true if the given symbol name is on the list of
5050 assignments wating to be processed.
5051 * archive.cc (should_incldue_member): If the symbol is undefined,
5052 check to see if it is on the list of symbols pending assignment.
5053
3f9a3278
ILT
50542010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5055
5056 * script-sections.cc (Script_sections::find_memory_region): Check
5057 for a NULL output section pointer.
5058
d06fb4d1
DK
50592010-10-29 Doug Kwan <dougkwan@google.com>
5060
5061 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5062 Output_section::add_relaxed_input_section.
5063 * output.cc (Output_section::add_relaxed_input_section): Add new
5064 arguments LAYOUT and NAME. Set section order index.
5065 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5066 Copy section order index.
5067 * output.h (Output_section::add_relaxed_input_section): Add new
5068 arguments LAYOUT and NAME.
5069
90e24de5
ILT
50702010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5071
5072 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5073 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5074 * testsuite/Makefile.in: Regenerate.
5075
c9484ea5
DK
50762010-10-20 Doug Kwan <dougkwan@google.com>
5077
5078 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5079 without SHF_LINK_ORDER flags.
5080 * layout.cc (Layout::choose_output_section): Do not filter
5081 SHF_LINK_ORDER flag in a relocatable link.
5082
5bc2f5be
CC
50832010-10-17 Cary Coutant <ccoutant@google.com>
5084
5085 * output.h (Output_segment::set_section_addresses): Change function
5086 signature. Update all callers.
5087 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5088 sections.
5089 (Output_segment::set_section_addresses): Align after last TLS
5090 section. Add padding before last relro section instead of after.
5091
0c91cf04
DK
50922010-10-17 Doug Kwan <dougkwan@google.com>
5093
5094 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5095 GOT output section to be writable.
5096
8c21d9d3
CC
50972010-10-14 Cary Coutant <ccoutant@google.com>
5098
5099 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5100 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5101 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5102 mode.
5103 * incremental.cc (report_command_line): Ignore all forms of
5104 --incremental.
5105 * layout.cc (Layout::Layout): Check parameters for incremental link
5106 mode.
5107 * options.cc (General_options::parse_incremental): New function.
5108 (General_options::parse_no_incremental): New function.
5109 (General_options::parse_incremental_full): New function.
5110 (General_options::parse_incremental_update): New function.
5111 (General_options::incremental_mode_): New data member.
5112 (General_options::finalize): Check incremental_mode_.
5113 * options.h (General_options): Update help text for --incremental.
5114 Add --no-incremental, --incremental-full, --incremental-update.
5115 (General_options::Incremental_mode): New enum type.
5116 (General_options::incremental_mode): New function.
5117 (General_options::incremental_mode_): New data member.
5118 * parameters.cc (Parameters::incremental_mode_): New data member.
5119 (Parameters::set_options): Set incremental_mode_.
5120 (Parameters::set_incremental_full): New function.
5121 (Parameters::incremental): New function.
5122 (Parameters::incremental_update): New function.
5123 (set_parameters_incremental_full): New function.
5124 * parameters.h (Parameters::set_incremental_full): New function.
5125 (Parameters::incremental): New function.
5126 (Parameters::incremental_update): New function.
5127 (Parameters::incremental_mode_): New data member.
5128 (set_parameters_incremental_full): New function.
5129 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5130 incremental link mode.
5131 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5132 (Sized_relobj::do_relocate_sections): Likewise.
5133 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5134 option.
5135 * testsuite/Makefile.in: Regenerate.
5136 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5137
bb32aa18 51382010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5139
5140 * script-sections.h (class Script_sections): Make
5141 Sections_elements typedef public.
5142 * script-sections.cc (class Sort_output_sections): Add elements_
5143 field. Add constructor which sets it; change all callers.
5144 (Sort_output_sections::is_before): New function.
5145 (Sort_output_sections::operator()): Call is_before.
5146 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5147 conditional.
5148 * testsuite/script_test_10.sh: New test. Test script section
5149 order.
5150 * testsuite/script_test_10.t: Likewise.
5151 * testsuite/script_test_10.s: Likewise.
5152 * testsuite/Makefile.am: Wrap the cross linker tests and the
5153 common tests into NATIVE_OR_CROSS_LINKER.
5154 (check_SCRIPTS): Add script_test_10.sh.
5155 (check_DATA): Add script_test_10.stdout.
5156 (script_test_10.o, script_test_10): New targets.
5157 (script_test_10.stdout): New target.
5158 * configure, testsuite/Makefile.in: Regenerate.
5159
3cef7179
ILT
51602010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5161
5162 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5163 error for the deprecated relocations.
5164 (Target_arm::Scan::global): Likewise.
5165 (Target_arm::Relocate::relocate): Likewise.
5166
7411e9a8
RS
51672010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5168
5169 * fileread.cc (Input_file::find_file): Initialize *found_name
5170 and *namep when using the fallback search for case 4.
5171
6a9da32a
CC
51722010-10-11 Cary Coutant <ccoutant@google.com>
5173
5174 * options.h (class General_options): Redefine -z lazy as an alias for
5175 the negation of -z now.
5176
ac897c20
ILT
51772010-10-11 Ian Lance Taylor <iant@google.com>
5178
5179 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5180 binding.
5181
ea5cae92
NC
51822010-10-06 Nick Clifton <nickc@redhat.com>
5183
5184 * script-sections.cc(class Memory_region): Remove
5185 current_lma_offset_ field. Rename current_vma_offset_ to
5186 current_offset_. Add last_section_ field.
5187 (Memory_region::get_current_vma_address): Rename to
5188 get_current_address.
5189 (Memory_region::get_current_lma_address): Delete.
5190 (Memory_region::increment_vma_offset): Rename to
5191 increment_offset.
5192 (Memory_region::increment_lma_offset): Delete.
5193 (Memory_region::attributes_compatible): New method. Returns
5194 true if the provided section is compatible with the region.
5195 (Memory_region::get_last_section): New method. Returns the last
5196 section to use the region.
5197 (Memory_region::set_last_section): New method. Stores the last
5198 section to use the region.
5199 (Script_sections::block_in_region): New method. Returns true if
5200 a block of memory is contained within a region.
5201 (Script_sections::find_memory_region): New method. Locates a
5202 memory region to be used to set a VMA or LMA address.
5203 (Output_section_definition::set_section_addresses): Add code to
5204 check for addresses set by memory regions.
5205 (Output_segment::set_section_addresses): Remove memory region
5206 walking code.
5207 (Script_sections::create_segment): Add a warning if a header
5208 segment is created outside of any region.
5209 * script-sections.h (class Script_sections): Add prototypes for
5210 find_memory_region and block_in_region methods.
5211 * testsuite/memory_test.s: Use .long instead of .word.
5212 * testsuite/memory_test.t: Add some more output sections.
5213 * testsuite/memory_test.sh: Update expected output.
5214
a9bfd952
DK
52152010-10-02 Doug Kwan <dougkwan@google.com>
5216
5217 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5218 defintion to symtab.h
5219 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5220 declaration to defintion.
5221
bacff3ab
NC
52222010-10-01 Nick Clifton <nickc@redhat.com>
5223
5224 * expression.cc (eval): Replace dummy argument with NULL.
5225 (eval_maybe_dot): Check for a NULL result section pointer.
5226 (Symbol_expression::value): Likewise.
5227 (Dot_expression::value): Likewise.
5228 (BINARY_EXPRESSION): Likewise.
5229 (Max_expression::value): Likewise.
5230 (Min_expression::value): Likewise.
5231 (Absolute_expression::value): Likewise.
5232 (Addr_expression::value_from_output_section): Likewise.
5233 (Loaddddr_expression::value_from_output_section): Likewise.
5234 (Segment_start_expression::value): Likewise.
5235 * script-sections.cc
5236 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5237 argument with NULL.
5238 (Sections_elememt_dot_assignment::set_section_addresses):
5239 Likewise.
5240 (Output_data_expression::do_write_to_buffer): Likewise.
5241 (Output_section_definition::finalize_symbols): Likewise.
5242 (Output_section_definition::set_section_addresses): Likewise.
5243
f81bc8b5
DK
52442010-09-30 Doug Kwan <dougkwan@google.com>
5245
5246 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5247
c95e9f27
ST
52482010-09-28 Sriraman Tallam <tmsriram@google.com>
5249
5250 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5251 function.
c95e9f27
ST
5252 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5253 virtual function.
5254 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5255 virtual function.
5256 * icf.cc (get_section_contents): Inline merge sections only when
5257 target allows it.
5258
3cac54d2
RW
52592010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5260
5261 * configure: Regenerate.
5262
2904037a
ILT
52632010-09-17 Ian Lance Taylor <iant@google.com>
5264
5265 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5266 * testsuite/Makefile.am (memory_test.o): New target.
5267 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5268 memory_test.t.
5269 * testsuite/Makefile.in: Rebuild.
2904037a 5270
bca7fb63
DK
52712010-09-17 Doug Kwan <dougkwan@google.com>
5272
5273 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5274 defintion if relocation uses GOT entries of the symbol.
5275 * testsuite/icf_safe_test.sh: Fix test.
5276 * testsuite/icf_safe_so_test.sh: Fix test.
5277
4ef28648
CC
52782010-09-16 Cary Coutant <ccoutant@google.com>
5279
5280 * script_sections.cc (class Memory_region): Remove "NULL" from
5281 vector initializations.
5282
793990de
CC
52832010-09-15 Cary Coutant <ccoutant@google.com>
5284
5285 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5286 Resolve forwarding symbols.
5287
81e015e2
DK
52882010-09-15 Doug Kwan <dougkwan@google.com>
5289
5290 * gold/testsuite/script_test_3.t: Add ARM special sections.
5291 * gold/testsuite/script_test_4.t: Same.
5292 * gold/testsuite/script_test_5.t: Same.
5293 * gold/testsuite/script_test_6.t: Same.
5294 * gold/testsuite/script_test_7.t: Same.
5295 * gold/testsuite/script_test_7.t: Same.
5296 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5297
36171d64
CC
52982010-09-14 Cary Coutant <ccoutant@google.com>
5299
5300 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5301 (Target_x86_64::Relocate::relocate_tls): Replace check for
5302 saw_tls_block_reloc_ with test for executable section.
5303
d89051bd
CC
53042010-09-12 Cary Coutant <ccoutant@google.com>
5305
5306 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5307 position-independent executables to shared libraries need dynamic
5308 relocations.
5309 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5310 position-independent executables.
5311 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5312 * testsuite/Makefile.in: Regenerate.
5313
fca41f0f
NC
53142010-09-10 Nick Clifton <nickc@redhat.com>
5315
5316 PR gold/11997
5317 * testsuite/memory_test.t: Discard any sections that are not
5318 needed.
5319
6695e4b3
L
53202010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5321
5322 PR gold/11996
5323 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5324 "This::" to work around a bug in gcc 4.2.
5325
5326 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5327
0f72bf6f
RÁE
53282010-09-09 Rafael Espindola <espindola@google.com>
5329
5330 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5331 sections with different PF_X flags in the same segment.
5332 (Layout::find_first_load_seg): Search all segments to find the first
5333 one.
5334 * options.h (rosegment): New.
5335
53362010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5337
05a79166 5338 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5339
aa98ff75
DK
53402010-09-08 Doug Kwan <dougkwan@google.com>
5341
5342 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5343 (Arm_relobj::do_relocate_sections): Add new parameter for output
5344 file to match the parent.
5345 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5346 of local symbols instead of input values. Update code to track
5347 changes in gold::relocate_section.
5348 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5349 (Sized_relobj::compute_final_local_value_internal): New methods.
5350 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5351 body into private version of Sized_relobj::compute_final_local_value.
5352 Call the inline method.
5353 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5354 merged symbol value if there is one.
5355 (Symbol_value::has_output_value): New method defintiion.
5356 (Sized_relobj::Compute_final_local_value_status): New enum type.
5357 (Sized_relobj::compute_final_local_value): New methods.
5358 (Sized_relobj::compute_final_local_value_internal): New methods.
5359 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5360 and arm_cortex_a8.sh.
5361 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5362 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5363 New tests.
5364 * Makefile.in: Regenerate.
5365 * testsuite/arm_bl_out_of_range.s: Update test.
5366 * testsuite/thumb_bl_out_of_range.s: Ditto.
5367 * testsuite/thumb_blx_out_of_range.s: Ditto.
5368 * testsuite/arm_branch_out_of_range.sh: New file.
5369 * testsuite/arm_cortex_a8.sh: Ditto.
5370 * testsuite/arm_cortex_a8_b.s: Ditto.
5371 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5372 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5373 * testsuite/arm_cortex_a8_bl.s: Ditto.
5374 * testsuite/arm_cortex_a8_blx.s: Ditto.
5375 * testsuite/arm_cortex_a8_local.s: Ditto.
5376 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5377 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5378
05a79166
L
53792010-09-08 Rafael Espindola <espindola@google.com>
5380
5381 * Makefile.am (memory_test.stdout): Run readelf with -W.
5382 * Makefile.in: Regenerate.
5383 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5384 64 bit output.
5385
33dbc701
RÁE
53862010-09-08 Rafael Espindola <espindola@google.com>
5387
5388 * script-sections.cc (Script_sections::add_memory_region): Convert
5389 field precision to int.
5390 * script.cc (script_set_section_region, script_set_section_region):
5391 Convert field precision to int.
5392
731ca54a
RÁE
53932010-09-08 Rafael Espindola <espindola@google.com>
5394
5395 * arm.cc (do_finalize_sections): Create the __exidx_start and
5396 __exdix_end symbols even when the section is missing.
5397
7f8cd844
NC
53982010-09-08 Nick Clifton <nickc@redhat.com>
5399
5400 * README: Remove claim that MEMORY is not supported.
5401 * expression.cc (script_exp_function_origin)
5402 (script_exp_function_length): Move from here to ...
5403 * script.cc: ... here.
5404 (script_set_section_region, script_add_memory)
5405 (script_parse_memory_attr, script_include_directive): New
5406 functions.
5407 * script-sections.cc
5408 (class Memory_region): New class.
5409 (class Output_section_definition): Add set_memory_region,
5410 set_section_vma, set_section_lma and get_section_name methods.
5411 (class Script_Sections): Add add_memory_region,
5412 find_memory_region, find_memory_region_origin,
5413 find_memory_region_length and set_memory_region methods.
5414 Have set_section_addresses method walk the list of set memory
5415 regions.
5416 Extend the print methos to display memory regions.
5417 * script-sections.h: Add prototypes for new methods.
5418 Add enum for MEMORY region attributes.
5419 * yyscript.y: Add support for parsing MEMORY regions.
5420 * script-c.h: Add prototypes for new functions.
5421 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5422 * testsuite/Makefile.in: Regenerate.
5423 * testsuite/memory_test.sh: New script.
5424 * testsuite/memory_test.s: New assembler source file.
5425 * testsuite/memory_test.t: New linker script.
5426
a4649286
DK
54272010-08-27 Doug Kwan <dougkwan@google.com>
5428
5429 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5430 reference override an existing dynamic weak reference.
5431 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5432 * testsuite/Makefile.in: Regenerate.
5433 * testsuite/dyn_weak_ref.sh: New file.
5434 * testsuite/dyn_weak_ref_1.c: Ditto.
5435 * testsuite/dyn_weak_ref_2.c: Ditto.
5436
b56648ad
ILT
54372010-08-27 Ian Lance Taylor <iant@google.com>
5438
5439 * incremental.h (class Incremental_input_entry): Add virtual
5440 destructor.
5441
809313cb
ILT
54422010-08-27 Ian Lance Taylor <iant@google.com>
5443
5444 * testsuite/start_lib_test_3.c: Mark t3 as used.
5445
11e32464
NC
54462010-08-27 Nick Clifton <nickc@redhat.com>
5447
5448 * options.cc (version_script): Fix small typo in previous
5449 whitespace tidyup.
5450
ca09d69a
NC
54512010-08-25 Nick Clifton <nickc@redhat.com>
5452
5453 * archive.cc: Formatting fixes: Remove whitespace between
5454 typename and following asterisk. Remove whitespace between
5455 function name and opening parenthesis.
5456 * archive.h: Likewise.
5457 * arm.cc: Likewise.
5458 * attributes.cc: Likewise.
5459 * attributes.h: Likewise.
5460 * common.cc: Likewise.
5461 * copy-relocs.cc: Likewise.
5462 * dirsearch.h: Likewise.
5463 * dynobj.cc: Likewise.
5464 * ehframe.cc: Likewise.
5465 * ehframe.h: Likewise.
5466 * expression.cc: Likewise.
5467 * fileread.cc: Likewise.
5468 * fileread.h: Likewise.
5469 * gc.h: Likewise.
5470 * gold-threads.cc: Likewise.
5471 * gold.cc: Likewise.
5472 * i386.cc: Likewise.
5473 * icf.h: Likewise.
5474 * incremental-dump.cc: Likewise.
5475 * incremental.cc: Likewise.
5476 * layout.cc: Likewise.
5477 * layout.h: Likewise.
5478 * main.cc: Likewise.
5479 * merge.cc: Likewise.
5480 * merge.h: Likewise.
5481 * object.cc: Likewise.
5482 * object.h: Likewise.
5483 * options.cc: Likewise.
5484 * options.h: Likewise.
5485 * output.cc: Likewise.
5486 * output.h: Likewise.
5487 * plugin.cc: Likewise.
5488 * plugin.h: Likewise.
5489 * powerpc.cc: Likewise.
5490 * reloc.cc: Likewise.
5491 * script-c.h: Likewise.
5492 * script-sections.cc: Likewise.
5493 * script.cc: Likewise.
5494 * stringpool.cc: Likewise.
5495 * symtab.cc: Likewise.
5496 * symtab.h: Likewise.
5497 * target.cc: Likewise.
5498 * timer.cc: Likewise.
5499 * timer.h: Likewise.
5500 * version.cc: Likewise.
5501 * x86_64.cc: Likewise.
5502
b8fa8750
NC
55032010-08-24 Nick Clifton <nickc@redhat.com>
5504
5505 PR 11899
5506 * layout.cc (segment_precedes): Sort segments by their physical
5507 addresses, if they have been set.
5508
9919d93b
CC
55092010-08-23 Cary Coutant <ccoutant@google.com>
5510
5511 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5512 symbols data.
5513 (Lib_group::include_member): Unlock object after deleting its
5514 symbols data.
5515 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5516 the bug fixed here.
5517
97b4be1c
CC
55182010-08-19 Neil Vachharajani <nvachhar@google.com>
5519 Cary Coutant <ccoutant@google.com>
5520
5521 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5522 constructor, and set_blocker.
5523 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5524 readsyms_blocker_.
5525 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5526 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5527 * testsuite/Makefile.am (start_lib_test): New test case.
5528 * testsuite/Makefile.in: Regenerate.
5529 * testsuite/start_lib_test_main.c: New file.
5530 * testsuite/start_lib_test_1.c: New file.
5531 * testsuite/start_lib_test_2.c: New file.
5532 * testsuite/start_lib_test_3.c: New file.
5533
dd0b1884
ILT
55342010-08-19 Ian Lance Taylor <iant@google.com>
5535
5536 * Makefile.in: Rebuild with automake 1.11.1.
5537 * aclocal.m4: Likewise.
5538 * testsuite/Makefile.in: Likewise.
5539
7223e9ca
ILT
55402010-08-19 Ian Lance Taylor <iant@google.com>
5541
5542 PR 10893
5543 * i386.cc (class Output_data_plt_i386): Update declarations.
5544 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5545 local_ifuncs_ fields.
5546 (Target_i386::do_plt_section_for_global): New function.
5547 (Target_i386::do_plt_section_for_local): New function.
5548 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5549 parameter; change all callers. Initialize global_ifuncs_ and
5550 local_ifuncs_. If doing a static link define __rel_iplt_start and
5551 __rel_iplt_end.
5552 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5553 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5554 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5555 symbols.
5556 (Target_i386::make_plt_section): New function, broken out of
5557 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5558 (Target_i386::make_plt_entry): Call make_plt_section.
5559 (Target_i386::make_local_ifunc_plt_entry): New function.
5560 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5561 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5562 R_386_IRELATIVE to switch.
5563 (Target_i386::Scan::global): Likewise.
5564 (Target_i386::Relocate::relocate): Likewise.
5565 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5566 switch.
5567 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5568 (Target_x86_64::do_plt_section_for_global): New function.
5569 (Target_x86_64::do_plt_section_for_local): New function.
5570 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5571 parameter; change all callers. If doing a static link define
5572 __rela_iplt_start and __rela_iplt_end.
5573 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5574 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5575 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5576 to point to .plt.
5577 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5578 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5579 switch.
5580 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5581 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5582 R_X86_64_IRELATIVE to switch.
5583 (Target_x86_64::Scan::global): Likewise.
5584 (Target_x86_64::Relocate::relocate): Likewise.
5585 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5586 switch.
5587 * target.h (class Target): Add plt_section_for_global and
5588 plt_section_for_local functions. Add do_plt_section_for_global
5589 and do_plt_section_for_local virtual functions.
5590 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5591 clarifying comments.
5592 (Symbol::use_plt_offset): Handle IFUNC symbol.
5593 * object.cc (Sized_relobj::Sized_relobj): Initialize
5594 local_plt_offsets_.
5595 (Sized_relobj::local_has_plt_offset): New function.
5596 (Sized_relobj::local_plt_offset): New function.
5597 (Sized_relobj::set_local_plt_offset): New function.
5598 (Sized_relobj::do_count): Handle IFUNC symbol.
5599 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5600 a bit away from input_shndx_ field. Add set_is_func_symbol and
5601 is_ifunc_symbol functions.
5602 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5603 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5604 local_plt_offsets_ field.
5605 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5606 * output.h (class Output_section_data): Add non-const
5607 output_section function.
5608 (class Output_data_got): Update declarations.
5609 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5610 Add use_plt_offset parameter to global and local constructors.
5611 Change all callers. Change local_sym_index_ field to 31 bits.
5612 Change GSYM_CODE and CONSTANT_CODE accordingly.
5613 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5614 doing a static link don't set sh_link field.
5615 (Output_data_got::Got_entry::write): Use PLT offset if
5616 appropriate.
5617 (Output_data_got::add_global_plt): New function.
5618 (Output_data_got::add_local_plt): New function.
5619 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5620 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5621 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5622 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5623 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5624 IFUNC conditional.
5625 * testsuite/ifunc-sel.h: New file.
5626 * testsuite/ifuncmain1.c: New file.
5627 * testsuite/ifuncmain1vis.c: New file.
5628 * testsuite/ifuncmod1.c: New file.
5629 * testsuite/ifuncdep2.c: New file.
5630 * testsuite/ifuncmain2.c: New file.
5631 * testsuite/ifuncmain3.c: New file.
5632 * testsuite/ifuncmod3.c: New file.
5633 * testsuite/ifuncmain4.c: New file.
5634 * testsuite/ifuncmain5.c: New file.
5635 * testsuite/ifuncmod5.c: New file.
5636 * testsuite/ifuncmain6pie.c: New file.
5637 * testsuite/ifuncmod6.c: New file.
5638 * testsuite/ifuncmain7.c: New file.
5639 * configure, testsuite/Makefile.in: Rebuild.
5640
56f75c03
ILT
56412010-08-18 Ian Lance Taylor <iant@google.com>
5642
5643 * incremental.cc
5644 (Output_section_incremental_inputs::write_input_files): Add cast
5645 to avoid signed/unsigned comparison warning.
5646 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5647
55455f89
CC
56482010-08-12 Cary Coutant <ccoutant@google.com>
5649
5650 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5651
e2054bcb
ILT
56522010-08-13 Ian Lance Taylor <iant@google.com>
5653
5654 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5655
74f67560
DK
56562010-08-12 Cary Coutant <ccoutant@google.com>
5657 Doug Kwan <dougkwan@google.com>
5658
5659 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5660 defintion overrides non-weak undef, remember that the original undef
5661 is not weak.
5662 * symtab.cc (Symbol_table::sized_write_global): For undef without
5663 an original weak binding, set binding to global in output.
5664 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5665 * testsuite/Makefile.in: Regenerate.
5666 * testsuite/strong_ref_weak_def.sh: New file.
5667 * testsuite/strong_ref_weak_def_1.c: Ditto.
5668 * testsuite/strong_ref_weak_def_2.c: Ditto.
5669
d1238d12
CC
56702010-08-12 Cary Coutant <ccoutant@google.com>
5671
5672 * testsuite/incremental_test.sh: Rewrite.
5673 * testsuite/incremental_test_1.c: Rewrite.
5674 * testsuite/incremental_test_2.c: Rewrite.
5675
0e70b911
CC
56762010-08-12 Cary Coutant <ccoutant@google.com>
5677
5678 * arm.cc (Target_arm::got_size): Add const.
5679 (Target_arm::got_entry_count): New function.
5680 (Target_arm::plt_entry_count): New function.
5681 (Target_arm::first_plt_entry_offset): New function.
5682 (Target_arm::plt_entry_size): New function.
5683 (Output_data_plt_arm::entry_count): New function.
5684 (Output_data_plt_arm::first_plt_entry_offset): New function.
5685 (Output_data_plt_arm::get_plt_entry_size): New function.
5686 * i386.cc (Target_i386::got_size): Add const.
5687 (Target_i386::got_entry_count): New function.
5688 (Target_i386::plt_entry_count): New function.
5689 (Target_i386::first_plt_entry_offset): New function.
5690 (Target_i386::plt_entry_size): New function.
5691 (Output_data_plt_i386::entry_count): New function.
5692 (Output_data_plt_i386::first_plt_entry_offset): New function.
5693 (Output_data_plt_i386::get_plt_entry_size): New function.
5694 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5695 find_incremental_inputs_sections. Dump incremental_got_plt section.
5696 * incremental.cc: Include target.h.
5697 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5698 parameter. Adjust all callers. Find incremental_got_plt section.
5699 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5700 section.
5701 (Output_section_incremental_inputs::set_final_data_size): Calculate
5702 size of incremental_got_plt section.
5703 (Output_section_incremental_inputs::do_write): Write the
5704 incremental_got_plt section.
5705 (Got_plt_view_info): New struct.
5706 (Local_got_offset_visitor): New class.
5707 (Global_got_offset_visitor): New class.
5708 (Global_symbol_visitor_got_plt): New class.
5709 (Output_section_incremental_inputs::write_got_plt): New function.
5710 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5711 Add parameter. Adjust all callers.
5712 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5713 (Incremental_inputs::got_plt_section): New function.
5714 (Incremental_inputs::got_plt_section_): New data member.
5715 (Incremental_got_plt_reader): New class.
5716 * layout.cc (Layout::create_incremental_info_sections): Add the
5717 incremental_got_plt section.
5718 * object.h (Got_offset_list::get_list): New function.
5719 (Got offset_list::for_all_got_offsets): New function.
5720 (Sized_relobj::local_got_offset_list): New function.
5721 * powerpc.cc (Target_powerpc::got_size): Add const.
5722 (Target_powerpc::got_entry_count): New function.
5723 (Target_powerpc::plt_entry_count): New function.
5724 (Target_powerpc::first_plt_entry_offset): New function.
5725 (Target_powerpc::plt_entry_size): New function.
5726 (Output_data_plt_powerpc::entry_count): New function.
5727 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5728 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5729 * sparc.cc (Target_sparc::got_size): Add const.
5730 (Target_sparc::got_entry_count): New function.
5731 (Target_sparc::plt_entry_count): New function.
5732 (Target_sparc::first_plt_entry_offset): New function.
5733 (Target_sparc::plt_entry_size): New function.
5734 (Output_data_plt_sparc::entry_count): New function.
5735 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5736 (Output_data_plt_sparc::get_plt_entry_size): New function.
5737 * symtab.h (Symbol::got_offset_list): New function.
5738 (Symbol_table::for_all_symbols): New function.
5739 * target.h (Sized_target::got_entry_count): New function.
5740 (Sized_target::plt_entry_count): New function.
5741 (Sized_target::plt_entry_size): New function.
5742 * x86_64.cc (Target_x86_64::got_size): Add const.
5743 (Target_x86_64::got_entry_count): New function.
5744 (Target_x86_64::plt_entry_count): New function.
5745 (Target_x86_64::first_plt_entry_offset): New function.
5746 (Target_x86_64::plt_entry_size): New function.
5747 (Output_data_plt_x86_64::entry_count): New function.
5748 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5749 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5750
09ec0418
CC
57512010-08-12 Cary Coutant <ccoutant@google.com>
5752
5753 * archive.cc: Include incremental.h.
5754 (Archive::Archive): Initialize incremental_info_.
5755 (Archive::include_member): Record archive members in incremental info.
5756 (Add_archive_symbols::run): Record begin and end of an archive in
5757 incremental info.
5758 (Lib_group::include_member): Record objects in incremental info.
5759 * archive.h (Incremental_archive_entry): Forward declaration.
5760 (Archive::set_incremental_info): New member function.
5761 (Archive::incremental_info): New member function.
5762 (Archive::Unused_symbol_iterator): New class.
5763 (Archive::unused_symbols_begin): New member function.
5764 (Archive::unused_symbols_end): New member function.
5765 (Archive::incremental_info_): New data member.
5766 * incremental-dump.cc (find_input_containing_global): New function.
5767 (dump_incremental_inputs): Dump new incremental info sections.
5768 * incremental.cc: Include symtab.h.
5769 (Output_section_incremental_inputs): New class.
5770 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5771 new incremental info sections.
5772 (Sized_incremental_binary::do_check_inputs): Likewise.
5773 (Incremental_inputs::report_archive): Remove.
5774 (Incremental_inputs::report_archive_begin): New function.
5775 (Incremental_inputs::report_archive_end): New function.
5776 (Incremental_inputs::report_object): New function.
5777 (Incremental_inputs::finalize_inputs): Remove.
5778 (Incremental_inputs::report_input_section): New function.
5779 (Incremental_inputs::report_script): Rewrite.
5780 (Incremental_inputs::finalize): Do nothing but finalize string table.
5781 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5782 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5783 (Incremental_inputs::create_data_sections): New function.
5784 (Incremental_inputs::relocs_entsize): New function.
5785 (Output_section_incremental_inputs::set_final_data_size): New function.
5786 (Output_section_incremental_inputs::do_write): New function.
5787 (Output_section_incremental_inputs::write_header): New function.
5788 (Output_section_incremental_inputs::write_input_files): New function.
5789 (Output_section_incremental_inputs::write_info_blocks): New function.
5790 (Output_section_incremental_inputs::write_symtab): New function.
5791 * incremental.h (Incremental_script_entry): Forward declaration.
5792 (Incremental_object_entry): Forward declaration.
5793 (Incremental_archive_entry): Forward declaration.
5794 (Incremental_inputs): Forward declaration.
5795 (Incremental_inputs_header_data): Remove.
5796 (Incremental_inputs_header): Remove.
5797 (Incremental_inputs_header_write): Remove.
5798 (Incremental_inputs_entry_data): Remove.
5799 (Incremental_inputs_entry): Remove.
5800 (Incremental_inputs_entry_write): Remove.
5801 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5802 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5803 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5804 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5805 Likewise.
5806 (Incremental_input_entry): New class.
5807 (Incremental_script_entry): New class.
5808 (Incremental_object_entry): New class.
5809 (Incremental_archive_entry): New class.
5810 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5811 (Incremental_inputs::report_inputs): Remove.
5812 (Incremental_inputs::report_archive): Remove.
5813 (Incremental_inputs::report_archive_begin): New function.
5814 (Incremental_inputs::report_archive_end): New function.
5815 (Incremental_inputs::report_object): Change prototype.
5816 (Incremental_inputs::report_input_section): New function.
5817 (Incremental_inputs::report_script): Change prototype.
5818 (Incremental_inputs::get_reloc_count): New function.
5819 (Incremental_inputs::set_reloc_count): New function.
5820 (Incremental_inputs::create_data_sections): New function.
5821 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5822 (Incremental_inputs::inputs_section): New function.
5823 (Incremental_inputs::symtab_section): New function.
5824 (Incremental_inputs::relocs_section): New function.
5825 (Incremental_inputs::get_stringpool): Add const.
5826 (Incremental_inputs::command_line): Add const.
5827 (Incremental_inputs::inputs): Remove.
5828 (Incremental_inputs::command_line_key): New function.
5829 (Incremental_inputs::input_file_count): New function.
5830 (Incremental_inputs::input_files): New function.
5831 (Incremental_inputs::relocs_entsize): New function.
5832 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5833 (Incremental_inputs::finalize_inputs): Remove.
5834 (Incremental_inputs::Input_info): Remove.
5835 (Incremental_inputs::lock_): Remove.
5836 (Incremental_inputs::inputs_): Change type.
5837 (Incremental_inputs::inputs_map_): Remove.
5838 (Incremental_inputs::current_object_entry_): New data member.
5839 (Incremental_inputs::inputs_section_): New data member.
5840 (Incremental_inputs::symtab_section_): New data member.
5841 (Incremental_inputs::relocs_section_): New data member.
5842 (Incremental_inputs::reloc_count_): New data member.
5843 (Incremental_inputs_reader): New class.
5844 (Incremental_symtab_reader): New class.
5845 (Incremental_relocs_reader): New class.
5846 * layout.cc (Layout::finalize): Move finalization of incremental info
5847 and creation of incremental info sections to follow finalization of
5848 symbol table. Set offsets for postprocessing sections.
5849 (Layout::create_incremental_info_sections): Call
5850 Incremental_inputs::create_data_sections. Add incremental symtab
5851 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5852 sections to layout after input sections.
5853 * layout.h (struct Timespec): Forward declaration.
5854 (Layout::incremental_inputs): Add const.
5855 (Layout::create_incremental_info_sections): Add parameter.
5856 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5857 * object.cc: Include incremental.h.
5858 (Relobj::finalize_incremental_relocs): New function.
5859 (Sized_relobj::do_layout): Record input sections in incremental info.
5860 * object.h (Object::output_section): New function.
5861 (Object::output_section_offset): Moved from Relobj.
5862 (Object::get_incremental_reloc_base): New function.
5863 (Object::get_incremental_reloc_count): New function.
5864 (Object::do_output_section): New function.
5865 (Object::do_output_section_offset): Moved from Relobj.
5866 (Object::do_get_incremental_reloc_base): New function.
5867 (Object::do_get_incremental_reloc_count): New function.
5868 (Object::Object): Initialize new data members.
5869 (Relobj::output_section): Renamed do_output_section and moved to
5870 protected.
5871 (Relobj::output_section_offset): Moved to Object.
5872 (Relobj::do_get_incremental_reloc_base): New function.
5873 (Relobj::do_get_incremental_reloc_count): New function.
5874 (Relobj::allocate_incremental_reloc_counts): New function.
5875 (Relobj::count_incremental_reloc): New function.
5876 (Relobj::finalize_incremental_relocs): New function.
5877 (Relobj::next_incremental_reloc_index): New function.
5878 (Relobj::reloc_counts_): New data member.
5879 (Relobj::reloc_bases_): New data member.
5880 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5881 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5882 (Sized_relobj::incremental_relocs_scan): New function.
5883 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5884 (Sized_relobj::incremental_relocs_write): New function.
5885 (Sized_relobj::incremental_relocs_write_reltype): New function.
5886 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5887 incremental link.
5888 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5889 archives and object files elsewhere.
5890 (Add_symbols::run): Report object files here.
5891 (Finish_group::run): Report end of archive at end of group.
5892 * reloc.cc: Include layout.h, incremental.h.
5893 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5894 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5895 (Sized_relobj::incremental_relocs_scan): New function.
5896 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5897 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5898 (Sized_relobj::incremental_relocs_write): New function.
5899 (Sized_relobj::incremental_relocs_write_reltype): New function.
5900 * script.cc (read_input_script): Rewrite test for incremental link.
5901 Change call to Incremental_inputs::report_script.
5902 * symtab.h (Symbol_table::first_global_index): New function.
5903 (Symbol_table::output_count): New function.
5904
ce0d1972
DK
59052010-08-12 Doug Kwan <dougkwan@google.com>
5906
5907 * arm.cc (Target_arm::merge_object_attributes): Check command line
5908 options --no-wchar-size-warning and --no-enum-size-warning.
5909 * options.h (General_options): Add ld-compatible options
5910 --no-enum-size-warning and --no-wchar-size-warning.
5911
6e5710ce
ILT
59122010-08-04 Ian Lance Taylor <iant@google.com>
5913
5914 * x86_64.cc (Target_x86_64::Scan::local): Use
5915 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5916 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5917 (Target_x86_64::Scan::global): Likewise.
5918 (Target_x86_64::Relocate::relocate): Likewise.
5919 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5920 Likewise.
5921
fef830db
CC
59222010-08-03 Cary Coutant <ccoutant@google.com>
5923
5924 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5925 to reserve space in merged_strings vector. Keep total input size
5926 for stats.
5927 (Output_merge_string::do_print_merge_stats): Print total input size.
5928 * merge.h (Output_merge_string): Add input_size_ field.
5929 * stringpool.cc (Stringpool_template::string_length): Move
5930 implementations out of Stringpool_template class and place in
5931 stringpool.h.
5932 * stringpool.h (string_length): Move out of Stringpool_template.
5933
1e3811b0
ILT
59342010-08-03 Ian Lance Taylor <iant@google.com>
5935
5936 PR 11712
5937 * layout.cc (relaxation_loop_body): If address of load segment is
5938 set, adjust address to include headers if possible.
5939
7af0c620
ILT
59402010-08-03 Ian Lance Taylor <iant@google.com>
5941
5942 * version.cc (version_string): Bump to 1.10.
5943
22f0da72
ILT
59442010-08-03 Ian Lance Taylor <iant@google.com>
5945
5946 PR 11805
5947 * layout.h (enum Output_section_order): Define.
5948 (class Layout): Update declarations.
5949 * layout.cc (Layout::get_output_section): Add order parameter.
5950 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5951 is_first_non_relro parameters. Change all callers.
5952 (Layout::choose_output_section): Likewise.
5953 (Layout::add_output_section_data): Likewise.
5954 (Layout::make_output_section): Likewise. Set order.
5955 (Layout::default_section_order): New function.
5956 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5957 * output.cc (Output_section::Output_section): Initialize order_.
5958 Don't initialize deleted fields.
5959 (Output_segment::Output_segment): Don't initialize deleted
5960 fields.
5961 (Output_segment::add_output_section_to_load): New function
5962 replacing add_output_section. Change all callers to call this or
5963 add_output_section_to_nonload.
5964 (Output_segment::add_output_section_to_nonload): New function.
5965 (Output_segment::remove_output_section): Rewrite.
5966 (Output_segment::add_initial_output_data): Likewise.
5967 (Output_segment::has_any_data_sections): Likewise.
5968 (Output_segment::is_first_section_relro): Likewise.
5969 (Output_segment::maximum_alignment): Likewise.
5970 (Output_segment::has_dynamic_reloc): New function replacing
5971 dynamic_reloc_count. Change all callers.
5972 (Output_segment::has_dynamic_reloc_list): New function replacing
5973 dynamic_reloc_count_list. Change all callers.
5974 (Output_segment::set_section_addresses): Rewrite.
5975 (Output_segment::set_offset): Rewrite.
5976 (Output_segment::find_first_and_last_list): Remove.
5977 (Output_segment::set_tls_offsets): Rewrite.
5978 (Output_segment::first_section_load_address): Likewise.
5979 (Output_segment::output_section_count): Likewise.
5980 (Output_segment::section_with_lowest_load_address): Likewise.
5981 (Output_segment::write_section_headers): Likewise.
5982 (Output_segment::print_sections_to_map): Likewise.
5983 * output.h (class Output_data): Remove dynamic_reloc_count_
5984 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5985 (Output_data::add_dynamic_reloc): Rewrite.
5986 (Output_data::has_dynamic_reloc): New function.
5987 (Output_data::dynamic_reloc_count): Remove.
5988 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5989 is_last_relro_, is_first_non_relro_, is_interp_,
5990 is_dynamic_linker_section_ fields. Add order and set_order
5991 functions. Remove is_relro_local, set_is_relro_local,
5992 is_last_relro, set_is_last_relro, is_first_non_relro,
5993 set_is_first_non_relro functions, is_interp, set_is_interp,
5994 is_dynamic_linker_section, and set_is_dynamic_linker_section
5995 functions.
5996 (class Output_segment): Change Output_data_list from std::list to
5997 std:;vector. Add output_lists_ field. Remove output_data_ and
5998 output_bss_ fields. Update declarations.
5999
3ff2ccb0
ILT
60002010-08-02 Ian Lance Taylor <iant@google.com>
6001
6002 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6003 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6004 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6005
88a4108b
ILT
60062010-08-02 Ian Lance Taylor <iant@google.com>
6007
6008 PR 11855
6009 * script.cc (Script_options::Script_options): Initialize
6010 symbol_definitions_ and symbol_references_.
6011 (Script_options::add_symbol_assignment): Update
6012 symbol_definitions_ and symbol_references_.
6013 (Script_options::add_symbol_reference): New function.
6014 (script_symbol): New function.
6015 * script.h (class Script_options): Add symbol_definitions_ and
6016 symbol_references_ fields.
6017 (Script_options::referenced_const_iterator): New type.
6018 (Script_options::referenced_begin): New function.
6019 (Script_options::referenced_end): New function.
6020 (Script_options::is_referenced): New function.
6021 (Script_options::any_unreferenced): New function.
6022 * script-c.h (script_symbol): Declare.
6023 * yyscript.y (exp): Call script_symbol.
6024 * symtab.cc: Include "script.h".
6025 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6026 Change all callers. Check symbols referenced by scripts.
6027 (Symbol_table::add_undefined_symbols_from_command_line): Add
6028 layout parameter. Change all callers.
6029 (Symbol_table::do_add_undefined_symbols_from_command_line):
6030 Likewise. Break out loop body. Check symbols referenced by
6031 scripts.
6032 (Symbol_table::add_undefined_symbol_from_command_line): New
6033 function broken out of
6034 do_add_undefined_symbols_from_command_line.
6035 * symtab.h (class Symbol_table): Update declarations.
6036 * archive.cc: Include "layout.h".
6037 (Archive::should_include_member): Add layout parameter. Change
6038 all callers. Check for symbol mentioned in expression.
6039 * archive.h (class Archive): Update declaration.
6040 * object.cc (Sized_relobj::do_should_include_member): Add layout
6041 parameter.
6042 * object.h (Object::should_include_member): Add layout parameter.
6043 Change all callers.
6044 (Object::do_should_include_member): Add layout parameter.
6045 (class Sized_relobj): Update declaration.
6046 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6047 parameter.
6048 * dynobj.h (class Sized_dynobj): Update declaration.
6049 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6050 layout parameter.
6051 * plugin.h (class Sized_pluginobj): Update declaration.
6052
5f1ab67a
ILT
60532010-08-02 Ian Lance Taylor <iant@google.com>
6054
6055 PR 11866
6056 * output.cc (Output_segment::set_offset): Search for the first and
6057 last sections rather than assuming that the list is in order.
6058 (Output_segment::find_first_and_last_list): New function.
6059 * output.h (class Output_segment): Update declarations.
6060 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6061 (relro_strip_test_SOURCES): New variable.
6062 (relro_strip_test_DEPENDENCIES): New variable.
6063 (relro_strip_test_LDFLAGS): New variable.
6064 (relro_strip_test_LDADD): New variable.
6065 (relro_strip_test.so): New target.
6066
a8df5856
ILT
60672010-08-02 Ian Lance Taylor <iant@google.com>
6068
6069 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6070 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6071 (Target_i386::got_tlsdesc_section): New function.
6072 (Target_i386::got_section): Create space for GOT entries for
6073 TLSDESC relocations.
6074 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6075 R_386_TLS_GOTDESC.
6076 (Target_i386::Scan::global): Likewise.
6077 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6078 using TLSDESC GOT.
6079 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6080 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6081 (Target_x86_64::got_tlsdesc_section): New function.
6082 (Target_x86_64::got_section): Create space for GOT entries for
6083 TLSDESC relocations.
6084 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6085 R_386_TLS_GOTDESC.
6086 (Target_x86_64::Scan::global): Likewise.
6087 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6088 using TLSDESC GOT.
6089
0c10a0a6
ILT
60902010-08-02 Ian Lance Taylor <iant@google.com>
6091
6092 * testsuite/final_layout.sh: Use dc to convert from hex to
6093 decimal.
6094
41cbeecc
ST
60952010-07-29 Sriraman Tallam <tmsriram@google.com>
6096
6097 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6098 paramter to the call to gold::gc_process_relocs.
6099 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6100 paramter to the call to gold::gc_process_relocs.
6101 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6102 parameter to the call to gold::gc_process_relocs.
6103 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6104 template parameter to the call to gold::gc_process_relocs.
6105 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6106 paramter to the call to gold::gc_process_relocs.
6107 * gc.h (get_embedded_addend_size): New function.
6108 (gc_process_relocs): Save the size of the reloc for use by ICF.
6109 * icf.cc (get_section_contents): Get the addend from the text section
6110 for SHT_REL relocation sections.
6111 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6112 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6113 * int_encoding.h (read_from_pointer): New overloaded function.
6114 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6115 * testsuite/icf_sht_rel_addend_test.sh: New file.
6116 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6117 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6118
6ea55b82
RW
61192010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6120
6121 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6122 * Makefile.in: Regenerate.
6123 * testsuite/Makefile.in: Regenerate.
6124
9691462b
ILT
61252010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6126
6127 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6128 * gold/testsuite/debug_msg.cc: Likewise.
6129 * gold/testsuite/odr_violation1.cc
6130 * gold/testsuite/odr_violation2.cc
6131
76897331
CC
61322010-07-21 Cary Coutant <ccoutant@google.com>
6133
6134 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6135 string, and length fields.
6136 (Output_merge_string::Merged_strings_list): New type.
6137 (Output_merge_string::Merged_strings_lists): New typedef.
6138 (Output_merge_string): Replace merged_strings_ with
6139 merged_strings_lists_.
6140 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6141 Merged_strings_list per input object and section. Don't store pointer
6142 to the string. Don't store length with each merged string entry.
6143 (Output_merge_string::finalize_merged_data): Loop over list of merged
6144 strings lists. Recompute length of each merged string.
6145
78384e8f
CC
61462010-07-15 Cary Coutant <ccoutant@google.com>
6147
6148 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6149 here.
6150
783659f9
ILT
61512010-07-14 Ian Lance Taylor <iant@google.com>
6152
6153 * descriptors.cc (Descriptors::open): Report correct name in error
6154 message.
6155
131687b4
DK
61562010-07-13 Doug Kwan <dougkwan@google.com>
6157
6158 * arm.cc (Arm_input_section::Arm_input_section): For a
6159 SHT_ARM_EXIDX section, always keeps the input sections.
6160 (Arm_input_section::set_exidx_section_link): New method.
6161 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6162 has_errors_ to false.
6163 (Arm_exidx_input_section::has_errors,
6164 Arm_exidx_input_section::set_has_errors): New methods.
6165 (Arm_exidx_input_section::has_errors_): New data member.
6166 (Arm_relobj::get_exidx_shndx_list): New method.
6167 (Arm_output_section::append_text_sections_to_list): Do not skip
6168 section without SHF_EXECINSTR.
6169 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6170 errors.
2e702c99 6171 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6172 section header. Make error messages more verbose. Check for
6173 a non-executable section linked to an EXIDX section.
6174 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6175 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6176 check that there is no deferred EXIDX section if we exit early.
6177 Instead of not making an EXIDX section in case of an error, make one
6178 and set the has_errors flag of it.
6179 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6180 in a relocatable link.
6181 (Target_arm::do_relax): Look for the EXIDX output section instead of
6182 assuming that it is called .ARM.exidx.
2e702c99 6183 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6184 section list. Do not check for SHF_EXECINSTR section flags but
6185 skip any input section with errors.
6186 * output.cc (Output_section::Output_section): Initialize
6187 always_keeps_input_sections_ to false.
6188 (Output_section::add_input_section): Check for
6189 always_keeps_input_sections_.
6190 * output.h (Output_section::always_keeps_input_sections,
6191 Output_section::set_always_keeps_input_sections): New methods.
6192 (Output_section::always_keeps_input_sections): New data member.
6193
69517287
RÁE
61942010-07-13 Rafael Espindola <espindola@google.com>
6195
6196 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6197 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6198
82742395
ILT
61992010-07-13 Philip Herron <herron.philip@googlemail.com>
6200 Ian Lance Taylor <iant@google.com>
6201
6202 * output.h (Output_section_lookup_maps::add_merge_section):
6203 Correct check of whether value was inserted.
6204 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6205 (Output_section_lookup_maps::add_relaxed_input_section):
6206 Likewise.
6207 * arm.cc (Target_arm::got_section): Remove used local os.
6208 * i386.cc (Target_i386::got_section): Likewise.
6209 * x86_64.cc (Target_x86_64::got_section): Likewise.
6210 * sparc.cc (Target_sparc::got_section): Likewise.
6211 (Target_sparc::relocate): Remove unused local have_got_offset.
6212 * powerpc.cc (Target_powerpc::relocate): Likewise.
6213
f2d707b5
ILT
62142010-07-13 Ian Lance Taylor <iant@google.com>
6215
241531d6
ILT
6216 * compressed_output.cc (zlib_decompress): Fix signature in
6217 !HAVE_ZLIB_H case.
6218
f2d707b5
ILT
6219 * archive.cc (Archive::include_member): Unlock an external member
6220 of a thin archive. Don't bother to delete an object we know is
6221 NULL.
6222
a2e47362
CC
62232010-07-12 Cary Coutant <ccoutant@google.com>
6224
6225 * compressed_output.cc (zlib_decompress): New function.
6226 (get_uncompressed_size): New function.
6227 (decompress_input_section): New function.
6228 * compressed_output.h (get_uncompressed_size): New function.
6229 (decompress_input_section): New function.
6230 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6231 Handle compressed debug sections.
6232 * layout.cc (is_compressed_debug_section): New function.
6233 (Layout::output_section_name): Map compressed section names to
6234 canonical names.
6235 * layout.h (is_compressed_debug_section): New function.
6236 (is_debug_info_section): Recognize compressed debug sections.
6237 * merge.cc: Include compressed_output.h.
6238 (Output_merge_data::do_add_input_section): Handle compressed
6239 debug sections.
6240 (Output_merge_string::do_add_input_section): Handle compressed
6241 debug sections.
6242 * object.cc: Include compressed_output.h.
6243 (Sized_relobj::Sized_relobj): Initialize new data members.
6244 (build_compressed_section_map): New function.
6245 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6246 * object.h (Object::section_is_compressed): New method.
6247 (Object::do_section_is_compressed): New method.
6248 (Sized_relobj::Compressed_section_map): New type.
6249 (Sized_relobj::do_section_is_compressed): New method.
6250 (Sized_relobj::compressed_sections_): New data member.
6251 * output.cc (Output_section::add_input_section): Handle compressed
6252 debug sections.
6253 * reloc.cc: Include compressed_output.h.
6254 (Sized_relobj::write_sections): Handle compressed debug sections.
6255
ce279a62
CC
62562010-07-08 Cary Coutant <ccoutant@google.com>
6257
6258 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6259 weak when resolving to a dynamic def.
6260 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6261 for weak undef/dynamic def cases. Adjust callers.
6262 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6263 undef_binding_weak_.
6264 (Symbol_table::sized_write_globals): Adjust symbol binding.
6265 (Symbol_table::sized_write_symbol): Add binding parameter.
6266 * symtab.h (Symbol::set_undef_binding): New method.
6267 (Symbol::is_undef_binding_weak): New method.
6268 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6269 (Symbol_table::should_override): Add new parameter.
6270 (Symbol_table::sized_write_symbol): Add new parameter.
6271
6272 * testsuite/weak_undef_file1.cc: Add new test case.
6273 * testsuite/weak_undef_file2.cc: Fix header comment.
6274 * testsuite/weak_undef_test.cc: Add new test case.
6275
b2286c10
DK
62762010-06-29 Doug Kwan <dougkwan@google.com>
6277
6278 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6279 Initialize USE_SYMBOL_.
6280 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6281 definition.
6282 (Arm_reloc_property::uses_symbol_): New data member declaration.
6283 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6284 uses symbol value and symbol is undefined but not weakly undefined.
6285
4802450a
RÁE
62862010-06-28 Rafael Espindola <espindola@google.com>
6287
6288 * plugin.cc (Plugin::load): Use dlerror.
6289
e5ca47ba
ILT
62902010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6291
6292 * symtab.cc (detect_odr_violations): When reporting an ODR
6293 violation, report an object where the symbol is defined.
6294
8a75a161
DK
62952010-06-25 Doug Kwan <dougkwan@google.com>
6296
6297 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6298 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6299 definition.
6300 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6301 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6302 target hook to detect function points.
6303 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6304 * icf.h (Icf::check_section_for_function_pointers): Change type of
6305 parameter SECTION_NAME to const reference to std::string. Use
6306 target hook to determine if section may have unsafe pointers.
6307 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6308 method definition.
6309
42218b9f
RÁE
63102010-06-21 Rafael Espindola <espindola@google.com>
6311
6312 * fileread.cc (Input_file::find_fie): New
6313 (Input_file::open): Use Input_file::find_fie.
6314 * fileread.h (Input_file::find_fie): New
6315 * plugin.cc (set_extra_library_path): New.
6316 (Plugin::load): Add set_extra_library_path to the transfer vector.
6317 (Plugin_manager::set_extra_library_path): New.
6318 (Plugin_manager::add_input_file): Use the extra search path if set.
6319 (set_extra_library_path(): New.
6320 * plugin.h (Plugin_manager): Add set_extra_library_path and
6321 extra_search_path_.
6322
a0506cca
CC
63232010-06-19 Cary Coutant <ccoutant@google.com>
6324
6325 * layout.cc (gdb_sections): Add .debug_types.
6326 (lines_only_debug_sections): Likewise.
6327
6508b958
RÁE
63282010-06-18 Rafael Espindola <espindola@google.com>
6329
6330 * plugin.cc (add_input_file,add_input_library)
6331 (Plugin_manager::add_input_file): Make filename arguments const.
6332 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6333 const.
6334
3e235302
DK
63352010-06-16 Doug Kwan <dougkwan@google.com>
6336
6337 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6338 .ARM.attributes section if we have not merged any input
6339 attributes sections.
6340
106e8a6c
DK
63412010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6342
6343 * arm.cc: Allow combining objects with no EABI version
6344 information.
6345
91ff43fe
RÁE
63462010-06-15 Rafael Espindola <espindola@google.com>
6347
6348 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6349
68ed838c
ILT
63502010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6351
6352 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6353 (struct iovec): Correct !HAVE_READV definition.
6354
f3a2388f
CC
63552010-06-10 Cary Coutant <ccoutant@google.com>
6356
6357 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6358 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6359 reloc sections.
6360 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6361
6362 PR 11683
6363 * symtab.h (Symbol::is_placeholder): New member function.
6364 * target-reloc.h (relocate_section): Check for placeholder symbols.
6365
6366 * testsuite/Makefile.am (plugin_test_8): New test.
6367 (plugin_test_9): New test.
6368 * testsuite/Makefile.in: Regenerate.
6369
e1df38aa
NC
63702010-06-09 Nick Clifton <nickc@redhat.com>
6371
6372 * yyscript.y (input_list_element): Allow strings prefixed with
6373 the '-' character. Treat these as libraries.
6374 * script.cc (script_add_library): New function. Adds a library
6375 specified by "-l<name>" found in an input script.
6376 * script-c.h: Add prototype for script_add_library.
6377
25bbe950
DK
63782010-06-07 Doug Kwan <dougkwan@google.com>
6379
6380 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6381 Restrict stub-group size to be within long conditional branch
6382 range when working around cortex-A8 erratum.
6383
0f32ea4c
ILT
63842010-06-07 Damien Diederen <dd@crosstwine.com>
6385
6386 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6387 #ifdef typo.
6388
8fe2a369
ST
63892010-06-03 Sriraman Tallam <tmsriram@google.com>
6390
6391 PR gold/11658
6392 * output.cc
6393 (Output_section::Input_section_sort_entry::compare_section_ordering):
6394 Change to return non-zero correctly.
6395 (Output_section::Input_section_sort_section_order_index_compare
6396 ::operator()): Change to fix ambiguity in comparisons.
6397
6e9ba2ca
ST
63982010-06-01 Sriraman Tallam <tmsriram@google.com>
6399
6400 * gold.h (is_wildcard_string): New function.
6401 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6402 (Layout::layout_eh_frame): Ditto.
6403 (Layout::find_section_order_index): New method.
6404 (Layout::read_layout_from_file): New method.
6405 * layout.h (Layout::find_section_order_index): New method.
6406 (Layout::read_layout_from_file): New method.
6407 (Layout::input_section_position_): New private member.
6408 (Layout::input_section_glob_): New private member.
6409 * main.cc (main): Call read_layout_from_file here.
6410 * options.h (--section-ordering-file): New option.
6411 * output.cc (Output_section::input_section_order_specified_): New
6412 member.
6413 (Output_section::Output_section): Initialize new member.
6414 (Output_section::add_input_section): Add new parameter.
6415 Keep input sections when --section-ordering-file is used.
6416 (Output_section::set_final_data_size): Sort input sections when
6417 section ordering file is specified.
6418 (Output_section::Input_section_sort_entry): Add new parameter.
6419 Check sorting type.
6420 (Output_section::Input_section_sort_entry::compare_section_ordering):
6421 New method.
6422 (Output_section::Input_section_sort_compare::operator()): Change to
6423 consider section_order_index.
6424 (Output_section::Input_section_sort_init_fini_compare::operator()):
6425 Change to consider section_order_index.
6426 (Output_section::Input_section_sort_section_order_index_compare
6427 ::operator()): New method.
6428 (Output_section::sort_attached_input_sections): Change to sort
6429 according to section order when specified.
e1df38aa
NC
6430 (Output_section::add_input_section<32, true>): Add new parameter.
6431 (Output_section::add_input_section<64, true>): Add new parameter.
6432 (Output_section::add_input_section<32, false>): Add new parameter.
6433 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6434 * output.h (Output_section::add_input_section): Add new parameter.
6435 (Output_section::input_section_order_specified): New
6436 method.
6437 (Output_section::set_input_section_order_specified): New method.
6438 (Input_section::Input_section): Initialize section_order_index_.
6439 (Input_section::section_order_index): New method.
6440 (Input_section::set_section_order_index): New method.
6441 (Input_section::section_order_index_): New member.
6442 (Input_section::Input_section_sort_section_order_index_compare): New
6443 struct.
6444 (Output_section::input_section_order_specified_): New member.
6445 * script-sections.cc (is_wildcard_string): Delete and move modified
6446 method to gold.h.
6447 (Output_section_element_input::Output_section_element_input): Modify
6448 call to is_wildcard_string.
6449 (Output_section_element_input::Input_section_pattern
6450 ::Input_section_pattern): Ditto.
6451 (Output_section_element_input::Output_section_element_input): Ditto.
6452 * testsuite/Makefile.am (final_layout): New test case.
6453 * testsuite/Makefile.in: Regenerate.
6454 * testsuite/final_layout.cc: New file.
6455 * testsuite/final_layout.sh: New file.
6456
3537c84b
RÁE
64572010-06-01 Rafael Espindola <espindola@google.com>
6458
6459 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6460
105b6afd
RÁE
64612010-06-01 Rafael Espindola <espindola@google.com>
6462
6463 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6464 visibility of symbols.
6465
29e11421
DK
64662010-05-27 Doug Kwan <dougkwan@google.com>
6467
6468 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6469 from start of output section instead of address for a local symbol
6470 in a merged or relaxed section when doing a relocatable link.
6471
5e0f337e
RÁE
64722010-05-26 Rafael Espindola <espindola@google.com>
6473
703d02da 6474 PR 11604
5e0f337e
RÁE
6475 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6476 adding sections the garbage collector removed.
6477 * gold/testsuite/Makefile.am: Add test.
6478 * gold/testsuite/Makefile.in: Regenerate.
6479 * gold/testsuite/plugin_test_7.sh: New.
6480 * gold/testsuite/plugin_test_7_1.c: New.
6481 * gold/testsuite/plugin_test_7_2.c: New.
6482
f4187277
RÁE
64832010-05-26 Rafael Espindola <espindola@google.com>
6484
6485 * script-sections.cc (Output_section_definition::set_section_addresses):
6486 Check for --section-start.
6487
5c388529
DK
64882010-05-26 Doug Kwan <dougkwan@google.com>
6489
6490 * arm.cc (Arm_scan_relocatable_relocs): New class.
6491 (Target_arm::relocate_special_relocatable): New method.
6492 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6493 (Arm_relocate_functions::thumb_branch_common): Same.
6494 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6495 instead of Default_scan_relocatable_relocs.
6496 * target-reloc.h (relocate_for_relocatable): Let target handle
6497 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6498 * target.h (Sized_target::relocate_special_relocatable): New method.
6499
bca1c3ae
ILT
65002010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6501
6502 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6503
0439c796
DK
65042010-05-23 Doug Kwan <dougkwan@google.com>
6505
6506 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6507 instead of a cast.
6508 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6509 with a direct branch, not a conditional branch, to a stub.
6510 * merge.cc (Output_merge_base::record_input_section): New method
6511 defintion.
6512 (Output_merge_data::do_add_input_section): Record input section if
6513 keeps-input-sections flag is set.
6514 (Output_merge_string::do_add_input_section): Ditto.
6515 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6516 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6517 INPUT_SECTIONS_.
6518 (Output_merge_base::keeps_input_sections,
6519 Output_merge_base::set_keeps_input_sections,
6520 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6521 method definitions.
6522 (Output_merge_base::Input_sections): New type declaration.
6523 (Output_merge_base::input_sections_begin,
6524 Output_merge_base::input_sections_end,
6525 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6526 (Output_merge_base::bool keeps_input_sections_,
6527 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6528 Output_merge_base::input_sections_): New data members.
6529 (Output_merge_data::do_set_keeps_input_sections): New method
6530 defintion.
6531 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6532 * output.cc (Output_section::Input_section::relobj): Move method
6533 defintion from class declaration to here and handle merge sections.
6534 (Output_section::Input_section::shndx): Ditto.
6535 (Output_section::Output_section): Remove initializations of removed
6536 data members and initialize new data member LOOKUP_MAPS_.
6537 (Output_section::add_input_section): Set keeps-input-sections flag
6538 for a newly created merge output section as appropriate. Adjust code
6539 to use Output_section_lookup_maps class.
6540 (Output_section::add_relaxed_input_section): Adjst code for lookup
6541 maps code refactoring.
2e702c99 6542 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6543 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6544 class. If adding input section to a newly created merge output
6545 section fails, remove the new merge section.
6546 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6547 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6548 (Output_section::find_merge_section): Ditto.
0439c796 6549 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6550 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6551 Output_section_lookup_maps class.
6552 (Output_section::get_input_sections): Export merge sections. Adjust
6553 code to use Output_section_lookup_maps class.
6554 (Output_section:::add_script_input_section): Adjust code to use
6555 Output_section_lookup_maps class. Update lookup maps for merge
6556 sections also.
6557 (Output_section::discard_states): Use Output_section_lookup_maps.
6558 (Output_section::restore_states): Same.
6559 * output.h (Merge_section_properties): Move class defintion out of
6560 Output_section.
6561 (Output_section_lookup_maps): New class.
6562 (Output_section::Input_section::is_merge_section): New method
6563 defintion.
6564 (Output_section::Input_section::relobj): Move defintion out of class
6565 defintion. Declare method only.
6566 (Output_section::Input_section::shndx): Ditto.
6567 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6568 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6569 (Output_section::Merge_section_by_properties_map,
6570 Output_section::Output_section_data_by_input_section_map,
6571 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6572 Remove types.
2e702c99 6573 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6574 KEEPS_INPUT_SECTIONS.
6575 (Output_section::build_lookup_maps): New method declaration.
6576 (Output_section::merge_section_map_,
6577 Output_section::merge_section_by_properties_map_,
6578 Output_section::relaxed_input_section_map_,
6579 Output_section::is_relaxed_input_section_map_valid_): Remove data
6580 members.
6581 (Output_section::lookup_maps_): New data member.
6582
76295588
L
65832010-05-21 Doug Kwan <dougkwan@google.com>
6584
6585 PR gold/11619
6586 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6587 avoid a compilation error.
6588
d103a984
RÁE
65892010-05-19 Rafael Espindola <espindola@google.com>
6590
6591 * script-sections.cc (Output_section_definition::allocate_to_segment):
6592 Update the phdrs_list even when the output section is NULL.
6593 * testsuite/Makefile.am: Add test.
6594 * testsuite/Makefile.in: Regenerate.
6595 * testsuite/script_test_9.cc: New.
6596 * testsuite/script_test_9.sh: New.
6597 * testsuite/script_test_9.t: New.
6598
6625d24e
DK
65992010-05-19 Doug Kwan <dougkwan@google.com>
6600
6601 * arm.cc (Arm_input_section::original_size): New method.
6602 (Arm_input_section::do_addralign): Add a cast.
6603 (Arm_input_section::do_output_offset): Remove static cast.
6604 (Arm_input_section::original_addralign,
6605 Arm_input_section::original_size_): Change type to uint32_t.
6606 (Arm_input_section::init): Add safe casts for section alignment
6607 and size.
6608 (Arm_input_section::set_final_data_size): Do not set address and
6609 offset of stub table.
6610 (Arm_output_section::fix_exidx_coverage): Change use of of
6611 Output_section::Simple_input_section to that of
6612 Output_section::Input_section.
6613 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6614 except for the first pass.
6615 * output.cc (Output_section::get_input_sections): Change type of
6616 input_sections to std::list<Input_section>.
6617 (Output_section::add_script_input_section): Rename from
6618 Output_section::add_simple_input_section. Change type of SIS
6619 parameter from Simple_input_section to Input_section.
6620 * output.h (Output_section::Simple_input_section): Remove class.
6621 (Output_section::Input_section): Change class visibility to public.
6622 (Output_section::Input_section::addralign): Use stored alignments
6623 for special input sections if set.
6624 (Output_section::Input_section::set_addralign): New method.
6625 (Output_section::get_input_sections): Change parameter type from
6626 list of Simple_input_section to list of Input_section.
6627 (Output_section::add_script_input_section): Rename from
6628 Output_section::add_simple_input_section. Change first parameter's
6629 type from Simple_input_section to Input_section and remove the
6630 second and third parameters.
6631 * script-sections.cc (Input_section::Input_section_list): Change
6632 type to list of Output_section::Input_section/
6633 (Input_section_info::Input_section_info): Change parameter type of
6634 INPUT_SECTION to Output_section::Input_section.
6635 (Input_section_info::input_section): Change return type.
6636 (Input_section_info::input_section_): Change type to
6637 Output_section::Input_section.
6638 (Output_section_element_input::set_section_addresses): Adjust code
6639 to use Output_section::Input_section instead of
6640 Output_section::Simple_input_section. Adjust code for renaming
6641 of Output_section::add_simple_input_section.
6642 (Orphan_output_section::set_section_addresses): Ditto.
6643
e1e82ea4
RW
66442010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6645
6646 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6647 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6648
91e75c8a
RÁE
66492010-05-18 Rafael Espindola <espindola@google.com>
6650
6651 * options.cc (General_options::finalize): Handle -nostdlib.
6652 * options.h (nostdlib): New option.
6653 * script.cc (script_add_search_dir): Handle -nostdlib.
6654
da59ad79
DK
66552010-05-12 Doug Kwan <dougkwan@google.com>
6656
6657 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6658 attributes section only if there no attributes section after merging.
6659 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6660 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6661 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6662 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6663 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6664 and arm_attr_merge_7.stdout.
6665 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6666 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6667 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6668 arm_attr_merge_7b.o): New rules.
6669 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6670 arm_attr_merge_7
6671 * testsuite/Makefile.in: Regenerate.
6672 * testsuite/arm_attr_merge.sh: New file.
6673 * testsuite/arm_attr_merge_[67][ab].s: Same.
6674
3e01a7fd
NC
66752010-05-05 Nick Clifton <nickc@redhat.com>
6676
6677 * po/es.po: Updated Spanish translation.
6678
7ad2014a
L
66792010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6680
6681 * Makefile.am (install-exec-local): Properly install gold as
6682 default cross linker.
6683 * Makefile.in: Regenerated.
6684
4fda8867
NC
66852010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6686 Nick Clifton <nickc@redhat.com>
6687
6688 * configure.ac (install_as_default): Define and set to false
6689 unless --enable-gold or --enable-gold=both/gold has been
6690 specified.
6691 * configure: Regenerate.
6692
6693 * Makefile.am (install-exec-local): Install the executable as
6694 'ld.gold'. If install_as_default is true then also install it as
6695 'ld'.
6696 * Makefile.in: Regenerated.
6697
bd288ea2
ILT
66982010-04-24 Ian Lance Taylor <iant@google.com>
6699
6700 * layout.cc (Layout::layout_reloc): In relocatable link don't
6701 combine reloc sections for grouped sections.
6702
ef38fd8a
ST
67032010-04-23 Sriraman Tallam <tmsriram@google.com>
6704
6705 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6706 sections that are not ordinary to icf.
6707 * icf.cc (get_section_contents): Handle relocation pointing to section
6708 with no object or shndx information.
6709 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6710 * testsuite/Makefile.in: Regenerate.
6711 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6712 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6713
f6973bdc
ILT
67142010-04-22 Ian Lance Taylor <iant@google.com>
6715
6716 * expression.cc (Expression::Expression_eval_info): Add
6717 result_alignment_pointer field.
6718 (Expression::eval_with_dot): Add result_alignment_pointer
6719 parameter. Change all callers.
6720 (Expression::eval_maybe_dot): Likewise.
6721 (class Binary_expression): Add alignment_pointer parameter to
6722 left_value and right_value. Change all callers.
6723 (BINARY_EXPRESSION): Set result alignment.
6724 (class Trinary_expression): Add alignment_pointer parameter to
6725 arg2_value and arg3_value. Change all callers.
6726 (Trinary_cond::value): Set result alignment.
6727 (Max_expression::value, Min_expression::value): Likewise.
6728 (Align_expression::value): Likewise.
6729 * script-sections.cc (class Sections_element): Add dot_alignment
6730 parameter to set_section_addresses virtual function. Update
6731 instantiations.
6732 (class Output_section_element): Likewise.
6733 (Script_sections::create_segments): Add dot_alignment parameter.
6734 Change all callers.
6735 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6736 (Script_sections::set_phdrs_clause_addresses): Likewise.
6737 * script-sections.h: Update declarations.
6738 * script.h: Update declarations.
6739 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6740 min_p_align.
6741 * testsuite/script_test_3.t: Set large alignment.
6742 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6743 segment has expected alignment.
6744
9c9c98a5
NC
67452010-04-22 Nick Clifton <nickc@redhat.com>
6746
6747 * po/gold.pot: Updated by the Translation project.
6748 * po/vi.po: Updated Vietnamese translation.
6749
2253bfba
L
67502010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6751
6752 * testsuite/Makefile.am (check_PROGRAMS): Add
6753 icf_virtual_function_folding_test.
6754 * testsuite/Makefile.in: Regenerated.
6755
85fdf906
AH
67562010-04-15 Andrew Haley <aph@redhat.com>
6757
6758 * options.h (merge_exidx_entries): New option.
6759 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6760 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6761 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6762 (Target_arm::merge_exidx_entries): New function.
6763 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6764 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6765 to Arm_exidx_fixup constructor.
6766 Add new arg, merge_exidx_entries.
6767 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6768 Arm_output_section::fix_exidx_coverage.
6769
ce97fa81
ST
67702010-04-18 Sriraman Tallam <tmsriram@google.com>
6771
6772 * icf.cc (get_section_contents): Check for preemptible functions.
6773 Ignore addend when appropriate.
6774 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6775 section folded.
6776 (add_from_relobj): Check for section folded.
6777 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6778 * symtab.h (should_add_dynsym_entry): Add new parameter.
6779 * target-reloc.h (scan_relocs): Check for section folded.
6780 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6781 Check reloc types for function pointers in shared objects.
6782 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6783 case.
6784 (icf_preemptible_functions_test): New test case.
6785 (icf_string_merge_test): New test case.
6786 * testsuite.Makefile.in: Regenerate.
6787 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6788 bar_glob. Refactor code.
6789 * testsuite/icf_preemptible_functions_test.cc: New file.
6790 * testsuite/icf_preemptible_functions_test.sh: New file.
6791 * testsuite/icf_string_merge_test.cc: New file.
6792 * testsuite/icf_string_merge_test.sh: New file.
6793 * testsuite/icf_virtual_function_folding_test.cc: New file.
6794 * testsuite/icf_virtual_function_folding_test.sh: New file.
6795
04ceb17c
DK
67962010-04-14 Doug Kwan <dougkwan@google.com>
6797
6798 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6799 for local symbol recounting if we remove a section due to ICF.
6800 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6801 there are no regular objects in input.
6802
153e7da4
DK
68032010-04-13 Doug Kwan <dougkwan@google.com>
6804
6805 * arm.cc (Arm_input_section::set_final_data_size): Compute
6806 accurate final data size instead of using current data size.
6807
4dbd9faf
DK
68082010-04-09 Doug Kwan <dougkwan@google.com>
6809
6810 * layout.cc (Layout::choose_output_section): Handle script section
6811 types.
6812 (Layout::make_output_section_for_script): Add section type parameter.
6813 Handle script section types.
6814 * layout.h (Layout::make_output_section_for_script): Add section
6815 type parameter.
6816 * output.cc (Output_section::Output_section): Initialize data member
6817 is_noload_.
6818 (Output_section::do_reset_address_and_file_offset): Do not set address
6819 to 0 if section is a NOLOAD section.
6820 * output.h (Output_section::is_noload): New method.
6821 (Output_section::set_is_noload): Ditto.
6822 (Output_section::is_noload_): New data member.
6823 * script-c.h (Script_section_type): New enum type.
6824 (struct Parser_output_section_header): Add new file section_type.
6825 * script-sections.cc (Sections_element::output_section_name): Add
6826 parameter for returning script section type.
6827 (Output_section_definition::output_section_name): Ditto.
6828 (Output_section_definition::section_type)P; New method.
6829 (Output_section_definiton::script_section_type_name): Ditto.
6830 (Output_section_definition::script_section_type_): New data member.
6831 (Output_section_definition::Output_section_definition): Initialize
6832 data member Output_section_definition::script_section_type_.
6833 (Output_section_definition::create_sections): Pass script section type
6834 to Layout::make_output_section_for_script.
6835 (Output_section_definition::output_section_name): Return script
6836 section type to caller.
6837 (Output_section_definition::set_section_address): Do not advance
6838 dot value and load address if section type is NOLOAD. Set address
6839 of NOLOAD sections regardless of section flags.
6840 (Output_section_definition::print): Print section type if it is
6841 not SCRIPT_SECTION_TYPE_NONE.
6842 (Output_section_definition::section_type): New method.
6843 (Output_section_definition::script_section_type_name): Ditto.
6844 (Script_sections::output_section_name): Add new parameter
6845 PSECTION_TYPE for returning script section type. Pass it to
6846 section elements. Handle discard sections.
6847 (Sort_output_sections::operator()): Handle NOLOAD sections.
6848 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6849 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6850 returning script section type.
6851 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6852 INFO and NOLOAD.
6853 * yyscript.y (union): Add new field SECTION_TYPE.
6854 (COPY, DSECT, INFO, NOLOAD): New tokens.
6855 (opt_address_and_section_type): Change type to output_section_header.
6856 (section_type): New non-terminal
6857 (section_header): Handle section type.
2253bfba 6858 (opt_address_and_section_type): Return section type value.
4dbd9faf 6859
721ea635
L
68602010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6861
6862 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6863 * testsuite/plugin_common_test_2.c (foo): Likewise.
6864
6bf924b0
DK
68652010-04-08 Doug Kwan <dougkwan@google.com>
6866
6867 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6868 Output_merge_data.
6869 * output.cc (Output_section::add_merge_input_section): Simplify
6870 code and return status of Output_merge_base::add_input_section.
e1df38aa 6871 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6872 returns true.
6873
24af6f92
DK
68742010-04-07 Doug Kwan <dougkwan@google.com>
6875
6876 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6877 if section is marked as containing instructions but has no mapping
6878 symbols.
6879 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6880 correct section index.
6881 (Arm_relobj::find_linked_text_section): Ditto.
6882
00698fc5
CC
68832010-04-07 Cary Coutant <ccoutant@google.com>
6884
6885 * archive.cc (include_member): Destroy Read_symbols_data object before
6886 releasing file.
6887 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6888 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6889 (Read_symbols_data::~Read_symbols_data) New destructor.
6890 (Section_relocs::Section_relocs) New constructor.
6891 (Section_relocs::~Section_relocs) New destructor.
6892 (Read_relocs_data::Read_relocs_data) New constructor.
6893 (Read_relocs_data::~Read_relocs_data) New destructor.
6894 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6895 pointers to NULL after deleting.
6896
7296d933
DK
68972010-04-07 Doug Kwan <dougkwan@google.com>
6898
6899 * arm.cc: Replace "endianity" with "endianness" in comments.
6900 (Arm_exidx_cantunwind): Ditto.
6901 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6902 (Arm_relobj::merge_flags_and_attributes): New method.
6903 (Arm_relobj::merge_flags_and_attributes_): New data member.
6904 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6905 (Arm_relobj::scan_sections_for_stubs): Ditto.
6906 (Arm_relobj::do_read_symbols): Check to see if we really want to
6907 merge processor-specific flags and attributes. Exit early if
6908 an object is empty except for section names and the undefined symbol.
6909 (Target_arm::do_finalize_sections): Move check for ELF format to
6910 Arm_relobj::do_read_symbols. Merge processor specific flags and
6911 attributes from a regular object only when we have determined that
6912 it is aapropriate. Do not create an .ARM.attributes section in
6913 output if there is no regular input object.
6914 (Target_arm::merge_processor_specific_flags): Check
6915 --warn-mismatch before printing any error.
6916 (Target_arm::merge_object_attributes): Ditto.
6917 * gold.cc (queue_middle_tasks): Handle the case in which there is
6918 no regular object in input.
6919 * options.cc (General_options::parse_EB): New method.
6920 (General_options::parse_EL): Same.
6921 (General_options::General_options): Initialize endianness_.
6922 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6923 New options.
6924 (General_options::Endianness): New enum.
6925 (General_options::endianness): New method.
6926 (General_options::endianness_): New data member.
6927 * parameters.cc (Parameters::set_options): Check target endianness.
6928 (Parameters::set_target_once): Ditto.
6929 (Parameters::check_target_endianness): New method.
6930 (parameters_force_valid_target): If either -EL or -EB is specified,
6931 use it to define endianness of default target.
6932 * parameters.h (Parameters::check_target_endianness): New method
6933 declaration.
6934 * target.h (class Target): Change "endianity" to "endianness"
6935 in comments.
6936
efc8d4f2
RW
69372010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6938
6939 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6940 * configure: Regenerate.
6941 * Makefile.in: Regenerate.
6942 * testsuite/Makefile.in: Regenerate.
6943
be234d88
CC
69442010-04-06 Cary Coutant <ccoutant@google.com>
6945
6946 gcc PR lto/42757
6947 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6948 prevailing definitions of common symbols.
6949 * testsuite/plugin_test_6.sh: New test case.
6950 * testsuite/plugin_common_test_1.c: New test case.
6951 * testsuite/plugin_common_test_2.c: New test case.
6952 * testsuite/Makefile.am (plugin_test_6): New test case.
6953 * testsuite/Makefile.in: Regenerate.
6954
bd32c6bd
NC
69552010-04-06 Nick Clifton <nickc@redhat.com>
6956
6957 * po/vi.po: New Vietnamese translation.
6958
323c532f
DK
69592010-03-30 Doug Kwan <dougkwan@google.com>
6960
6961 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6962
4fcd97eb
DK
69632010-03-25 Doug Kwan <dougkwan@google.com>
6964
6965 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6966 to avoid a conversion warning on a 32-bit host.
6967
4ebf39db
ILT
69682010-03-24 Ian Lance Taylor <iant@google.com>
6969
6970 * testsuite/script_test_3.t: Add a TLS segment.
6971 * testsuite/Makefile.am (check_PROGRAMS): Add
6972 tls_phdrs_script_test.
6973 (tls_phdrs_script_test_SOURCES): Define.
6974 (tls_phdrs_script_test_DEPENDENCIES): Define.
6975 (tls_phdrs_script_test_LDFLAGS): Define.
6976 (tls_phdrs_script_test_LDADD): Define.
6977 * testsuite/Makefile.in: Rebuild.
6978
4a599bdd
CC
69792010-03-23 Cary Coutant <ccoutant@google.com>
6980
6981 * fileread.cc (find_or_make_view): Fix comment.
6982
6c93b22c
ILT
69832010-03-23 Ian Lance Taylor <iant@google.com>
6984
6985 * script-sections.cc (class Orphan_section_placement): Define
6986 PLACE_TLS and PLACE_TLS_BSS.
6987 (Orphan_section_placement::Orphan_section_placement): Initialize
6988 new places.
6989 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6990 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6991 (tls_script_test_SOURCES): Define.
6992 (tls_script_test_DEPENDENCIES): Define.
6993 (tls_script_test_LDFLAGS): Define.
6994 (tls_script_test_LDADD): Define.
6995 * testsuite/Makefile.in: Rebuild.
6996
a2c7281b
DK
69972010-03-22 Doug Kwan <dougkwan@google.com>
6998
6999 * arm.cc (Arm_relocate_functions::abs8,
7000 Arm_relocate_functions::abs16): Use correct check for overflow
7001 specified in the ARM ELF specs.
7002 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7003 target of a BLX instruction specially.
7004 (Reloc_stub::stub_type_for_reloc): Ditto.
7005 (Relocate::relocate): Use symbolic names instead of numeric relocation
7006 codes to report error.
7007 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7008 workaround.
7009 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7010 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7011 thumb2_blx_out_of_range.stdout
7012 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7013 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7014 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7015 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7016 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7017 thumb2_blx_in_range, thumb2_blx_in_range.o,
7018 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7019 thumb2_blx_out_of_range.o): New rules.
2e702c99 7020 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7021 thumb2_blx_in_range and thumb2_blx_out_of_range.
7022 * testsuite/Makefile.in: Regenerate.
7023 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7024 * testsuite/thumb_blx_in_range.s: New file.
7025 * testsuite/thumb_blx_out_of_range.s: New file.
7026
b0193076
RÁE
70272010-03-22 Rafael Espindola <espindola@google.com>
7028
7029 * archive.cc (Should_include): Move to archive.h.
7030 (should_include_member): Make it a member of Archive.
7031 (Lib_group): New.
7032 (Add_lib_group_symbols): New.
7033 * archive.h: Include options.h.
7034 (Archive_member): Moved from Archive.
7035 (Should_include): Moved from archive.cc.
7036 (Lib_group): New.
7037 (Add_lib_group_symbols): New.
7038 * dynobj.cc (do_should_include_member): New.
7039 * dynobj.h (do_should_include_member): New.
7040 * gold.cc (queue_initial_tasks): Update call to queue.
7041 * main.cc (main): Print lib group stats.
7042 * object.cc (do_should_include_member): New.
7043 * object.h: Include archive.h.
7044 (Object::should_include_member): New.
7045 (Object::do_should_include_member): New.
7046 (Sized_relobj::do_should_include_member): New.
7047 * options.cc (General_options::parse_start_lib): New.
7048 (General_options::parse_end_lib): New.
7049 (Input_arguments::add_file): Handle lib groups.
7050 (Input_arguments::start_group): Check we are not in a lib.
7051 (Input_arguments::start_lib): New.
7052 (Input_arguments::end_lib): New.
7053 * options.h (General_options): Add start_lib and end_lib.
7054 (Input_argument::lib_): New.
7055 (Input_argument::lib): New.
7056 (Input_argument::is_lib): New.
7057 (Input_file_lib): New.
7058 (Input_arguments::in_lib_): New.
7059 (Input_arguments::in_lib): New.
7060 (Input_arguments::start_lib): New.
7061 (Input_arguments::end_lib_): New.
7062 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7063 in unused members as preempted.
7064 (Sized_pluginobj::do_should_include_member): New.
7065 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7066 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7067 return the blocker.
7068 (Read_symbols::do_whole_lib_group): New.
7069 (Read_symbols::do_lib_group): New.
7070 (Read_symbols::do_read_symbols): Handle lib groups.
7071 (Read_symbols::get_name): Handle lib groups.
7072 * readsyms.h (Read_symbols): Add an archive member pointer.
7073 (Read_symbols::do_whole_lib_group): New.
7074 (Read_symbols::do_lib_group): New.
7075 (Read_symbols::member_): New.
7076 * script.cc (read_input_script): Update call to queue_soon.
7077
d099120c
DK
70782010-03-19 Doug Kwan <dougkwan@google.com>
7079
7080 * arm.cc (Stub_table::Stub_table): Initialize new data members
7081 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7082 (Stub_table::add_reloc_stub): Assign stub offset and update
7083 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7084 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7085 New data members.
2e702c99 7086 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7087 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7088 instead of going over all reloc stubs.
2e702c99 7089 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7090 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7091 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7092 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7093 Stringpool_template::offset_.
7094 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7095 Stringpool_template::offset_ to zero.
7096
1aa37384
DK
70972010-03-15 Doug Kwan <dougkwan@google.com>
7098
7099 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7100 offset_.
7101 (Stringpool_template::new_key_offset): New method.
7102 (Stringpool_template::add_string): Assign offsets when adding new
7103 strings.
7104 (Stringpool_template::set_string_offsets): Do not set string offsets
7105 when not optimizing.
7106 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7107 member size_.
2e702c99
RM
7108 (Chunked_vector::clear): Clear size_.
7109 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7110 (Chunked_vector::size): Return size_.
7111 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7112 (Chunked_vector::size_): New data member.
1aa37384
DK
7113 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7114 (Stringpool_template::new_key_offset): New method declaration.
7115 (Stringpool_template::offset_): New data member.
7116
b672b057
RÁE
71172010-03-15 Rafael Espindola <espindola@google.com>
7118
7119 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7120 Add_symbols' constructor.
7121 * readsyms.h (Add_symbols): Remove the input_group member.
7122
b6848d3c
ILT
71232010-03-10 Ian Lance Taylor <iant@google.com>
7124
7125 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7126 target to ask whether a reference to a symbol requires a stack
7127 split.
7128 * target.h (Target::is_call_to_non_split): New function.
7129 (Target::do_is_call_to_non_split): Declare virtual function.
7130 * target.cc: Include "symtab.h".
7131 (Target::do_is_call_to_non_split): New function.
7132 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7133
a2a5469e
CC
71342010-03-10 Cary Coutant <ccoutant@google.com>
7135
7136 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7137 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7138 (File_read::open[2]): Add whole_file_view_ to list of views.
7139 (File_read::make_view): Remove test of whole_file_view_.
7140 (File_read::find_or_make_view): Create whole_file_view_ if
7141 necessary.
7142 (File_read::clear_views): Replace bool parameter with enum;
7143 adjust all callers. Don't delete views with permanent data;
7144 do delete cached views and views from archives if
7145 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7146 if clearing the corresponding view.
7147 * fileread.h (File_read::Clear_views_mode): New enum.
7148 (File_read::View::is_permanent_view): New method.
7149 (File_read::clear_views): Replace bool parameter
7150 with enum; adjust all callers.
7151 * options.h (General_options): Change keep_files_mapped option;
7152 add map_whole_files.
7153 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7154 releasing the file.
7155 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7156 the file.
7157
8861f32b
DM
71582010-03-10 David S. Miller <davem@davemloft.net>
7159
7160 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7161
d62d0f5f
ST
71622010-03-09 Sriraman Tallam <tmsriram@google.com>
7163
7164 * icf.cc (get_section_contents): Add '@' marker after processing the
7165 merge reloc.
7166
9177756d
DK
71672010-03-08 Doug Kwan <dougkwan@google.com>
7168
7169 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7170 due to a conversion warning.
7171 (Arm_relobj::update_output_local_symbol_count): Check for local
7172 symbol with unset output index.
7173
9e9e071b
ILT
71742010-03-05 Ian Lance Taylor <iant@google.com>
7175
7176 * options.h (class General_options): Add --spare-dynamic-tags.
7177 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7178 --spare-dynamic-tags.
7179
a81ee015
ILT
71802010-03-05 Ian Lance Taylor <iant@google.com>
7181
7182 * incremental.cc: Include "libiberty.h".
7183
44ec90b9
RO
71842010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7185
7186 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7187 function, is_info_ member.
7188 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7189 (Versions::Versions): Update caller.
7190 (Versions::define_base_version): Likewise.
7191 (Versions::add_def): Likewise.
7192
0897ed3b
ST
71932010-03-03 Sriraman Tallam <tmsriram@google.com>
7194
7195 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7196 (Scan::possible_function_pointer_reloc): New function.
7197 (Scan::local_reloc_may_be_function_pointer): Change to call
7198 possible_function_pointer_reloc.
7199 (Scan::global_reloc_may_be_function_pointer): Ditto.
7200 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7201 relocations in ".data.rel.ro._ZTV" section.
7202 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7203 * testsuite/icf_safe_so_test.cc: Ditto.
7204 * testsuite/icf_safe_test.cc: Ditto.
7205 * testsuite/icf_safe_test.sh: Ditto.
7206
d3bbad62
ILT
72072010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7208 Ian Lance Taylor <iant@google.com>
7209
7210 * target-reloc.h (relocate_section): Check the symbol table index
7211 for -1U before setting the local symbol index.
7212 (scan_relocatable_relocs): If copying the relocation, record that
7213 the local symbol is required.
7214 * object.h (Symbol_value::is_output_symtab_index_set): New
7215 function.
7216 (Symbol_value::may_be_discarded_from_output_symtab): New
7217 function.
7218 (Symbol_value::has_output_symtab_entry): New function.
7219 (Symbol_value::needs_output_symtab_entry): Remove.
7220 (Symbol_value::output_symtab_index): Make sure the symbol index is
7221 set.
7222 (Symbol_value::set_output_symtab_index): Make sure the symbol
7223 index is not set. Make sure the new index is valid.
7224 (Symbol_value::set_must_have_output_symtab_entry): New function.
7225 (Symbol_value::has_output_dynsym_entry): New function.
7226 (Symbol_value::set_output_dynsym_index): Make sure the new index
7227 is valid.
7228 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7229 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7230 local symbol if permitted.
7231 (Sized_relobj::do_finalize_local_symbols): Call
7232 is_output_symtab_index_set rather than needs_output_symtab_entry.
7233 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7234 rather than needs_output_symtab_entry. Call
7235 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7236 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7237 is_output_symtab_index_set rather than needs_output_symtab_entry.
7238 * testsuite/discard_locals_relocatable_test.c: New file.
7239 * testsuite/discard_locals_test.sh: Test -r.
7240 * testsuite/Makefile.am (check_DATA): Add
7241 discard_locals_relocatable_test1.syms,
7242 discard_local_relocatable_test2.syms.
7243 (MOSTLYCLEANFILES): Likewise. Also add
7244 discard_locals_relocatable_test1.lout and
7245 discard_locals_relocatable_test2.out.
7246 (discard_locals_relocatable_test1.syms): New target.
7247 (discard_locals_relocatable_test.o): New target.
7248 (discard_locals_relocatable_test1.out): New target.
7249 (discard_locals_relocatable_test2.syms): New target.
7250 (discard_locals_relocatable_test2.out): New target.
7251 (various): Add missing ../ld-new dependencies.
7252 * testsuite/Makefile.in: Rebuild.
7253
7e8ccf26
NC
72542010-03-03 Nick Clifton <nickc@redhat.com>
7255
7256 * po/fi.po: New Finnish translation.
7257
2a0ff005
DK
72582010-03-01 Doug Kwan <dougkwan@google.com>
7259
7260 * layout.cc (Layout::Layout): Force section types of .init_array*,
7261 .preinit_array* and .fini_array* sections.
7262 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7263 Fix check of return value of std::string::find.().
7264 (Output_section::Input_section_sort_compare::operator()): Remove
7265 comment about .init_array.
7266 (Output_section::Input_section_sort_init_fini_compare::operator()):
7267 New method.
7268 (Output_section::sort_attached_input_sections): Handle .init_array
7269 and .fini_array specially.
7270 * output.h (Output_section::Inut_section_sort_compare): Update
7271 comment.
7272 (Output_section::Input_section_sort_init_fini_compare): New struct.
7273
c3e4ae29
DK
72742010-02-26 Doug Kwan <dougkwan@google.com>
7275
7276 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7277 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7278 * testsuite/debug_msg.sh: Avoid matching source line number for
7279 use of global variable undef_int.
7280
2fd9ae7a
DK
72812010-02-26 Doug Kwan <dougkwan@google.com>
7282
7283 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7284 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7285 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7286 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7287 * options.cc (General_options::General_options): Initialize member
7288 fix_v4bx_.
7289 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7290 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7291 and rm_no_fix_v4bx.stdout
7292 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7293 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7294 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7295 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7296 and arm_no_fix_v4bx.
7297 * Makefile.in: Regenerate.
7298 * testsuite/arm_fix_v4bx.s: New file.
7299 * testsuite/arm_fix_v4bx.sh: Ditto.
7300
67ec7d0b
DK
73012010-02-24 Doug Kwan <dougkwan@google.com>
7302
7303 * arm.cc (Target_arm::got_section): Make the .got section the first
7304 non RELRO section in the data segment.
7305 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7306 suffixes of section names.
7307
10165461
DK
73082010-02-24 Doug Kwan <dougkwan@google.com>
7309
7310 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7311 flags and attributes merging if an input file is a binary file.
7312 * fileread.cc (Input_file::open): Record format of original file.
7313 * fileread.h (Input_file::Format): New enum type.
2e702c99 7314 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7315 (Input_file::format): New method definition.
7316 (Input_file::format_):: New data member.
7317
4a54abbb
DK
73182010-02-24 Doug Kwan <dougkwan@google.com>
7319
7320 * arm.cc (Arm_output_data_got): New class.
7321 (ARM_TCB_SIZE): New constant
7322 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7323 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7324 If user uses a script with a SECTIONS clause, issue only a warning
7325 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7326 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7327 garbage collection.
7328 (Target_arm::got_mode_index_entry): Handle static linking.
7329 (Target_arm::Scan::local): Ditto.
7330 (Target_arm::Scan::global): Ditto.
7331 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7332 all incorrectly implemented relocations.
e1df38aa 7333 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7334 Arm_output_section::fix_exidx_coverage.
7335 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7336 from ".ARM.exidx." and ".ARM.extab.".
7337
ca419a6f
ILT
73382010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7339
7340 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7341 section if it does not already exist.
7342 * attributes.cc (Attributes_section_data::Attributes_section_data):
7343 Don't crash if size is zero.
7344
135b9c78
ILT
73452010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7346 Ian Lance Taylor <iant@google.com>
7347
7348 * gold.cc (queue_middle_tasks): If no input files were opened,
7349 exit.
7350 * workqueue.h (Task_function::Task_function): Assert that there is
7351 a blocker.
7352
bb0bfe4f
DK
73532010-02-22 Doug Kwan <dougkwan@google.com>
7354
7355 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7356 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7357 types to avoid warnings due to different uint64_t implementations
7358 on different hosts.
7359
2a2b6d42
DK
73602010-02-21 Doug Kwan <dougkwan@google.com>
7361
7362 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7363 handling of the maximum backward branch offset.
2e702c99 7364 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7365 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7366 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7367 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7368 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7369 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7370 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7371 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7372 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7373 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7374 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7375 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7376 thumb2_bl_out_of_range.o): New rules.
7377 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7378 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7379 thumb2_bl_out_of_range
7380 * testsuite/Makefile.in: Regenerate.
7381 * testsuite/arm_bl_in_range.s: New file.
7382 * testsuite/arm_bl_out_of_range.s: Ditto.
7383 * testsuite/arm_branch_in_range.sh: Ditto.
7384 * testsuite/arm_branch_range.t: Ditto.
7385 * testsuite/thumb2_branch_range.t: Ditto.
7386 * testsuite/thumb_bl_in_range.s: Ditto.
7387 * testsuite/thumb_bl_out_of_range.s: Ditto.
7388 * testsuite/thumb_branch_range.t: Ditto.
7389
b487ad64
ST
73902010-02-20 Sriraman Tallam <tmsriram@google.com>
7391
7392 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7393 Add reloc offset information.
7394 * icf.cc (get_section_contents): Change iterators to point to the new
7395 vectors. Add reloc offset information to the contents.
7396 * icf.h (Icf::Sections_reachable_info): New typedef.
7397 (Icf::Sections_reachable_list): New typedef.
7398 (Icf::Offset_info): New typedef.
7399 (Icf::Reloc_info): New struct typedef.
7400 (Icf::Reloc_info_list): New typedef.
7401 (Icf::symbol_reloc_list): Delete method.
7402 (Icf::addend_reloc_list): Delete method.
7403 (Icf::section_reloc_list): Delete method.
7404 (Icf::reloc_info_list): New method.
7405 (Icf::reloc_info_list_): New member.
7406
f96accdf
DK
74072010-02-19 Doug Kwan <dougkwan@google.com>
7408
7409 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7410 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7411 * arm.cc (Arm_relocation_functions): New forward declaration.
7412 (Target_arm::Target_arm): Initialize new data members
7413 got_mod_index_offset_ and tls_base_symbol_defined_.
7414 (Target_arm::Relocate::relocate_tls): New method.
7415 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7416 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7417 New methods.
2e702c99 7418 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7419 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7420 (Target_arm::got_mod_index_offset_,
7421 Target_arm::tls_base_symbol_defined_): New data members.
7422 (Target_arm::Scan::local, Target::Scan::global,
7423 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7424 relocations.
7425
c8761b9a
DK
74262010-02-18 Doug Kwan <dougkwan@google.com>
7427
7428 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7429 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7430 text section as a parameter becuase some broken tools may not set
7431 the link in section header.
7432 (Target_arm::has_got_section): New method.
7433 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7434 without any mapping symbol as data only. Remove warning.
7435 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7436 link in its section header, try to discover the link by inspecting the
7437 REL31 relocation at the beginning of the section.
7438 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7439 in error message.
7440 (Target_arm::Scan::global): Treat any reference to the symbol
7441 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7442
21bb3914
ST
74432010-02-12 Sriraman Tallam <tmsriram@google.com>
7444
7445 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7446 (Scan::global_reloc_may_be_function_pointer): New function.
7447 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7448 (Scan::global_reloc_may_be_function_pointer): New function.
7449 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7450 (Scan::global_reloc_may_be_function_pointer): New function.
7451 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7452 (Scan::global_reloc_may_be_function_pointer): New function.
7453 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7454 (Scan::global_reloc_may_be_function_pointer): New function.
7455 (Scan::possible_function_pointer_reloc): New function.
7456 (Target_x86_64::can_check_for_function_pointers): New function.
7457 * gc.h (gc_process_relocs): Scan relocation types to determine if
7458 function pointers were taken for targets that support it.
7459 * icf.cc (Icf::find_identical_sections): Include functions for
7460 folding in safe ICF whose pointer is not taken.
7461 * icf.h (Secn_fptr_taken_set): New typedef.
7462 (fptr_section_id_): New member.
7463 (section_has_function_pointers): New function.
7464 (set_section_has_function_pointers): New function.
7465 (check_section_for_function_pointers): New function.
7466 * options.h: Fix comment for safe ICF option.
7467 * target.h (can_check_for_function_pointers): New function.
7468 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7469 Modify icf_safe_test for X86-64.
7470 * testsuite/Makefile.in: Regenerate.
7471 * testsuite/icf_safe_so_test.cc: New file.
7472 * testsuite/icf_safe_so_test.sh: New file.
7473 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7474 (main): Change to take pointer to function kept_func_3.
7475 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7476 folding is done correctly for X86-64.
7477
0da6fa6c
DM
74782010-02-12 David S. Miller <davem@davemloft.net>
7479
7480 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7481 is_symbolless parameter.
7482 (Output_reloc<SHT_REL>::is_symbolless): New.
7483 (Output_reloc<SHT_REL>::is_symbolless_): New.
7484 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7485 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7486 (Output_reloc<SHT_RELA>::is_symbolless): New.
7487 (Output_data_reloc::add_global): Handle is_symbolless.
7488 (Output_data_reloc::add_global_relative): Likewise.
7489 (Output_data_reloc::add_local): Likewise.
7490 (Output_data_reloc::add_local_relative): Likewise.
7491 (Output_data_reloc::add_symbolless_global_addend): New.
7492 (Output_data_reloc::add_symbolless_local_addend): New.
7493 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7494 is_symbolless.
7495 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7496 instead of ->is_relative_
7497 (Output_reloc::write): Likewise.
7498 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7499 (Output_reloc::write_rel): Simplify.
7500
7501 * sparc.cc (Target_sparc::Scan::local): Use
7502 ->add_symbolless_local_addend as needed.
7503 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7504 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7505 based upon relocation offset.
7506
e4782e83
DK
75072010-02-11 Doug Kwan <dougkwan@google.com>
7508
7509 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7510 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7511 beginning of function.
7512 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7513 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7514 parameter is_32bit in calls to should_apply_static_reloc.
7515 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7516 (check_DATA): Add arm_abs_global.stdout.
7517 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7518 arm_abs_global.stdout): New rules.
7519 (MOSTLLYCLEANFILES): Add arm_abs_global
7520 * Makefile.in: Regenerate.
7521 * testsuite/arm_abs_global.s: New file.
7522 * testsuite/arm_abs_global.sh: Ditto.
7523 * testsuite/arm_abs_lib.s: Ditto.
7524
93ceb764
ILT
75252010-02-11 Ian Lance Taylor <iant@google.com>
7526
7527 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7528 Read_relocs task.
7529 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7530 Allocate_commons_task first.
7531 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7532 task, rather than symtab_lock_.
7533 (Gc_process_relocs::~Gc_process_relocs): New function.
7534 (Gc_process_relocs::is_runnable): Check this_blocker_.
7535 (Gc_process_relocs::locks): Use next_blocker_ rather than
7536 blocker_.
7537 (Scan_relocs::~Scan_relocs): New function.
7538 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7539 symtab_lock_.
7540 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7541 next_blocker_.
7542 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7543 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7544 constructor accordingly.
7545 (class Gc_process_relocs): Likewise.
7546 (class Scan_relocs): Likewise.
7547 * common.h (class Allocate_commons_task): Remove symtab_lock_
7548 field, and corresponding constructor parameter.
7549 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7550 symtab_lock_.
7551 (Allocate_commons_task::locks): Likewise.
7552
114dfbe1
ILT
75532010-02-11 Ian Lance Taylor <iant@google.com>
7554
7555 * gold-threads.h (class Once): Define.
7556 (class Initialize_lock): Rewrite as child of Once.
7557 * gold-threads.cc (class Once_initialize): Define.
7558 (once_pointer_control): New static variable.
7559 (once_pointer, once_arg): New static variables.
7560 (c_run_once): New static function.
7561 (Once::Once, Once::run_once, Once::internal_run): New functions.
7562 (class Initialize_lock_once): Remove.
7563 (initialize_lock_control): Remove.
7564 (initialize_lock_pointer): Remove.
7565 (initialize_lock_once): Remove.
7566 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7567 (Initialize_lock::initialize): Rewrite.
7568 (Initialize_lock::do_run_once): New function.
7569 * archive.cc (Archive::interpret_header): Only clear name if it is
7570 not already empty.
7571 * fileread.cc: Include "gold-threads.h"
7572 (file_counts_lock): New static variable.
7573 (file_counts_initialize_lock): Likewise.
7574 (File_read::release): Only increment counts when using --stats.
7575 Use a lock around the increment.
7576 * parameters.cc (class Set_parameters_target_once): Define.
7577 (set_parameters_target_once): New static variable.
7578 (Parameters::Parameters): Move here from parameters.h.
7579 (Parameters::set_target): Rewrite.
7580 (Parameters::set_target_once): New function.
7581 (Parameters::clear_target): Move here and rewrite.
7582 * parameters.h (class Parameters): Update declarations. Add
7583 set_parameters_target_once_ field.
7584 (Parameters::Parameters): Move to parameters.cc.
7585 (Parameters::clear_target): Likewise.
7586 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7587 task.
7588 (Start_group::~Start_group): New function.
7589 (Start_group::is_runnable): New function.
7590 (Start_group::locks, Start_group::run): New functions.
7591 (Finish_group::run): Change saw_undefined to size_t.
7592 * readsyms.h (class Start_group): Define.
7593 (class Finish_group): Change saw_undefined_ field to size_t.
7594 (Finish_group::Finish_group): Remove saw_undefined and
7595 this_blocker parameters. Change all callers.
7596 (Finish_group::set_saw_undefined): New function.
7597 (Finish_group::set_blocker): New function.
7598 * symtab.h (class Symbol_table): Change saw_undefined to return
7599 size_t. Change saw_undefined_ field to size_t.
7600 * target-select.cc (Set_target_once::do_run_once): New function.
7601 (Target_selector::Target_selector): Initialize set_target_once_
7602 field. Don't initialize lock_ and initialize_lock_ fields.
7603 (Target_selector::instantiate_target): Rewrite.
7604 (Target_selector::set_target): New function.
7605 * target-select.h (class Set_target_once): Define.
7606 (class Target_selector): Update declarations. Make
7607 Set_target_once a friend. Remove lock_ and initialize_lock_
7608 fields. Add set_target_once_ field.
7609
fa17a3f4
ILT
76102010-02-10 Ian Lance Taylor <iant@google.com>
7611
7612 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7613 queueing any tasks.
7614 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7615 (queue_middle_tasks): Add all blockers before queueing any tasks.
7616 (queue_final_tasks): Likewise.
7617 * token.h (Task_token::add_blockers): New function.
7618 * object.h (Input_objects::number_of_relobjs): New function.
7619
c7177d31
ILT
76202010-02-10 Ian Lance Taylor <iant@google.com>
7621
5de0e392
ILT
7622 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7623 shared, not if not position independent.
7624 * x86_64.cc (Relocate::relocate_tls): Likewise.
7625 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7626 (tls_pie_pic_test): New target.
7627 * testsuite/Makefile.in: Rebuild.
7628
c7177d31
ILT
7629 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7630 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7631 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7632 * testsuite/Makefile.in: Rebuild.
7633
684b268a
DM
76342010-02-09 David S. Miller <davem@davemloft.net>
7635
7636 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7637 R_SPARC_RELATIVE using ->add_local_relative().
7638 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7639
612a8d3d
DM
7640 * output.h (Output_data_dynamic::add_section_size): New method
7641 that takes two Output_data objects.
7642 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7643 entry param. Handle it in initializers.
7644 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7645 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7646 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7647 arg.
7648 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7649 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7650 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7651 for dynrel_includes_plt.
7652 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7653 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7654 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7655 before .rela.plt
7656 (Target_sparc::do_finalize_sections): Update to pass true for
7657 dynrel_includes_plt.
7658 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7659 output before .rela.plt
7660 (Target_powerpc::do_finalize_sections): Update to pass true for
7661 dynrel_includes_plt when 32-bit.
7662
cb1be87e
DK
76632010-02-08 Doug Kwan <dougkwan@google.com>
7664
7665 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7666 method.
7667 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7668 Arm_relobj::scan_section_for_cortex_a8_stubs,
7669 Arm_relobj::do_relocation_section): Instead of calling
7670 Output_section::output_address, use faster
7671 Arm_relobj::simple_input_section_output_address.
7672
705b5121
DM
76732010-02-08 David S. Miller <davem@davemloft.net>
7674
7675 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7676 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7677 relocation helper function.
7678
024c4466
DM
7679 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7680 just like R_SPARC_GOT{10,13,22}.
7681 (Target_sparc::Scan::local): Likewise.
7682 (Target_sparc::Relocate:relocate): Likewise.
7683
9109c078
ILT
76842010-02-06 Ian Lance Taylor <iant@google.com>
7685
7686 * configure.ac: Rewrite targetobjs duplicate removal code to use
7687 only shell constructs.
7688 * configure: Rebuild.
7689
cf846138
DK
76902010-02-05 Doug Kwan <dougkwan@google.com>
7691
7692 PR 11247
7693 * arm.cc (Arm_relobj::section_is_scannable): New method.
7694 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7695 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7696
6cfaf60b
DK
76972010-02-04 Doug Kwan <dougkwan@google.com>
7698
7699 PR 11247
7700 * arm-reloc-property.cc (cstdio): Include.
7701 * configure.ac (targetobjs): Remove duplicates.
7702 * configure: Regenerate.
7703 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7704 big and little endian version for a given address size.
7705
5c57f1be
DK
77062010-02-03 Doug Kwan <dougkwan@google.com>
7707
7708 * arm-reloc-property.cc
7709 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7710 definition.
7711 * arm-reloc-property.h
7712 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7713 New method definition.
7714 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7715 declaration.
7716 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7717 overflow to N.
7718 (GOT_PREL): Change implemented to Y.
7719 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7720 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7721 (Arm_relocate_functions::movw_abs_nc): Remove method.
7722 (Arm_relocate_functions::movt_abs): Ditto.
7723 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7724 (Arm_relocate_functions::thm_movt_abs): Ditto.
7725 (Arm_relocate_functions::movw_rel_nc): Ditto.
7726 (Arm_relocate_functions::movw_rel): Ditto.
7727 (Arm_relocate_functions::movt_rel): Ditto.
7728 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7729 (Arm_relocate_functions:thm_movw_rel): Ditto.
7730 (Arm_relocate_functions:thm_movt_rel): Ditto.
7731 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7732 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7733 New method definitions.
7734 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7735 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7736 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7737 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7738 (Target_arm::Relocate::relocate): Check for non-static or
7739 unimplemented relocation code and exit early. Change calls to
7740 Target_arm::reloc_uses_thumb_bit and
7741 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7742 instead. Refactor code to handle similar relocations to increase
7743 code sharing. Remove check for unsupported relocation code in switch
7744 statement.
7745 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7746 relocation property table to find out size. Change error message to
7747 print out the name of a relocation code instead of the numeric value.
7748 (Target_arm::scan_reloc_for_stub): Use relocation property table
7749 instead of calling Target_arm::reloc_uses_thumb_bit().
7750
218c5831
DK
77512010-02-02 Doug Kwan <dougkwan@google.com>
7752
7753 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7754 types of relaxed input section.
7755
0d31c79d
DK
77562010-02-02 Doug Kwan <dougkwan@google.com>
7757
7758 * Makefile.am (HFILES): Add arm-reloc-property.h.
7759 (DEFFILES): New.
2e702c99
RM
7760 (TARGETSOURCES): Add arm-reloc-property.cc
7761 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7762 (libgold_a_SOURCES): $(DEFFILES)
7763 * Makefile.in: Regenerate.
7764 * arm-reloc-property.cc: New file.
7765 * arm-reloc-property.h: New file.
7766 * arm-reloc.def: New file.
7767 * arm.cc: Update comments.
7768 (arm-reloc-property.h): New included header.
7769 (arm_reloc_property_table): New global variable.
7770 (Target_arm::do_select_as_default_target): New method definition.
7771 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7772 arm-reloc-property to targ_extra_obj.
7773 * parameters.cc (set_parameters_target): Call
7774 Target::select_as_default_target().
7775 * target.h (Target::select_as_default_target): New method definition.
7776 (Target::do_select_as_default_target): Same.
7777
546c7457
DK
77782010-02-01 Doug Kwan <dougkwan@google.com>
7779
7780 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7781 first_output_text_section_.
7782 (Arm_exidx_fixup::first_output_text_section): New method definition.
7783 (Arm_exidx_fixup::first_output_text_section_): New data member.
7784 (Arm_exidx_fixup::process_exidx_section): Record the first text
7785 output section seen.
7786 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7787 and entsize in output section header.
7788
11b861d5
DK
77892010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7790
7791 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7792 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7793 (Arm_relocate_functions::thm_alu11): New Method.
7794 (Arm_relocate_functions::thm_pc8): New Method.
7795 (Arm_relocate_functions::thm_pc12): New Method.
7796 (Target_arm::Scan::local): Handle the relocations.
7797 (Target_arm::Scan::global): Likewise.
7798 (Target_arm::Relocate::relocate): Likewise.
7799 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7800
c9a2c125
DK
78012010-01-29 Doug Kwan <dougkwan@google.com>
7802
7803 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7804 of relocation types as ld.
7805
1521477a
DK
78062010-01-29 Doug Kwan <dougkwan@google.com>
7807
7808 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7809 to public.
7810 (Arm_relocate_functions::thumb_branch_common): Ditto.
7811 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7812 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7813 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7814 Arm_relocate_functions::jump24): Remove.
7815 (Target_arm::Relocate::relocate): Adjust code to call
7816 Arm_relocation_functions::arm_branch_common and
7817 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7818 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7819
e7eca48c
DK
78202010-01-29 Doug Kwan <dougkwan@google.com>
7821
7822 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7823 output_local_symbol_count_needs_update_.
7824 (Arm_relobj::output_local_symbol_count_needs_update,
7825 Arm_relobj::set_output_local_symbol_count_needs_update,
7826 Arm_relobj::update_output_local_symbol_count): New methods.
7827 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7828 member.
7829 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7830 of pointed function as in a R_ARM_PREL31 relocation.
7831 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7832 for output local symbol count updating.
7833 (Target_arm::do_relax): Update output local symbol counts in objects
7834 if necessary.
7835 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7836
02961d7e
ILT
78372010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7838
7839 * arm.cc: Added support for the ARM relocations:
7840 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7841 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7842 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7843 movw_prel_nc).
7844 (Arm_relocate_functions::movw_rel): New method.
7845 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7846 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7847 thm_movw_prel_nc).
7848 (Arm_relocate_functions::thm_movw_rel): New method.
7849 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7850 thm_movt_prel).
7851 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7852 relocations.
7853 (Target_arm::Scan::global): Likewise.
7854 (Target_arm::Relocate::relocate): Likewise.
7855 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7856 Likewise.
7857
b10d2873
ILT
78582010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7859
7860 * arm.cc: Added support for ARM group relocations.
7861 (Target_arm::reloc_needs_sym_origin): New method.
7862 (Arm_relocate_functions::calc_grp_kn): New method.
7863 (Arm_relocate_functions::calc_grp_residual): New method.
7864 (Arm_relocate_functions::calc_grp_gn): New method.
7865 (Arm_relocate_functions::arm_grp_alu): New Method.
7866 (Arm_relocate_functions::arm_grp_ldr): New Method.
7867 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7868 (Arm_relocate_functions::arm_grp_ldc): New Method.
7869 (Target_arm::Scan::local): Handle the ARM group relocations.
7870 (Target_arm::Scan::global): Likewise.
7871 (Target_arm::Relocate::relocate): Likewise.
7872 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7873 Likewise.
7874
2b328d4e
DK
78752010-01-26 Doug Kwan <dougkwan@google.com>
7876
7877 * arm.cc (set): Include.
7878 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7879 pointer type.
2e702c99 7880 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7881 (Arm_output_section::append_text_sections_to_list): New method.
7882 (Arm_output_section::fix_exidx_coverage): Ditto.
7883 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7884 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7885 Relobj::set_section_offset() instead of
7886 Sized_relobj::invalidate_section_offset().
2e702c99 7887 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7888 parameter for section headers. Ignore relocation sections for
7889 unallocated sections and EXIDX sections.
7890 (Target_arm::fix_exidx_coverage): New method.
7891 (Target_arm::output_section_address_less_than): New type.
7892 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7893 linked text section instead of the EXIDX section.
7894 (Arm_output_section::create_stub_group): Add an assertion to check
7895 that this is not an EXIDX output section.
7896 (Arm_output_section::append_text_sections_to_list): New method.
7897 (Arm_output_section::fix_exidx_coverage): Ditto.
7898 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7899 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7900 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7901 first pass.
7902 (Target_arm::fix_exidx_coverage): New method.
7903 * object.h (Relobj::set_output_section): New method.
7904 (Sized_relobj::invalidate_section_offset): Remove method.
7905 (Sized_relobj::do_invalidate_section_offset): Remove method.
7906 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7907
c7f3c371
DK
79082010-01-25 Doug Kwan <dougkwan@google.com>
7909
7910 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7911 Fix warning due to signed and unsigned comparison on a 32-bit host.
7912
8923b24c
DK
79132010-01-22 Doug Kwan <dougkwan@google.com>
7914
7915 * arm.cc (Target_arm::do_relax): Record an output section for section
7916 offset adjustment it contains any stub table that has changed.
7917 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7918 offsets in an output section if necessary.
7919 * output.cc (Output_section::Output_section): Initialize
7920 section_offsets_need_adjustments_.
7921 (Output_section::add_input_section_for_script): Renamed to
7922 Output_section::add_simple_input_section.
7923 (Output_section::save_states): Add a comment.
7924 (Output_section::discard_states): New method defintion.
7925 (Output_section::adjust_section_offsets): Same.
7926 * output.h (Output_section::add_input_section_for_script): Renamed to
7927 Output_section::add_simple_input_section.
7928 (Output_section::discard_states): New method declaration.
7929 (Output_section::adjust_section_offsets): Same.
7930 (Output_section::section_offsets_need_adjustment,
7931 Output_section::set_section_offsets_need_adjustment): New method
7932 definitions.
7933 (Output_section::section_offsets_need_adjustment_): New data member.
7934 * script-sections.cc
7935 (Output_section_element_input::set_section_address): Adjust code for
7936 renaming of Output_section::add_input_section_for_script.
7937 (Orphan_output_section::set_section_address): Same.
7938
9b2fd367
DK
79392010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7940
7941 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7942 Fix_v4bx enum values .
7943 * gold/options.h (General_options): New option definitions.
7944 (General_options::fix_v4bx): New method.
7945 (General_options::Fix_v4bx): New enum.
7946 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7947 (General_options::parse_fix_v4bx_interworking): New method.
7948
80d0d023
DK
79492010-01-22 Doug Kwan <dougkwan@google.com>
7950
7951 * arm.cc (Arm_exidx_fixup): New class.
7952
af2cdeae
DK
79532010-01-21 Doug Kwan <dougkwan@google.com>
7954
7955 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7956 classes.
7957 (Arm_exidx_section_offset_map): New type.
7958
993d07c1
DK
79592010-01-21 Doug Kwan <dougkwan@google.com>
7960
7961 * arm.cc (Arm_exidx_input_section): New class.
7962 (Arm_relobj::exidx_input_section_by_link,
7963 Arm_relobj::exidx_input_section_by_shndx,
7964 Arm_relobj::make_exidx_input_section): New methods.
7965 (read_arm_attributes_section): Remove.
7966 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7967 information about them.
7968 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7969 to here.
7970
5ac169d4
DK
79712010-01-20 Doug Kwan <dougkwan@google.com>
7972
7973 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7974 Input_section_specifier to Section_id.
7975 (Target_arm::new_arm_input_section: Adjust code for change of key
7976 type.
7977 (Target_arm::find_arm_input_section): Ditto.
7978 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7979 (Section_id): Remove.
7980 (Garbage_collection::Section_id_hash): Remove.
7981 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7982 (Section_id): Remove.
7983 (Icf::Section_id_hash): Remove.
7984 * object.h (Section_id, Const_section_id, Section_id_hash,
7985 Const_section_id_hash): New type definitions.
7986 * output.cc (Output_section::add_relaxed_input_section): Change to
7987 use Const_section_id instead of Input_section_specifier as key type.
7988 (Output_section::add_merge_input_section): Ditto.
7989 (Output_section::build_relaxation_map): Change to use Section_id
7990 instead of Input_section_specifier as key type.
2e702c99 7991 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7992 Ditto.
7993 (Output_section::convert_input_sections_to_relaxed_sections): Change
7994 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7995 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7996 (Output_section::find_relaxed_input_section): Ditto.
7997 * output.h (Input_section_specifier): Remove class.
7998 (Output_section::Output_section_data_by_input_section_map): Change
7999 key type to Const_section_id.
8000 (Output_section::Output_relaxed_input_section_by_input_section_map):
8001 Ditto.
8002 (Output_section::Relaxation_map): Change key type to Section_id.
8003
a2162063
ILT
80042010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8005
8006 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8007 (class Arm_v4bx_stub): New class.
8008 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8009 (Stub_factory::make_arm_v4bx_stub): New method.
8010 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8011 (Stub_table::empty): Handle v4bx stubs.
8012 (Stub_table::add_arm_v4bx_stub): New method.
8013 (Stub_table::find_arm_v4bx_stub): New method.
8014 (Arm_relocate_functions::v4bx): New method.
8015 (Target_arm::fix_v4bx): New method.
8016 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8017 (Stub_table::relocate_stubs): Likewise.
8018 (Stub_table::do_write): Likewise.
8019 (Stub_table::update_data_size_and_addralign): Likewise.
8020 (Stub_table::finalize_stubs): Likewise.
8021 (Target_arm::Scan::local): Likewise.
8022 (Target_arm::Scan::global): Likewise.
8023 (Target_arm::do_finalize_sections): Likewise.
8024 (Target_arm::Relocate::relocate): Likewise.
8025 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8026 Likewise.
8027 (Target_arm::scan_reloc_for_stub): Likewise.
8028 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8029
5696ab0b
ILT
80302010-01-19 Ian Lance Taylor <iant@google.com>
8031
8032 * output.cc (Output_section_headers::do_sized_write): Write large
8033 segment count to sh_info field.
8034 (Output_file_header::do_sized_write): For large segment count,
8035 write PN_XNUM to e_phnum field.
8036
800d0f56
ILT
80372010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8038
8039 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8040 (Arm_relocate_functions::thm_jump8): New function.
8041 (Arm_relocate_functions::thm_jump11): New function.
8042 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8043 R_ARM_THM_JUMP11.
8044 (Target_arm::Scan::global): Likewise.
8045 (Target_arm::Relocate::relocate): Likewise.
8046 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8047 Likewise.
8048
41263c05
DK
80492010-01-14 Doug Kwan <dougkwan@google.com>
8050
8051 * arm.cc (map, utility): Include headers.
8052 (Target_arm::apply_cortex_a8_workaround): New method.
8053 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8054 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8055 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8056 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8057 the --[no-]fix-cortex-a8 command line options.
8058 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8059 (Target_arm::relocate_stub): Use addend in instruction template.
8060 * options.h (DEFINE_bool): Set the user-set flag.
8061 (General_options): Add --[no-]-fix-cortex options.
8062 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8063 : Update fast look-up map after conversion.
41263c05 8064
459e9b03
ST
80652010-01-14 Sriraman Tallam <tmsriram@google.com>
8066
8067 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8068 in the first pass of do_layout.
8069
b521dfe4
DK
80702010-01-13 Doug Kwan <dougkwan@google.com>
8071
8072 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8073 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8074 apparent compiler problem of not folding static constant integral
8075 data members of elfcpp::Elf_sizes<32>.
8076
44272192
DK
80772010-01-13 Doug Kwan <dougkwan@google.com>
8078
8079 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8080 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8081 Arm_relobj::scan_section_for_cortex_a8_erratum,
8082 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8083 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8084 sections to scan for relocation stubs into a new method
8085 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8086 relocation and Cortex-A8 stub scanning.
8087 (Target_arm::do_relax): Force stubs to be after stubbed sections
8088 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8089 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8090 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8091
44b71ece
ILT
80922010-01-12 Ian Lance Taylor <iant@google.com>
8093
8094 * target-reloc.h (visibility_error): New inline function.
8095 (relocate_section): Call visibility_error.
8096 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8097 (MOSTLYCLEANFILES): Likewise.
8098 (protected_4_pic.o, protected_3.err): New targets.
8099 * testsuite/protected_4.cc: New file.
8100
a120bc7f
DK
81012010-01-12 Doug Kwan <dougkwan@google.com>
8102
8103 * arm.cc (Cortex_a8_reloc): New class.
8104 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8105 and cortex_a8_relocs_info_.
8106 (Target_arm::fix_cortex_a8): New method definition.
8107 (Target_arm::Cortex_a8_relocs_info): New type.
8108 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8109 New data member declarations.
8110 (Target_arm::scan_reloc_for_stub): Record information about
8111 relocations for THUMB branches that might be exempted from the
8112 Cortex-A8 workaround.
8113 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8114 at the beginning of a relaxation pass.
8115
20138696
DK
81162010-01-12 Doug Kwan <dougkwan@google.com>
8117
8118 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8119 (Arm_relobj::Mapping_symbol_position,
8120 Arm_reloj::Mapping_symbol_position_less,
8121 Arm_relobj::Mapping_symbols_info): New types.
8122 (Target_arm::is_mapping_symbol_name): New method definition.
8123 (Arm_relobj::do_count_local_symbols): Save information about mapping
8124 symbols.
8125
089d69dc
DK
81262010-01-11 Doug Kwan <dougkwan@google.com>
8127
8128 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8129 Arm_relocate_functions::thumb32_branch_upper,
8130 Arm_relocate_functions::thumb32_branch_lower,
8131 Arm_relocate_functions::thumb32_cond_branch_offset,
8132 Arm_relocate_functions::thumb32_cond_branch_upper,
8133 Arm_relocate_functions::thumb32_cond_branch_lower,
8134 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8135 branch offset encoding.
8136 (Arm_relocate_functions::thumb_branch_common): Use new branch
8137 offset encoding methods to avoid code duplication.
8138 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8139 (Stub_addend_reader::operator()): Use new branch encoding method
8140 to avoid code duplication.
8141
99e5bff2
DK
81422010-01-11 Doug Kwan <dougkwan@google.com>
8143
8144 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8145 (Target_arm::do_finalize_sections): Define special EXIDX section
8146 symbols only if referenced.
8147 * gc.h (Garbage_collection::add_reference): New method.
8148 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8149 code duplication.
8150
98e090bd
ILT
81512010-01-11 Ian Lance Taylor <iant@google.com>
8152
d0a91bd8
ILT
8153 * script.cc (Version_script_info::build_expression_list_lookup):
8154 Change complaing about duplicate wildcard match from error to
8155 warning.
8156
98e090bd
ILT
8157 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8158 of 2009-12-30.
8159 (Version_script_info::Version_script_info): Initialize globs_,
8160 default_version_, default_is_global_, and exact_. Don't
8161 initialize globals_ or locals_.
8162 (Version_script_info::build_lookup_tables): Build local symbols
8163 first.
8164 (Version_script_info::unquote): New function.
8165 (Version_script_info::add_exact_match): New function.
8166 (Version_script_info::build_expression_list_lookup): Remove lookup
8167 parameter. Add is_global parameter. Change all callers. Handle
8168 wildcard pattern specially. Unquote pattern. Call
8169 add_exact_match.
8170 (Version_script_info::get_name_to_match): New function.
8171 (Version_script_info::get_symbol_version): New function.
8172 (Version_script_info::get_symbol_version_helper): Remove.
8173 (Version_script_info::check_unmatched_names): Call unquote.
8174 * script.h (class Version_script_info): Change get_symbol_version
8175 to be non-inline and add is_global parameter; change all callers.
8176 Rewrite symbol_is_local. Update declarations. Define struct
8177 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8178 Remove globals_ and locals_ members. Add exact_, globs_,
8179 default_version_, is_global_.
8180 (Version_script_info::Glob): Remove pattern, add expression and
8181 is_global. Update constructor. Change all callers.
8182 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8183 default version.
8184 (Versions::symbol_section_contents): If a symbol is undefined, or
8185 defined in a dynamic object, set the version index to
8186 VER_NDX_LOCAL.
8187 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8188 symbol_is_local.
8189 (Symbol_table::add_from_pluginobj): Likewise.
8190 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8191
d56962d3
DK
81922010-01-11 Doug Kwan <dougkwan@google.com>
8193
8194 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8195 (incremental_dump_LDADD): Add linking option for libintl.
8196 * Makefile.in: Regenerate.
8197
94e6ee91
L
81982010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8199
8200 PR gold/11144
8201 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8202 instead of -Ds.
8203 * testsuite/Makefile.in: Regenerated.
8204
e96c574b
DK
82052010-01-10 Doug Kwan <dougkwan@google.com>
8206
8207 * options.h (DEFINE_var): Use parentheses around argument varname__
8208 in macro body to avoid any unintended subsequent substitutions.
8209
7198066b
ILT
82102010-01-10 Ian Lance Taylor <iant@google.com>
8211
ba4d53bf
ILT
8212 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8213 candidates before doing symbol resolution.
8214
7198066b
ILT
8215 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8216 ODR candidates if only one is weak.
8217
a2beed37
ILT
82182010-01-08 Ian Lance Taylor <iant@google.com>
8219
8220 * script.cc (Version_script_info::build_expression_list_lookup):
8221 Don't warn about ambiguous version, just record the ambiguity.
8222 (Version_script_info::get_symbol_version_helper): Give error if
8223 version is ambiguous.
8224
2fb7225c
DK
82252010-01-08 Doug Kwan <dougkwan@google.com>
8226
8227 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8228 prev_data_size_ and prev_addralign_. Remove initializer for
8229 deleted data member has_been_changed_.
8230 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8231 to determine if the table is empty.
8232 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8233 Remove.
8234 (Stub_table::add_reloc_stub): Define method in class definition
8235 instead of just declaring it there.
8236 (Stub_table::add_cortex_a8_stub): New method definition.
8237 (Stub_table::update_data_size_and_addralign): Ditto.
8238 (Stub_table::finalize_stubs): Ditto.
8239 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8240 (Stub_table::do_addralign_): Return address alignment in the
8241 (Stub_table::do_reset_address_and_file_offset): Define method in
8242 class definition instead of declaring it there. Set current data
8243 size to be the data size of the previous pass.
8244 (Stub_table::set_final_data_size): Use current data size as the
8245 final data size.
8246 (Stub_table::relocate_stub): Change parameter type of stub from
8247 Reloc_stub pointer to Stub pointer.
8248 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8249 (Stub_table::Cortex_a8_stub_list): New typedef.
8250 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8251 Stub_table::prev_addralign_): New data member.
8252 (Arm_relobj::Arm_relobj): Initialize data member
8253 section_has_cortex_a8_workaround_.
8254 (Arm_relobj::section_has_cortex_a8_workaround,
8255 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8256 definitions.
8257 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8258 declarations.
8259 (Target_arm::relocate_stub): Change parameter type of stub from
8260 Reloc_stub pointer to Stub pointer.
8261 (Insn_template::size, Insn_template::alignment): Handle
8262 THUMB16_SPECIAL_TYPE.
8263 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8264 Stub_table::update_data_size_and_addralign,
8265 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8266 definitions.
8267 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8268 (Stub_table::do_write): Ditto.
8269 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8270
880cd20d
ILT
82712010-01-08 Ian Lance Taylor <iant@google.com>
8272
8273 PR 11108
8274 * symtab.h (class Symbol): Remove fields is_target_special_ and
8275 has_plt_offset_. Add field is_defined_in_discarded_section_.
8276 (Symbol::is_defined_in_discarded_section): New function.
8277 (Symbol::set_is_defined_in_discarded_section): New function.
8278 (Symbol::has_plt_offset): Rewrite.
8279 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8280 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8281 Don't initialize is_target_special_ or has_plt_offset_.
8282 Initialize is_defined_in_discarded_section_.
8283 (Symbol_table::add_from_relobj): If appropriate, set
8284 is_defined_in_discarded_section.
8285 * resolve.cc (Symbol::override_base_with_special): Don't test
8286 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8287 * target-reloc.h (relocate_section): Do special handling for
8288 symbols defined in discarded sections for global symbols as well
8289 as local symbols.
8290
2703e3eb
ILT
82912010-01-08 Ian Lance Taylor <iant@google.com>
8292
8293 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8294 the SHT_SYMTAB case.
8295
339d40a3
ILT
82962010-01-08 Ian Lance Taylor <iant@google.com>
8297
8298 * object.cc (Sized_relobj::do_layout): Don't get confused if
8299 layout_eh_frame returns NULL.
8300
abecea76
ILT
83012010-01-08 Ian Lance Taylor <iant@google.com>
8302
8303 PR 11084
8304 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8305 dynamic symbol table, use the normal symbol table.
8306 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8307 symbol table.
8308
6b7dd3f3
ILT
83092010-01-08 Ian Lance Taylor <iant@google.com>
8310
8311 PR 11072
8312 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8313 sections.
8314
36c50e63
L
83152010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8316
8317 * version.cc (print_version): Change to "Copyright 2010".
8318
e291e7b9
ILT
83192010-01-08 Ian Lance Taylor <iant@google.com>
8320
8321 PR 10287
8322 PR 11063
8323 * i386.cc (class Target_i386): Change return type of plt_section
8324 to be non-const.
8325 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8326 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8327 tls_desc_rel_ field.
8328 (Output_data_plt_i386::rel_tls_desc): New function.
8329 (Target_i386::rel_tls_desc_section): New function.
8330 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8331 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8332 R_386_TLS_DESC reloc in rel_tls_desc_section.
8333 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8334 Define struct Tlsdesc_info.
8335 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8336 (Target_x86_64::do_reloc_symbol_index): New function.
8337 (Target_x86_64::add_tlsdesc_info): New function.
8338 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8339 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8340 tlsdesc_rel_ field.
8341 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8342 all callers.
8343 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8344 (Target_x86_64::rela_tlsdesc_section): New function.
8345 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8346 handling.
8347 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8348 (Target_x86_64::do_reloc_addend): New function.
8349 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8350 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8351 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8352 (Output_reloc::type): New function.
8353 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8354 (Output_reloc::is_target_specific): New function.
8355 (Output_reloc::target_arg): New function.
8356 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8357 absolute relocs and target specific relocs.
8358 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8359 add_target_specific.
8360 (class Output_data_reloc) [SHT_RELA]: Likewise.
8361 * output.cc (Output_reloc::Output_reloc): Add four new versions
8362 for absolute relocs and target specific relocs.
8363 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8364 (Output_reloc::get_symbol_index): Likewise.
8365 (Output_reloc::local_section_offset): Check that local_sym_index_
8366 is not TARGET_CODE or 0.
8367 (Output_reloc::symbol_value): Likewise.
8368 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8369 reloc.
8370 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8371 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8372 functions.
8373 * layout.cc (add_target_dynamic_tags): Use output section for
8374 DT_PLTRELSZ and DT_JMPREL.
8375
3a44184e
ILT
83762010-01-07 Ian Lance Taylor <iant@google.com>
8377
8378 PR 11061
8379 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8380 function.
8381 (class Output_data_reloc_generic): Define.
8382 (class Output_data_reloc_base): Change base class to
8383 Output_data_reloc_generic. Change add() method to call
8384 bump_relative_reloc_count for a relative reloc. Remove
8385 sort_relocs_ field.
8386 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8387 to sort_relocs().
8388 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8389 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8390 appropriate.
8391 * layout.h (class Layout): Update declaration.
8392
ea715a34
ILT
83932010-01-07 Ian Lance Taylor <iant@google.com>
8394
8395 * output.h (class Output_data): Add const version of
8396 output_section and do_output_section.
8397 (class Output_section_data): Add const version of
8398 do_output_section.
8399 (class Output_section): Likewise.
8400 * layout.cc (Layout::add_target_dynamic_tags): New function.
8401 * layout.h (class Layout): Update declarations.
8402 * arm.cc (Target_arm::do_finalize_sections): Use
8403 add_target_dynamic_tags.
8404 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8405 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8406 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8407 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8408
659948a4
ILT
84092010-01-07 Ian Lance Taylor <iant@google.com>
8410
8411 PR 11042
8412 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8413 object as needed.
8414
9d3b86f6
ILT
84152010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8416 Ian Lance Taylor <iant@google.com>
8417
8418 PR 11019
8419 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8420 Xindex::read_symtab_xindex.
8421
bb0d3eb0
DK
84222010-01-07 Doug Kwan <dougkwan@google.com>
8423
8424 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8425 (Insn_template::thumb16_bcond_insn): New method declaration.
8426 (Insn_template): Fix spelling.
8427 (Stub::thumb16_special): New method declaration.
8428 (Stub::do_write): Define virtual method which was previously pure
8429 virtual.
8430 (Stub::do_thumb16_special): New method declaration.
8431 (Stub::do_fixed_endian_write): New template member.
8432 (Reloc_stub::do_write): Remove.
8433 (Reloc_stub::do_fixed_endian_write): Remove.
8434 (Cortex_a8_stub): New class definition.
8435 (Stub_factory::make_cortex_a8_stub): New method definition.
8436 (Stub_factory::Stub_factory): Add missing static storage class
8437 qualifier for elf32_arm_stub_a8_veneer_blx.
8438
ffeef7df
ILT
84392010-01-07 Ian Lance Taylor <iant@google.com>
8440
dc3f80fe
ILT
8441 PR 10980
8442 * options.h (class General_options): Add --warn-unresolved-symbols
8443 and --error-unresolved-symbols.
8444 * errors.cc (Errors::undefined_symbol): Implement
8445 --warn-unresolved-symbols.
8446
ffeef7df
ILT
8447 * options.h (class General_options): Add -z text and -z textoff.
8448 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8449
f1ec9ded
ST
84502010-01-06 Sriraman Tallam <tmsriram@google.com>
8451
8452 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8453 (Garbage_collection::cident_sections): New function.
8454 (Garbage_collection::add_cident_section): New function.
8455 (Garbage_collection::cident_sections_): New member.
8456 (gc_process_relocs): Add references to sections whose names are C
8457 identifiers.
8458 * gold.h (cident_section_start_prefix): New constant.
8459 (cident_section_stop_prefix): New constant.
8460 (is_cident): New function.
8461 * layout.cc (Layout::define_section_symbols): Replace string constants
8462 with the newly defined constants.
8463 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8464 C identifiers.
8465 * testsuite/Makefile.am: Add gc_orphan_section_test.
8466 * testsuite/Makefile.in: Regenerate.
8467 * testsuite/gc_orphan_section_test.cc: New file.
8468 * testsuite/gc_orphan_section_test.sh: New file.
8469
6eda8c29
ILT
84702010-01-06 Ian Lance Taylor <iant@google.com>
8471
b9674e17
ILT
8472 PR 10980
8473 * options.h (class General_options): Add --warn-shared-textrel.
8474 * layout.cc (Layout::finish_dynamic_section): Implement
8475 --warn-shared-textrel.
8476
6eda8c29
ILT
8477 PR 10980
8478 * options.h (class General_options): Add --warn-multiple-gp.
8479
32dcd44e
ILT
84802010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8481
8482 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8483 $(THREADSLIB) and $(LIBDL).
8484 * Makefile.in: Rebuild.
8485
a192ba05
ILT
84862010-01-06 Ian Lance Taylor <iant@google.com>
8487
8488 PR 10980
8489 * options.cc (General_options::parse_section_start): New function.
8490 (General_options::section_start): New function.
8491 (General_options::General_options): Initialize all members.
8492 * options.h: Include <map>
8493 (class General_options): Add --section-start. Add section_starts_
8494 member.
8495 * layout.cc (Layout::attach_allocated_section_to_segment): If
8496 --section-start was used, set the address of the segment. Remove
8497 local sort_sections.
8498 (Layout::relaxation_loop_body): If the address of the load segment
8499 has been set by --section-start, don't use it.
8500 * output.h (Output_segment::update_flags_for_output_section): New
8501 function.
8502 * output.cc (Output_segment::add_output_section): Call
8503 update_flags_for_output_section.
8504
dde3f402
ILT
85052010-01-05 Ian Lance Taylor <iant@google.com>
8506
62dfdd4d
ILT
8507 PR 10980
8508 * options.h (class General_options): Add --undefined-version.
8509 * script.cc (struct Version_expression): Add was_matched_by_symbol
8510 field.
8511 (Version_script_info::matched_symbol): New function.
8512 (Version_script_info::get_symbol_version_helper): Call
8513 matched_symbol.
8514 (Version_script_info::check_unmatched_names): New function.
8515 * script.h (class Version_script_info): Update declarations.
8516 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8517
9c4ae156
ILT
8518 * options.h (class General_options): Use DEFINE_bool_alias for
8519 allow_multiple_definition.
8520 * resolve.cc (Symbol_table::should_override): Don't test
8521 allow_multiple_definition.
8522
dde3f402
ILT
8523 PR 10980
8524 * options.h (class General_options): Add --cref.
8525 * main.cc (main): Print cref table if --cref. Don't close mapfile
8526 until after printing cref table.
8527 * cref.cc: Include "symtab.h".
8528 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8529 (Cref_table_compare::operator()): New function.
8530 (Cref_inputs::gather_cref): New function.
8531 (filecol): New static const.
8532 (Cref_inputs::print_cref): New function.
8533 (Cref::print_cref): New function.
8534 * cref.h: Include <cstdio>.
8535 (class Cref): Update declarations.
8536 * mapfile.h (Mapfile::file): New function.
8537 * object.h (class Object): Define Symbols. Declare virtual
8538 do_get_global_symbols.
8539 (Object::get_global_symbols): New function.
8540 * object.cc (Input_objects::add_object): Pass object to cref_ if
8541 --cref.
8542 (Input_objects::archive_start): Likewise.
8543 (Input_objects::archive_stop): Likewise.
8544 (Input_objects::print_cref): New function.
8545 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8546 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8547 --cref.
8548 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8549 function.
8550 * plugin.h (class Sized_pluginobj): Update declarations.
8551
8781f709
ILT
85522010-01-05 Ian Lance Taylor <iant@google.com>
8553
8554 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8555 to is_default_version. Rename insdef to insdefault.
8556 (Symbol_table::add_from_relobj): Rename def to is_default_version
8557 and local to is_forced_local.
8558 (Symbol_table::add_from_pluginobj): Likewise.
8559 (Symbol_table::add_from_dynobj): Likewise.
8560 (Symbol_table::define_special_symbol): Rename insdef to
8561 insdefault.
8562
fe35d28d
ILT
85632010-01-04 Ian Lance Taylor <iant@google.com>
8564
30bc8c46
ILT
8565 PR 10980
8566 * options.h (class General_options): Add
8567 --allow-multiple-definition and -z muldefs.
8568 * resolve.cc (Symbol_table::should_override): Don't warn about a
8569 multiple symbol definition if --allow-multiple-definition or -z
8570 muldefs.
8571
7eaea549
ILT
8572 PR 10980
8573 * options.h (class General_options): Add --add-needed and
8574 --copy-dt-needed-entries. Tweak --as-needed help entry.
8575 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8576 error if --copy-dt-needed-entries aka --add-needed is used and
8577 would cause a change in behaviour.
8578
fe35d28d
ILT
8579 PR 10980
8580 * options.h (class General_options): Add -G as a short version of
8581 --shared. Add no-op options -assert, -g, and -i.
8582
55a2bb35
ST
85832010-01-04 Sriraman Tallam <tmsriram@google.com>
8584
8585 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8586 check for .text or .gnu.linkonce.t sections.
8587 * icf.cc (Icf::find_identical_sections): Ditto.
8588 Change the detection for mangled function name within the section
8589 name.
8590 * icf.h (is_section_foldable_candidate): New function.
8591
719328e1
ILT
85922009-12-30 Ian Lance Taylor <iant@google.com>
8593
8594 PR 10980
8595 * options.h (class General_options): Permit two dashes with
8596 --retain-symbols-file.
8597
d7bb5745
ILT
85982009-12-30 Ian Lance Taylor <iant@google.com>
8599
403a15dd
ILT
8600 PR 10979
8601 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8602 don't put the file header and segment headers in the text
8603 segment.
8604
eda294df
ILT
8605 PR 10979
8606 * common.cc (Sort_commons::operator()): Stabilize sort when both
8607 entries are NULL.
8608 (Symbol_table::do_allocate_commons_list): When allocating common
8609 symbols, skip a symbol which is no longer common.
8610 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8611 an object before checking its type.
8612 * testsuite/common_test_2.c: New file.
8613 * testsuite/common_test_3.c: New file.
8614 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8615 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8616 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8617 (common_test_2_pic.o, common_test_2.so): New targets.
8618 (common_test_3_pic.o, common_test_3.so): New targets.
8619 * testsuite/Makefile.in: Rebuild.
8620
d7bb5745
ILT
8621 PR 10979
8622 * script.cc (read_input_script): If we see a new SECTIONS clause,
8623 and we have added an input section, give an error.
8624 * layout.h (class Layout): Add have_added_input_section function.
8625 Add have_added_input_section_ field.
8626 * layout.cc (Layout::Layout): Initialize
8627 have_added_input_section_.
8628 (Layout::layout): Set have_added_input_section_.
8629 (Layout::layout_eh_frame): Likewise.
8630
fc59c572
ILT
86312009-12-30 Ian Lance Taylor <iant@google.com>
8632
8633 PR 10931
8634 * options.h (class General_options): Add --sort-common option.
8635 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8636 * common.cc (Sort_common): Add sort_order parameter to
8637 constructor. Add sort_order_ field.
8638 (Sort_commons::operator): Check sort_order_.
8639 (Symbol_table::allocate_commons): Determine the sort order.
8640 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8641 Change all callers.
8642 (Symbol_table::do_allocate_commons_list): Likewise.
8643
1c74fab0
ILT
86442009-12-30 Ian Lance Taylor <iant@google.com>
8645
8646 PR 10916
8647 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8648 symbols from this object, don't change the visibility of an
8649 undefined symbol.
8650 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8651
6affe781
ILT
86522009-12-30 Ian Lance Taylor <iant@google.com>
8653
8654 PR 10861
8655 * script.h (class Version_script_info): Define Language enum.
8656 Update declarations. Define Glob, Exact, and Lookup types. Add
8657 new fields globals_, locals_, and is_finalized_.
8658 * script.cc: Various formatting fixes.
8659 (class Parser_closure): Change language_stack_ from a vector of
8660 std::string to one of Version_script_info::Language. Adjust all
8661 uses accordingly.
8662 (class Lazy_demangler): Remove.
8663 (struct Version_expression): Change language from std::string to
8664 Version_script_info::Language.
8665 (Version_script_info::Version_script_info): New function.
8666 (Version_script_info::~Version_script_info): Don't call clear.
8667 (Version_script_info::finalize): New function.
8668 (Version_script_info::build_lookup_tables): New function.
8669 (Version_script_info::build_expression_list_lookup): New
8670 function.
8671 (Version_script_info::get_symbol_version_helper): Rewrite to use
8672 lookup tables.
8673 (Version_script_info::print_expression_list): Adjust to use
8674 Version_script_info::Language.
8675 (script_push_lex_into_version_mode): Check that the version script
8676 has not been finalized.
8677 (version_script_push_lang): Change language string to
8678 Version_script_info::Language.
8679 * options.cc (Command_line::version_script): New function.
8680 * options.h (class General_options): Add finalize_dynamic_list
8681 function. Change version_script from declaration to definition.
8682 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8683 * testsuite/version_script.map: Remove duplicate def of foo.
8684 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8685 version_script.map.
8686 * testsuite/Makefile.in: Rebuild.
8687
818bf354
ILT
86882009-12-30 Ian Lance Taylor <iant@google.com>
8689
8690 PR 10843
8691 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8692 if the input symbol index is 0, make the output symbol index 0.
8693
ebcc8304
ILT
86942009-12-30 Ian Lance Taylor <iant@google.com>
8695
8696 PR 10670
8697 * options.h (class General_options): Add -x/--discard-all.
8698 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8699 --discard-all. If the local symbol needs a dynamic entry, check
8700 that before handling --discard-locals.
8701
176fe33f
ILT
87022009-12-30 Ian Lance Taylor <iant@google.com>
8703
bb321bb1
ILT
8704 PR 10450
8705 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8706 flags to PF_R.
8707 (Output_segment::add_output_section): Don't change the flags if
8708 the type is PT_TLS.
8709
176fe33f
ILT
8710 PR 10450
8711 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8712 GNU hash table if they need a dynamic value. Otherwise, don't add
8713 them if they are defined in a dynamic object or are forced local.
8714
e8cd95c7
ILT
87152009-12-29 Ian Lance Taylor <iant@google.com>
8716
1b81fb71
ILT
8717 PR 10450
8718 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8719 .gnu.hash table for a 32-bit target.
8720
8d6d383d
ILT
8721 PR 10450
8722 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8723 regular and a dynamic object only needs a dynamic symbol table
8724 entry if it is externally visible.
8725
e785ec03
ILT
8726 PR 10450
8727 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8728 constructor. Add global_offset_table_ field.
8729 (Target_i386::got_section): Set global_offset_table_.
8730 (Target_i386::do_finalize_sections): Set global_offset_table_
8731 size.
8732 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8733 in constructor. Add global_offset_table_ field.
8734 (Target_x86_64::got_section): Set global_offset_table_.
8735 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8736 size.
8737
1a2dff53
ILT
8738 * layout.cc (Layout::Layout): Initialize increase_relro_.
8739 (Layout::get_output_section): Add is_relro, is_last_relro, and
8740 is_first_non_relro parameters. Change all callers.
8741 (Layout::choose_output_section): Likewise.
8742 (Layout::add_output_section_data): Likewise.
8743 (Layout::make_output_section): Likewise.
8744 (Layout::set_segment_offsets): Clear increase_relro when using a
8745 linker script.
8746 * layout.h (class Layout): Add increase_relro method. Add
8747 increase_relro_ field. Update declarations.
8748 * output.cc (Output_section::Output_section): Initialize
8749 is_last_relro_ and is_first_non_relro_.
8750 (Output_segment::add_output_section): Group relro sections is
8751 do_sort is true. Handle is_last_relro and is_first_non_relro.
8752 (Output_segment::maximum_alignment): Remove relro handling.
8753 (Output_segment::set_section_addresses): Add increase_relro
8754 parameter. Change all callers. Add initial alignment to align
8755 relro sections on separate page. Remove old relro handling.
8756 (Output_segment::set_section_list_addresses): Remove in_relro
8757 parameter. Change all callers.
8758 (Output_segment::set_offset): Add increase parameter. Change all
8759 callers. Remove old relro handling.
8760 * output.h (class Output_section): Add new methods: is_last_relro,
8761 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8762 Add is_last_relro_ and is_first_non_relro_ fields.
8763 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8764 Create separate .got.plt section. Call increase_relro.
8765 * x86_64.cc (Target_x86_64::got_section): Likewise.
8766 * testsuite/relro_script_test.t: Add .got.plt.
8767
f0ba79e2
ILT
8768 PR 10450
8769 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8770 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8771 (Layout::finalize): Call set_dynamic_symbol_size.
8772 (Layout::set_dynamic_symbol_size): New function.
8773 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8774 set_dynamic_symbol_size.
8775
e8cd95c7
ILT
8776 PR 10450
8777 * output.h (class Output_section): Add is_entsize_zero_ field.
8778 * output.cc (Output_section::Output_section): Initialize
8779 is_entsize_zero_.
8780 (Output_section::set_entsize): If two different entsizes are
8781 requested, force it to zero.
8782 (Output_section::add_input_section): Set flags for .debug_str
8783 before updating section flags. Set entsize.
8784 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8785 and SHF_STRING if all input sections have those flags.
8786
3e1b9a8a
RÁE
87872009-12-29 Rafael Espindola <espindola@google.com>
8788
8789 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8790 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8791 reporting.
3e1b9a8a 8792
3dcad376
ST
87932009-12-29 Sriraman Tallam <tmsriram@google.com>
8794
8795 * options.cc (General_options::parse_version): Allow -v to exit
8796 without an error if there is nothing to link.
8797
084e2665
ILT
87982009-12-29 Ian Lance Taylor <iant@google.com>
8799
8800 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8801 using a version of gcc before 4.1.
8802 * configure: Rebuild.
8803
250acde3
CD
88042009-12-28 Chris Demetriou <cgd@google.com>
8805
8806 * attributes.cc (Output_attributes_section_data::do_write): Use
8807 std::vector::front rather than std::vector::data.
8808
99fff23b
ILT
88092009-12-28 Ian Lance Taylor <iant@google.com>
8810
8811 * symtab.h (class Symbol_table): Add enum Defined.
8812 * resolve.cc (Symbol_table::should_override): Add defined
8813 parameter. Change all callers. Test whether object is NULL
8814 before calling a method on it.
8815 (Symbol_table::report_resolve_problem): Add defined parameter.
8816 Change all callers.
8817 (Symbol_table::should_override_with_special): Likewise.
8818 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8819 parameter. Change all callers.
8820 (Symbol_table::do_define_in_output_data): Likewise.
8821 (Symbol_table::define_in_output_segment): Likewise.
8822 (Symbol_table::do_define_in_output_segment): Likewise.
8823 (Symbol_table::define_as_constant): Likewise.
8824 (Symbol_table::do_define_as_constant): Likewise.
8825 * script.h (class Symbol_assignment): Add is_defsym parameter to
8826 constructor; change all callers.
8827 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8828 parameter. Change all callers. Add is_defsym_ field.
8829 (class Parser_closure): Add parsing_defsym parameter to
8830 constructor; change all callers. Add parsing_defsym accessor
8831 function. Add parsing_defsym_ field.
8832
556bd683
ILT
88332009-12-28 Ian Lance Taylor <iant@google.com>
8834
8835 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8836 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8837
1782c879
ILT
88382009-12-23 Ian Lance Taylor <iant@google.com>
8839
8840 * i386.cc (Target_i386::do_calls_non_split): Recognize
8841 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8842 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8843 -fsplit-stack prologue when using %r11.
1782c879 8844
329ca2b1
ST
88452009-12-21 Sriraman Tallam <tmsriram@google.com>
8846
8847 * options.cc (General_options::parse_version): Make -v continue and do
8848 the link like GNU ld does.
8849
d675ff46
RÁE
88502009-12-17 Rafael Avila de Espindola <espindola@google.com>
8851
8852 * Makefile.am (CCFILES): Add timer.cc.
8853 (HFILES): Add timer.h.
8854 * configure.ac: Check for sysconf and times.
8855 * main.cc: include timer.h.
8856 (main): Use Timer instead of get_run_time.
8857 * timer.cc: New.
8858 * timer.h: New.
8859 * workqueue.cc: include timer.h.
8860 (Workqueue::find_and_run_task):
8861 Report user, sys and wall time.
8862 * Makefile.in: Regenerate.
8863 * config.in: Regenerate.
8864 * configure: Regenerate.
8865
d6344fb5
DK
88662009-12-16 Doug Kwan <dougkwan@google.com>
8867
8868 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8869 sections.
8870 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8871 relaxed input sections.
8872 * output.cc (Output_section::find_relaxed_input_section): Change
8873 return type to Output_relaxed_input_section pointer. Adjust code
8874 for new type of relaxed_input_section_map_.
8875 * output.h (Output_section::find_relaxed_input_section): Change
8876 return type to Output_relaxed_input_section pointer.
8877 (Output_section::Output_relaxed_input_section_by_input_section_map):
8878 New type.
8879 (Output_section::relaxed_input_section_map_): Change type to
8880 Output_section::Output_relaxed_input_section_by_input_section_map.
8881 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8882 input section.
8883
0e0d5469
ILT
88842009-12-15 Ian Lance Taylor <iant@google.com>
8885
8886 * layout.cc (Layout::create_shstrtab): Only write out after input
8887 sections if we are compressing debug sections.
8888
0649a889
ILT
88892009-12-15 Ian Lance Taylor <iant@google.com>
8890
8891 * archive.cc (Archive::add_symbols): Only look up a symbol without
8892 a version if there is, in fact, a version.
8893
2ea97941
ILT
88942009-12-14 Ian Lance Taylor <iant@google.com>
8895
8896 Revert -Wshadow changes, all changes from:
8897 2009-12-11 Doug Kwan <dougkwan@google.com>
8898 2009-12-11 Nick Clifton <nickc@redhat.com>
8899 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8900
b0eec2cc
DK
89012009-12-11 Doug Kwan <dougkwan@google.com>
8902
8903 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8904 due to -Wshadow.
8905 * attributes.cc (Object_attribute::size): Ditto.
8906 (Attributes_section_data::size): Ditto.
8907 (Attributes_section_data::Attributes_section_data): Ditto.
8908 (Output_attributes_section_data::do_write): Ditto.
8909 * attributes.h (Object_attribute::set_type): Ditto.
8910 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8911
91d6fa6a
NC
89122009-12-11 Nick Clifton <nickc@redhat.com>
8913
8914 * archive.cc: Fix shadowed variable warnings.
8915 * arm.cc: Likewise.
8916 * compressed_output.cc: Likewise.
8917 * compressed_output.h: Likewise.
8918 * configure: Likewise.
8919 * dwarf_reader.cc: Likewise.
8920 * dynobj.cc: Likewise.
8921 * dynobj.h: Likewise.
8922 * ehframe.cc: Likewise.
8923 * ehframe.h: Likewise.
8924 * errors.cc: Likewise.
8925 * expression.cc: Likewise.
8926 * fileread.cc: Likewise.
8927 * fileread.h: Likewise.
8928 * freebsd.h: Likewise.
8929 * i386.cc: Likewise.
8930 * icf.cc: Likewise.
8931 * incremental.h: Likewise.
8932 * layout.cc: Likewise.
8933 * layout.h: Likewise.
8934 * mapfile.cc: Likewise.
8935 * merge.cc: Likewise.
8936 * merge.h: Likewise.
8937 * object.cc: Likewise.
8938 * object.h: Likewise.
8939 * options.h: Likewise.
8940 * output.cc: Likewise.
8941 * output.h: Likewise.
8942 * parameters.cc: Likewise.
8943 * plugin.cc: Likewise.
8944 * powerpc.cc: Likewise.
8945 * reduced_debug_output.cc: Likewise.
8946 * reduced_debug_output.h: Likewise.
8947 * reloc.cc: Likewise.
8948 * reloc.h: Likewise.
8949 * resolve.cc: Likewise.
8950 * script-sections.cc: Likewise.
8951 * script.cc: Likewise.
8952 * script.h: Likewise.
8953 * sparc.cc: Likewise.
8954 * symtab.cc: Likewise.
8955 * symtab.h: Likewise.
8956 * target-select.cc: Likewise.
8957 * target-select.h: Likewise.
8958 * token.h: Likewise.
8959 * workqueue.cc: Likewise.
8960 * workqueue.h: Likewise.
8961 * x86_64.cc: Likewise.
8962
a0351a69
DK
89632009-12-10 Doug Kwan <dougkwan@google.com>
8964
8965 * arm.cc (attributes.h): New include.
8966 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8967 (Arm_relobj::~Arm_relobj): Delete object pointed by
8968 attributes_section_data_.
8969 (Arm_relobj::attributes_section_data): New method definition.
8970 (Arm_relobj::attributes_section_data_): New data member declaration.
8971 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8972 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8973 attributes_section_data_.
8974 (Arm_dynobj::attributes_section_data): New method definition.
8975 (Arm_dynobj::attributes_section_data_): New data member declaration.
8976 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8977 initialization value of may_use_blx_ to false.
2e702c99 8978 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8979 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8980 object attributes to compute results instead of hard-coding.
8981 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8982 Target_arm::get_secondary_compatible_arch,
8983 Target_arm::set_secondary_compatible_arch
8984 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8985 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8986 New method declarations.
8987 (Target_arm::get_aeabi_object_attribute): New method definition.
8988 (Target_arm::attributes_section_data_): New data member declaration.
8989 (read_arm_attributes_section): New template definition.
8990 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8991 (Arm_dynobj::do_read_symbols): Ditto.
8992 (Target_arm::do_finalize_sections): Merge attributes sections from
8993 input. Check for BLX use after attributes section merging.
8994 Fix __exidx_start and __exidx_end visibility. Create an
8995 .ARM.attributes section if necessary.
8996 (Target_arm::get_secondary_compatible_arch,
8997 Target_arm::set_secondary_compatible_arch,
8998 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8999 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9000 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9001 New method definitions.
9002
b59befec
ILT
90032009-12-09 Ian Lance Taylor <iant@google.com>
9004
9005 * plugin.cc (Plugin::load): Don't cast from void* to a function
9006 pointer.
9007
1276bc89
ILT
90082009-12-09 Ian Lance Taylor <iant@google.com>
9009
9010 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9011 information fields.
9012
2f2de248
L
90132009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9014
9015 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9016 Replace two_file_shared_1.so with two_file_shared_2.so.
9017 * testsuite/Makefile.in: Regenerated.
9018
4f787271
DK
90192009-12-08 Doug Kwan <dougkwan@google.com>
9020
9021 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9022 (HFILES): Add attributes.h and int_encoding.h.
9023 * Makefile.in: Regenerate.
9024 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9025 function definitions to int_encoding.cc
9026 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9027 prototypes to int_encoding.h
9028 * reduced_debug_output.cc (int_encoding.h): New include.
9029 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9030 function definitions to int_encoding.cc
9031 (insert_into_vector, read_from_pointer): Move template definitions to
9032 int_encoding.h
9033 * attributes.cc: New file.
9034 * attributes.h: New file.
9035 * int_encoding.cc: New file.
9036 * int_encoding.h: New file.
9037
20b52f1a
RÁE
90382009-12-07 Rafael Avila de Espindola <espindola@google.com>
9039
9040 PR gold/11055
9041 * incremental-dump.cc (dump_incremental_inputs): New.
9042 (main): Use dump_incremental_inputs.
9043
53d7974c
L
90442009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9045
9046 PR gold/10893
9047 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9048 checking elfcpp::STT_FUNC.
9049 (Target_i386::Relocate::relocate): Likewise.
9050 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9051
9052 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9053 symbols from shared libraries into normal FUNC symbols.
9054
9055 * symtab.h (Symbol): Add is_func and use it.
9056
05a352e6
DK
90572009-12-05 Doug Kwan <dougkwan@google.com>
9058
9059 * arm.cc (Target_arm::arm_info): Initialize new fields
9060 attributes_section and attributes_vendor.
9061 * i386.cc (Target_i386::i386_info): Same.
9062 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9063 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9064 fields attributes_section and attributes_vendor.
53d7974c 9065 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9066 * target.h (Target::attributes_section, Target::attributes_vendor,
9067 Target::is_attributes_section, Target::attribute_arg_type,
9068 Target::attributes_order): New method definitions.
9069 (Target::Target_info::attributes_section,
9070 Target::Target_info::attributes_vendor): New fields.
9071 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9072 virtual method definitions.
9073 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9074 attributes_section and attributes_vendor.
9075 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9076
f4e5969c
DK
90772009-12-05 Doug Kwan <dougkwan@google.com>
9078
9079 * arm.cc: Update comments about interworking and stub generation.
9080 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9081 considered as non-PIC.
9082 (Arm_relocate_functions::base_abs): Fix formatting.
9083 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9084 of function to use GOT entry address instead of offset.
9085 (Target_arm::Scan::global): Issue an error if a symbol would need a
9086 PLT does not get one because it is untyped. Remove code to create
9087 dynamic symbols for relative branches.
9088 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9089 takes unsigned integer instead of boolean.
9090
1abce4a6
L
90912009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9092
9093 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9094 (two_file_test_LDADD): Likewise.
9095 (common_test_1_LDADD): Likewise.
9096 (exception_test_LDADD) Likewise.
9097 (weak_test_LDADD): Likewise.
9098 (many_sections_test_LDADD): Likewise.
9099 (initpri1_LDADD): Likewise.
9100 (script_test_1_LDADD): Likewise.
9101 (script_test_2_LDADD): Likewise.
9102 (justsyms_LDADD): Likewise.
9103 (binary_test_LDADD): Likewise.
9104 (large_LDADD): Likewise.
9105 * testsuite/Makefile.in: Regenerated.
9106
adcf2816 91072009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9108
adcf2816
L
9109 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9110 (Symbol_table::override_with_special): Likewise.
9111 (Symbol_table::add_from_object): Likewise.
9112
28e67f5d
RÁE
91132009-12-04 Rafael Avila de Espindola <espindola@google.com>
9114
9115 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9116 Don't set the data_offset twice.
9117
ae10a101
RÁE
91182009-12-04 Rafael Avila de Espindola <espindola@google.com>
9119
9120 * testsuite/Makefile.in: Regenerate.
9121
f59f41f3
DK
91222009-12-03 Doug Kwan <dougkwan@google.com>
9123
9124 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9125 (Target_arm::do_finalize_sections): Add parameter for symbol table
9126 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9127 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9128 parameter for symbol table pointer.
9129 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9130 an additional parameter for a pointer to symbol table.
9131 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9132 parameter for a symbol table pointer.
9133 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9134 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9135 Ditto.
9136 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9137 parameter for a symbol table pointer.
9138
ca55d848
RÁE
91392009-12-03 Rafael Avila de Espindola <espindola@google.com>
9140
9141 * incremental.cc (Incremental_inputs_header)
9142 (Incremental_inputs_header_write, Incremental_inputs_entry)
9143 (Incremental_inputs_entry_write): Move ...
9144 * incremental.h (Incremental_inputs_header)
9145 (Incremental_inputs_header_write, Incremental_inputs_entry)
9146 (Incremental_inputs_entry_write): here.
9147
3aec4f9c
RÁE
91482009-12-02 Rafael Avila de Espindola <espindola@google.com>
9149
9150 * incremental.cc (make_sized_incremental_binary): Set the target.
9151 Error if it is incompatible.
9152 * output.h (Output_file): Add filename method.
9153
9c0ae74d
RÁE
91542009-12-02 Rafael Avila de Espindola <espindola@google.com>
9155
9156 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9157 from the get_* methods.
9158
a45500ae
RÁE
91592009-12-02 Rafael Avila de Espindola <espindola@google.com>
9160
9161 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9162 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9163 Write 0 for the data_offset of scripts.
9164
325e6408
RÁE
91652009-12-02 Rafael Avila de Espindola <espindola@google.com>
9166
9167 * testsuite/Makefile.am: Add the incremental_test.sh test.
9168 * testsuite/incremental_test.sh: New.
9169 * testsuite/incremental_test_1.c: New.
9170 * testsuite/incremental_test_2.c: New.
9171
954c3e2e
RÁE
91722009-12-01 Rafael Avila de Espindola <espindola@google.com>
9173
703d02da 9174 * incremental-dump.cc (main): Fix typos.
954c3e2e 9175
f8086623
RÁE
91762009-11-27 Rafael Avila de Espindola <espindola@google.com>
9177
9178 PR gold/11025
9179 * incremental-dump.cc (main): Use llu to print 64 bit values.
9180
3b0dd6ac
L
91812009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9182 H.J. Lu <hongjiu.lu@intel.com>
9183
9184 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9185 $(LIBDL).
9186 (incremental_dump_LDADD): Likewise.
9187 * Makefile.in: Regenerated.
9188
a6d1ef57 91892009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9190
a6d1ef57
DK
9191 Revert:
9192
9193 2009-11-25 Doug Kwan <dougkwan@google.com>
9194
9195 * arm.cc (Target_arm::Target_arm): Move method definition
9196 outside of class definition. Add code to handle
9197 --target1-rel, --target1-abs and --target2= options.
9198 (Target_arm::get_reloc_reloc_type): Change method to be
9199 non-static and const.
9200 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9201 New data member declaration.
9202 (Target_arm::Scan::local, Target_arm::Scan::global,
9203 Target_arm::Relocate::relocate,
9204 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9205 Adjust call to Target_arm::get_real_reloc_type.
9206 (Target_arm::get_real_reloc_type): Use command line options
9207 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9208 * options.h (--target1-rel, --target1-abs, --target2): New
9209 ARM-only options.
9210
50aeb7d4
DK
92112009-11-25 Doug Kwan <dougkwan@google.com>
9212
9213 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9214 class definition. Add code to handle --target1-rel, --target1-abs
9215 and --target2= options.
9216 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9217 and const.
9218 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9219 member declaration.
9220 (Target_arm::Scan::local, Target_arm::Scan::global,
9221 Target_arm::Relocate::relocate,
9222 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9223 call to Target_arm::get_real_reloc_type.
9224 (Target_arm::get_real_reloc_type): Use command line options to
9225 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9226 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9227 options.
9228
51938283
DK
92292009-11-25 Doug Kwan <dougkwan@google.com>
9230
9231 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9232 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9233 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9234 formatting.
9235 (Arm_relocate_functions::thm_call): Replace body with a call to
9236 Arm_relocate_functions::thumb_branch_common.
9237 (Arm_relocate_functions::thm_jump24,
9238 Arm_relocate_functions::thm_xpc22): New method definitions.
9239 (Arm_relocate_functions::thumb_branch_common): New method definition.
9240 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9241 operator.
9242 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9243 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9244
e2b8f3c4
RÁE
92452009-11-24 Rafael Avila de Espindola <espindola@google.com>
9246
9247 * Makefile.am: Build incremental-dump
9248 * Makefile.in: Regenerate.
9249 * incremental-dump.cc: New.
9250 * incremental.cc (Incremental_inputs_header_data,
9251 Incremental_inputs_entry_data): Move to incremental.h
9252 * incremental.h: (Incremental_inputs_header_data,
9253 Incremental_inputs_entry_data): Move from incremental.cc
9254
bcba9aec
RÁE
92552009-11-24 Rafael Avila de Espindola <espindola@google.com>
9256
9257 * incremental.cc (Incremental_inputs_header,
9258 Incremental_inputs_header_write, Incremental_inputs_entry,
9259 Incremental_inputs_entry_write): Add a typedef with the data type.
9260
7c3afe08
RÁE
92612009-11-24 Rafael Avila de Espindola <espindola@google.com>
9262
9263 * incremental.cc (Incremental_inputs_header,
9264 Incremental_inputs_header_write, Incremental_inputs_entry,
9265 Incremental_inputs_entry_write): Update comment about which
9266 type has the filed descriptions.
9267
d204b6e9
DK
92682009-11-15 Doug Kwan <dougkwan@google.com>
9269
9270 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9271 (Arm_relocate_functions::arm_branch_common): Change method defintion
9272 in class definition to a method declaration and update list of formal
9273 parameters.
9274 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9275 Arm_relocation_functions::jump24): Adjust call to
9276 Arm_relocate_functions::arm_branch_common. Update list of formal
9277 parameters.
9278 (Arm_relocate_functions::xpc25): New method definition.
9279 (Arm_relocate_functions::arm_branch_common): Move method defintion
9280 out from class definition. Use stubs for mode-switching and extending
9281 branch ranges.
9282 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9283 specially. Change code to enable use of stubs in ARM branches.
9284
43d12afe
DK
92852009-11-10 Doug Kwan <dougkwan@google.com>
9286
9287 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9288 in method declaration.
9289 (Target_arm::relocate_stub): New method declaration.
9290 (Target_arm::default_target): Change to return a pointer instead of
9291 a const reference.
9292 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9293 Target_arm::default_target.
9294 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9295 method definition.
9296 (Target_arm::relocate_section): Adjust view.
9297 (Target_arm::relocate_stub): New method definition.
9298
ac33a407
DK
92992009-11-10 Doug Kwan <dougkwan@google.com>
9300
9301 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9302 a format warning.
9303 * incremental.cc (open_incremental_binary): Initialized local
9304 variables to avoid warnings.
9305 * object.cc (make_elf_object): Ditto.
9306 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9307 a format warning.
e1df38aa 9308
88ee28e9
L
9309009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9310
9311 PR gold/10930
9312 * testsuite/plugin_test.c: Include "config.h".
9313
2daedcd6
DK
93142009-11-09 Doug Kwan <dougkwan@google.com>
9315
9316 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9317 (arm_symbol_value): Remove.
9318 (Arm_relocate_functions::arm_branch_common,
9319 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9320 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9321 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9322 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9323 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9324 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9325 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9326 Arm_relocate_functions::thm_mobw_abs_nc,
9327 Arm_relocate_functions::thm_mov_abs,
9328 Arm_relocate_functions::movw_prel_nc,
9329 Arm_relocate_functions::thm_movt_abs,
9330 Arm_relocate_functions::movt_prel,
9331 Arm_relocate_functions::thm_movw_prel_nc,
9332 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9333 (Target_arm::Relocate::relocate): Only decompose address into two
9334 parts if relocation type uses the thumb-bit and pass the actual
9335 bit instead of a flag indicating that the thumb-bit is used. Adjust
9336 calls to methods in Arm_relocate_functions for this change.
9337
1276bc89 93382009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9339
9340 PR 10925
9341 * reloc.cc: Instantiate
9342 Sized_relobj::initialize_input_to_output_maps and
9343 Sized_relobj:free_input_to_output_maps.
9344
e53ad1b5
ILT
93452009-11-06 Ian Lance Taylor <iant@google.com>
9346
9347 PR 10876
9348 * defstd.cc (in_segment): Set only_if_ref true for "end".
9349
eb44217c
DK
93502009-11-06 Doug Kwan <dougkwan@google.com>
9351
9352 * arm.cc (class Reloc_stub): Correct a comment.
9353 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9354 (Target_arm::scan_section_for_stubs): New method declaration.
9355 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9356 Change methods from private to protected.
9357 (Target_arm::do_may_relax): New method definition.
9358 (Target_arm::do_relax, Target_arm::group_sections,
9359 Target_arm::scan_reloc_for_stub,
9360 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9361 (Target_arm::arm_input_section_map_): New data member declaration.
9362 (Target_arm::scan_reloc_for_stub,
9363 Target_arm::scan_reloc_section_for_stubs,
9364 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9365 Target_arm::do_relax): New method definitions.
9366
5d329b7d
ILT
93672009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9368
9369 * configure.ac: Check for (struct stat)::st_mtim
9370 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9371 * config.in: Regenerate.
9372 * configure: Regenerate.
9373
96a0d71b
ILT
93742009-11-05 Ian Lance Taylor <iant@google.com>
9375
9376 PR 10910
9377 * output.cc (Output_segment::add_output_section): Add missing
9378 return statement.
9379
594c8e5e
ILT
93802009-11-04 Ian Lance Taylor <iant@google.com>
9381
9382 PR 10880
9383 * object.h (class Object): Add is_needed and set_is_needed
9384 methods. Add is_needed_ field. Make bool fields into bitfields.
9385 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9386 defined in a dynamic object and referenced by a regular object,
9387 set is_needed for the dynamic object.
9388 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9389 if the file is marked with as_needed and it is not needed.
9390
22b127cc
ILT
93912009-11-04 Ian Lance Taylor <iant@google.com>
9392
9393 PR 10887
9394 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9395 tags if data is discarded by linker script.
9396 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9397 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9398 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9399 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9400
f5c870d2
ILT
94012009-11-04 Ian Lance Taylor <iant@google.com>
9402
9403 * layout.cc (Layout::get_output_section): Add is_interp and
9404 is_dynamic_linker_section parameters. Change all callers.
9405 (Layout::choose_output_section): Likewise.
9406 (Layout::make_output_section): Likewise.
9407 (Layout::add_output_section_data): Add is_dynamic_linker_section
9408 parameter. Change all callers.
9409 * layout.h (class Layout): Update declarations.
9410 * output.h (class Output_section): Add is_interp, set_is_interp,
9411 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9412 Add is_interp_, is_dynamic_linker_section_ fields. Change
9413 generate_code_fills_at_write_ to a bitfield.
9414 * output.cc (Output_section::Output_sections): Initialize new
9415 fields.
9416 (Output_segment::add_output_section): Add do_sort parameter.
9417 Change all callers.
9418
1ae4d23b
ILT
94192009-11-03 Ian Lance Taylor <iant@google.com>
9420
9421 PR 10860
9422 * options.h (class General_options): Add --warn-common.
9423 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9424 merging two common symbols.
9425 (Symbol_table::should_override): Handle --warn-common when merging
9426 a common symbol with a defined symbol. Use report_resolve_problem
9427 for multiple definitions.
9428 (Symbol_table::report_resolve_problem): New function.
9429 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9430
55da9579
DK
94312009-11-03 Doug Kwan <dougkwan@google.com>
9432
9433 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9434 stub_factory_.
9435 (Target_arm::stub_factory): New method definition.
9436 (Target_arm::new_arm_input_section,
9437 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9438 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9439 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9440 New type definitions.
9441 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9442 member declarations.
9443 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9444 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9445 New method definitions.
9446
37a9ac43
ILT
94472009-11-03 Ian Lance Taylor <iant@google.com>
9448
9449 * options.h (class General_options): Add --warn_constructors.
9450
b3d6a3d4
ILT
94512009-11-03 Ian Lance Taylor <iant@google.com>
9452
9453 PR 10893
9454 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9455 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9456
934b01dd
ILT
94572009-11-03 Ian Lance Taylor <iant@google.com>
9458
9459 PR 10895
9460 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9461 --msgid-bugs-address.
9462 (install-pdf): New target.
9463 (install-data_yes): Look up one directory to find mkinstalldirs.
9464
03c1939b
L
94652009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9466
9467 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9468 tree.
9469
ebd95253
DK
94702009-10-30 Doug Kwan <dougkwan@google.com>
9471
9472 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9473
e9bbb538
DK
94742009-10-30 Doug Kwan <dougkwan@google.com>
9475
9476 * arm.cc (Stub_addend_reader): New struct template definition
9477 and partial specializations.
9478 (Stub_addend_reader::operator()): New method definition for a
9479 partially specialized template.
9480
d5b40221
DK
94812009-10-30 Doug Kwan <dougkwan@google.com>
9482
9483 * arm.cc (Arm_relobj::processor_specific_flags): New method
9484 definition.
9485 (Arm_relobj::do_read_symbols): New method declaration.
9486 (Arm_relobj::processor_specific_flags_): New data member declaration.
9487 (Arm_dynobj): New class definition.
9488 (Target_arm::do_finalize_sections): Add input_objects parameter.
9489 (Target_arm::do_adjust_elf_header): New method declaration.
9490 (Target_arm::are_eabi_versions_compatible,
9491 (Target_arm::merge_processor_specific_flags): New method declaration.
9492 (Target_arm::do_make_elf_object): New overloaded method definitions
9493 and declaration.
9494 (Arm_relobj::do_read_symbols): New method definition.
9495 (Arm_dynobj::do_read_symbols): Ditto.
9496 (Target_arm::do_finalize_sections): Add input_objects parameters.
9497 Merge processor-specific flags from all input objects.
9498 (Target_arm::are_eabi_versions_compatible,
9499 Target_arm::merge_processor_specific_flags,
9500 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9501 New method definitions.
9502 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9503 Input_objects pointer type parameter.
9504 * layout.cc (Layout::finalize): Pass input objects to target's.
9505 finalize_sections function.
9506 * output.cc (Output_file_header::do_sized_write): Set ELF file
9507 header's processor-specific flags.
9508 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9509 Input_objects pointer type parameter.
9510 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9511 * target.h (Input_objects): New forward class declaration.
9512 (Target::processor_specific_flags,
9513 Target::are_processor_specific_flags_sect): New method definitions.
9514 (Target::finalize_sections): Add input_objects parameter.
9515 (Target::Target): Initialize processor_specific_flags_ and
9516 are_processor_specific_flags_set_.
9517 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9518 parameter.
9519 (Target::set_processor_specific_flags): New method definition.
9520 (Target::processor_specific_flags_,
9521 Target::are_processor_specific_flags_set_): New data member
9522 declarations.
9523 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9524 Input_objects pointer type parameter.
9525
ebabffbd
DK
95262009-10-30 Doug Kwan <dougkwan@google.com>
9527
9528 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9529
ad0f2072
ILT
95302009-10-28 Ian Lance Taylor <iant@google.com>
9531
9532 * object.h (class Relobj): Drop options parameter from
9533 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9534 do_scan_relocs, do_relocate. Change all callers.
9535 (class Sized_relobj): Drop options parameters from
9536 do_gc_process_relocs, do_scan_relocs, do_relocate,
9537 do_relocate_sections, relocate_sections, emit_relocs_scan,
9538 emit_relocs_scan_reltype. Change all callers.
9539 (struct Relocate_info): Remove options field and all references to
9540 it.
9541 * reloc.h (class Read_relocs): Remove options constructor
9542 parameter and options_ field. Change all callers.
9543 (class Gc_process_relocs, class Scan_relocs): Likewise.
9544 (class Relocate_task): Likewise.
9545 * target-reloc.h (scan_relocs): Remove options parameter. Change
9546 all callers.
9547 (scan_relocatable_relocs): Likewise.
9548 * target.h (class Sized_target): Remove options parameter from
9549 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9550 all callers.
9551 * gc.h (gc_process_relocs): Remove options parameter. Change all
9552 callers.
9553 * arm.cc: Update functions to remove options parameters.
9554 * i386.cc: Likewise.
9555 * powerpc.cc: Likewise.
9556 * sparc.cc: Likewise.
9557 * x86_64.cc: Likewise.
9558 * testsuite/testfile.cc: Likewise.
9559
8ffa3667
DK
95602009-10-28 Doug Kwan <dougkwan@google.com>
9561
9562 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9563 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9564 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9565 New method definitions.
9566
40f36857
CC
95672009-10-28 Cary Coutant <ccoutant@google.com>
9568
9569 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9570 (Plugin::cleanup_done_): New member.
9571 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9572 (Plugin_manager::cleanup_done_): Remove.
9573 (Plugin_manager::add_input_file): Edit error message.
9574 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9575 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9576
2c849493
ILT
95772009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9578
9579 * fileread.cc: (File_read::View::~View): Use the new
9580 data_ownership_ filed.
9581 (File_read::~File_read): Dispose the new whole_file_view_.
9582 (File_read::open): Mmap the whole file if needed.
9583 (File_read::open): Use whole_file_view_ instead of contents_.
9584 (File_read::find_view): Use whole_file_view_ if applicable.
9585 (File_read::do_read): Use whole_file_view_ instead of contents_.
9586 (File_read::make_view): Use whole_file_view_ instead of contents_,
9587 update File_read::View::View call.
9588 (File_read::find_or_make_view): Update File_read::View::View
9589 call.
9590 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9591 remove contents_
9592 (File_read::View::Data_ownership): New enum.
9593 (File_read::View::View): Replace bool mapped_ with Data_ownership
9594 argument.
9595 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9596 (File_read::View::data_ownership_): New field.
9597 (File_read::contents_): Remove (replaced by whole_file_view_).
9598 (File_read::whole_file_view_): New field.
9599 * options.h (class General_options): Add --keep-files-mapped.
9600
24998053
CC
96012009-10-27 Cary Coutant <ccoutant@google.com>
9602
9603 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9604 * testsuite/Makefile.am (plugin_test_5): New test case.
9605 * testsuite/Makefile.in: Regenerate.
9606
72adc4fa
DK
96072009-10-25 Doug Kwan <dougkwan@google.com>
9608
9609 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9610 from private to protected to allow access by child class.
9611 (Sized_relobj::do_relocate_sections): New method declaration.
9612 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9613 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9614 Sized_relobj::relocate_sections. Instantiate template explicitly
9615 for different target sizes and endianity.
9616
07f508a2
DK
96172009-10-24 Doug Kwan <dougkwan@google.com>
9618
9619 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9620 (Arm_input_section::as_arm_input_section): New method.
9621 (Arm_output_section): New class definition.
9622 (Arm_output_section::create_stub_group,
9623 Arm_output_section::group_sections): New method definitions.
9624
10ad9fe5
DK
96252009-10-22 Doug Kwan <dougkwan@google.com>
9626
9627 * arm.cc (Arm_input_section): New class definition.
9628 (Arm_input_section::init, Arm_input_section:do_write,
9629 Arm_input_section::set_final_data_size,
9630 Arm_input_section::do_reset_address_and_file_offset): New method
9631 definitions.
9632
56ee5e00
DK
96332009-10-21 Doug Kwan <dougkwan@google.com>
9634
9635 * arm.cc (Stub_table, Arm_input_section): New forward class
9636 declarations.
9637 (Stub_table): New class defintion.
9638 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9639 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9640 New method definition.
9641
b569affa
DK
96422009-10-21 Doug Kwan <dougkwan@google.com>
9643
9644 * arm.cc: Update copyright comments.
9645 (Target_arm): New forward class template declaration.
9646 (Arm_address): New type.
9647 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9648 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9649 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9650 constants.
9651 (Insn_template): Same.
9652 (DEF_STUBS): New macro.
9653 (Stub_type): New enum type.
9654 (Stub_template): New class definition.
9655 (Stub): Same.
9656 (Reloc_stub): Same.
9657 (Stub_factory): Same.
9658 (Target_arm::Target_arm): Initialize may_use_blx_ and
9659 should_force_pic_veneer_.
9660 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9661 Target_arm::should_force_pic_veneer,
9662 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9663 Target_arm::using_thumb_only, Target_arm:;default_target): New
9664 method defintions.
9665 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9666 New data member declarations.
9667 (Insn_template::size, Insn_template::alignment): New method defintions.
9668 (Stub_template::Stub_template): New method definition.
9669 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9670 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9671 (Stub_factory::Stub_factory): New method definition.
9672 * gold.h (string_hash): New template.
9673 * output.h (Input_section_specifier::hash_value): Use
9674 gold::string_hash.
9675 (Input_section_specifier::string_hash): Remove.
9676 * stringpool.cc (Stringpool_template::string_hash): Use
9677 gold::string_hash.
9678
6c172549
DK
96792009-10-20 Doug Kwan <dougkwan@google.com>
9680
9681 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9682 symbols of relaxed input sections.
9683 * output.h (Output_section::find_relaxed_input_section): Make
9684 method public.
9685
c5617f2f
DK
96862009-10-16 Doug Kwan <dougkwan@google.com>
9687
9688 * dynobj.cc (Versions::Versions): Initialize version_script_.
9689 Only insert base version symbol definition for a shared object
9690 if version script defines any version versions.
9691 (Versions::define_base_version): New method definition.
9692 (Versions::add_def): Check that base version is not needed.
9693 (Versions::add_need): Define base version lazily.
9694 * dynobj.h (Versions::define_base_version): New method declaration.
9695 (Versions::needs_base_version_): New data member declaration.
9696 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9697 (check_DATA): Add no_version_test.stdout.
9698 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9699 New make rules.
9700 * testsuite/Makefile.in: Regenerate.
9701 * testsuite/no_version_test.c: New file.
9702 * testsuite/no_version_test.sh: Ditto.
9703
3c12dcdb
DK
97042009-10-16 Doug Kwan <dougkwan@google.com>
9705
9706 * expression.cc (class Segment_start_expression): New class definition.
9707 (Segment_start_expression::value): New method definition.
9708 (script_exp_function_segment_start): Return a new
9709 Segment_start_expression.
9710 * gold/script-c.h (script_saw_segment_start_expression): New function
9711 prototype.
9712 * script-sections.cc (Script_sections::Script_sections): Initialize
9713 SAW_SEGMENT_START_EXPRESSION_ to false.
9714 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9715 and -Tbbs options to specify section addresses if given in
9716 command line and no SEGMENT_START expression is seen in a script.
9717 * script-sections.h (Script_sections::saw_segment_start_expression,
9718 Script_sections::set_saw_segment_start_expression): New method
9719 definition.
9720 (Script_sections::saw_segment_start_expression_): New data member
9721 declaration.
9722 * script.cc (script_saw_segment_start_expression): New function.
9723 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9724 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9725 script_test_7.sh and script_test_8.sh.
9726 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9727 script_test_8.stdout.
9728 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9729 (script_test_6, script_test_6.stdout, script_test_7,
9730 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9731 * Makefile.in: Regenerate.
9732 * testsuite/script_test_6.sh: New file.
9733 * testsuite/script_test_6.t: Same.
9734 * testsuite/script_test_7.sh: Same.
9735 * testsuite/script_test_7.t: Same.
9736 * testsuite/script_test_8.sh: Same.
9737
64b1ae37
DK
97382009-10-16 Doug Kwan <dougkwan@google.com>
9739
9740 * output.cc (Output_segment::set_section_list_address): Cast
9741 expressions to unsigned long long type to avoid format warnings.
9742
661be1e2
ILT
97432009-10-15 Ian Lance Taylor <iant@google.com>
9744
12edd763 9745 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9746 dot assignment to script_sections_.
12edd763
ILT
9747 * script-sections.cc (Script_sections::add_dot_assignment):
9748 Initialize if necessary.
9749
68b6574b
ILT
9750 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9751 program headers with no load segment if there is a linker script.
9752
661be1e2
ILT
9753 * layout.cc (Layout::set_segment_offsets): Align the file offset
9754 to the segment aligment for -N or -n with no load segment.
9755 * output.cc (Output_segment::add_output_section): Don't crash if
9756 the first section is a TLS section.
9757 (Output_segment::set_section_list_addresses): Print an error
9758 message if the address moves backward in a linker script.
9759 * script-sections.cc
9760 (Output_section_element_input::set_section_addresses): Don't
9761 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9762 (Orphan_output_section::set_section_addresses): Likewise.
9763
f15f61a7
DK
97642009-10-15 Doug Kwan <dougkwan@google.com>
9765
9766 * layout.cc (Layout::finish_dynamic_section): Generate tags
9767 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9768 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9769 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9770
82bb573a
ILT
97712009-10-14 Ian Lance Taylor <iant@google.com>
9772
9773 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9774 fields.
9775 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9776 data_shdr fields of relinfo.
9777 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9778 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9779 R_386_TLS_LDO_32, adjust based on section flags.
9780 (Target_i386::Relocate::fix_up_ldo): Remove.
9781
374ad285
ILT
97822009-10-13 Ian Lance Taylor <iant@google.com>
9783
9784 Add support for -pie.
9785 * options.h (class General_options): Add -pie and
9786 --pic-executable.
9787 (General_options::output_is_position_independent): Test -pie.
9788 (General_options::output_is_executable): Return true if not shared
9789 and not relocatable.
9790 (General_options::output_is_pie): Remove.
9791 * options.cc (General_options::finalize): Reject incompatible uses
9792 of -pie.
9793 * gold.cc (queue_middle_tasks): A -pie link is not static.
9794 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9795 * symtab.cc (Symbol::final_value_is_known): Return false if
9796 output_is_position_independent.
9797 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9798 output_is_position_independent.
9799 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9800 output_is_position_independent.
9801 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9802 output_is_position_independent.
9803 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9804 two_file_pie_test.
9805 (basic_pie_test.o, basic_pie_test): New targets.
9806 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9807 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9808 (two_file_pie_test): New target.
9809 * testsuite/Makefile.in: Rebuild.
9810 * README: Remove note saying that -pie is not supported.
9811
c6585162
ILT
98122009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9813
9814 * options.h (class General_options): Add -init and -fini.
9815 * layout.cc (Layout::finish_dynamic_section): Emit
9816 given init and fini functions.
9817
032ce4e9
ST
98182009-10-13 Sriraman Tallam <tmsriram@google.com>
9819
9820 * gc.h (gc_process_relocs): Check if icf is enabled using new
9821 function.
9822 * gold.cc (queue_initial_tasks): Likewise.
9823 (queue_middle_tasks): Likewise.
9824 * object.cc (do_layout): Likewise.
9825 * symtab.cc (is_section_folded): Likewise.
9826 * main.cc (main): Likewise.
9827 * reloc.cc (Read_relocs::run): Likewise.
9828 (Sized_relobj::do_scan_relocs): Likewise.
9829 * icf.cc (is_function_ctor_or_dtor): New function.
9830 (Icf::find_identical_sections): Check if function is ctor or dtor when
9831 safe icf is chosen.
9832 * options.h (General_options::icf): Change option to be an enum.
9833 (Icf_status): New enum.
9834 (icf_enabled): New method.
9835 (icf_safe_folding): New method.
9836 (set_icf_status): New method.
9837 (icf_status_): New variable.
9838 * (options.cc) (General_options::finalize): Set icf_status_.
9839 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9840 icf_test and icf_keep_unique_test to use the --icf enum flag.
9841 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9842 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9843
f345227a
ST
98442009-10-12 Sriraman Tallam <tmsriram@google.com>
9845
9846 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9847 includes to gc.h and icf.h.
9848 * arm.cc: Include gc.h.
9849 * gold.cc: Likewise.
9850 * i386.cc: Likewise.
9851 * powerpc.cc: Likewise.
9852 * sparc.cc: Likewise.
9853 * x86_64.cc: Likewise.
9854 * gc.h: Include icf.h.
9855
1c7814ed
ILT
98562009-10-11 Ian Lance Taylor <iant@google.com>
9857
9858 * plugin.cc: Include "gold.h" before other header files.
9859
ae3b5189
CD
98602009-10-10 Chris Demetriou <cgd@google.com>
9861
9862 * options.h (Input_file_argument::Input_file_type): New enum.
9863 (Input_file_argument::is_lib_): Replace with...
9864 (Input_file_argument::type_): New member.
9865 (Input_file_argument::Input_file_argument): Take Input_file_type
9866 'type' rather than boolean 'is_lib' as second argument.
9867 (Input_file_argument::is_lib): Use type_.
9868 (Input_file_argument::is_searched_file): New function.
9869 (Input_file_argument::may_need_search): Handle is_searched_file.
9870 * options.cc (General_options::parse_library): Support -l:filename.
9871 (General_options::parse_just_symbols): Update for Input_file_argument
9872 changes.
9873 (Command_line::process): Likewise.
9874 * archive.cc (Archive::get_file_and_offset): Likewise.
9875 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9876 * script.cc (read_script_file, script_add_file): Likewise.
9877 * fileread.cc (Input_file::Input_file): Likewise.
9878 (Input_file::will_search_for): Handle is_searched_file.
9879 (Input_file::open): Likewise.
9880 * readsyms.cc (Read_symbols::get_name): Likewise.
9881 * testsuite/Makefile.am (searched_file_test): New test.
9882 * testsuite/Makefile.in: Regenerate.
9883 * testsuite/searched_file_test.cc: New file.
9884 * testsuite/searched_file_test_lib.cc: New file.
9885
f3048a1d
ILT
98862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9887 Ian Lance Taylor <iant@google.com>
9888
9889 * descriptor.cc: Include <cstdio> and "binary-io.h".
9890 (Descriptors::open): Open the files in binary mode always.
9891 * script.cc (Lex::get_token): Treat \r as whitespace.
9892
d4780e57
ILT
98932009-10-09 Ian Lance Taylor <iant@google.com>
9894
9895 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9896
d9a893b8
ILT
98972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9898 Ian Lance Taylor <iant@google.com>
9899
9900 * configure.ac: Check for readv function also.
9901 * fileread.cc (readv): Define if not HAVE_READV.
9902 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9903 does not exist.
9904 * config.in: Regenerate.
9905 * configure: Regenerate.
9906
c0a62865
DK
99072009-10-09 Doug Kwan <dougkwan@google.com>
9908
9909 * layout.cc (Layout::make_output_section): Call target hook to make
9910 ordinary output section.
9911 (Layout::finalize): Adjust parameter list of call the
9912 Target::may_relax().
9913 * layout.h (class Layout::section_list): New method.
9914 * merge.h (Output_merge_base::entsize): Change visibility to public.
9915 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9916 New methods.
9917 (Output_merge_string::do_is_string): New method.
9918 * object.cc (Sized_relobj::do_setup): renamed from
9919 Sized_relobj::set_up.
9920 * object.h (Sized_relobj::adjust_shndx,
9921 Sized_relobj::initializ_input_to_output_maps,
9922 Sized_relobj::free_input_to_output_maps): Change visibilities to
9923 protected.
9924 (Sized_relobj::setup): Virtualize.
9925 (Sized_relobj::do_setup): New method declaration.
9926 (Sized_relobj::invalidate_section_offset,
9927 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9928 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9929 * options.cc (parse_int): New function.
9930 * options.h (parse_int): New declaration.
9931 (DEFINE_int): New macro.
9932 (stub_group_size): New option.
9933 * output.cc (Output_section::Output_section): Initialize memebers
9934 merge_section_map_, merge_section_by_properties_map_,
9935 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9936 (Output_section::add_input_section): Handled deferred code-fill
9937 generation and remove an old comment.
9938 (Output_section::add_relaxed_input_section): New method definition.
9939 (Output_section::add_merge_input_section): Use merge section by
9940 properties map to speed to search. Update merge section maps
9941 as appropriate.
9942 (Output_section::build_relaxation_map): New method definition.
9943 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9944 Same.
9945 (Output_section::relax_input_section): Renamed to
9946 Output_section::convert_input_sections_to_relaxed_sections and change
9947 interface to take a vector of pointers to relaxed sections.
9948 (Output_section::find_merge_section,
9949 Output_section::find_relaxed_input_section): New method definitions.
9950 (Output_section::is_input_address_mapped,
9951 Output_section::output_offset, Output_section::output_address):
9952 Use output section data maps to speed up searching.
9953 (Output_section::find_starting_output_address): Add comments.
9954 (Output_section::do_write,
9955 Output_section::write_to_postprocessing_buffer): Do code-fill
9956 generation as appropriate.
9957 (Output_section::get_input_sections): Invalidate relaxed input section
9958 map.
9959 (Output_section::restore_states): Adjust type of checkpoint .
9960 Invalidate relaxed input section map.
9961 * output.h (Output_merge_base): New class declaration.
9962 (Input_section_specifier): New class defintion.
9963 (class Output_relaxed_input_section) Change base class to
9964 Output_section_data_build.
9965 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9966 base class initializer.
9967 (Output_section::add_relaxed_input_section): New method declaration.
9968 (Output_section::Input_section): Change visibility to protected.
2e702c99 9969 (Output_section::Input_section::relobj,
c0a62865
DK
9970 Output_section::Input_section::shndx): Handle relaxed input sections.
9971 Output_section::input_sections) Change visibility to protected. Also
9972 define overload to return a non-const pointer.
9973 (Output_section::Merge_section_properties): New class defintion.
9974 (Output_section::Merge_section_by_properties_map,
9975 Output_section::Output_section_data_by_input_section_map,
9976 Output_section::Relaxation_map): New types.
9977 (Output_section::relax_input_section): Rename method to
9978 Output_section::convert_input_sections_to_relaxed_sections and change
9979 interface to take a vector of relaxed section pointers.
9980 (Output_section::find_merge_section,
9981 Output_section::find_relaxed_input_section,
9982 Output_section::build_relaxation_map,
9983 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9984 New method declarations.
9985 (Output_section::merge_section_map_
9986 Output_section::merge_section_by_properties_map_,
9987 Output_section::relaxed_input_section_map_,
9988 Output_section::is_relaxed_input_section_map_valid_,
9989 Output_section::generate_code_fills_at_write_): New data members.
9990 * script-sections.cc
9991 (Output_section_element_input::set_section_addresses): Call
9992 current_data_size and addralign methods of relaxed input sections.
9993 (Orphan_output_section::set_section_addresses): Call current_data_size
9994 and addralign methods of relaxed input sections.
9995 * symtab.cc (Symbol_table::compute_final_value): Extract template
9996 from the body of Symbol_table::sized_finalize_symbol.
9997 (Symbol_table::sized_finalized_symbol): Call
9998 Symbol_table::compute_final_value.
9999 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10000 (Symbol_table::compute_final_value): New templated method declaration.
10001 * target.cc (Target::do_make_output_section): New method defintion.
10002 * target.h (Target::make_output_section): New method declaration.
10003 (Target::relax): Add more parameters for input objects, symbol table
10004 and layout. Adjust call to do_relax.
10005 (Target::do_make_output_section): New method declaration.
10006 (Target::do_relax): Add parameters for input objects, symbol table
10007 and layout.
10008
d446d6c4
ILT
100092009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10010
10011 * pread.c: Include stdio.h.
10012
bc06c745
ILT
100132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10014
10015 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10016 defined.
10017
75aea3d0
ILT
100182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10019
10020 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10021 Change read_shndx type to unsigned int.
10022 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10023 int.
10024 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10025 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10026 Change read_shndx type to unsigned int.
10027 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10028 int.
10029 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10030 * layout.cc (Layout::create_symtab_sections): Cast the result of
10031 local_symcount * symsize to off_t in the gold_assert.
10032
be8fcb75
ILT
100332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10034
10035 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10036 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10037 R_ARM_BASE_ABS.
10038 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10039 (Arm_relocate_functions::thm_abs5): New function.
10040 (Arm_relocate_functions::abs12): New function.
10041 (Arm_relocate_functions::abs16): New function.
10042 (Arm_relocate_functions::base_abs): New function.
10043 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10044 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10045 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10046 R_ARM_BASE_ABS.
10047 (Scan::global): Likewise.
10048 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10049 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10050 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10051 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10052 R_ARM_BASE_ABS.
10053
c2a122b6
ILT
100542009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10055
10056 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10057 (Arm_relocate_functions::movt_prel): New function.
10058 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10059 (Arm_relocate_functions::thm_movt_prel): New function.
10060 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10061 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10062 (Scan::global, Relocate::relocate): Likewise.
10063 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10064
c4aa1e2d
ILT
100652009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10066
10067 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10068 Incremental_checker.
10069 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10070 unsigned int.
10071 (class Incremental_inputs_header): New class.
10072 (Incremental_inputs_header_writer): Edit comment.
10073 (Incremental_inputs_entry): New class.
10074 (Incremental_inputs_entry_writer): Edit comment.
10075 (Sized_incremental_binary::do_find_incremental_inputs_section):
10076 Add *strtab_shndx parameter, fill it.
10077 (Sized_incremental_binary::do_check_inputs): New method.
10078 (Incremental_checker::can_incrementally_link_output_file): Use
10079 Sized_incremental_binary::check_inputs.
10080 (Incremental_inputs::report_command_line): Save command line in
10081 command_line_.
10082 * incremental.h:
10083 (Incremental_binary::find_incremental_inputs_section): New
10084 method.
10085 (Incremental_binary::do_find_incremental_inputs_section): Add
10086 strtab_shndx parameter.
10087 (Incremental_binary::do_check_inputs): New pure virtual method.
10088 (Sized_incremental_binary::do_check_inputs): Declare.
10089 (Incremental_checker::Incremental_checker): Add incremental_inputs
10090 parameter, use it to initialize incremental_inputs_.
10091 (Incremental_checker::incremental_inputs_): New field.
10092 (Incremental_checker::command_line): New method.
10093 (Incremental_checker::inputs): New method.
10094 (Incremental_checker::command_line_): New field.
10095
c549a694
ILT
100962009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10097
10098 * incremental.cc: Include <cstdarg> and "target-select.h".
10099 (vexplain_no_incremental): New function.
10100 (explain_no_incremental): New function.
10101 (Incremental_binary::error): New method.
10102 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10103 method.
10104 (make_sized_incremental_binary): New function.
10105 (open_incremental_binary): New function.
10106 (can_incrementally_link_file): Add checks if output is ELF and has
10107 inputs section.
10108 * incremental.h: Include "elfcpp_file.h" and "output.h".
10109 (Incremental_binary): New class.
10110 (Sized_incremental_binary): New class.
10111 (open_incremental_binary): Declare.
10112 * object.cc (is_elf_object): Use
10113 elfcpp::Elf_recognizer::is_elf_file.
10114 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10115 * output.h (Output_file::filesize): New method.
10116
fd3c5f0b
ILT
101172009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10118
10119 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10120 New function.
10121 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10122 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10123 function.
10124 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10125 function.
10126 (Arm_relocate_functions::movw_abs_nc): New function.
10127 (Arm_relocate_functions::movt_abs): New function.
10128 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10129 (Arm_relocate_functions::thm_movt_abs): New function.
10130 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10131 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10132 (Scan::global): Likewise.
10133 (Relocate::relocate): Likewise.
10134 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10135
7f5309a5
ILT
101362009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10137
10138 * arm.cc (Arm_relocate_functions::got_prel) New function.
10139 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10140 (Relocate::relocate): Likewise.
10141 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10142
364c7fa5
ILT
101432009-10-06 Ian Lance Taylor <iant@google.com>
10144
10145 * options.h (class General_options): Define
10146 split_stack_adjust_size parameter.
10147 * object.h (class Object): Add uses_split_stack_ and
10148 has_no_split_stack_ fields. Add uses_split_stack and
10149 has_no_split_stack accessor functions. Declare
10150 handle_split_stack_section.
10151 (class Reloc_symbol_changes): Define.
10152 (class Sized_relobj): Define Function_offsets. Declare
10153 split_stack_adjust, split_stack_adjust_reltype, and
10154 find_functions.
10155 * object.cc (Object::handle_split_stack_section): New function.
10156 (Sized_relobj::do_layout): Call handle_split_stack_section.
10157 * dynobj.cc (Sized_dynobj::do_layout): Call
10158 handle_split_stack_section.
10159 * reloc.cc (Sized_relobj::relocate_sections): Call
10160 split_stack_adjust for executable sections in split_stack
10161 objects. Pass reloc_map to relocate_section.
10162 (Sized_relobj::split_stack_adjust): New function.
10163 (Sized_relobj::split_stack_adjust_reltype): New function.
10164 (Sized_relobj::find_functions): New function.
10165 * target-reloc.h: Include "object.h".
10166 (relocate_section): Add reloc_symbol_changes parameter. Change
10167 all callers.
10168 * target.h (class Target): Add calls_non_split method. Declare
10169 do_calls_non_split virtual method. Declare match_view and
10170 set_view_to_nop.
10171 * target.cc: Include "elfcpp.h".
10172 (Target::do_calls_non_split): New function.
10173 (Target::match_view): New function.
10174 (Target::set_view_to_nop): New function.
10175 * gold.cc (queue_middle_tasks): Give an error if mixing
10176 split-stack and non-split-stack objects with -r.
10177 * i386.cc (Target_i386::relocate_section): Add
10178 reloc_symbol_changes parameter.
10179 (Target_i386::do_calls_non_split): New function.
10180 * x86_64.cc (Target_x86_64::relocate_section): Add
10181 reloc_symbol_changes parameter.
10182 (Target_x86_64::do_calls_non_split): New function.
10183 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10184 parameter.
10185 * powerpc.cc (Target_powerpc::relocate_section): Add
10186 reloc_symbol_changes parameter.
10187 * sparc.cc (Target_sparc::relocate_section): Add
10188 reloc_symbol_changes parameter.
10189 * configure.ac: Call AM_CONDITIONAL for the default target.
10190 * configure: Rebuild.
10191 * testsuite/Makefile.am (TEST_AS): New variable.
10192 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10193 (check_DATA): Add split_i386 and split_x86_64 files.
10194 (SPLIT_DEFSYMS): Define.
10195 (split_i386_[1234n].o): New targets.
10196 (split_i386_[124]): New targets.
10197 (split_i386_[1234r].stdout): New targets.
10198 (split_x86_64_[1234n].o): New targets.
10199 (split_x86_64_[124]): New targets.
10200 (split_x86_64_[1234r].stdout): New targets.
10201 (MOSTLYCLEANFILES): Add new executables.
10202 * testsuite/split_i386.sh: New file.
10203 * testsuite/split_x86_64.sh: New file.
10204 * testsuite/split_i386_1.s: New file.
10205 * testsuite/split_i386_2.s: New file.
10206 * testsuite/split_i386_3.s: New file.
10207 * testsuite/split_i386_4.s: New file.
10208 * testsuite/split_i386_n.s: New file.
10209 * testsuite/split_x86_64_1.s: New file.
10210 * testsuite/split_x86_64_2.s: New file.
10211 * testsuite/split_x86_64_3.s: New file.
10212 * testsuite/split_x86_64_4.s: New file.
10213 * testsuite/split_x86_64_n.s: New file.
10214 * testsuite/testfile.cc (Target_test): Update relocation_section
10215 function.
10216 * testsuite/Makefile.in: Rebuild.
10217
e8a9fcda
ILT
102182009-10-06 Ian Lance Taylor <iant@google.com>
10219
10220 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10221 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10222 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10223 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10224 the address on ldo_addrs_.
10225 (Target_i386::Relocate::fix_up_ldo): New function.
10226
e99daf92
ILT
102272009-10-06 Rafael Espindola <espindola@google.com>
10228
10229 * plugin.cc (add_input_library): New.
10230 (Plugin::load): Add add_input_library to tv.
10231 (Plugin_manager::add_input_file): Add the is_lib argument.
10232 (add_input_file): Update call to Plugin_manager::add_input_file.
10233 (add_input_library): New.
10234 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10235
966d4097
DK
102362009-09-30 Doug Kwan <dougkwan@google.com>
10237
10238 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10239 symbol and call Symbol::may_need_copy_reloc to determine if
10240 a copy reloc is needed.
10241 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10242 nocopyreloc is given in command line.
10243 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10244 given in command line.
10245 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10246 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10247 of the removed Target_i386::may_need_copy_reloc.
10248 * options.h (copyreloc): New option with default value false.
10249 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10250 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10251 instead of the removed Target_powerpc::may_need_copy_reloc.
10252 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10253 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10254 instead of the removed Target_sparc::may_need_copy_reloc.
10255 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10256 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10257 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10258 instead of the removed Target_x86_64::may_need_copy_reloc.
10259
029ba973
ILT
102602009-09-30 Ian Lance Taylor <iant@google.com>
10261
10262 * object.h (class Object): Remove target_ field, and target,
10263 sized_target, and set_target methods.
10264 (Object::sized_target): Remove.
10265 (class Sized_relobj): Update declarations. Remove sized_target.
10266 * object.cc (Sized_relobj::setup): Remove target parameter.
10267 Change all callers.
10268 (Input_objects::add_object): Don't do anything with the target.
10269 (make_elf_sized_object): Add punconfigured parameter. Change all
10270 callers. Set or test parameter target.
10271 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10272 Change all callers.
10273 * parameters.cc (Parameters::set_target): Change parameter type to
10274 be non-const.
10275 (Parameters::default_target): Remove.
10276 (set_parameters_target): Change parameter type to be non-const.
10277 (parameters_force_valid_target): New function.
10278 (parameters_clear_target): New function.
10279 * parameters.h (class Parameters): Update declarations. Remove
10280 default_target method. Add sized_target and clear_target
10281 methods. Change target_ to be non-const.
10282 (set_parameters_target): Update declaration.
10283 (parameters_force_valid_target): Declare.
10284 (parameters_clear_target): Declare.
10285 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10286 as NULL if we aren't searching.
10287 (Add_symbols::run): Don't check for compatible target.
10288 * fileread.cc (Input_file::open_binary): Call
10289 parameters_force_valid_target.
10290 * gold.cc (queue_middle_tasks): Likewise.
10291 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10292 set_target on object.
10293 * dynobj.h (class Sized_dynobj): Update declarations.
10294 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10295 make_elf_object returns NULL.
10296 (Archive::include_member): Don't check whether object target is
10297 compatible.
10298 * output.cc (Output_section::add_input_section): Get target from
10299 parameters.
10300 (Output_section::relax_input_section): Likewise.
10301 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10302 parameters.
10303 (Sized_relobj::do_scan_relocs): Likewise.
10304 (Sized_relobj::relocate_sections): Likewise.
10305 * resolve.cc (Symbol_table::resolve): Likewise.
10306 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10307 parameter. Change all callers.
10308 (Symbol_table::add_from_object): Get target from parameters.
10309 (Symbol_table::add_from_relobj): Don't check object target.
10310 (Symbol_table::add_from_dynobj): Likewise.
10311 (Symbol_table::define_special_symbol): Get target from
10312 parameters.
10313 * symtab.h (class Symbol_table): Update declaration.
10314 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10315 parameter. Change all callers. Clear parameter target.
10316 (Binary_test): Test target here.
10317 * testsuite/object_unittest.cc (gold_testsuite): Remove
10318 target_test_pointer parameter. Change all callers.
10319 (Object_test): Test target here.
10320
a6a22b83
ILT
103212009-09-26 Ian Lance Taylor <iant@google.com>
10322
10323 * testsuite/initpri1.c: Don't try to use constructor priorities if
10324 compiling with gcc before 4.3.
10325
6a8f49fe
ILT
103262009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10327
10328 * testsuite/retain_symbols_file_test.sh (check_present): Change
10329 output file name to retain_symbols_file_test.stdout.
10330 (check_absent): Likewise.
10331
8c604651
CS
103322009-09-18 Craig Silverstein <csilvers@google.com>
10333
10334 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10335 * options.cc: Include <cerrno> and <fstream>.
10336 (General_options::finalize): Parse -retain-symbols-file tag.
10337 * options.h: New flag.
10338 (General_options): New method should_retain_symbol, new
10339 variable symbols_to_retain.
10340 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10341 should_retain_symbol map.
10342 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10343 * testsuite/Makefile.in: Regenerate.
10344 * testsuite/retain_symbols_file_test.sh: New file.
10345
ca58b19f
NC
103462009-09-18 Nick Clifton <nickc@redhat.com>
10347
10348 * po/es.po: Updated Spanish translation.
10349
20e6d0d6
DK
103502009-09-17 Doug Kwan <dougkwan@google.com>
10351
10352 * debug.h (DEBUG_RELAXATION): New constant.
10353 (DEBUG_ALL): Add DEBUG_RELAXATION.
10354 (debug_string_to_enum): Add relaxation debug option.
10355 * layout.cc
10356 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10357 Layout::Relaxation_debug_check::read_sections,
10358 Layout::Relaxation_debug_check::read_sections): New method definitions.
10359 (Layout::Layout): Initialize data members
10360 record_output_section_data_from_scrips_,
10361 script_output_section_data_list_ and relaxation_debug_check_.
10362 (Layout::save_segments, Layout::restore_segments,
10363 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10364 Layout::relaxation_loop_body): New method definitions.
10365 (Layout::finalize): Support relaxation. Move section layout code to
10366 Layout::relaxation_loop_body.
10367 (Layout::set_asection_address_from_script): Move code for orphan
10368 section placement out.
10369 (Layout::place_orphan_sections_in_script): New method definition.
10370 * layout.h (Output_segment_headers, Output_file_header):
10371 New forward class declarations.
10372 (Layout::~Layout): Define.
10373 (Layout::new_output_section_data_from_script): New method definition.
10374 (Layout::place_orphan_sections_in_script): New method declaration.
10375 (Layout::Segment_states): New type declaration.
10376 (Layout::save_segments, Layout::restore_segments,
10377 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10378 Layout::relaxation_loop_body): New method declarations.
10379 (Layout::Output_section_data_list): New type declaration.
10380 (Layout::Relaxation_debug_check): New class definition.
10381 (Layout::record_output_section_data_from_script_,
10382 Layout::script_output_section_data_list_, Layout::segment_states_,
10383 Layout::relaxation_debug_check_): New data members.
10384 * output.cc: (Output_section_headers::do_size): New method definition.
10385 (Output_section_headers::Output_section_headers): Move size
10386 computation to Output_section_headers::do_size.
10387 (Output_segment_headers::do_size): New method definition.
e1df38aa 10388 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10389 Output_file_header::do_size and call it.
10390 (Output_file_header::do_size): New method definition.
10391 (Output_data_group::Output_data_group): Adjust call to
10392 Output_section_data.
10393 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10394 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10395 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10396 RELAXED_INPUT_SECTION_CODE.
10397 (Output_section::Output_section): Initialize data member checkpoint_.
10398 (Output_section::~Output_section): Delete checkpoint object pointed
10399 by checkpoint_.
10400 (Output_section::add_input_section): Always add an Input_section if
10401 relaxing.
10402 (Output_section::add_merge_input_section): Add assert.
10403 (Output_section::relax_input_section): New method definition.
10404 (Output_section::set_final_data_size): Set load address to zero for
10405 an unallocated section.
10406 (Output_section::do_address_and_file_offset_have_reset_values):
10407 New method definition.
10408 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10409 Handle relaxed input section.
10410 (Output_section::sort_attached_input_sections): Checkpoint input
10411 section list lazily.
10412 (Output_section::get_input_sections): Change type of input_sections to
10413 list of Simple_input_section pointers. Checkpoint input section list
10414 lazily. Also handle relaxed input sections.
10415 (Output_section::add_input_section_for_script): Take a reference to
10416 a Simple_input_section object instead of Relobj pointer and section
10417 index as parameter. Handle relaxed input sections.
10418 (Output_section::save_states, Output_section::restore_states): New
10419 method definitions.
10420 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10421 (Output_data::is_data_size_fixed): New method definition.
10422 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10423 if it is fixed.
10424 (Output_data::address_and_file_offset_have_reset_values): New method
10425 definition.
10426 (Output_data::do_address_and_file_offset_have_reset_values): New method
10427 definition.
10428 (Output_data::set_data_size): Check that data size is not fixed.
10429 (Output_data::fix_data_size): New method definition.
10430 (Output_data::is_data_size_fixed_): New data member.
10431 (Output_section_headers::set_final_data_size): New method definition.
10432 (Output_section_headers::do_size): New method declaration.
10433 (Output_segment_headers::set_final_data_size): New method definition.
10434 (Output_segment_headers::do_size): New method declaration.
10435 (Output_file_header::set_final_data_size)::New method definition.
10436 (Output_file_header::do_size)::New method declaration.
10437 (Output_section_data::Output_section_data): Add new parameter
10438 is_data_size_fixed and use it to fix data size.
10439 (Output_data_const::Output_data_const): Adjust call to base class
10440 constructor and fix data size.
10441 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10442 base class constructor and fix data size.
10443 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10444 base class constructor and fix data size.
10445 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10446 class constructor and fix data size.
10447 (Output_data_group::set_final_data_size): New method definition.
10448 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10449 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10450 class constructor and fix data size.
10451 (Output_relaxed_input_section): New class definition.
10452 (Output_section::Simple_input_section): New class definition.
10453 (Output_section::get_input_sections): Adjust parameter list.
10454 (Output_section::add_input_section_for_script): Same.
10455 (Output_section::save_states, Output_section::restore_states,
10456 Output_section::do_address_and_file_offset_have_reset_values,
10457 (Output_section::Input_section::Input_section): Handle
10458 RELAXED_INPUT_SECTION_CODE. Add new overload for
10459 Output_relaxed_input_section.
10460 (Output_section::Input_section::is_input_section,
10461 Output_section::Input_section::set_output_section): Handle relaxed
10462 input section.
10463 (Output_section::Input_section::is_relaxed_input_section,
10464 Output_section::Input_section::output_section_data,
10465 Output_section::Input_section::relaxed_input_section): New method
10466 definitions.
10467 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10468 value.
10469 (Output_section::Input_section::u1_): Update comments.
10470 (Output_section::Input_section::u2_): Add new union member poris.
10471 (Output_section::Checkpoint_output_section): New classs definition.
10472 (Output_section::relax_input_section): New method declaration.
10473 (Output_section::checkpoint_): New data member.
10474 (Output_segment): Update comments.
10475 (Output_segment::Output_segment): Un-privatize copy constructor.
10476 (Output_segment::operator=): Un-privatize.
10477 * script-sections.cc (Output_section_element::Input_section_list):
10478 Change element type to Output_section::Simple_input_section.
10479 (Output_section_element_dot_assignment::set_section_addresses):
10480 Register output section data for relaxation clean up.
10481 (Output_data_exression::Output_data_expression): Adjust call to base
10482 constructor to fix data size.
10483 (Output_section_element_data::set_section_addresses): Register
10484 Output_data_expression object for relaxation clean up.
10485 (struct Input_section_info): Replace Relobj pointer and section index
10486 pair with Output_section::Simple_input_section and Convert struct to a
10487 class.
10488 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10489 Input_section_info data member to use accessors.
20e6d0d6
DK
10490 (Output_section_element_input::set_section_addresses): Use layout
10491 parameter. Adjust code to use Output_section::Simple_input_section
10492 and Input_secction_info classes. Register filler for relaxation
10493 clean up.
10494 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10495 and section index pair with Output_section::Simple_input_section
10496 class. Adjust code accordingly.
10497 (Phdrs_element::release_segment): New method definition.
10498 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10499 segment list.
10500 (Script_sections::release_segments): New method definition.
10501 * gold/script-sections.h (Script_sections::release_segments): New
10502 method declaration.
10503 * gold/target.h (Target::may_relax, Target::relax,
10504 Target::do_may_relax, Target::do_relax): New method definitions.
10505
5e445df6
ILT
105062009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10507
10508 * arm.cc (has_signed_unsigned_overflow): New function.
10509 (Arm_relocate_functions::abs8): New function.
10510 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10511 (Target_arm::Scan::global): Likewise.
10512 (Target_arm::relocate::relocate): Likewise.
10513 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10514 Likewise.
10515
8c604651 105162009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10517
10518 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10519 * testsuite/Makefile.in: Regenerate.
10520
1e9cc1c2
NC
105212009-09-11 Nick Clifton <nickc@redhat.com>
10522
10523 * po/gold.pot: Updated by the Translation project.
10524
6a89f575
CC
105252009-09-08 Cary Coutant <ccoutant@google.com>
10526
10527 * output.cc (Output_file::open): Add execute permission to empty file.
10528 * testsuite/Makefile.am (permission_test): New test.
10529 * testsuite/Makefile.in: Regenerate.
10530
fdcac5af
ILT
105312009-09-02 Ian Lance Taylor <iant@google.com>
10532
10533 * output.cc (Output_file::resize): Call map_no_anonymous rather
10534 than map.
10535
44453f85
ILT
105362009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10537
10538 * gold.cc: Include "incremental.h".
10539 (queue_initial_tasks): Call Incremental_checker methods.
10540 * incremental.cc: Include "output.h".
10541 (Incremental_checker::can_incrementally_link_output_file): New
10542 method.
10543 * incremental.h (Incremental_checker): New class.
10544
10545 * output.cc (Output_file::open_for_modification): New method.
10546 (Output_file::map_anonymous): Changed return type to bool. Record
10547 map in base_ field.
10548 (Output_file::map_no_anonymous): New method, broken out of map.
10549 (Output_file::map): Use map_no_anonymous and map_anonymous.
10550 * output.h (class Output_file): Update declarations.
10551
293c1386
CC
105522009-08-24 Cary Coutant <ccoutant@google.com>
10553
10554 * options.h (Command_line::Pre_options): New class.
10555 (Command_line::pre_options): New member.
10556 * options.cc (gold::options::ready_to_register): New variable.
10557 (One_option::register_option): Do nothing if not registering options.
10558 Assert if same short option registered twice.
10559 (General_options::General_options): Turn off option registration when
10560 done constructing.
10561 (Command_line::Pre_options::Pre_options): New constructor.
10562
f773f3d2
CC
105632009-08-24 Cary Coutant <ccoutant@google.com>
10564
06a73cfe
CC
10565 * options.h (General_options::no_keep_memory): Remove incorrect
10566 short option.
f773f3d2 10567
a15af8e2
RW
105682009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10569
10570 * Makefile.am (am__skiplex, am__skipyacc): New.
10571 * Makefile.in: Regenerate.
10572
c462b41b
RW
105732009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10574
14ec8efd
RW
10575 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10576 (INCLUDES): ... this.
10577 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10578 (AM_CPPFLAGS): Renamed from ...
10579 (INCLUDE): ... this.
10580 * Makefile.in, testsuite/Makefile.in: Regenerate.
10581
81ecdfbb
RW
10582 * Makefile.in: Regenerate.
10583 * aclocal.m4: Likewise.
10584 * config.in: Likewise.
10585 * configure: Likewise.
10586 * testsuite/Makefile.in: Likewise.
10587
c462b41b
RW
10588 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10589 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10590 * Makefile.in: Regenerate.
10591 * testsuite/Makefile.in: Regenerate.
10592
2da73f13
CC
105932009-08-19 Cary Coutant <ccoutant@google.com>
10594
10595 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10596 symbols in shared libraries overridden by hidden or internal symbols
10597 in the main program.
10598
2db70501
CD
105992009-08-19 Chris Demetriou <cgd@google.com>
10600
10601 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10602 checking source file names in error messages.
10603
f733487b
DK
106042009-08-18 Doug Kwan <dougkwan@google.com>
10605
10606 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10607 an elcpp::Ehdr as parameter. Adjust call to set_target.
10608 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10609 an elfcpp::Ehdr as parameter.
10610 * object.cc (Object::set_target): Remove the version that looks up
10611 a target and sets it.
10612 (Sized_relobj::setup): Take a Target object instead of
10613 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10614 (make_elf_sized_object): Find target and ask target to
10615 make an ELF object.
10616 * object.h: (Object::set_target): Remove the version that looks up
10617 a target and sets it.
10618 (Sized_relobj::setup): Take a Target object instead of
10619 an elfcpp:Ehdr as parameter.
10620 * target.cc: Include dynobj.h.
10621 (Target::do_make_elf_object_implementation): New.
2e702c99 10622 (Target::do_make_elf_object): New.
f733487b
DK
10623 * target.h (Target::make_elf_object): New template declaration.
10624 (Target::do_make_elf_object): New method declarations.
10625 (Target::do_make_elf_object_implementation): New template declaration.
10626
cc70f101
ILT
106272009-08-14 Ian Lance Taylor <iant@google.com>
10628
10629 * gold.h (FUNCTION_NAME): Define.
10630 (gold_unreachable): Use FUNCTION_NAME.
10631
ef5e0cb1
ST
106322009-08-12 Sriraman Tallam <tmsriram@google.com>
10633
10634 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10635 symbol in the --keep-unique list is not found.
10636
48c187ce
ST
106372009-08-12 Sriraman Tallam <tmsriram@google.com>
10638
10639 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10640 been maked as --keep-unique.
10641 (Icf::unfold_section): New function.
10642 * icf.h (Icf::unfold_section): New function.
10643 * options.h (General_options::keep_unique): New option.
10644 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10645 * testsuite/Makefile.in: Regenerate.
10646 * testsuite/icf_keep_unique_test.sh: New file.
10647 * testsuite/icf_keep_unique_test.cc: New file.
10648
645afe0c
CC
106492009-08-12 Cary Coutant <ccoutant@google.com>
10650
10651 PR 10471
10652 * resolve.cc (Symbol_table::resolve): Check for references from
10653 dynamic objects to hidden and internal symbols.
10654 * testsuite/Makefile.am (hidden_test.sh): New test.
10655 * testsuite/Makefile.in: Regenerate.
10656 * testsuite/hidden_test.sh: New script.
10657 * testsuite/hidden_test_1.c: New test source.
10658 * testsuite/hidden_test_main.c: New test source.
10659
11af873f
DK
106602009-08-11 Doug Kwan <dougkwan@google.com>
10661
10662 * arm.cc: Update comments.
10663 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10664 segment to locate the .ARM.exidx section if present.
10665
b9f7d72d
DK
106662009-08-09 Doug Kwan <dougkwan@google.com>
10667
10668 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10669 patch.
10670
ddd3c53c
ST
106712009-08-07 Sriraman Tallam <tmsriram@google.com>
10672 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10673 compiler warnings.
10674
27721062
ST
106752009-08-06 Sriraman Tallam <tmsriram@google.com>
10676
10677 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10678 valid tls_segment only for non-debug-section relocations.
10679 * testsuite/Makefile.am: Add gc_tls_test.
10680 * testsuite/Makefile.in: Regenerate.
10681 * testsuite/gc_tls_test.cc: New file.
10682 * testsuite/gc_tls_test.sh: New file.
10683
ef15dade 106842009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10685
ef15dade
ST
10686 * icf.cc: New file.
10687 * icf.h: New file.
10688 * Makefile.am (CCFILES): Add icf.cc.
10689 (HFILES): Add icf.h
10690 * Makefile.in: Regenerate.
10691 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10692 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10693 section, symbol and addend information for the relocs.
10694 * gold.cc (queue_middle_tasks): Call identical code folding.
10695 * gold.h: Add defines for multimap.
10696 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10697 to the call of finalize_local_symbols.
10698 * main.cc (main): Create object of class Icf.
10699 * object.cc (Sized_relobj::do_layout): Allow this function to be
10700 called twice during icf.
10701 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10702 to sections marked as identical by icf.
10703 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10704 when available.
10705 (Sized_relobj::do_section_entsize): New function.
10706 * object.h (Object::section_entsize): New function.
10707 (Object::do_section_entsize): New pure virtual function.
10708 (Relobj::finalize_local_symbols): Add new parameter.
10709 (Relobj::do_section_entsize): New function.
10710 * options.h (General_options::icf): New option.
10711 (General_options::icf_iterations): New option.
10712 (General_options::print_icf_sections): New option.
10713 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10714 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10715 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10716 icf.
10717 * symtab.cc (Symbol_table::is_section_folded): New function.
10718 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10719 to sections marked as identical by icf.
10720 * symtab.h (Symbol_table::set_icf): New function.
10721 (Symbol_table::icf): New function.
10722 (Symbol_table::is_section_folded): New function.
10723 (Symbol_table::icf_): New data member.
10724 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10725 * testsuite/Makefile.am: Add commands to build icf_test.
10726 * testsuite/Makefile.in: Regenerate.
10727 * testsuite/icf_test.sh: New file.
10728 * testsuite/icf_test.cc: New file.
10729
c3b65ac4
CD
107302009-07-24 Chris Demetriou <cgd@google.com>
10731
10732 * layout.cc (is_compressible_debug_section): Fix incorrect
10733 comment about compressed section names.
10734
1caf2c51
ILT
107352009-07-20 Ian Lance Taylor <ian@airs.com>
10736
10737 PR 10419
10738 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10739
1ef4d87f
ILT
107402009-07-16 Ian Lance Taylor <iant@google.com>
10741
10742 PR 10400
10743 * layout.h: #include <map>.
10744 (class Kept_section): Change from struct to class. Add accessors
10745 and setters. Add section size to Comdat_group mapping. Change
10746 Comdat_group to std::map. Add is_comdat_ field. Add
10747 linkonce_size field in union.
10748 (class Layout): Update declaration of find_or_add_kept_section.
10749 Don't declare find_kept_object.
10750 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10751 parameter. Add object, shndx, is_comdat, and is_group_name
10752 parameters. Change all callers. Adjust for new Kept_section.
10753 (Layout::find_kept_object): Remove.
10754 * object.cc (Sized_relobj::include_section_group): Update use of
10755 Kept_section. Rename secnum to shndx. Only record
10756 Kept_comdat_section if sections are the same size.
10757 (Sized_relobj::include_linkonce_section): Update use of
10758 Kept_section. Only record Kept_comdat_section if sections are the
10759 same size. Set size of linkonce section.
10760 (Sized_relobj::map_to_kept_section): Update call to
10761 get_kept_comdat_section.
10762 * object.h (class Sized_relobj): Rename fields in
10763 Kept_comdat_section to drop trailing underscores; change object
10764 field to Relobj*. Change Kept_comdat_section_table to store
10765 struct rather than pointer.
10766 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10767 Add kept_object and kept_shndx parameters. Change all callers.
10768 (Sized_relobj::get_kept_comdat_section): Change return type to
10769 bool. Add kept_object and kept_shndx parameters. Change all
10770 callers.
10771 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10772 Layout::find_or_add_kept_section.
10773
37c3b7b0
ILT
107742009-07-09 Ian Lance Taylor <iant@google.com>
10775
10776 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10777 Reserve space in the hash table.
10778
98fa85cb
ILT
107792009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10780
10781 * fileread.cc (File_read::get_mtime): New method.
10782 * fileread.h (Timespec): New structure.
10783 (File_read::get_mtime): New method.
10784 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10785 Renamed from timestamp_nsec.
10786 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10787 Elf_Xword.
e1df38aa 10788 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10789 timestamp_nsec.
e1df38aa 10790 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10791 (Incremental_inputs::report_obejct): Save mtime; style fix.
10792 (Incremental_inputs::report_script): Save mtime; style fix.
10793 (Incremental_inputs::finalize_inputs): Style fix.
10794 (Incremental_inputs::finalize): Style fix.
10795 (Incremental_inputs::create_input_section_data): Store inputs
10796 mtime.
10797 * incremental.h (Incremental_inputs::report_script): Add mtime
10798 argument.
10799 (Incremental_inputs::Input_info::Input_info): Intialize only one
10800 union member.
10801 (Incremental_inputs::Input_info::archive): Move to nameless
10802 union.
10803 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10804 (Incremental_inputs::Input_info::script): Move to nameless union.
10805 (Incremental_inputs::mtime): New field.
10806 * script.cc (read_input_script): Pass file mtime to
10807 Incremental_input.
10808 * script.h (Script_info::inputs): Style fix.
10809
c9d70757
ILT
108102009-07-01 Ian Lance Taylor <ian@airs.com>
10811
10812 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10813 instead of 32.
10814
9c547ec3
ILT
108152009-06-24 Ian Lance Taylor <iant@google.com>
10816
10817 PR 10156
10818 * layout.cc (Layout::choose_output_section): If we find an
10819 existing section, update the flags.
10820 (Layout::create_notes): New function, broken out of
10821 Layout::finalize.
10822 (Layout::finalize): Don't create note sections.
10823 (Layout::create_note): Don't crash if linker script discards
10824 section.
10825 (Layout::create_gold_note): Likewise.
10826 (Layout::create_build_id): Likewise. Don't set
10827 after_input_sections on the section.
10828 (Layout::create_executable_stack_info): Remove target parameter.
10829 Change caller.
10830 * layout.h (class Layout): Declare create_notes. Update
10831 declaration of create_executable_stack_info.
10832 * gold.cc (queue_middle_tasks): Call create_notes.
10833 * output.cc (Output_section::update_flags_for_input_section): Move
10834 here from output.h. If SHF_ALLOC flag is newly set, mark address
10835 invalid.
10836 * output.h (Output_data::mark_address_invalid): New function.
10837 (class Output_section): Only declare, not define,
10838 update_flags_for_input_section. Remove set_flags.
10839
55458500
ILT
108402009-06-24 Ian Lance Taylor <iant@google.com>
10841
10842 * script-sections.cc (Output_section_definition::
10843 set_section_addresses): Rename shadowing local load_address to
10844 laddr.
10845
1307d6cd
ILT
108462009-06-24 Ian Lance Taylor <iant@google.com>
10847
10848 PR 10244
10849 * reloc.cc (relocate_sections): Skip empty relocation sections.
10850
ec3f783e
ILT
108512009-06-23 Ian Lance Taylor <iant@google.com>
10852
10853 PR 10156
10854 * layout.cc (Layout::create_note): Use choose_output_section
10855 rather than make_output_section.
10856
459c9f1c
ILT
108572009-06-23 Ian Lance Taylor <iant@google.com>
10858
10859 PR 10237
10860 * options.cc (General_options::parse_V): Set printed_version_.
10861 (General_options::General_options): Initialize printed_version_.
10862 * options.h (class General_options): Add printed_version_ field.
10863 * gold.cc (queue_initial_tasks): If there are no input files,
10864 don't give a fatal error if we printed the version information.
10865 (queue_middle_tasks): If using -r with a shared object, give a
10866 fatal error rather than an ordinary error.
10867
1518dc8f
ILT
108682009-06-23 Ian Lance Taylor <iant@google.com>
10869
10870 PR 10219
10871 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10872 (Layout::make_output_section): Set have_stabstr_section_ if we see
10873 a .stab*str section.
10874 (Layout::finalize): Call link_stabs_sections.
10875 (Layout::link_stabs_sections): New file.
10876 * layout.h (class Layout): Add have_stabstr_section_ field.
10877 Declare link_stabs_sections.
10878
3d857b98
DK
108792009-06-23 Doug Kwan <dougkwan@google.com>
10880
10881 * Makefile.am (libgold_a_LIBADD): New.
10882 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10883 * Makefile.in: Regenerate.
3d857b98
DK
10884 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10885 * configure: Regenerate.
10886 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10887 * fileread.cc: Include sys/state.h
10888 * gold.h: Declare memmem and strndup if found missing.
10889 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10890
0639a6f6
ILT
108912009-06-23 Ian Lance Taylor <iant@google.com>
10892
10893 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10894 * configure: Rebuild.
10895
8d63875c
ILT
108962009-06-23 Ian Lance Taylor <iant@google.com>
10897
10898 PR 10147
10899 * object.cc (Object::section_contents): Don't try to get a view if
10900 the section has length zero.
10901 (Object::handle_gnu_warning_section): If the section is empty, use
10902 the name of the section as the warning.
10903
f7c8a183
ILT
109042009-06-23 Ian Lance Taylor <iant@google.com>
10905
10906 PR 10133
10907 * stringpool.h (class Stringpool_template): Add optimize_ field.
10908 (Stringpool_template::set_optimize): New function.
10909 * stringpool.cc (Stringpool_template::Stringpool_template):
10910 Initialize optimize_ field.
10911 (Stringpool_template::set_string_offsets): Test local optimize
10912 fild rather than parameter.
10913 * layout.cc (Layout::Layout): Call set_optimize on the section
10914 name stringpool.
10915
e6a307ba
ILT
109162009-06-22 Ian Lance Taylor <iant@google.com>
10917
10918 PR 10030
10919 * yyscript.y: Parse TARGET.
10920 * script.cc (script_set_target): New function.
10921 * script-c.h (script_set_target): Declare.
10922 * options.cc (General_options::string_to_object_format): Rename
10923 from string_to_object_format in anonymous namespace. Change
10924 callers.
10925 * options.h (class General_options): Declare
10926 string_to_object_format.
10927
3ee173de
ILT
109282009-06-22 Ian Lance Taylor <iant@google.com>
10929
10930 * script-sections.cc (Script_sections::create_segments): Don't put
10931 program headers in a PT_LOAD segment if -n or -N.
10932
109332009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10934
10935 PR 10141
10936 * options.h (class General_options): Add -z lazy and -z now. Sort
10937 -z options into alphabetical order.
10938 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10939
cd6739a1 109402009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10941
10942 * layout.cc (Layout::make_output_section): Call
10943 Target::new_output_section.
10944 (Layout::attach_allocated_section_to_segment): Put large section
10945 sections in a separate load segment with the large segment flag
10946 set.
10947 (Layout::segment_precedes): Sort large data segments after other
10948 load segments.
10949 (align_file_offset): New static function.
10950 (Layout::set_segment_offsets): Use align_file_offset.
10951 * output.h (class Output_section): Add is_small_section_ and
10952 is_large_section_ fields.
10953 (Output_section::is_small_section): New function.
10954 (Output_section::set_is_small_section): New function.
10955 (Output_section::is_large_section): New function.
10956 (Output_section::set_is_large_section): New function.
10957 (Output_section::is_large_data_section): New function.
10958 (class Output_segment): Add is_large_data_segment_ field.
10959 (Output_segment::is_large_data_segment): New function.
10960 (Output_segment::set_is_large_data_segment): New function.
10961 * output.cc (Output_section::Output_section): Initialize new
10962 fields.
10963 (Output_segment::Output_segment): Likewise.
10964 (Output_segment::add_output_section): Add assertion that large
10965 data sections always go in large data segments. Force small data
10966 sections to the end of the list of data sections. Force small BSS
10967 sections to the start of the list of BSS sections. For large BSS
10968 sections to the end of the list of BSS sections.
10969 * symtab.h (class Symbol): Declare is_common_shndx.
10970 (Symbol::is_defined): Check Symbol::is_common_shndx.
10971 (Symbol::is_common): Likewise.
10972 (class Symbol_table): Define enum Commons_section_type. Update
10973 declarations. Add small_commons_ and large_commons_ fields.
10974 * symtab.cc (Symbol::is_common_shndx): New function.
10975 (Symbol_table::Symbol_table): Initialize new fields.
10976 (Symbol_table::add_from_object): Put small and large common
10977 symbols in the right list.
10978 (Symbol_table::sized_finalized_symbol): Check
10979 Symbol::is_common_shndx.
10980 (Symbol_table::sized_write_globals): Likewise.
10981 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10982 common symbol lists. Don't call do_allocate_commons_list if the
10983 list is empty.
10984 (Symbol_table::do_allocate_commons_list): Remove is_tls
10985 parameter. Add comons_section_type parameter. Change all
10986 callers. Handle small and large common symbols.
10987 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10988 Symbol::is_common_shndx.
10989 * resolve.cc (symbol_to_bits): Likewise.
10990 * target.h (Target::small_common_shndx): New function.
10991 (Target::small_common_section_flags): New function.
10992 (Target::large_common_shndx): New function.
10993 (Target::large_common_section_flags): New function.
10994 (Target::new_output_section): New function.
10995 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10996 small_common_section_flags, and large_common_section_flags
10997 fields.
10998 (Target::do_new_output_section): New virtual function.
10999 * arm.cc (Target_arm::arm_info): Initialize new fields.
11000 * i386.cc (Target_i386::i386_info): Likewise.
11001 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11002 Likewise.
11003 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11004 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11005 (Target_x86_64::do_new_output_section): New function.
11006 * configure.ac: Define conditional MCMODEL_MEDIUM.
11007 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11008 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11009 (large_LDFLAGS): Define.
11010 * testsuite/large.c: New file.
11011 * testsuite/testfile.cc (Target_test::test_target_info):
11012 Initialize new fields.
11013 * configure, testsuite/Makefile.in: Rebuild.
11014
bb04269c
DK
110152009-06-05 Doug Kwan <dougkwan@google.com>
11016
11017 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11018 * Makefile.in: Regenerate.
bb04269c
DK
11019 * i386.cc (class Target_i386): Define new virtual method to
11020 override do_is_local_label_name in parent.
11021 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11022 local symbols if --discard-locals or -X is given.
11023 * options.h (class General_options): Declare new options
11024 '--discard-locals' and '-X' for discarding locals.
11025 * target.h (class Target): Define new methods is_local_label_name.
11026 Declare new virtual method do_is_local_label_name.
11027 * target.cc: New file.
11028 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11029 (check_SCRIPTS): Add discard_locals_test.sh.
11030 (check_DATA): Add discard_local_tests.syms.
11031 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11032 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11033 * testsuite/Makefile.in: Regenerate.
11034 * testsuite/discard_locals_test.c: New file.
11035 * testsuite/discard_locals_test.sh: Same.
11036
805bb01c
DK
110372009-06-05 Doug Kwan <dougkwan@google.com>
11038
11039 * object.cc (Sized_relobj::Sized_relobj): Initialize
11040 discarded_eh_frame_shndx_ to -1U.
11041 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11042 section.
11043 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11044 a discarded .eh_frame section.
11045 (Sized_relobj::do_finalize_local_symbols): Ditto.
11046 * object.h (class Sized_relobj): Declare new member
11047 discarded_eh_frame_shndx_.
11048 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11049 (local_labels_test.o, local_labels_test): New rules.
11050 * testsuite/Makefile.in: Regenerate.
11051
1dcd334d
DK
110522009-06-04 Doug Kwan <dougkwan@google.com>
11053
11054 * layout.cc (Layout::section_name_mapping): Add mapping for
11055 special ARM sections.
11056
96d49306
DK
110572009-06-03 Doug Kwan <dougkwan@google.com>
11058
11059 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11060 (utils::has_overflow): Same.
11061
dff16297
ILT
110622009-06-03 Ian Lance Taylor <iant@google.com>
11063
11064 * layout.cc (Layout::section_name_mapping): New array, replacing
11065 Layout::linkonce_mapping.
11066 (Layout::section_name_mapping_count): New variable, replacing
11067 Layout::linkonce_mapping_count.
11068 (Layout::linkonce_output_name): Remove.
11069 (Layout::output_section_name): Rewrite.
11070 * layout.h (class Layout): Rename Linkonce_mapping to
11071 Section_name_mapping, linkonce_mapping to section_name_mapping,
11072 linkonce_mapping_count to section_name_mapping_count. Don't
11073 declare linkonce_output_name.
11074
c121c671
DK
110752009-06-03 Doug Kwan <dougkwan@google.com>
11076
11077 * gold/arm.cc (namespace utils): New.
11078 (Target_arm::reloc_is_non_pic): Define new method.
11079 (class Arm_relocate_functions): New.
11080 (Target_arm::Relocate::relocate): Handle relocation types used by
11081 Android.
11082
07800fab
ILT
110832009-06-03 Ian Lance Taylor <iant@google.com>
11084
11085 * arm.cc (Target_arm::scan::global): Use || instead of |.
11086
c121c671
DK
110872009-06-02 Doug Kwan <dougkwan@google.com>
11088
11089 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11090 issued_non_pic_error_.
11091 (class Target_arm::Scan): Declare new method check_non_pic.
11092 Define new method symbol_needs_plt_entry.
11093 Declare new data member issued_non_pic_error_.
11094 (class Target_arm::Relocate): Declare new method
11095 should_apply_static_reloc.
11096 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11097 (Target_arm::Scan::check_non_pic): Define new method.
11098 (Target_arm::Scan::local): Handle a small subset of reloc types used
11099 by Android.
11100 (Target_arm::Scan::local): Same.
11101 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11102
b19b0c6d
ILT
111032009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11104
11105 * incremental.cc (Incremental_inputs::report_command_line): Filter
11106 out --incremental-* options.
11107
94cdfcff
DK
111082009-05-29 Doug Kwan <dougkwan@google.com>
11109
11110 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11111 template class.
11112 (class Target_arm): Update comment.
11113 (Target_arm::Target_arm): Initialize new data members GOT_,
11114 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11115 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11116 and Target_arm::rel_dyn_section.
11117 Declare new_enum Target_arm::Got_type.
11118 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11119 and DYNBSS_.
11120 Update commments for member do_dynsym_value.
11121 (Target_arm::got_size, Target_arm::plt_section,
11122 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11123 new methods inside class defintion.
11124 (Target_arm::got_section): Define new method.
11125 (Target_arm::rel_dyn_section): Same.
11126 (Output_data_plt_arm): New template class.
11127 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11128 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11129 (Output_data_plt_arm::add_entry): Same.
11130 (Output_data_plt_arm::first_plt_entry): Define new
11131 static data member for PLT instruction template.
11132 (Output_data_plt_arm::plt_entry): Same.
11133 (Output_data_plt_arm::do_write): Define new method.
11134 (Target_arm::make_plt_entry): Same.
11135 (Target_arm::do_finalize_sections): Same.
11136 (Target_arm::do_dynsym_value): Same.
11137
4a657b0d
DK
111382009-05-28 Doug Kwan <dougkwan@google.com>
11139
11140 * Makefile.am (TARGETSOURCES): Add arm.cc.
11141 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11142 * Makefile.in: Regenerate.
11143 * arm.cc: New file.
11144 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11145
e7ae8c36
DK
111462009-05-26 Doug Kwan <dougkwan@google.com>
11147
11148 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11149 (General_options::check_excluded_libs): Strip off directories in
11150 archive name before matching like GNU ld does.
11151 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11152 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11153 (exclude_libs_test_LDFLAGS): Add linker option
11154 -Wl,--exclude-libs,libexclude_libs_test_3
11155 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11156 an explicit archive without using -l.
11157 (alt/libexclude_libs_test_3.a): New make rule.
11158 * testsuite/Makefile.in: Regenerate.
11159 * testsuite/exclude_libs_test.c : Declare lib3_default().
11160 (main): Call it.
11161 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11162 * exclude_libs_test_3.c: New file.
11163
f12e7348
NC
111642009-05-26 Nick Clifton <nickc@redhat.com>
11165
11166 * po/id.po: New Indonesian translation.
11167 * po/gold.pot: Updated template file.
11168
4daadc0d
ST
111692009-05-22 Sriraman Tallam <tmsriram@google.com>
11170
e1df38aa 11171 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11172 gc_comdat_test files. Add -Wl,--gc-sections to build
11173 gc_comdat_test.
11174 * testsuite/Makefile.in: Regenerate.
11175 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11176
531813ad
ST
111772009-05-21 Sriraman Tallam <tmsriram@google.com>
11178
11179 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11180 kept comdat section was garbage collected.
11181 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11182 * testsuite/Makefile.in: Regenerate.
11183 * testsuite/gc_comdat_test.sh: New file.
11184 * testsuite/gc_comdat_test_1.cc: New file.
11185 * testsuite/gc_comdat_test_2.cc: New file.
11186
65514900
CC
111872009-05-19 Doug Kwan <dougkwan@google.com>
11188
11189 * archive.cc (Archive::Archive): Move constructor from archive.h
11190 to here. Initialize no_export_.
11191 (Archive::get_elf_object_for_member): Set no_export flag of object.
11192 * archive.h (Archive::Archive): Move constructor body to
11193 archive.cc.
11194 (Archive::no_export): New method.
11195 (Archive::no_export_): New field.
11196 * object.h (Object::Object): Initialize no_export_ to false.
11197 (Object::no_export, Object::set_no_export): New methods.
11198 (Object::no_export_): New field.
11199 * options.cc (General_options::parse_exclude_libs): New method.
11200 (General_options::check_excluded_libs) Same.
11201 * options.h (exclude_libs): New option.
11202 (General_options::check_excluded_libs): New method declaration.
11203 (General_options::excluded_libs_): New field.
11204 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11205 default or protected visibility if an object has no-export flag set.
11206 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11207 (check_SCRIPTS): Add exclude_libs_test.sh.
11208 (check_DATA): Add exclude_libs_test.syms.
11209 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11210 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11211 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11212 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11213 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11214 libexclude_libs_test_2.a): New rules.
11215 * testsuite/Makefile.in: Regenerate.
11216 * testsuite/exclude_libs_test.c: New file.
11217 * testsuite/exclude_libs_test.sh: Ditto.
11218 * testsuite/exclude_libs_test_1.c: Ditto.
11219 * testsuite/exclude_libs_test_2.c: Ditto.
11220
1b77ea50
ILT
112212009-05-15 Ian Lance Taylor <iant@google.com>
11222
11223 * configure.ac: Check for declarations for cases where libiberty.h
11224 checks HAVE_DECL_xxx.
11225 * configure, config.in: Rebuild.
11226
072fe7ce
ILT
112272009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11228
11229 * gold.h (Incremental_argument_list): Remove (invalid) forward
11230 declaration.
11231 * incremental.cc (Incremental_inputs::report_achive): New method.
11232 (Incremental_inputs::report_object): New method.
11233 (Incremental_inputs::report_script): New method.
11234 (Incremental_inputs::finalize_inputs): New method.
11235 (Incremental_inputs::finalize): Call finalize_inputs().
11236 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11237 Create inputs entries.
11238 * incremental.h (Incremental_input_type): New enum.
11239 (Incremental_inputs::Incremental_input): Initialize new fields.
11240 (Incremental_inputs::report_inputs): New method.
11241 (Incremental_inputs::report_achive): New method.
11242 (Incremental_inputs::report_object): New method.
11243 (Incremental_inputs::report_script): New method.
11244 (Incremental_inputs::finalize_inputs): New method.
11245 (Incremental_inputs::Input_info): New struct.
11246 (Incremental_inputs::Input_info_map): New typedef.
11247 (Incremental_inputs::lock_): New field.
11248 (Incremental_inputs::Inputs_): New field.
11249 (Incremental_inputs::Inputs_map): New field.
11250 * main.cc (main): Call Incremental_input::report_inputs.
11251 * options.h (Input_argument_list): Typedef moved from
11252 Input_arguments.
11253 (Input_file_group::Files): Remove, use ::Input_argument_list.
11254 (Input_file_group::Input_argument_list): Remove, use
11255 ::Input_argument_list.
11256 * plugin.cc (Plugin_manager::add_input_file): Add error in
11257 incremental build.
11258 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11259 functions.
11260 * script.cc (read_input_script): Call
11261 Incremental_input::report_script.
11262 * script.h (Script_info): New class.
11263
b0481b0b
ILT
112642009-04-27 Ian Lance Taylor <iant@google.com>
11265
11266 * x86_64.cc (do_adjust_output_section): Set entsize to
11267 plt_entry_size.
11268
b22a5a41 112692009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11270
11271 * output.cc (Output_file::close): After short writes, continue
11272 writing from the correct offset in the buffer being written.
11273
40fde488
CD
112742009-04-23 Chris Demetriou <cgd@google.com>
11275
11276 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11277 * configure: Regenerate.
11278 * config.in: Regenerate.
11279 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11280 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11281
3ce2c28e
ILT
112822009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11283
11284 * incremental.cc (Incremental_inputs_header_data): Renamed from
11285 Incremental_input_header_data.
11286 (Incremental_inputs_header_data::data_size): New field.
11287 (Incremental_inputs_header_data::put_input_file_count): Renamed
11288 from input_file_count.
11289 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11290 from command_line_offset.
11291 (Incremental_inputs_header_data::put_reserved): Renamed from
11292 put_reserved.
11293 (Incremental_inputs_entry_data): Renamed from
11294 Incremental_input_entry_data.
11295 (Incremental_inputs_entry_data::data_size): New field.
11296 (Incremental_inputs::report_command_line): New method.
11297 (Incremental_inputs::finalize): New method.
11298 (Incremental_inputs::create_incremental_inputs_data): New method.
11299 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11300 * incremental.h: New file.
11301 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11302 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11303 incremental builds.
703d02da 11304 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11305 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11306 (Layout::create_incremental_info_sections): New method.
11307 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11308 * main.cc (main): Notify Incremental_input of the command line.
11309
e55bde5e
ILT
113102009-04-01 Ian Lance Taylor <iant@google.com>
11311 Mikolaj Zalewski <mikolajz@google.com>
11312
11313 * gold.h (reserve_unordered_map): Define, three versions, one for
11314 each version of Unordered_map.
11315 * layout.cc (Layout::Layout): Remove options parameter. Add
11316 number_of_input_files parameter. Don't initialize options_.
11317 Initialize number_of_input_files_ and resized_signatures_. Move
11318 sections_are_attached_.
11319 (Layout::layout_group): Reserve space for group_signatures_.
11320 (Layout::find_or_add_kept_section): Change name parameter to be a
11321 reference. Resize signatures_ map when it gets large enough.
11322 (Layout::layout_eh_frame): Use parameters->options() instead of
11323 this->options_.
11324 (Layout::make_output_section): Likewise.
11325 (Layout::attach_allocated_section_to_segment): Likewise.
11326 (Layout::finalize, Layout::create_executable_stack): Likewise.
11327 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11328 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11329 * layout.h (class Layout): Update declarations. Remove options_
11330 field. Add number_of_input_files_ and resized_signatures_
11331 fields. Move sections_are_attached_ field.
11332 * main.cc (main): Pass number of input files to Layout
11333 constructor. Don't pass options.
11334
154b857c
ILT
113352009-03-30 Ian Lance Taylor <iant@google.com>
11336
11337 * ffsll.c (ffsll): Correct implementation.
11338
2f35ab9b
ILT
113392009-03-27 Ian Lance Taylor <iant@google.com>
11340
fd03461a
ILT
11341 * ffsll.c: New file.
11342 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11343 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11344 * ftruncate.c (ftruncate): Declare before definition.
11345 * mremap.c (mremap): Likewise.
11346 * pread.c (pread): Likewise.
11347 * configure, Makefile.in, config.in: Rebuild.
11348
2f35ab9b
ILT
11349 * mremap.c: New file.
11350 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11351 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11352 (mremap): Declare if HAVE_MREMAP is not defined.
11353 * configure, Makefile.in, config.in: Rebuild.
11354
33aea2fd
CC
113552009-03-27 Cary Coutant <ccoutant@google.com>
11356
11357 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11358 position independent.
11359 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11360 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11361
6d479619
CC
113622009-03-24 Cary Coutant <ccoutant@google.com>
11363
11364 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11365 an executable.
11366 (needs_dynamic_reloc): Likewise.
11367
afc06bb8
ILT
113682009-03-24 Ian Lance Taylor <iant@google.com>
11369
11370 * yyscript.y (file_cmd): Recognize EXTERN.
11371 (extern_name_list, extern_name_list_body): New nonterminals.
11372 * script.cc (script_add_extern): Define.
11373 * script-c.h (script_add_extern): Declare.
11374
f6060a4d
ILT
113752009-03-24 Rafael Avila de Espindola <espindola@google.com>
11376
11377 * object.cc (is_elf_object): Define.
11378 * object.h (is_elf_object): Declare.
11379 * archive.cc (Archive::get_elf_object_for_member): Call
11380 is_elf_object.
33aea2fd 11381 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11382
26736d8e
ILT
113832009-03-24 Elliott Hughes <enh@google.com>
11384
11385 * output.cc (Output_file::map_anonymous): Define.
11386 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11387 try an anonymous one. Report the size if the mmap fails.
11388 * output.h (class Output_file): Declare map_anonymous.
11389
22fd9730
ILT
113902009-03-24 Ian Lance Taylor <iant@google.com>
11391
11392 * target-select.cc (instantiate_target): Don't acquire the lock if
11393 the instantiated_target_ field has already been set.
11394
cb010894
ILT
113952009-03-23 Ian Lance Taylor <iant@google.com>
11396
7f055c20
ILT
11397 * gold-threads.h (class Initialize_lock): Define.
11398 * gold-threads.cc (class Initialize_lock_once): Define.
11399 (initialize_lock_control): New static variable.
11400 (initialize_lock_pointer): New static variable.
11401 (initialize_lock_once): New static function.
11402 (Initialize_lock::Initialize_lock): Define.
11403 (Initialize_lock::initialize): Define.
11404 * target-select.h: Include "gold-threads.h".
11405 (class Target_selector): Add lock_ and initialize_lock_ fields.
11406 Don't define instantiate_target, just declare it.
11407 * target-select.cc (Target_selector::Target_selector): Initialize
11408 new fields.
11409 (Target_selector::instantiate_target): Define.
11410 * descriptors.h: Include "gold-threads.h".
11411 (class Descriptors): Add initialize_lock_ field.
11412 * descriptors.cc (Descriptors::Descriptors): Initialize new
11413 field.
11414 (Descriptors::open): Use initialize_lock_ field
11415 * errors.h (class Errors): Add initialize_lock_ field.
11416 * errors.cc (Errors::Errors): Initialize new field.
11417 (Errors::initialize_lock): Use initialize_lock_ field.
11418 * powerpc.cc (class Target_selector_powerpc): Remove
11419 instantiated_target_ field. In do_recognize call
11420 instantiate_target rather than do_instantiate_target. In
11421 do_instantiate_target just allocate a new target.
11422 * sparc.cc (class Target_selector_sparc): Likewise.
11423
36959681
ILT
11424 * freebsd.h: New file.
11425 * i386.cc: Include "freebsd.h".
11426 (Target_i386): Derive from Target_freebsd rather than
11427 Sized_target.
11428 (Target_selector_i386): Derive from Target_selector_freebsd rather
11429 than Target_selector.
11430 * x86_64.cc: Include "freebsd.h".
11431 (Target_x86_64): Derive from Target_freebsd rather than
11432 Sized_target.
11433 (Target_selector_x86_64): Derive from Target_selector_freebsd
11434 rather than Target_selector.
11435 * target.h (class Target): Add adjust_elf_header and
11436 do_adjust_elf_header.
11437 * output.cc (Output_file_header:: do_sized_write): Call target
11438 adjust_elf_header routine.
11439 * configure.tgt: Set targ_osabi.
11440 * configure.ac: Define GOLD_DEFAULT_OSABI.
11441 * parameters.cc (Parameters::default_target): Pass
11442 GOLD_DEFAULT_OSABI to select_target.
11443 * target-select.h (class Target_selector): Make instantiate_target
11444 protected rather than private.
11445 * Makefile.am (HFILES): Add freebsd.h.
11446 * configure, Makefile.in, config.in: Rebuild.
11447
cb010894
ILT
11448 * merge.cc (do_add_input_section): Correct pend value. Change
11449 message about last entry not being null terminated from error to
11450 warning.
11451
0e879927
ILT
114522009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11453
11454 * incremental.cc: New file.
11455 * Makefile.am (CCFILES): Add incremental.cc.
11456 * Makefile.in: Rebuild.
11457
41105937
PP
114582009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11459
11460 * layout.cc (Layout::output_section_name): Preserve names
11461 of '.note.' sections.
e1df38aa 11462
60439920
ILT
114632009-03-19 Ian Lance Taylor <iant@google.com>
11464
11465 * descriptors.cc (Descriptors::open): Check that the options are
11466 valid before using them.
11467
0d371ad3
ILT
114682009-03-18 Ian Lance Taylor <iant@google.com>
11469
11470 * script-sections.h: Include <list>.
11471 (class Script_sections): Change Sections_elements from std::vector
11472 to std::list. Typedef public Elements_iterator. Add
11473 orphan_section_placement_, data_segment_align_start_, and
11474 saw_data_segment_align_ fields. Remove data_segment_align_index_
11475 field.
11476 * script-sections.cc (class Orphan_section_placement): New class.
11477 (class Sections_element): Add virtual functions is_relro and
11478 orphan_section_init. Remove virtual function place_orphan_here.
11479 (class Output_section_definition): Add is_relro and
11480 orphan_section_init. Remove place_orphan_here.
11481 (class Orphan_output_section): Likewise.
11482 (Script_sections::Script_sections): Update for field changes.
11483 (Script_sections::data_segment_align): Set saw_data_segment_align_
11484 and data_segment_align_start_, not data_segment_align_index.
11485 (Script_sections::data_segment_relro_end): Check
11486 saw_data_segment_align_. Use data_segment_align_start_ rather
11487 than data_segment_align_index_.
11488 (Script_sections::place_orphan): Rewrite to use
11489 Orphan_section_placement.
11490
9201d894
ILT
114912009-03-17 Ian Lance Taylor <iant@google.com>
11492
9c5b8369
ILT
11493 * archive.cc (Archive::add_symbols): Check for a version attached
11494 to the symbol name in the archive map.
11495 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11496 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11497 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11498 (ver_test_11.a): New target.
11499 * testsuite/Makefile.in: Rebuild.
11500
9201d894
ILT
11501 * configure.ac: Check for chsize and posix_fallocate. Replace
11502 ftruncate.
11503 * ftruncate.c: New file, from gnulib.
11504 * output.cc (posix_fallocate): Define dummy version if not
11505 HAVE_POSIX_FALLOCATE.
11506 (Output_file::map): Call posix_fallocate rather than lseek and
11507 write.
11508 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11509 * configure, Makefile.in, config.in: Rebuild.
11510
ef4ab7a8 115112009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11512
ef4ab7a8
PP
11513 * layout.h (Layout::create_note): Add section_name parameter.
11514 * layout.cc (Layout::create_note): Likewise.
11515 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11516
8c500701
ILT
115172009-03-17 Ian Lance Taylor <iant@google.com>
11518
e85b18e1
ILT
11519 * descriptors.cc: Include "options.h".
11520 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11521 (Descriptors::open): Always use O_CLOEXEC when opening a new
11522 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11523 then set FD_CLOEXEC.
11524
9efe6174
ILT
11525 * sparc.cc (class Target_sparc): Add has_got_section.
11526 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11527 make sure we have a GOT section.
11528
11529 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11530 (Target_sparc::Scan::local): Likewise.
11531 (Target_sparc::Scan::global): Likewise.
11532 (Target_sparc::Relocate::relocate): Likewise.
11533 (Target_sparc::Relocate::relocate_tls): Likewise.
11534
8c500701
ILT
11535 * symtab.cc (Symbol_table::define_default_version): New function,
11536 broken out of add_from_object.
11537 (Symbol_table::add_from_object): Call define_default_version.
11538 (Symbol_table::define_special_symbol): Add resolve_oldsym
11539 parameter. Change all callers. If the version for a symbol comes
11540 from a version script, resolve it with the symbol with the same
11541 name with no version. Also add the symbol without a version if
11542 appropriate.
11543 (do_define_in_output_data): If resolving with oldsym, don't delete
11544 sym.
11545 (do_define_in_output_segment): Likewise.
11546 (do_define_as_constant): Likewise.
11547 * symtab.h (class Symbol_table): Update declarations.
11548
f1ed28fb
ILT
115492009-03-13 Ian Lance Taylor <iant@google.com>
11550
15f8229b
ILT
11551 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11552 (Read_symbols::requeue): New function.
11553 (Read_symbols::do_read_symbols): If make_elf_object fails because
11554 the target type is not configured, and the file was searched for,
11555 issue a warning and retry with the next directory.
11556 (Add_symbols::run): If the file has an incompatible format, and
11557 it was searched for, requeue the Read_symbols task. On error,
11558 release the object.
11559 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11560 dirindex parameter to constructor. Change all callers. Declare
11561 incompatible_warning and requeue.
11562 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11563 input_argument_ and input_group_ fields. Add them to
11564 constructor. Change all callers.
11565 (class Read_script): Add dirindex_ field. Add it to constructor.
11566 Change all callers.
11567 * archive.cc (Archive::setup): Remove input_objects parameter.
11568 Change all callers.
11569 (Archive::get_file_and_offset): Likewise.
11570 (Archive::read_all_symbols): Likewise.
11571 (Archive::read_symbols): Likewise.
11572 (Archive::get_elf_object_for_member): Remove input_objects
11573 parameter. Add punconfigured parameter. Change all callers.
11574 (Archive::add_symbols): Change return type to bool. Check return
11575 value of include_member.
11576 (Archive::include_all_members): Likewise.
11577 (Archive::include_member): Change return type to bool. Return
11578 false if first included object has incompatible target. Set
11579 included_member_ field.
11580 (Add_archive_symbols::run): If add_symbols returns false, requeue
11581 Read_symbols task.
11582 * archive.h (class Archive): Add included_member_ field.
11583 Initialize it in constructor. Add input_file and searched_for
11584 methods. Update declarations.
11585 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11586 input_argument_ fields. Add them to constructor. Change all
11587 callers.
11588 * script.cc: Include "target-select.h".
11589 (class Parser_closure): Add skip_on_incompatible_target_ and
11590 found_incompatible_target_ fields. Add
11591 skip_on_incompatible_target parameter to constructor. Change all
11592 callers. Add methods skip_on_incompatible_target,
11593 clear_skip_on_incompatible_target, found_incompatible_target, and
11594 set_found_incompatible_target.
11595 (read_input_script): Add dirindex parameter. Change all callers.
11596 If parser finds an incompatible target, requeue Read_symbols
11597 task.
11598 (script_set_symbol): Clear skip_on_incompatible_target in
11599 closure.
11600 (script_add_assertion, script_parse_option): Likewise.
11601 (script_start_sections, script_add_phdr): Likewise.
11602 (script_check_output_format): New function.
11603 * script.h (read_input_script): Update declaration.
11604 * script-c.h (script_check_output_format): Declare.
11605 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11606 (ignore_cmd): Remove OUTPUT_FORMAT.
11607 * fileread.cc (Input_file::Input_file): Add explicit this.
11608 (Input_file::will_search_for): New function.
11609 (Input_file::open): Add pindex parameter. Change all callers.
11610 * fileread.h (class Input_file): Add input_file_argument method.
11611 Declare will_search_for. Update declarations.
11612 * object.cc (make_elf_object): Add punconfigured parameter.
11613 Change all callers.
11614 * object.h (class Object): Make input_file public. Add
11615 searched_for method.
11616 (make_elf_object): Update declaration.
11617 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11618 restart search.
11619 * dirsearch.h (class Dirsearch): Update declaration.
11620 * options.h (class General_options): Add --warn-search-mismatch.
11621 * parameters.cc (Parameters::is_compatible_target): New function.
11622 * parameters.h (class Parameters): Declare is_compatible_target.
11623 * workqueue.cc (Workqueue::add_blocker): New function.
11624 * workqueue.h (class Workqueue): Declare add_blocker.
11625
f1ed28fb
ILT
11626 * fileread.cc (Input_file::open): Remove options parameter.
11627 Change all callers.
11628 (Input_file::open_binary): Likewise.
11629 * script.cc (read_input_script): Likewise.
11630 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11631 options parameter from constructor. Change all callers.
11632 (class Read_script): Likewise.
11633 * fileread.h (class Input_file): Update declarations.
11634 * script.h (read_input_script): Update declaration.
11635
34dd024a
NC
116362009-03-10 Nick Clifton <nickc@redhat.com>
11637
11638 * po/es.po: New Spanish translation.
11639
6d71b17c
CC
116402009-03-06 Cary Coutant <ccoutant@google.com>
11641
11642 * options.cc (parse_short_option): Keep dash_z from registering itself.
11643
031cdbed
ILT
116442009-03-03 Ian Lance Taylor <iant@google.com>
11645
11646 PR 9918
11647 * target-reloc.h (relocate_section): Pass output_section to
11648 relocate.
11649 * i386.cc (Target_i386::should_apply_static_reloc): Add
11650 output_section parameter. Change all callers.
11651 (Target_i386::Relocate::relocate): Add output_section parameter.
11652 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11653 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11654 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11655 * testsuite/two_file_shared.sh: New script.
11656 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11657 (check_DATA): Add two_file_shared.dbg.
11658 (two_file_shared.dbg): New target.
11659 * testsuite/Makefile.in: Rebuild.
11660
15d5fa16
ILT
116612009-03-01 Ian Lance Taylor <iant@google.com>
11662
11663 * configure.ac: Check for byteswap.h.
11664 * configure: Rebuild.
11665 * config.in: Rebuild.
11666
8a4c0b0d
ILT
116672009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11668
11669 * layout.cc (Layout::find_or_add_kept_section): New function.
11670 (Layout::add_comdat): Removed.
11671 * layout.h (struct Kept_section): Move out of class Layout.
11672 Remove trailing underscores from field names. Add group_sections
11673 field. Rename group_ field to is_group. Change all uses.
11674 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11675 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11676 comdat_groups_ field.
11677 (Sized_relobj::include_section_group): Use
11678 find_or_add_kept_section and Kept_section::group_sections.
11679 (Sized_relobj::include_linkonce_section): Likewise.
11680 * object.cc (class Sized_relobj): Don't define Comdat_group or
11681 Comdat_group_table. Remove find_comdat_group and
11682 add_comdat_group. Remove comdat_groups_ field.
11683 * plugin.cc (include_comdat_group): Use
11684 Layout::find_or_add_kept_section.
11685
b4ecf66b
ILT
116862009-02-28 Ian Lance Taylor <iant@google.com>
11687
14359ca0
ILT
11688 * README: --gc-sections and map files are now supported. Document
11689 some build requirements.
11690
b4ecf66b
ILT
11691 PR 6992
11692 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11693 relocatable link set the value of the section symbol to zero.
11694 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11695 relocatable link don't include the section address in the local
11696 symbol value.
11697
0602e05a
ILT
116982009-02-27 Ian Lance Taylor <iant@google.com>
11699
fd9d194f
ILT
11700 PR 6811
11701 * options.h (class Search_directory): Add is_system_directory.
11702 (class General_options): Declare is_in_system_directory.
11703 * options.cc (get_relative_sysroot): Make static.
11704 (get_default_sysroot): Make static.
11705 (General_optoins::is_in_system_directory): New function.
11706 * fileread.cc (Input_file::is_in_system_directory): New function.
11707 * fileread.h (class Input_file): Declare is_in_system_directory.
11708 * object.h (class Object): Add is_in_system_directory.
11709 (class Input_objects): Remove system_library_directory_ field.
11710 * object.cc (Input_objects::add_object): Don't set
11711 system_library_directory_.
11712 (input_objects::found_in_system_library_directory): Remove.
11713 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11714 parameter. Change all callers.
11715 (Symbol_table::sized_write_globals): Likewise.
11716 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11717 Call Object::is_in_system_directory.
11718 * symtab.h (class Symbol_table): Update declarations.
11719
61edd21f
ILT
11720 PR 5990
11721 * descriptors.h (Open_descriptor): Add is_on_stack field.
11722 * descriptors.cc (Descriptors::open): If the descriptor is on the
11723 top of the stack, remove it. Initialize is_on_stack field.
11724 (Descriptors::release): Only add pod to stack if it is not on the
11725 stack already.
11726 (Descriptors::close_some_descriptor): Clear stack_next and
11727 is_on_stack fields.
11728
e29e076a
ILT
11729 PR 7091
11730 * output.cc (Output_section::find_starting_output_address): Rename
11731 from starting_output_address; add PADDR parameter; change return
11732 type.
11733 * output.h (class Output_section): Declare
11734 find_starting_output_address instead of starting_output_address.
11735 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11736 section symbol for which we can't find a merge section.
11737
0602e05a
ILT
11738 PR 9836
11739 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11740 hidden or internal, force the symbol to be local.
11741 * resolve.cc (Symbol::override_visibility): Define.
11742 (Symbol::override_base): Use override_visibility.
11743 (Symbol_table::resolve): Likewise.
11744 (Symbol::override_base_with_special): Likewise.
11745 (Symbol_table::override_with_special): If the visibility is hidden
11746 or internal, force the symbol to be local.
11747 * symtab.h (class Symbol): Add set_visibility and
11748 override_visibility.
11749 * testsuite/ver_test_1.sh: New file.
11750 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11751 (check_DATA): Add ver_test_1.syms.
11752 (ver_test_1.syms): New target.
11753 * testsuite/Makefile.in: Rebuild.
11754
401a9a73
CC
117552009-02-25 Cary Coutant <ccoutant@google.com>
11756
11757 * layout.cc (Layout::choose_output_section): Don't rename sections
11758 when using a linker script that has a SECTIONS clause.
11759 * Makefile.in: Regenerate.
11760
11761 * testsuite/Makefile.am (script_test_5.sh): New test case.
11762 * testsuite/Makefile.in: Regenerate.
11763 * testsuite/script_test_5.cc: New file.
11764 * testsuite/script_test_5.sh: New file.
11765 * testsuite/script_test_5.t: New file.
11766
f488e4b0
CC
117672009-02-13 Rafael Avila de Espindola <espindola@google.com>
11768
11769 * archive.cc (Archive::include_member): Update calls to add_symbols.
11770 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11771 the Layout argument.
11772 * dynobj.h (do_add_symbols): Add the Layout argument.
11773 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11774 Layout argument.
11775 * object.h (Object::add_symbols): Add the Layout argument.
11776 (Object::do_add_symbols): Add the Layout argument.
11777 (Sized_relobj::do_add_symbols): Add the Layout argument.
11778 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11779 Unify the two versions.
11780 (Add_plugin_symbols): Remove.
11781 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11782 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11783 (Add_plugin_symbols): Remove.
11784 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11785 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11786 (Add_symbols::run): Make it work with Pulginobj.
11787
89dd1680
ILT
117882009-02-06 Ian Lance Taylor <iant@google.com>
11789
11790 * object.cc (Sized_relobj::do_layout): Make info message start
11791 with lower case letter.
11792
266d0a74
ILT
117932009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11794
602b464e
ILT
11795 * binary.cc: Fix file comment.
11796
266d0a74
ILT
11797 * options.h (enum Incremental_disposition): Define.
11798 (class General_options): Add new options: --incremental,
11799 --incremental_changed, --incremental_unchanged,
11800 --incremental_unknown. Add incremental_disposition_ and
11801 implicit_incremental_ fields.
11802 (General_options::incremental_disposition): New function.
11803 (class Position_dependent_options): Add incremental_disposition
11804 option.
11805 (Position_dependent_options::copy_from_options): Set incremental
11806 dispositions.
11807 * options.cc (General_options::parse_incremental_changed): New
11808 function.
2e702c99
RM
11809 (General_options::parse_incremental_unchanged): New function.
11810 (General_options::parse_incremental_unknown): New function.
11811 (General_options::General_options): Initialize new fields
266d0a74 11812 incremental_disposition_ and implicit_incremental_.
2e702c99 11813 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11814 without --incremental.
11815
f073bbf7
CD
118162009-02-06 Chris Demetriou <cgd@google.com>
11817
11818 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11819 pointer and to report location as the file name associated with
11820 the symbol.
11821 (gold_undefined_symbol_at_location): New function to replace the
11822 old gold_undefined_symbol functionality.
11823 * target-reloc.h (relocate_section): Update to use
11824 gold_undefined_symbol_at_location.
11825 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11826 Call gold_undefined_symbol function rather than gold_error.
11827 * errors.h (Errors::undefined_symbol): Take location as a
11828 string, rather than calculating it from a relocation.
11829 * errors.cc (Errors::fatal): Print "fatal error:" before the
11830 formatted message.
11831 (Errors::error, Errors::error_at_location): Print "error: "
11832 before the formatted message.
11833 (Errors::undefined_symbol): Take location as a string, rather
11834 than calculating it from a relocation.
11835 (gold_undefined_symbol_at_location): New function akin to
11836 old gold_undefined_symbol, calculates location from relocation.
11837 (gold_undefined_symbol): Change to take only a Symbol pointer
11838 and to report location as the file name associated with the symbol.
11839 * testsuite/debug_msg.sh: Update for changed error messages.
11840 * testsuite/undef_symbol.sh: Likewise.
11841
8e94a90c
ILT
118422009-02-04 Duncan Sands <baldrick@free.fr>
11843
11844 PR 9812
11845 * reduced_debug_output.h
11846 (Output_reduced_debug_abbrev_section::failed): Use format for
11847 gold_warning.
11848 (Output_reduced_debug_info_section::faild): Likewise.
11849
88a0e15b
ILT
118502009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11851
11852 * script.cc (Lazy_demangler): New class.
2e702c99 11853 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11854 symbol only once.
11855
5efc7cd2
CC
118562009-01-29 Cary Coutant <ccoutant@google.com>
11857
11858 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11859 to __tls_get_addr.
11860 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11861
e0ebcf42
ILT
118622009-01-28 Ian Lance Taylor <iant@google.com>
11863
5efc7cd2 11864 * version.cc (version_string): Bump to 1.9.
75fe7426 11865
e0ebcf42
ILT
11866 * gold.h: Include <cstring> and <stdint.h>.
11867 * version.cc: Include <cstdio>.
11868 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11869 warning.
11870 * reduced_debug_output.cc (insert_into_vector): Rename from
11871 Insert_into_vector; change all callers. Use Swap_unaligned to
11872 avoid aliasing issue; remove union since it is unnecessary.
11873
8e2813be 118742009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11875
11876 * Makefile.am (CCFILES): Add gc.cc.
11877 (HFILES): Add gc.h.
11878 * Makefile.in: Regenerate.
11879 * gold.cc (Gc_runner): New class.
11880 (queue_initial_tasks): Call garbage collection related tasks
11881 when corresponding options are invoked.
11882 (queue_middle_gc_tasks): New function.
11883 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11884 processed early before laying out sections during garbage collection.
11885 * gold.h (queue_middle_gc_tasks): New function.
11886 (is_prefix_of): Move from "layout.cc".
11887 * i386.cc (Target_i386::gc_process_relocs): New function.
11888 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11889 * main.cc (main): Create object of class "Garbage_collection".
11890 * object.cc (Relobj::copy_symbols_data): New function.
11891 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11892 (Sized_relobj::do_layout): Allow this function to be called twice
11893 during garbage collection and defer layout of section during the
6d03d481
ST
11894 first call.
11895 * object.h (Relobj::get_symbols_data): New function.
11896 (Relobj::is_section_name_included): New function.
11897 (Relobj::copy_symbols_data): New function.
11898 (Relobj::set_symbols_data): New function.
11899 (Relobj::get_relocs_data): New function.
11900 (Relobj::set_relocs_data): New function.
11901 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11902 (Relobj::gc_process_relocs): New function.
11903 (Relobj::do_gc_process_relocs): New pure virtual function.
11904 (Relobj::sd_): New data member.
11905 (Sized_relobj::is_output_section_offset_invalid): New function.
11906 (Sized_relobj::do_gc_process_relocs): New function.
11907 * options.h (General_options::gc_sections): Modify to not be a no-op.
11908 (General_options::print_gc_sections): New option.
11909 * plugin.cc (Plugin_finish::run): Remove function call to
11910 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11911 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11912 * reloc.cc (Read_relocs::run): Add task to process relocs and
11913 determine unreferenced sections when doing garbage collection.
11914 (Gc_process_relocs): New class.
11915 (Sized_relobj::do_gc_process_relocs): New function.
11916 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11917 sections that are garbage collected.
11918 * reloc.h (Gc_process_relocs): New class.
11919 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11920 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11921 symbols whose corresponding sections are garbage collected.
11922 (Symbol_table::Symbol_table): Add new parameter for the garbage
11923 collection object.
11924 (Symbol_table::gc_mark_undef_symbols): New function.
11925 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11926 (Symbol_table::gc_mark_dyn_syms): New function.
11927 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11928 as garbage.
11929 (Symbol_table::add_from_object): Likewise.
11930 (Symbol_table::add_from_relobj): When building shared objects, do not
11931 treat externally visible symbols as garbage.
11932 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11933 table information for static and relocatable links.
11934 * symtab.h (Symbol_table::set_gc): New function.
11935 (Symbol_table::gc): New function.
11936 (Symbol_table::gc_mark_undef_symbols): New function.
11937 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11938 (Symbol_table::gc_mark_dyn_syms): New function.
11939 (Symbol_table::gc_): New data member.
e1df38aa 11940 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11941 function.
11942 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11943 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11944
3b293544
CF
119452009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11946
11947 * options.h (General_options::gc_sections): Define as a no-op for now.
11948 (General_options::no_keep_memory): Ditto.
11949 (General_options::Bshareable): Define.
11950 * options.cc (General_options::finalize): Honor -Bshareable.
11951
83d22aa8
AS
119522009-01-20 Andreas Schwab <schwab@suse.de>
11953
11954 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11955 read the value in the contents, since we don't use it. Use the
11956 template endianness when writing.
11957 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11958
cd536b21
AS
119592009-01-19 Andreas Schwab <schwab@suse.de>
11960
11961 * configure.tgt (powerpc64-*): Fix targ_obj.
11962
99e9a495
ILT
119632009-01-15 Ian Lance Taylor <iant@google.com>
11964
11965 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11966 local symbols when stripping all symbols.
11967
bbbfea06
CC
119682009-01-14 Cary Coutant <ccoutant@google.com>
11969
99e9a495 11970 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11971
0f7c0701
CC
119722009-01-14 Cary Coutant <ccoutant@google.com>
11973
11974 * archive.cc (Archive::get_elf_object_for_member): Remove call
11975 to File_read::claim_for_plugin.
11976 * descriptors.cc (Descriptors::open): Remove reference to
11977 is_claimed.
11978 (Descriptors::claim_for_plugin): Remove.
11979 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11980 (Descriptors::is_claimed): Remove.
11981 (claim_descriptor_for_plugin): Remove.
11982 * fileread.cc (File_read::claim_for_plugin): Remove.
11983 * fileread.h (File_read::claim_for_plugin): Remove.
11984 (File_read::descriptor): Reopen descriptor if necessary.
11985 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11986 (Plugin_manager::all_symbols_read): Add task parameter. Change
11987 all callers.
11988 (Plugin_manager::get_input_file): New function.
11989 (Plugin_manager::release_input_file): New function.
11990 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11991 corresponding data member.
11992 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11993 and pass to base constructor. Change all callers.
11994 (get_input_file, release_input_file): New functions.
11995 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11996 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11997 (Plugin_manager::all_symbols_read): Add task parameter.
11998 (Plugin_manager::get_input_file): New function.
11999 (Plugin_manager::release_input_file): New function.
12000 (Plugin_manager::task_): New data member.
12001 (Pluginobj::Pluginobj): Add filesize parameter.
12002 (Pluginobj::filename): New function.
12003 (Pluginobj::descriptor): New function.
12004 (Pluginobj::filesize): New function.
12005 (Pluginobj::filesize_): New data member.
12006 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12007 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12008 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12009
12010 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12011 with archive libraries.
12012 * testsuite/Makefile.in: Regenerate.
12013 * testsuite/plugin_test.c (struct sym_info): New type.
12014 (get_input_file, release_input_file): New static variables.
12015 (onload): Capture new transfer vector entries.
12016 (claim_file_hook): Stop reading at end of file according to filesize.
12017 Factor out parsing of readelf output into separate function.
12018 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12019 APIs and get the source file name from the symbol table. Convert
12020 source file name to corresponding object file name. Print info
12021 message when adding new input files.
12022 (parse_readelf_line): New function.
12023 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12024 * testsuite/plugin_test_2.sh: Likewise.
12025 * testsuite/plugin_test_3.sh: Likewise.
12026 * testsuite/plugin_test_4.sh: New test case.
12027
62a6d109
ILT
120282009-01-07 Ian Lance Taylor <iant@google.com>
12029
12030 * version.cc (version_string): Bump to 1.8.
12031
483620e8
CC
120322008-12-23 Cary Coutant <ccoutant@google.com>
12033
12034 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12035 * plugin.cc (Plugin_manager::finish): Rename as
12036 layout_deferred_objects. Move cleanup to separate function.
12037 (Plugin_manager::cleanup): New function.
12038 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12039 separately.
12040 * plugin.h (Plugin_manager::finish): Rename as
12041 layout_deferred_objects.
12042 (Plugin_manager::cleanup): New function.
12043 (Plugin_manager::cleanup_done): New field.
12044
d66a9eb3
CC
120452008-12-23 Cary Coutant <ccoutant@google.com>
12046
12047 * plugin.cc (is_visible_from_outside): New function.
12048 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12049 so we don't return "IR only" status for exported symbols or -r links.
12050
12051 * testsuite/Makefile.am (plugin_test_3): New test case.
12052 * testsuite/Makefile.in: Regenerate.
12053 * testsuite/plugin_test_3.sh: New file.
12054
5995b570
CC
120552008-12-22 Cary Coutant <ccoutant@google.com>
12056
12057 * object.cc (Sized_relobj::layout_section): New function.
12058 (Sized_relobj::do_layout): Defer layout of input sections until after
12059 plugin has provided replacement files.
12060 (Sized_relobj::do_layout_deferred_sections): New function.
12061 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12062 (Relobj::layout_deferred_sections): New function.
12063 (Relobj::do_layout_deferred_sections): New function.
12064 (Sized_relobj::do_layout_deferred_sections): New function.
12065 (Sized_relobj::layout_section): New function.
12066 (Sized_relobj::Deferred_layout): New structure.
12067 (Sized_relobj::deferred_layout_): New field.
12068 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12069 Change all callers. Layout deferred sections.
12070 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12071 references.
12072 (Plugin_hook::run): Move code from do_plugin_hook inline.
12073 (Plugin_hook::do_plugin_hook): Remove.
12074 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12075 (Plugin_manager::finish): Renamed, was cleanup.
12076 (Plugin_manager::should_defer_layout): New function.
12077 (Plugin_manager::add_deferred_layout_object): New function.
12078 (Plugin_manager::Deferred_layout_list): New type.
12079 (Plugin_manager::deferred_layout_objects_): New field.
12080 (Plugin_hook::do_plugin_hook): Remove.
12081
ee769c88
ILT
120822008-12-17 Ian Lance Taylor <iant@google.com>
12083
12084 * options.h (class General_options): Add --no case for
12085 --export-dynamic.
12086
abc8dcba
CC
120872008-12-16 Cary Coutant <ccoutant@google.com>
12088
12089 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12090 vector.
12091 (Plugin_manager::claim_file): Create plugin object even if
12092 plugin did not call the add_symbols callback.
12093 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12094 asking for more symbols than were added.
12095 * testsuite/Makefile.am (plugin_test_1): Add test case with
12096 no global symbols.
12097 (empty.syms): New target.
12098 * testsuite/Makefile.in: Regenerate.
12099 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12100 message. Don't call add_symbols if no globals.
12101 (all_symbols_read_hook): Don't provide replacement for empty
12102 claimed file.
12103
b0074644
ILT
121042008-12-12 Ian Lance Taylor <iant@google.com>
12105
68943102
ILT
12106 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12107 r_type == 0 for a local symbol with r_sym == 0.
12108 (scan_relocatable_relocs): Pass r_sym to
12109 local_non_section_strategy.
12110 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12111 r_sym parameter.
12112
b0074644
ILT
12113 * configure.ac: Update test for TLS descriptors: they are
12114 supported as of glibc 2.9.
12115 * configure: Rebuild.
12116
c2508178
ILT
121172008-12-11 Ian Lance Taylor <iant@google.com>
12118
12119 PR 7091
12120 * target-reloc.h (Default_scan_relocatable_relocs): For each
12121 function, map r_type == 0 to RELOC_DISCARD.
12122
2756a258
CC
121232008-12-10 Cary Coutant <ccoutant@google.com>
12124
12125 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12126 object to override a kept COMDAT group from a plugin object.
12127
bb6f53d3
ILT
121282008-12-09 Ian Lance Taylor <iant@google.com>
12129
fbc558e1
ILT
12130 PR 7088
12131 * yyscript.y (file_cmd): Handle INPUT.
12132
bb6f53d3
ILT
12133 * testsuite/initpri1.c: Change all declarations to be full
12134 prototypes by adding void, to avoid compiler warnings.
12135
4674ecfc
CC
121362008-12-05 Rafael Avila de Espindola <espindola@google.com>
12137
12138 * options.cc (General_options::parse_plugin_opt): New.
12139 (General_options::add_plugin): The argument now is just the filename.
12140 (General_options::add_plugin_option): New.
12141 * options.h (plugin_opt): New.
12142 (add_plugin): Change argument name.
12143 (add_plugin_option): New.
12144 * plugin.cc (Plugin::load): Don't parse the plugin option.
12145 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12146 (Plugin::add_option): New.
12147 (Plugin::args_): Change type.
12148 (Plugin::filename_): New.
12149 (Plugin_manager::add_plugin_option): New.
12150 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12151 * testsuite/Makefile.in: Regenerate.
12152
fd06b4aa
CC
121532008-12-05 Cary Coutant <ccoutant@google.com>
12154
12155 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12156 Handle --strip-lto-sections option.
12157 * options.h (strip_lto_sections): New option.
12158
6c52134c
CC
121592008-12-01 Cary Coutant <ccoutant@google.com>
12160
12161 * plugin.cc (ld_plugin_message): Change format parameter to const.
12162 Fix mismatch between new[] and delete.
12163
a45248e0
CC
121642008-11-14 Cary Coutant <ccoutant@google.com>
12165
12166 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12167 instead of -1U.
12168
c82fbeee
CS
121692008-11-05 Craig Silverstein <csilvers@google.com>
12170
12171 * options.cc (General_options::parse_dynamic_list): New function.
12172 * options.h (General_options): New flags dynamic_list,
12173 dynamic_list_data, dynamic_list_cpp_new, and
12174 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12175 (General_options::in_dynamic_list): New function.
12176 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12177 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12178 (Lex::can_continue_name): Likewise.
12179 (yylex): Likewise.
12180 (read_script_file): New parameter script_options.
12181 (read_dynamic_list): New function.
12182 (Script_options::define_dynamic_list): New function.
12183 (dynamic_list_keyword_parsecodes): New variable.
12184 (dynamic_list_keywords): New variable.
12185 * script.h (Script_options::define_dynamic_list): New function
12186 prototype.
12187 (read_dynamic_list): New function prototype.
12188 * symtab.cc (strprefix): New macro.
12189 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12190 dynamic_list_data, dynamic_list_cpp_new, and
12191 dynamic_list_cpp_typeinfo.
12192 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12193 (dynamic_list_expr): New rule.
12194 (dynamic_list_nodes): Likewise.
12195 (dynamic_list_node): Likewise.
12196 * testsuite/Makefile.am (dynamic_list): New test.
12197 * testsuite/Makefile.in: Regenerated.
12198 * testsuite/dynamic_list.t: New file.
12199 * testsuite/dynamic_list.sh: New file.
12200
e0bb29a5
CS
122012008-11-05 Craig Silverstein <csilvers@google.com>
12202
12203 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12204 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12205 (t11_last): Likewise.
12206 * testsuite/ver_test_6.c (main): Likewise.
12207
4e1e25e0
CC
122082008-10-07 Cary Coutant <ccoutant@google.com>
12209
12210 * options.c (General_options::finalize): Add check for -static and
12211 -shared.
12212 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12213 is not empty.
12214
92f03fcb
CC
122152008-10-02 Cary Coutant <ccoutant@google.com>
12216
12217 * plugin.cc (make_sized_plugin_object): Fix conditional
12218 compilation to work when not all targets are enabled.
12219
fbd8a257
CC
122202008-09-29 Cary Coutant <ccoutant@google.com>
12221
12222 * archive.cc (Archive::get_file_and_offset): Use filename instead
12223 of name to get library path.
12224 (Archive::include_member): Unlock external member of a thin archive.
12225
12226 * testsuite/Makefile.am (TEST_AR): New variable.
12227 (thin_archive_test_1): New test.
12228 (thin_archive_test_2): New test.
81636b3f
CC
12229 * testsuite/Makefile.in: Regenerate.
12230 * testsuite/thin_archive_main.cc: New file.
12231 * testsuite/thin_archive_test_1.cc: New file.
12232 * testsuite/thin_archive_test_2.cc: New file.
12233 * testsuite/thin_archive_test_3.cc: New file.
12234 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12235
eff45813
CC
122362008-09-29 Cary Coutant <ccoutant@google.com>
12237
12238 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12239 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12240 instead of -1U.
12241 (Sized_relobj::do_finalize_local_symbols): Likewise.
12242 (Sized_relobj::map_to_kept_section): Likewise.
12243 * object.h (Sized_relobj::invalid_address): New constant.
12244 (Sized_relobj::do_output_section_offset): Check for invalid_address
12245 and return -1ULL.
12246 * output.cc (Output_reloc::local_section_offset): Use constant
12247 invalid_address instead of -1U.
12248 (Output_reloc::get_address): Likewise.
12249 (Output_section::output_address): Change -1U to -1ULL.
12250 * output.h (Output_reloc::invalid_address): New constant.
12251 * reloc.cc (Sized_relobj::write_sections): Use constant
12252 invalid_address instead of -1U.
12253 (Sized_relobj::relocate_sections): Likewise.
12254 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12255 values for merge sections.
12256 * target-reloc.h (relocate_for_relocatable): Use constant
12257 invalid_address instead of -1U.
12258
89fc3421
CC
122592008-09-19 Cary Coutant <ccoutant@google.com>
12260
12261 Add plugin functionality for link-time optimization (LTO).
12262 * configure.ac (plugins): Add --enable-plugins option.
12263 * configure: Regenerate.
12264 * config.in: Regenerate.
12265 * Makefile.am (LIBDL): New variable.
12266 (CCFILES): Add plugin.cc.
12267 (HFILES): Add plugin.h.
12268 (ldadd_var): Add LIBDL.
12269 * Makefile.in: Regenerate.
12270
12271 * archive.cc: Include "plugin.h".
12272 (Archive::setup): Don't preread archive symbols when using a plugin.
12273 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12274 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12275 files.
12276 (Archive::include_member): Add symbols from plugin objects.
12277 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12278 * descriptors.cc (Descriptors::open): Check for file descriptors
12279 abandoned by plugins.
12280 (Descriptors::claim_for_plugin): New function.
12281 * descriptors.h (Descriptors::claim_for_plugin): New function.
12282 (Open_descriptor::is_claimed): New field.
12283 (claim_descriptor_for_plugin): New function.
12284 * fileread.cc (File_read::claim_for_plugin): New function.
12285 * fileread.h (File_read::claim_for_plugin): New function.
12286 (File_read::descriptor): New function.
12287 * gold.cc: Include "plugin.h".
12288 (queue_initial_tasks): Add task to call plugin hooks for generating
12289 new object files.
12290 * main.cc: Include "plugin.h".
12291 (main): Load plugin libraries.
12292 * object.h (Pluginobj): Declare.
12293 (Object::pluginobj): New function.
12294 (Object::do_pluginobj): New function.
12295 (Object::set_target): New function.
12296 * options.cc: Include "plugin.h".
12297 (General_options::parse_plugin): New function.
12298 (General_options::General_options): Initialize plugins_ field.
12299 (General_options::add_plugin): New function.
12300 * options.h (Plugin_manager): Declare.
12301 (General_options): Add --plugin option.
12302 (General_options::has_plugins): New function.
12303 (General_options::plugins): New function.
12304 (General_options::add_plugin): New function.
12305 (General_options::plugins_): New field.
12306 * plugin.cc: New file.
12307 * plugin.h: New file.
12308 * readsyms.cc: Include "plugin.h".
12309 (Read_symbols::do_read_symbols): Check for archive before checking
12310 for ELF file. Call plugin hooks to claim files.
12311 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12312 from a real object file; force override when processing replacement
12313 files.
12314 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12315 (Symbol::init_base_object): Likewise.
12316 (Symbol::init_base_output_data): Likewise.
12317 (Symbol::init_base_output_segment): Likewise.
12318 (Symbol::init_base_constant): Likewise.
12319 (Symbol::init_base_undefined): Likewise.
12320 (Symbol::output_section): Assert that object is not a plugin.
12321 (Symbol_table::add_from_pluginobj): New function.
12322 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12323 undefined.
12324 (Symbol_table::sized_write_globals): Likewise.
12325 (Symbol_table::add_from_pluginobj): Instantiate template.
12326 * symtab.h (Sized_pluginobj): Declare.
12327 (Symbol::in_real_elf): New function.
12328 (Symbol::set_in_real_elf): New function.
12329 (Symbol::in_real_elf_): New field.
12330 (Symbol_table::add_from_pluginobj): New function.
12331
12332 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12333 (LIBDL): New variable.
12334 (LDADD): Add LIBDL.
12335 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12336 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12337 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12338 (MOSTLYCLEANFILES): Likewise.
12339 * testsuite/Makefile.in: Regenerate.
12340 * testsuite/plugin_test.c: New file.
12341 * testsuite/plugin_test_1.sh: New file.
12342 * testsuite/plugin_test_2.sh: New file.
12343
de31bda5
ILT
123442008-09-16 Ian Lance Taylor <iant@google.com>
12345
9c2d0ef9
ILT
12346 * target-reloc.h (relocate_section): Check whether a symbol is
12347 defined by the ABI before reporting an undefined symbol error.
12348 * target.h (Target::is_defined_by_abi): Make parameter const.
12349 (Target::do_is_defined_by_abi): Likewise.
12350 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12351 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12352 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12353 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12354 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12355 * testsuite/Makefile.in: Rebuild.
12356
de31bda5
ILT
12357 * fileread.cc (make_view): Add casts to avoid warning.
12358
9fa33bee
AO
123592008-09-16 Alexandre Oliva <aoliva@redhat.com>
12360
12361 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12362 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12363
183fd0e3
AO
123642008-09-16 Alexandre Oliva <aoliva@redhat.com>
12365
12366 * options.h (General_options::output_is_executable): New.
12367 (General_options::output_is_pie): New.
12368 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12369 for shared libraries.
12370 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12371
7be8330a
CD
123722008-09-11 Chris Demetriou <cgd@google.com>
12373
12374 * options.h (origin): New -z option.
12375 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12376 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12377 in DT_FLAGS_1.
12378
a9caad02
CC
123792008-09-05 Cary Coutant <ccoutant@google.com>
12380
12381 * fileread.cc (File_read::make_view): Add check for attempt to map
12382 beyond end of file.
12383
ae6dce4d
CC
123842008-09-05 Cary Coutant <ccoutant@google.com>
12385
12386 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12387 explicit instantiations.
12388
d7ab2a47
KVH
123892008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12390
12391 PR gold/6858
12392 * options.cc (General_options::finalize): Allow undefined symbols
12393 in shlibs if linking -shared.
12394
12395 PR gold/6859
12396 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12397 symbols as not needing a dynsym entry.
12398
1e52a9c1
CS
123992008-08-20 Craig Silverstein <csilvers@google.com>
12400
12401 * fileread.cc (File_read::open): Do not lock the file unless it
12402 was successfully opened.
12403
d85c80a3
CC
124042008-08-14 Cary Coutant <ccoutant@google.com>
12405
12406 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12407 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12408 * testsuite/tls_test.cc (struct int128): 128-bit struct
12409 for testing TLS relocs with non-zero addend.
12410 (v12): New TLS variable.
12411 (t12): New test.
12412 (t_last): Add check for v12.
12413 * testsuite/tls_test.h (t12): New function.
12414 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12415
2d924fd9
ILT
124162008-08-13 Ian Lance Taylor <iant@google.com>
12417
12418 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12419 set tls_segment_ or relro_segment_.
12420 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12421 when appropriate.
12422 * output.h (Output_section::clear_is_relro): New function.
12423 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12424 sections specially even when output_data_ is empty.
12425 (Output_segment::maximum_alignment): When first section is relro,
12426 only force alignment for PT_LOAD segments.
12427 * script.cc (script_data_segment_align): New function.
12428 (script_data_segment_relro_end): New function.
12429 * script-c.h (script_data_segment_align): Declare.
12430 (script_data_segment_relro_end): Declare.
12431 * script-sections.h (class Script_sections): Declare
12432 data_segment_align and data_segment_relro_end. Add fields
12433 segment_align_index_ and saw_relro_end_.
12434 * script-sections.cc (class Sections_element): Add set_is_relro
12435 virtual function. Add new bool* parameter to place_orphan_here.
12436 Add get_output_section virtual function.
12437 (class Output_section_definition): Add set_is_relro. Add new
12438 bool* parameter to place_orphan_here. Add get_output_section.
12439 Add is_relro_ field.
12440 (Output_section_definition::Output_section_definition): Initialize
12441 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12442 and is_relro_ fields.
12443 (Output_section_definition::place_orphan_here): Add is_relro
12444 parameter.
12445 (Output_section_definition::set_section_addresses): Set relro for
12446 output section.
12447 (Output_section_definition::alternate_constraint): Likewise.
12448 (class Orphan_output_section): Add new bool* parameter to
12449 place_orphan_here. Add get_output_section.
12450 (Orphan_output_section::place_orphan_here): Add is_relro
12451 parameter.
12452 (Script_sections::Script_sections): Initialize
12453 data_segment_align_index_ and saw_relro_end_.
12454 (Script_sections::data_segment_align): New function.
12455 (Script_sections::data_segment_relro_end): New function.
12456 (Script_sections::place_orphan): Set or clear is_relro.
12457 (Script_sections::set_section_addresses): Force alignment of first
12458 TLS section.
12459 * yyscript.y (exp): Call script_data_segment_align and
12460 script_data_segment_relro_end.
12461 * testsuite/relro_script_test.t: New file.
12462 * testsuite/relro_test.cc (using_script): Declare.
12463 (t1, t2): Test using_script.
12464 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12465 (relro_script_test_SOURCES): Define.
12466 (relro_script_test_DEPENDENCIES): Define.
12467 (relro_script_test_LDFLAGS): Define.
12468 (relro_script_test_LDADD): Define.
12469 (relro_script_test.so): New target.
12470 * testsuite/Makefile.in: Rebuild.
12471
f827c9a9
CC
124722008-08-06 Cary Coutant <ccoutant@google.com>
12473
12474 * archive.cc (Archive::total_archives, Archive::total_members)
12475 (Archive::total_members_loaded): New variables.
12476 (Archive::setup): Add parameter. Add option to preread
12477 archive symbols.
12478 (Archive::read_armap): Add counter.
12479 (Archive::get_file_and_offset): New function.
12480 (Archive::get_elf_object_for_member): New function.
12481 (Archive::read_all_symbols): New function.
12482 (Archive::read_symbols): New function.
12483 (Archive::add_symbols): Add counters.
12484 (Archive::include_all_members): Use armap to find members if it's
12485 already built.
12486 (Archive::include_member): Skip reading symbols if already read.
12487 Factored code into Archive::get_file_and_offset and
12488 Archive::get_elf_object_for_member. Changed call to
12489 Mapfile::report_include_archive_member.
12490 (Archive::print_stats): New function.
12491 * archive.h: Declare Object and Read_symbols_data classes.
12492 (Archive::Archive): Add initializers for new members.
12493 (Archive::setup): Add parameter.
12494 (Archive::print_stats): New function.
12495 (Archive::total_archives, Archive::total_members)
12496 (Archive::total_members_loaded): New variables.
12497 (Archive::get_file_and_offset): New function.
12498 (Archive::get_elf_object_for_member): New function.
12499 (Archive::read_all_symbols): New function.
12500 (Archive::read_symbols): New function.
12501 (Archive::Archive_member): New class.
12502 (Archive::members_): New member.
12503 (Archive::num_members_): New member.
12504 * main.cc: Include archive.h.
12505 (main): Call Archive::print_stats.
12506 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12507 archive parameter; member_name is now the fully-decorated name.
12508 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12509 * options.h: (General_options): Add --preread-archive-symbols option.
12510 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12511 Archive::setup.
12512
de4c45bd
ILT
125132008-08-04 Ian Lance Taylor <iant@google.com>
12514
12515 * symtab.h (Symbol::use_plt_offset): New function.
12516 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12517 * powerpc.cc (Relocate::relocate): Likewise.
12518 * sparc.cc (Relocate::relocate): Likewise.
12519 * x86_64.cc (Relocate::relocate): Likewise.
12520 * testsuite/weak_plt.sh: New test.
12521 * testsuite/weak_plt_main.cc: New test.
12522 * testsuite/weak_plt_shared.cc: New test.
12523 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12524 (check_PROGRAMS): Add weak_plt.
12525 (check_DATA): Add weak_plt_shared.so.
12526 (weak_plt_main_pic.o, weak_plt): New targets.
12527 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12528 * testsuite/Makefile.in: Rebuild.
12529
12530 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12531 gcctestdir/ld.
12532 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12533 * testsuite/Makefile.in: Rebuild.
12534
323ee3f4
AM
125352008-08-04 Alan Modra <amodra@bigpond.net.au>
12536
12537 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12538 * Makefile.in: Regenerate.
12539 * po/POTFILES.in: Regenerate.
12540
7c07ecec
ILT
125412008-07-29 Ian Lance Taylor <iant@google.com>
12542
12543 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12544 symbols before other symbols.
12545 * testsuite/script_test_2.cc (test_addr): Declare.
12546 (test_addr_alias): Declare.
12547 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12548 values.
7c07ecec
ILT
12549 * testsuite/script_test_2.t: Define test_addr_alias and
12550 test_addr.
12551
5778530e
ILT
125522008-07-24 Ian Lance Taylor <iant@google.com>
12553
2a00e4fb
ILT
12554 PR 5990
12555 * descriptors.cc: New file.
12556 * descriptors.h: New file.
12557 * gold-threads.h (class Hold_optional_lock): New class.
12558 * fileread.cc: Include "descriptors.h".
12559 (File_read::~File_read): Release descriptor rather than closing
12560 it.
12561 (File_read::open) [file]: Call open_descriptor rather than open.
12562 Set is_descriptor_opened_.
12563 (File_read::open) [memory]: Assert that descriptor is not open.
12564 (File_read::reopen_descriptor): New function.
12565 (File_read::release): Release descriptor.
12566 (File_read::do_read): Make non-const. Reopen descriptor.
12567 (File_read::read): Make non-const.
12568 (File_read::make_view): Reopen descriptor.
12569 (File_read::do_readv): Likewise.
12570 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12571 Update declarations.
12572 * layout.cc: Include "descriptors.h".
12573 (Layout::create_build_id): Use open_descriptor rather than open.
12574 * output.cc: Include "descriptors.h".
12575 (Output_file::open): Use open_descriptor rather than open.
12576 * archive.cc (Archive::const_iterator): Change Archive to be
12577 non-const.
12578 (Archive::begin, Archive::end): Make non-const.
12579 (Archive::count_members): Likewise.
12580 * archive.h (class Archive): Update declarations.
12581 * object.h (Object::read): Make non-const.
12582 * Makefile.am (CCFILES): Add descriptors.cc.
12583 (HFILES): Add descriptors.h.
12584 * Makefile.in: Rebuild.
12585
801647d1
ILT
12586 PR 6716
12587 * gold.h: Always include <clocale>. Add Solaris workarounds
12588 following code in binutils/sysdep.h.
12589
5edd166e
ILT
12590 PR 6048
12591 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12592 this->eh_frame_hdr_ is NULL before using it.
12593
c89ad728
ILT
12594 * dynobj.cc (Versions::Versions): Update comment.
12595
aa86f06b
ILT
12596 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12597 the base version name.
12598
5778530e
ILT
12599 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12600 array size plus one.
12601 (Stringpool_template::set_string_offsets): Subtract one from key
12602 before using it as an array index.
12603 (Stringpool_template::get_offset_with_length): Likewise.
12604 (Stringpool_template::write_to_buffer): Likewise.
12605 * stringpool.h (Stringpool_template::get_offset_from_key):
12606 Likewise.
12607
057ead22
ILT
126082008-07-23 Ian Lance Taylor <iant@google.com>
12609
7f649c59
ILT
12610 PR 6658
12611 * object.h (Merged_symbol_value::value): Do our best to handle a
12612 negative addend.
12613
057ead22
ILT
12614 PR 6647
12615 * script.cc (Version_script_info::get_versions): Don't add empty
12616 version tag to return value.
12617 (Version_script_info::get_symbol_version_helper): Change return
12618 type to bool. Add pversion parameter. Change all callers.
12619 (script_register_vers_node): Don't require a non-NULL tag.
12620 * script.h (class Version_script_info): Update declarations.
12621 (Version_script_info::get_symbol_version): Change return type to
12622 bool. Add version parameter. Change all callers.
12623 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12624 handling. Handle an empty version from a version script.
12625 (Symbol_table::define_special_symbol): Likewise.
12626 * testsuite/ver_test_10.script: New file.
12627 * testsuite/ver_test_10.sh: New file.
12628 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12629 (check_DATA): Add ver_test_10.syms.
12630 (ver_test_10.syms, ver_test_10.so): New target.
12631 * testsuite/Makefile.in: Rebuild.
12632
58e54ac2
CD
126332008-07-23 Simon Baldwin <simonb@google.com>
12634
12635 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12636 to zero for undefined symbols from dynamic libraries.
12637
95d14cd3
ILT
126382008-07-23 Ian Lance Taylor <iant@google.com>
12639
12640 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12641 Change all callers.
12642 * symtab.h (class Symbol_table): Update declaration.
12643 * testsuite/ver_test_9.cc: New file.
12644 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12645 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12646 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12647 (ver_test_9.so, ver_test_9.o): New targets.
12648 * testsuite/Makefile.in: Rebuild.
12649
92de84a6
ILT
126502008-07-22 Ian Lance Taylor <iant@google.com>
12651
34810851
ILT
12652 * options.h (class General_options): Define --check-sections.
12653 * layout.cc (Layout::set_segment_offsets): Handle
12654 --check-sections.
12655
af6156ef
ILT
12656 * options.h (class General_options): Define -n/--nmagic and
12657 -N/--omagic.
12658 * options.cc (General_options::finalize): For -n/--nmagic or
12659 -N/--omagic, set -static.
12660 * layout.cc (Layout::attach_allocated_section_to_segment): If
12661 -N/--omagic, don't put read-only and read-write sections in
12662 different segments.
12663 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12664 finding a read-only segment.
12665 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12666 don't set the minimum segment alignment to the common page size,
12667 and don't set the file offset to the address modulo the page size.
12668 * script-sections.cc (Script_sections::create_segments): If
12669 -n/--omagic, don't put read-only and read-write sections in
12670 different segments.
12671
92de84a6
ILT
12672 * cref.cc: New file.
12673 * cref.h: New file.
12674 * options.h (class General_options): Add --print-symbol-counts.
12675 * main.cc (main): Issue defined symbol report if requested.
12676 * archive.cc (Archive::interpret_header): Make into a const member
12677 function.
12678 (Archive::add_symbols): Call Input_objects::archive_start and
12679 archive_stop.
12680 (Archive::const_iterator): Define new class.
12681 (Archive::begin, Archive::end): New functions.
12682 (Archive::include_all_members): Rewrite to use iterator.
12683 (Archive::count_members): New function.
12684 * archive.h (class Archive): Update declarations.
12685 (Archive::filename): New function.
12686 * object.cc: Include "cref.h".
12687 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12688 (Sized_relobj::do_get_global_symbol_counts): New function.
12689 (Input_objects::add_object): Add object to cross-referencer.
12690 (Input_objects::archive_start): New function.
12691 (Input_objects::archive_stop): New function.
12692 (Input_objects::print_symbol_counts): New function.
12693 * object.h: Declare Cref and Archive.
12694 (Object::get_global_symbol_counts): New function.
12695 (Object::do_get_global_symbol_counts): New pure virtual function.
12696 (class Sized_relobj): Add defined_count_ field. Update
12697 declarations.
12698 (class Input_objects): Add cref_ field. Update constructor.
12699 Update declarations.
12700 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12701 defined_count_.
12702 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12703 symbol counts.
12704 (Sized_dynobj::do_get_global_symbol_counts): New function.
12705 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12706 defined_count_. Update declarations. Define Symbols typedef.
12707 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12708 parameter. Change all callers.
12709 (Symbol_table::add_from_dynobj): Add sympointers and defined
12710 parameters. Change all callers.
12711 * symtab.h (class Symbol_table): Update declarations.
12712 * Makefile.am (CCFILES): Add cref.cc.
12713 (HFILES): Add cref.h.
12714 * Makefile.in: Rebuild.
12715
3f7c5e1d
CD
127162008-07-22 Simon Baldwin <simonb@google.com>
12717
12718 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12719 to zero when writing undefined symbols.
12720
e0b64032
ILT
127212008-07-22 Ian Lance Taylor <iant@google.com>
12722
12723 * output.cc (Output_section::add_input_section): Don't try to
12724 merge empty merge sections.
12725
096b02cf
CS
127262008-07-21 Craig Silverstein <csilvers@google.com>
12727
12728 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12729 Include symbol version in error message.
cd536b21 12730
1d1f116d
CD
127312008-07-20 Chris Demetriou <cgd@google.com>
12732
cd536b21 12733 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12734 (RANDOM_SEED_CFLAGS): New substituted variable.
12735 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12736 * configure: Rebuild.
12737 * Makefile.in: Likewise.
12738 * testsuite/Makefile.in: Likewise.
12739
a18f591e
ILT
127402008-07-18 Ian Lance Taylor <iant@google.com>
12741
12742 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12743 where we see NAME/NULL and NAME/VERSION as separate symbols.
12744 * testsuite/ver_test_main.cc (main): Call t4.
12745 (t4, t4_2a): Define.
12746 * testsuite/ver_test_2.cc (t4_2): Define.
12747 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12748 * testsuite/ver_test_4.cc (t4_2a): Define.
12749 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12750 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12751
c6e3f6ed
ILT
127522008-07-17 Ian Lance Taylor <iant@google.com>
12753
12754 * dynobj.cc (Versions::add_def): If we give an error about a
12755 missing version, go ahead and create the version anyhow.
12756
ef9beddf
ILT
127572008-07-10 Ian Lance Taylor <iant@google.com>
12758
12759 Handle output sections with more than 0x7fffffff bytes.
12760 * object.h (class Relobj): Change map_to_output_ to
12761 output_sections_, and just keep a section pointer. Change all
12762 uses. Move comdat group support to Sized_relobj.
12763 (Relobj::is_section_specially_mapped): Remove.
12764 (Relobj::output_section): Remove poff parameter. Change all
12765 callers.
12766 (Relobj::output_section_offset): New function.
12767 (Relobj::set_section_offset): Rewrite.
12768 (Relobj::map_to_output): Remove.
12769 (Relobj::output_sections): New function.
12770 (Relobj::do_output_section_offset): New pure virtual function.
12771 (Relobj::do_set_section_offset): Likewise.
12772 (class Sized_relobj): Add section_offsets_ field. Add comdat
12773 group support from Relobj. Update declarations.
12774 (Sized_relobj::get_output_section_offset): New function.
12775 (Sized_relobj::do_output_section_offset): New function.
12776 (Sized_relobj::do_set_section_offset): New function.
12777 * object.cc (Relobj::output_section_address): Remove.
12778 (Sized_relobj::Sized_relobj): Initialize new fields.
12779 (Sized_relobj::include_section_group): Cast find_kept_object to
12780 Sized_relobj.
12781 (Sized_relobj::include_linkonce_section): Likewise.
12782 (Sized_relobj::do_layout): Use separate arrays for output section
12783 and output offset.
12784 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12785 output_sections.
12786 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12787 output_sections and section_offsets.
12788 (Sized_relobj::write_local_symbols): Likewise.
12789 (map_to_kept_section): Compute output address directly.
12790 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12791 output_sections and section_offsets.
12792 (Sized_relobj::write_sections): Likewise.
12793 (Sized_relobj::relocate_sections): Likewise.
12794 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12795 * output.h (class Output_reloc): Update declarations. Change
12796 u2_.relobj to Sized_relobj*.
12797 (class Output_data_reloc): Change add functions to use
12798 Sized_relobj*.
12799 * output.cc (Output_reloc::Output_reloc): Change relobj to
12800 Sized_relobj*.
12801 (Output_reloc::local_section_offset): Change return type to
12802 Elf_Addr. Use get_output_section_offset.
12803 (Output_reloc::get_address): Likewise.
12804 (Output_section::is_input_address_mapped): Don't call
12805 is_section_specially_mapped.
12806 (Output_section::output_offset): Likewise.
12807 (Output_section::output_address): Likewise.
12808 (Output_section::starting_output_address): Likewise.
12809 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12810 parameter to Sized_relobj*.
12811 (Copy_relocs::need_copy_reloc): Likewise.
12812 (Copy_relocs::save): Likewise.
12813 * copy-relocs.h (class Copy_relocs): Update declarations.
12814 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12815 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12816 * target-reloc.h (relocate_for_relocatable): Change
12817 offset_in_output_section type to Elf_Addr. Change code that uses
12818 it as well.
12819 * layout.cc (Layout::layout): Always set *off.
12820 * mapfile.cc (Mapfile::print_input_section): Use
12821 output_section_offset.
12822 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12823 Sized_relobj*.
12824 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12825 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12826 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12827
5cb66f97
ILT
128282008-07-03 Ian Lance Taylor <iant@google.com>
12829
12830 * layout.cc (Layout::include_section): Do not discard unrecognized
12831 SHT_STRTAB sections.
12832
afe47622
CS
128332008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12834
12835 * script.cc (Lex::can_continue_name): Make '?' allowable in
12836 version-script names.
12837 * testsuite/version_script.map: Change glob pattern to use '?'
12838
5adf9721
ILT
128392008-06-30 Manish Singh <yosh@gimp.org>
12840
12841 PR 6585
12842 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12843 Correct typo.
12844
e6fde208
ILT
128452008-06-30 Ian Lance Taylor <iant@google.com>
12846
12847 PR 6660
12848 PR 6682
12849 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12850 versions]: Don't try to read the value in the contents, since we
12851 don't use it. Use the template endianness when writing.
12852
3f2e6a2d
CC
128532008-06-25 Cary Coutant <ccoutant@google.com>
12854
12855 * fileread.cc (File_read::make_view): Assert on zero-length view.
12856 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12857 symbol table when there are no symbols to read.
12858
c43d3a48
CS
128592008-06-23 Craig Silverstein <csilvers@google.com>
12860
12861 * version.cc (version_string): Bump to 1.7
12862
5f494ea0
CS
128632008-06-18 Craig Silverstein <csilvers@google.com>
12864
12865 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12866 constant 0xFFFF to type Valtype.
12867 (Powerpc_relocate_functions::rel16_ha): Likewise.
12868
c42e122e
ILT
128692008-06-17 Ian Lance Taylor <iant@google.com>
12870
f34787f8
ILT
12871 * output.h (Output_section::Input_section): Initialize p2align_ to
12872 zero for Output_section_data constructors.
12873 (Output_section::Input_section::addralign): If not an input
12874 section, return the alignment of the Output_section_data.
12875 * testsuite/copy_test.cc: New file.
12876 * testsuite/copy_test_1.cc: New file.
12877 * testsuite/copy_test_2.cc: New file.
12878 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12879 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12880 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12881 (copy_test_1_pic.o, copy_test_1.so): New targets.
12882 (copy_test_2_pic.o, copy_test_2.so): New targets.
12883 * testsuite/Makefile.in: Rebuild.
12884
c42e122e
ILT
12885 * script-sections.cc (Script_sections::place_orphan): Initialize
12886 local variable exact.
12887
ce3ac18a
DE
128882008-06-13 David Edelsohn <edelsohn@gnu.org>
12889
12890 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12891
42cacb20
DE
128922008-06-12 David Edelsohn <edelsohn@gnu.org>
12893 David S. Miller <davem@davemloft.net>
12894
12895 * powerpc.cc: New file.
12896 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12897 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12898 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12899 * Makefile.in: Rebuild.
12900
7b308235
ILT
129012008-06-09 Ian Lance Taylor <iant@google.com>
12902
12903 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12904 <exception>.
12905 (throwing, orig_terminate): New static variables.
12906 (terminate_handler): New static function.
12907 (t2): Set terminate handler.
12908
f0b886e3
ILT
129092008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12910
12911 PR 6584
cd536b21 12912 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12913 alignment.
12914
3e90f135
CC
129152008-05-30 Cary Coutant <ccoutant@google.com>
12916
12917 * archive.cc (Archive::include_all_members) Correct to step
12918 over symbol table and extended name table in thin archives.
12919
e09ad04a
ILT
129202008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12921
12922 PR 6407
12923 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12924 calculation.
12925
62b01cb5
ILT
129262008-05-28 Caleb Howe <cshowe@google.com>
12927
12928 * reduced_debug_output.cc: New file.
12929 * reduced_debug_output.h: New file.
92de84a6 12930 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12931 * options.cc (General_options::finalize): Add strip_debug_non_line
12932 to the strip heirarchy.
12933 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12934 fields.
12935 * layout.cc: Include "reduced_debug_output.h".
12936 (Layout::Layout): Initialize new fields.
12937 (line_only_debug_sections): New static array.
12938 (is_lines_only_debug_sections): New static inline function.
12939 (Layout::include_section): Handle --strip-debug-non-line.
12940 (Layout::make_output_section): If --strip-debug-non-line, build
12941 new output sections for .debug_abbrev and .debug_info.
12942 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12943 gold. Warn about possible overflow.
12944 (read_signed_LEB_128): Likewise.
12945 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12946 (read_signed_LEB_128): Declare.
12947 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12948 (HFILES): Add reduced_debug_output.h.
12949 * Makefile.in: Rebuild.
12950
7d9e3d98
ILT
129512008-05-21 Ian Lance Taylor <iant@google.com>
12952
12953 * mapfile.cc: New file.
12954 * mapfile.h: New file.
12955 * options.h (class General_options): Add -M/--print-map and -Map.
12956 * options.cc (General_options::finalize): Make -M equivalent to
12957 -Map -.
12958 * main.cc: Include <cstdio> and "mapfile.h".
12959 (main): Open mapfile if requested.
12960 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12961 constructor. Change caller.
12962 (queue_initial_tasks): Add mapfile parameter. Change caller.
12963 (queue_middle_tasks): Likewise.
12964 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12965 declarations.
12966 * archive.cc: Include "mapfile.h".
12967 (Archive::add_symbols): Add mapfile parameter. Change all
12968 callers. Pass mapfile, symbol, and reason to include_member.
12969 (Archive::include_all_members): Add mapfile parameter. Change all
12970 callers.
12971 (Archive::include_member): Add mapfile, sym, and why parameters.
12972 Change all callers. Report inclusion to map file.
12973 * archive.h: Include "fileread.h".
12974 (class Archive): Update declarations.
12975 (Archive::file): New const method.
12976 (class Add_archive_symbols): Add mapfile_ field. Update
12977 constructor. Change all callers.
12978 * readsyms.h (class Read_symbols): Likewise.
12979 (class Finish_group): Likewise.
12980 (class Read_script): Likewise.
12981 * common.cc: Include "mapfile.h".
12982 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12983 all callers.
12984 (Symbol_table::do_allocate_commons): Likewise.
12985 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12986 symbol allocation to mapfile.
12987 * common.h (class Allocate_commons_task): Add mapfile_ field.
12988 Update constructor. Change all callers.
12989 * symtab.h (class Symbol_table): Update declarations.
12990 * layout.cc: Include "mapfile.h".
12991 (Layout_task_runner::run): Print information to mapfile.
12992 (Layout::create_gold_note): Change Output_data_fixed_space to
12993 Output_data_zero_fill.
12994 (Layout::create_build_id): Likewise.
12995 (Layout::print_to_mapfile): New function.
12996 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12997 constructor. Change caller.
12998 (class Layout): Declare print_to_mapfile.
12999 * output.cc (Output_section::Input_section::print_to_mapfile): New
13000 function.
13001 (Output_section::add_input_section): If producing a map, always
13002 add to input_sections_ list.
13003 (Output_section::do_print_to_mapfile): New function.
13004 (Output_segment::print_sections_to_mapfile): New function.
13005 (Output_segment::print_section_list_to_mapfile): New function.
13006 * output.h: Include "mapfile.h".
13007 (Output_data::print_to_mapfile): New function.
13008 (Output_data::do_print_to_mapfile): New virtual function.
13009 (Output_segment_headers::do_print_to_mapfile): New function.
13010 (Output_file_header::do_print_to_mapfile): New function.
13011 (Output_data_const::do_print_to_mapfile): New function.
13012 (class Output_data_const_buffer): Add map_name_ field. Update
13013 constructor. Change all callers. Add do_print_to_mapfile
13014 function.
13015 (class Output_data_fixed_space): Likewise.
13016 (class Output_data_space): Likewise.
13017 (class Output_data_zero_fill): New class.
13018 (Output_data_strtab::do_print_to_mapfile): New function.
13019 (Output_data_reloc_base::do_print_to_mapfile): New function.
13020 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13021 (Output_data_group::do_print_to_mapfile): New function.
13022 (Output_data_got::do_print_to_mapfile): New function.
13023 (Output_data_dynamic::do_print_to_mapfile): New function.
13024 (Output_symtab_xindex::do_print_to_mapfile): New function.
13025 (class Output_section): Declare do_print_to_mapflie. Declare
13026 print_to_mapfile in Input_section.
13027 (class Output_segment): Declare new functions.
13028 * object.h (Sized_relobj::symbol_count): New function.
13029 * script-sections.cc
13030 (Output_section_element_dot_assignment::set_section_addresses):
13031 Change Output_data_fixed_space to Output_data_zero_fill.
13032 (Output_data_expression::do_print_to_mapfile): New function.
13033 * script.cc (read_input_script): Add mapfile parameter. Change
13034 all callers.
13035 * script.h (read_input_script): Update declaration.
13036 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13037 (Eh_frame::do_print_to_mapfile): New function.
13038 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13039 (Output_merge_string::do_print_to_mapfile): New function.
13040 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13041 function.
13042 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13043 function.
13044 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13045 function.
13046 * Makefile.am (CCFILES): Add mapfile.cc.
13047 (HFILES): Add mapfile.h.
13048 * Makefile.in: Rebuild.
13049
9f1d377b
ILT
130502008-05-19 Ian Lance Taylor <iant@google.com>
13051
13052 * options.h (class General_options): Add -z relro.
13053 * layout.cc (Layout::Layout): Initialize relro_segment_.
13054 (Layout::add_output_section_data): Return the output section.
13055 (Layout::make_output_section): Rcognize relro sections and mark
13056 them appropriately.
13057 (Layout::attach_allocated_section_to_segment): Put relro sections
13058 in a PT_GNU_RELRO segment.
13059 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13060 section as relro.
13061 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13062 PT_TLS segments.
13063 (Layout::linkonce_mapping): Map d.rel.ro.local to
13064 .data.rel.ro.local.
13065 (Layout::output_section_name): Us .data.rel.ro.local for any
13066 section which begins with that.
13067 * layout.h (class Layout): Update add_output_section_data
13068 declaration. Add relro_segment_ field.
13069 * output.cc (Output_section::Output_section): Initialize is_relro_
13070 and is_relro_local_ fields.
13071 (Output_segment::add_output_section): Group relro sections.
13072 (Output_segment::is_first_section_relro): New function.
13073 (Output_segment::maximum_alignment): If there is a relro section,
13074 align the segment to the common page size.
13075 (Output_segment::set_section_addresses): Track whether we are
13076 looking at relro sections. If the last section is a relro
13077 section, align to the common page size.
13078 (Output_segment::set_section_list_addresses): Add in_relro
13079 parameter. Change all callers. Align to the page size when
13080 moving from relro to non-relro section.
13081 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13082 segment.
13083 * output.h (class Output_section): Add is_relro_ and
13084 is_relro_local_ fields.
13085 (Output_section::is_relro): New function.
13086 (Output_section::set_is_relro): New function.
13087 (Output_section::is_relro_local): New function.
13088 (Output_section::set_is_relro_local): New function.
13089 (class Output_segment): Update declarations.
13090 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13091 * sparc.cc (Target_sparc::got_section): Likewise.
13092 * x86_64.cc (Target_x86_64::got_section): Likewise.
13093 * testsuite/relro_test_main.cc: New file.
13094 * testsuite/relro_test.cc: New file.
13095 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13096 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13097 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13098 (relro_test.so, relro_test_pic.o): New targets.
13099 * testsuite/Makefile.in: Rebuild.
13100
a984ee1d
ILT
131012008-05-16 Ian Lance Taylor <iant@google.com>
13102
01676dcd
ILT
13103 * output.cc (Output_segment::add_output_section): Remove front
13104 parameter.
13105 * output.h (class Output_segment): Remove
13106 add_initial_output_section and overloaded add_output_section.
13107 Update declaration of remaining add_output_section.
13108 * layout.cc (Layout::create_interp): Call add_output_section
13109 rather than add_initial_output_section.
13110 (Layout::finish_dynamic_section): Likewise.
13111
497897f9
ILT
13112 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13113 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13114 know the dynamic type.
13115 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13116 field. Initialize it in constructor.
13117 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13118 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13119 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13120 reloc.
13121
a984ee1d
ILT
13122 * output.cc (Output_reloc::get_address): Change return type to
13123 Elf_Addr.
13124 * output.h (class Output_reloc): Update get_address declaration.
13125 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13126 for section addresses.
13127
55ba0940
ILT
131282008-05-09 Ian Lance Taylor <iant@google.com>
13129
13130 PR 6493
13131 * gold.cc (gold_nomem): Use return value of write.
13132
75517b77
ILT
131332008-05-08 Ian Lance Taylor <iant@google.com>
13134
13135 * symtab.c (Symbol::init_base_output_data): Add version
13136 parameter. Change all callers.
13137 (Symbol::init_base_output_segment): Likewise.
13138 (Symbol::init_base_constant): Likewise.
13139 (Symbol::init_base_undefined): Likewise.
13140 (Sized_symbol::init_output_data): Likewise.
13141 (Sized_symbol::init_output_segment): Likewise.
13142 (Sized_symbol::init_constant): Likewise.
13143 (Sized_symbol::init_undefined): Likewise.
13144 (Symbol_table::do_define_in_output_data): If the new symbol has a
13145 version, mark it as the default.
13146 (Symbol_table::do_define_in_output_segment): Likewise.
13147 (Symbol_table::do_define_as_constant): Likewise.
13148 * symtab.h (class Symbol): Update declarations.
13149 (class Sized_symbol): Likewise.
13150 * resolve.cc (Symbol::override_version): New function.
c42e122e 13151 (Symbol::override_base): Call override_version.
75517b77
ILT
13152 (Symbol::override_base_with_special): Likewise.
13153 * testsuite/ver_script_8.script: New file.
13154 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13155 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13156 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13157 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13158
f1f70eae
ILT
131592008-05-06 Ian Lance Taylor <iant@google.com>
13160
f3e9c5c5
ILT
13161 PR 6049
13162 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13163 functions.
13164 (class General_options): Remove existing --undefined, and add
13165 --no-undefined instead. Add new --undefined as synonym for -u.
13166 * archive.cc (Archive::add_symbols): Check whether symbol was
13167 named with -u.
13168 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13169 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13170 all uses. Add IS_UNDEFINED. Update declarations to split
13171 different versions of init_base. Declare init_base_undefined.
13172 (Symbol::is_defined): Handle IS_UNDEFINED.
13173 (Symbol::is_undefined): Likewise.
13174 (Symbol::is_weak_undefined): Call is_undefined.
13175 (Symbol::is_absolute): Handle IS_CONSTANT.
13176 (class Sized_symbol): Update declarations to split different
13177 versions of init. Declare init_undefined.
13178 (class Symbol_table): Declare new functions.
13179 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13180 Change all callers.
13181 (Symbol::init_base_output_data): Likewise.
13182 (Symbol::init_base_output_segment): Likewise.
13183 (Symbol::init_base_constant): Likewise.
13184 (Symbol::init_base_undefined): New function.
13185 (Sized_symbol::init_object): Rename from init. Change all
13186 callers.
13187 (Sized_symbol::init_output_data): Likewise.
13188 (Sized_symbol::init_output_segment): Likewise.
13189 (Sized_symbol::init_constant): Likewise.
13190 (Sized_symbol::init_undefined): New function.
13191 (Symbol_table::add_undefined_symbols_from_command_line): New
13192 function.
13193 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13194 function.
13195 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13196 (Symbol::output_section): Likewise.
13197 (Symbol::set_output_section): Likewise.
13198 (Symbol_table::sized_finalize_symbol): Likewise.
13199 (Symbol_table::sized_write_globals): Likewise.
13200 * resolve.cc (Symbol_table::should_override): Likewise.
13201 (Symbol::override_base_with_special): Likewise.
13202
8bdcdf2c
ILT
13203 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13204 symbol, change it to have default visibility.
13205 * testsuite/protected_1.cc: New file.
13206 * testsuite/protected_2.cc: New file.
13207 * testsuite/protected_3.cc: New file.
13208 * testsuite/protected_main_1.cc: New file.
13209 * testsuite/protected_main_2.cc: New file.
13210 * testsuite/protected_main_3.cc: New file.
13211 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13212 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13213 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13214 (protected_1.so): New target.
13215 (protected_1_pic.o, protected_2_pic.o): New targets.
13216 (protected_3_pic.o): New target.
13217 (check_PROGRAMS): Add protected_2.
13218 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13219 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13220 * testsuite/Makefile.in: Rebuild.
13221
2b706932
ILT
13222 * options.h (DEFINE_var): Add set_user_set_##varname__.
13223 (DEFINE_bool_alias): New macro.
13224 (class General_options): Define -Bstatic using DEFINE_bool_alias
13225 rather than DEFINE_special. Add --undefined as an alias for -z
13226 defs.
13227 * options.cc (General_options::parse_Bstatic): Remove.
13228
d82a5bcc
ILT
13229 * options.h (class General_options): Add --fatal-warnings.
13230 * main.cc (main): Implement --fatal-warnings.
13231 * errors.h (Errors::warning_count): New function.
13232
f1f70eae
ILT
13233 * options.h (class General_options): Add -Bsymbolic-functions.
13234 * symtab.h (Symbol::is_preemptible): Check for
13235 -Bsymbolic-functions.
13236
8825ac63
ILT
132372008-05-05 Ian Lance Taylor <iant@google.com>
13238
d98bc257
ILT
13239 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13240 as noVARNAME rather than no-VARNAME.
13241 (class General_options): Add option -z combreloc.
13242 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13243 get_address.
13244 (Output_reloc::sort_before) [SHT_REL]: New function.
13245 (Output_reloc::sort_before) [SHT_RELA]: New function.
13246 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13247 Sort_relocs_comparison.
13248 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13249 parameter. Change all callers.
13250 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13251 sort_relocs parameter. Change all callers.
13252 * output.cc (Output_reloc::get_address): New function, broken out
13253 of write_rel.
13254 (Output_reloc::write_rel): Call it.
13255 (Output_reloc::compare): New function.
13256 (Output_data_reloc_base::do_write): Optionally sort relocs.
13257
60b2b4e7
ILT
13258 * configure.ac: If targ_extra_obj is set, link it in.
13259 * configure.tgt: Initialize all variables.
13260 (x86_64*): Set targ_extra_obj and targ_extra_size.
13261 * configure: Rebuild.
13262
8825ac63
ILT
13263 * object.cc (Sized_relobj::include_section_group): Adjust section
13264 indexes read from group data. Build vector to pass to
13265 layout_group.
13266 * layout.cc (Layout::layout_group): Add flags and shndxes
13267 parameters. Remove contents parameter. Change caller. Update
13268 explicit instantiations.
13269 * layout.h (class Layout): Update layout_group declaration.
13270 * output.cc (Output_data_group::Output_data_group): Add flags and
13271 input_shndxes parameters. Remove contents parameter. Change
13272 caller.
13273 (Output_data_group::do_write): Change input_sections_ to
13274 input_shndxes_.
13275 * output.h (class Output_data_group): Update constructor
13276 declaration. Rename input_sections_ to input_shndxes_.
13277 * testsuite/many_sections_test.cc: Add template.
13278
e94cf127
CC
132792008-04-30 Cary Coutant <ccoutant@google.com>
13280
4418b2d5
CC
13281 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13282
e94cf127
CC
13283 * layout.cc (Layout::include_section): Refactored check for debug
13284 info section.
13285 (Layout::add_comdat): Add new parameters. Change type
13286 of signature parameter. Add object and shndx to signatures table.
13287 (Layout::find_kept_object): New function.
13288 * layout.h: Include <cstring>.
13289 (Layout::is_debug_info_section): New function.
13290 (Layout::add_comdat): Add new parameters.
13291 (Layout::find_kept_object): New function.
13292 (Layout::Kept_section): New struct.
13293 (Layout::Signatures): Change type of map range.
13294 * object.cc (Relobj::output_section_address): New function.
13295 (Sized_relobj::include_section_group): Add new parameters. Change
13296 calls to Layout::add_comdat. Change to build table of kept comdat
13297 groups and table mapping discarded sections to kept sections.
13298 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13299 (Sized_relobj::do_layout): Change calls to include_section_group and
13300 include_linkonce_section.
13301 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13302 value to zero when section is discarded.
13303 (Sized_relobj::map_to_kept_section): New function.
13304 * object.h (Relobj::output_section_address): New function.
13305 (Relobj::Comdat_group): New type.
13306 (Relobj::find_comdat_group): New function.
13307 (Relobj::Comdat_group_table): New type.
13308 (Relobj::Kept_comdat_section): New type.
13309 (Relobj::Kept_comdat_section_table): New type.
13310 (Relobj::add_comdat_group): New function.
13311 (Relobj::set_kept_comdat_section): New function.
13312 (Relobj::get_kept_comdat_section): New function.
13313 (Relobj::comdat_groups_): New field.
13314 (Relobj::kept_comdat_sections_): New field.
13315 (Symbol_value::input_value): Update comment.
13316 (Sized_relobj::map_to_kept_section) New function.
13317 (Sized_relobj::include_linkonce_section): Add new parameter.
13318 * target-reloc.h (Comdat_behavior): New type.
13319 (get_comdat_behavior): New function.
13320 (relocate_section): Add code to map a discarded section to the
13321 corresponding kept section when applying a relocation.
13322
e4e5049b
CS
133232008-04-30 Craig Silverstein <csilvers@google.com>
13324
13325 * dwarf_reader.cc (next_generation_count): New static var.
13326 (Addr2line_cache_entry): New struct.
13327 (addr2line_cache): New static var.
13328 (Dwarf_line_info::one_addr2line): Added caching.
13329 (Dwarf_line_info::clear_addr2line_cache): New function.
13330 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13331 cache-size parameter.
13332 (Dwarf_line_info::one_addr2line_cache): New function.
13333 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13334 new cache-size argument to one_addr2line(), and clear cache.
13335
d09e9154
CC
133362008-04-28 Cary Coutant <ccoutant@google.com>
13337
13338 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13339 R_386_PC8 relocations.
13340
7ef73768
ILT
133412008-04-23 Ian Lance Taylor <iant@google.com>
13342
55438702
ILT
13343 * object.cc (Sized_relobj::include_section_group): Check for
13344 invalid section group.
13345
c165fb93
ILT
13346 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13347 header size.
13348
7ef73768
ILT
13349 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13350 than read for file header.
13351 * archive.cc (Archive::include_member): Likewise.
13352
6194aaab
L
133532008-04-23 Paolo Bonzini <bonzini@gnu.org>
13354
13355 * aclocal.m4: Regenerate.
13356 * configure: Regenerate.
13357
d491d34e
ILT
133582008-04-19 Ian Lance Taylor <iant@google.com>
13359
5ea2bac6
ILT
13360 * version.cc (version_string): Bump to 1.6.
13361
7bc3e21a
ILT
13362 * testsuite/Makefile.am (many_sections_r_test): New target.
13363 (many_sections_r_test_SOURCES): Remove.
13364 (many_sections_r_test_DEPENDENCIES): Remove.
13365 (many_sections_r_test_LDFLAGS): Remove.
13366 (many_sections_r_test_LDADD): Remove.
13367
7fcd3aa9
ILT
13368 * object.cc (Sized_relobj::do_add_symbols): Always pass
13369 local_symbol_count_ to add_from_relobj.
13370
4c94d6ae
ILT
13371 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13372 every thousand variables.
13373 * testsuite/Makefile.in: Rebuild.
13374
d491d34e
ILT
13375 * object.cc (Xindex::initialize_symtab_xindex): New function.
13376 (Xindex::read_symtab_xindex): New function.
13377 (Xindex::sym_xindex_to_shndx): New function.
13378 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13379 available.
13380 (Sized_relobj::do_initialize_xindex): New function.
13381 (Sized_relobj::do_read_symbols): Adjust section links.
13382 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13383 parameter. Change all callers.
13384 (Sized_relobj::include_section_group): Adjust section links and
13385 symbol section indexes.
13386 (Sized_relobj::do_layout): Adjust section links.
13387 (Sized_relobj::do_count_local_symbols): Adjust section links and
13388 symbol section indexes.
13389 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13390 ordinary and special symbols.
13391 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13392 dynsym_xindex parameters. Change all callers. Adjust section
13393 links. Use SHN_XINDEX when needed.
13394 (Sized_relobj::get_symbol_location_info): Adjust section links.
13395 Don't get fooled by special symbols.
13396 * object.h (class Xindex): Define.
13397 (class Object): Add xindex_ parameter. Declare virtual functoin
13398 do_initialize_xindex.
13399 (Object::adjust_sym_shndx): New function.
13400 (Object::set_xindex): New protected function.
13401 (class Symbol_value): Add is_ordinary_shndx_ field.
13402 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13403 (Symbol_value::value): Assert ordinary section.
13404 (Symbol_value::initialize_input_to_output_map): Likewise.
13405 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13406 Change all callers.
13407 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13408 all callers.
13409 (class Sized_relobj): Update declarations.
13410 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13411 parameter. Change all callers.
13412 (Sized_relobj::adjust_shndx): New function.
13413 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13414 field.
13415 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13416 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13417 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13418 (Sized_dynobj::read_dynsym_section): Adjust section links.
13419 (Sized_dynobj::read_dynamic): Likewise.
13420 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13421 section links.
13422 (Sized_dynobj::do_initialize_xindex): New function.
13423 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13424 do_initialize_xindex.
13425 (Sized_dynobj::adjust_shndx): New function.
13426 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13427 dynsym_xindex_ fields.
13428 (Layout::finalize): Add a call to set_section_indexes before
13429 creating the symtab sections.
13430 (Layout::set_section_indexes): Don't do anything if the section
13431 already has a section index.
13432 (Layout::create_symtab_sections): Add shnum parameter. Change
13433 caller. Create .symtab_shndx section if needed.
13434 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13435 caller.
13436 (Layout::allocated_output_section_count): New function.
13437 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13438 needed.
13439 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13440 fields. Update declarations.
13441 (Layout::symtab_xindex): New function.
13442 (Layout::dynsym_xindex): New function.
13443 (class Write_symbols_task): Add layout_ field.
13444 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13445 Change caller.
13446 * output.cc (Output_section_headers::Output_section_headers): Add
13447 shstrtab_section parameter. Change all callers.
13448 (Output_section_headers::do_sized_write): Store overflow values
13449 for section count and section string table section index in
13450 section header zero.
13451 (Output_file_header::do_sized_write): Check for overflow of
13452 section count and section string table section index.
13453 (Output_symtab_xindex::do_write): New function.
13454 (Output_symtab_xindex::endian_do_write): New function.
13455 * output.h (class Output_section_headers): Add shstrtab_section_.
13456 Update declarations.
13457 (class Output_symtab_xindex): Define.
13458 (Output_section::has_out_shndx): New function.
13459 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13460 field.
13461 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13462 Change all callers.
13463 (Sized_symbol::init): Likewise.
13464 (Symbol::output_section): Check for ordinary symbol.
13465 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13466 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13467 callers.
13468 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13469 Change all callers. Simplify handling of symbols from sections
13470 not included in the link.
13471 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13472 distinction.
13473 (Weak_alias_sorter::operator()): Assert that symbols are
13474 ordinary.
13475 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13476 distinction.
13477 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13478 parameters. Change all callers.
13479 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13480 symbol distinction. Use SHN_XINDEX when needed.
13481 (Symbol_table::write_section_symbol): Add symtab_xindex
13482 parameter. Change all callers.
13483 (Symbol_table::sized_write_section_symbol): Likewise. Use
13484 SHN_XINDEX when needed.
13485 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13486 declarations.
13487 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13488 (Symbol::is_defined): Check is_ordinary.
13489 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13490 (Symbol::is_absolute, Symbol::is_common): Likewise.
13491 (class Sized_symbol): Update declarations.
13492 (class Symbol_table): Update declarations.
13493 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13494 parameters. Change all callers.
13495 (Sized_symbol::override): Likewise.
13496 (Symbol_table::override): Likewise.
13497 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13498 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13499 is_ordinary, and orig_st_shndx parameters. Change all callers.
13500 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13501 to be in an ordinary section.
13502 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13503 object and is_ordinary parameters. Change all callers.
13504 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13505 Change all callers. Don't add undefined or non-ordinary symbols
13506 to reloc_map_.
13507 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13508 Change all callers.
13509 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13510 declarations.
13511 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13512 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13513 (Sized_relobj::relocate_sections): Likewise.
13514 * target-reloc.h (scan_relocs): Adjust section symbol index.
13515 (scan_relocatable_relocs): Likewise.
13516 * i386.cc (Scan::local): Check for ordinary symbols.
13517 * sparc.cc (Scan::local): Likewise.
13518 * x86_64.cc (Scan::local): Likewise.
13519 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13520 to symbol_section_and_value.
13521 * testsuite/many_sections_test.cc: New file.
13522 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13523 (check_PROGRAMS): Add many_sections_test.
13524 (many_sections_test_SOURCES): Define.
13525 (many_sections_test_DEPENDENCIES): Define.
13526 (many_sections_test_LDFLAGS): Define.
13527 (BUILT_SOURCES): Add many_sections_define.h.
13528 (many_sections_define.h): New target.
13529 (BUILT_SOURCES): Add many_sections_check.h.
13530 (many_sections_check.h): New target.
13531 (check_PROGRAMS): Add many_sections_r_test.
13532 (many_sections_r_test_SOURCES): Define.
13533 (many_sections_r_test_DEPENDENCIES): Define.
13534 (many_sections_r_test_LDFLAGS): Define.
13535 (many_sections_r_test_LDADD): Define.
13536 (many_sections_r_test.o): New target.
13537 * testsuite/Makefile.in: Rebuild.
13538
c5818ff1
CC
135392008-04-17 Cary Coutant <ccoutant@google.com>
13540
13541 * errors.cc (Errors::info): New function.
13542 (gold_info): New function.
13543 * errors.h (Errors::info): New function.
13544 * gold.h (gold_info): New function.
13545 * object.cc (Input_objects::add_object): Print trace output.
13546 * options.cc (options::parse_set): New function.
13547 (General_options::parse_wrap): Deleted.
13548 (General_options::General_options): Deleted initializer.
13549 * options.h (options::String_set): New typedef.
13550 (options::parse_set): New function.
13551 (DEFINE_set): New macro.
13552 (General_options::wrap): Changed to use DEFINE_set. Changed
13553 callers of any_wrap_symbols and is_wrap_symbol.
13554 (General_options::trace, General_options::trace_symbol):
13555 New options.
13556 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13557 (General_options::wrap_symbols_): Deleted.
13558 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13559
b5be4a7c
DM
135602008-04-17 David S. Miller <davem@davemloft.net>
13561
13562 * options.cc (General_options::parse_V): New function.
13563 * options.h: Add entries for -V and -Qy.
13564
155a0dd7
ILT
135652008-04-17 Ian Lance Taylor <iant@google.com>
13566
13567 * common.cc (Symbol_table::allocate_commons): Remove options
13568 parameter. Change caller.
13569 (Symbol_table::do_allocate_commons): Remove options parameter.
13570 Change caller. Just call do_allocate_commons_list twice.
13571 (Symbol_table::do_allocate_commons_list): New function, broken out
13572 of do_allocate_commons.
13573 * common.h (class Allocate_commons_task): Remove options_ field.
13574 Update constructor.
13575 * symtab.cc (Symbol_table::Symbol_table): Initialize
13576 tls_commons_.
13577 (Symbol_table::add_from_object): Put TLS common symbols on
13578 tls_commons_ list.
13579 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13580 which are IN_OUTPUT_DATA.
13581 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13582 allocate_commons and do_allocate_commons declarations. Declare
13583 do_allocate_commons_list.
13584 * gold.cc (queue_middle_tasks): Update creation of
13585 Allocate_commons_task to not pass options.
13586 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13587 (TLS_TEST_C_FLAGS): New variable.
13588 (tls_test_c_pic.o): New target.
13589 (tls_test_shared.so): Link in tls_test_c_pic.o.
13590 (tls_test_c_pic_ie.o): New target.
13591 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13592 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13593 (tls_test_c.o): New target.
13594 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13595 (tls_pic_test_LDADD): Likewise.
13596 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13597 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13598 (tls_test_c_gnu2.o): New target.
13599 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13600 tls_test_c_gnu2.o.
13601 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13602 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13603 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13604 * testsuite/tls_test.cc: Include "config.h".
13605 (t_last): Call t11_last.
13606 * testsuite/tls_test.h (t11, t11_last): Declare.
13607 * testsuite/tls_test_c.c: New file.
13608 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13609 * configure.ac: Check for OpenMP support.
13610 * configure, config.in, Makefile.in: Rebuild.
13611 * testsuite/Makefile.in: Rebuild.
13612
edfbb029
CC
136132008-04-16 Cary Coutant <ccoutant@google.com>
13614
13615 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13616 (Target_i386::tls_base_symbol_defined_): New field.
13617 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13618 (Target_i386::Scan::global): Likewise.
13619 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13620 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13621 (Target_x86_64::tls_base_symbol_defined_): New field.
13622 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13623 (Target_x86_64::Scan::global): Likewise.
13624
f3c69fca
CC
136252008-04-16 Cary Coutant <ccoutant@google.com>
13626
13627 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13628 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13629 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13630 building shared libraries.
13631 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13632 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13633 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13634 * testsuite/Makefile.in: Rebuild.
13635 * testsuite/weak_undef.h: New file.
13636 * testsuite/weak_undef_file1.cc: Add extra test cases.
13637 * testsuite/weak_undef_file2.cc: Likewise.
13638 * testsuite/weak_undef_test.cc: Likewise.
13639
7c414435
DM
136402008-04-16 David S. Miller <davem@davemloft.net>
13641
32b769e1
DM
13642 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13643 Add issued_non_pic_error_ field. Declare check_non_pic.
13644 (Target_sparc::Scan::check_non_pic): New function.
13645 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13646 (Target_sparc::Scan::global): Likewise.
13647
11936fb1
DM
13648 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13649 * configure: Rebuild.
13650
7c414435
DM
13651 * options.h (DEFINE_enable): New macro.
13652 (new_dtags): New enable option.
13653 (initfirst, interpose, loadfltr, nodefaultlib,
13654 nodelete, nodlopen, nodump): New -z options.
13655 * layout.cc (Layout:finish_dynamic_section): If new
13656 dtags enabled, emit DT_RUNPATH. Also, emit a
13657 DT_FLAGS_1 containing any specified -z flags.
13658
85c7bf8b
ILT
136592008-04-16 Ian Lance Taylor <iant@google.com>
13660
12c0daef
ILT
13661 * copy-relocs.cc: New file.
13662 * copy-relocs.h: New file.
13663 * reloc.cc: Remove Copy_relocs code.
13664 * reloc.h: Likewise.
13665 * reloc-types.h (struct Reloc_types) [both versions]: Add
13666 get_reloc_addend_noerror.
13667 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13668 variants of add_global which take an addend which must be zero.
13669 * i386.cc: Include "copy-relocs.h".
13670 (class Target_i386): Change type of copy_relocs_ to variable,
13671 update initializer.
13672 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13673 Change all callers.
13674 (Target_i386::do_finalize_sections): Change handling of
13675 copy_relocs_.
13676 * sparc.cc: Include "copy-relocs.h".
13677 (class Target_sparc): Change type of copy_relocs_ to variable,
13678 update initializer.
13679 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13680 Change all callers.
13681 (Target_sparc::do_finalize_sections): Change handling of
13682 copy_relocs_.
13683 * x86_64.cc: Include "copy-relocs.h".
13684 (class Target_x86_64): Change type of copy_relocs_ to variable,
13685 update initializer.
13686 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13687 class. Change all callers.
13688 (Target_x86_64::do_finalize_sections): Change handling of
13689 copy_relocs_.
13690 * Makefile.am (CCFILES): Add copy-relocs.cc.
13691 (HFILES): Add copy-relocs.h.
13692
4f4995b6
ILT
13693 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13694
85c7bf8b
ILT
13695 * testsuite/script_test_4.sh: Permit leading zeroes.
13696
4f2a9edd
ILT
136972008-04-15 Ian Lance Taylor <iant@google.com>
13698
e6188289
ILT
13699 * script-sections.cc (Script_sections::create_segments): Use
13700 header_size_adjustment even when there is enough room for the
13701 headers.
13702 * testsuite/script_test_4.sh: New file.
13703 * testsuite/script_test_4.t: New file.
13704 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13705 (check_DATA): Add script_test_4.stdout.
13706 (MOSTLYCLEANFILES): Likewise.
13707 (script_test_4): New target.
13708 (script_test_4.stdout): New target.
13709 * testsuite/Makefile.in: Rebuild.
13710
4f2a9edd
ILT
13711 * sparc.cc: Add definitions for Output_data_plt_sparc class
13712 constants.
13713
f5314dd5
DM
137142008-04-14 David S. Miller <davem@davemloft.net>
13715
13716 * sparc.cc: New file.
13717 * Makefile.am (TARGETSOURCES): Add sparc.cc
13718 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13719 * configure.tgt: Document targ_extra_size and
13720 targ_extra_big_endian. Add entries for sparc-* and
13721 sparc64-*.
13722 * configure.ac: Handle targ_extra_size and
13723 targ_extra_big_endian.
13724 * Makefile.in: Rebuild.
13725 * configure: Likewise.
13726 * po/POTFILES.in: Likewise.
13727 * po/gold.pot: Likewise.
13728
154e0e9a
ILT
137292008-04-14 Ian Lance Taylor <iant@google.com>
13730
13731 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13732 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13733 in the name/type/flags to section mapping. Don't call
13734 allocate_output_section.
13735 (Layout::choose_output_section): Change parameter from adjust_name
13736 to is_input_section. Don't permit input sections after sections
13737 are attached to segments. Don't call allocate_output_section.
13738 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13739 not write_enable_output_section.
13740 (Layout::make_output_section): Don't push to
13741 unattached_section_list_ nor call attach_to_segment. Call
13742 attach_section_to_segment if sections are attached.
13743 (Layout::attach_sections_to_segments): New function.
13744 (Layout::attach_section_to_segment): New function.
13745 (Layout::attach_allocated_section_to_segment): Rename from
13746 attach_to_segment. Remove flags parameter.
13747 (Layout::allocate_output_section): Remove function.
13748 (Layout::write_enable_output_section): Remove function.
13749 * layout.h (class Layout): Update for above changes. Add new
13750 field sections_are_attached_.
13751 * output.h (Output_section::update_flags_for_input_section): New
13752 function.
13753 * output.cc (Output_section::add_input_section): Call
13754 update_flags_for_input_section.
13755 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13756
009a67a2
CC
137572008-04-11 Cary Coutant <ccoutant@google.com>
13758
13759 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13760 thought unnecessary.
13761 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13762
759b1a24
ILT
137632008-04-11 Ian Lance Taylor <iant@google.com>
13764
13765 * output.h (class Output_section_data): Remove inline definition
13766 of set_addralign.
13767 * output.cc (Output_section_data::set_addralign): New function.
13768
c2b45e22
CC
137692008-04-11 Cary Coutant <ccoutant@google.com>
13770
13771 Add support for TLS descriptors for i386 and x86_64.
13772 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13773 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13774 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13775 GOT_TYPE_TLS_DESC.
13776 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13777 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13778 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13779 relocations.
13780 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13781 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13782 Fix problem with initial-exec relocations.
13783 (Target_i386::Relocate::relocate_tls): Likewise.
13784 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13785 relaxation.
13786 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13787 support for section-plus-offset dynamic table entries.
13788 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13789 (Output_data_dynamic::Dynamic_entry): Add support for
13790 section-plus-offset dynamic table entries.
13791 (Output_data_dynamic::Classification): Likewise.
13792 (Output_data_dynamic::classification_): Renamed offset_.
13793 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13794 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13795 (Target_x86_64::make_plt_section): New function.
13796 (Target_x86_64::reserve_tlsdesc_entries): New function.
13797 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13798 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13799 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13800 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13801 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13802 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13803 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13804 add extra PLT entry for TLS descriptors.
13805 (Output_data_plt_x86_64::got_): New field.
13806 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13807 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13808 fields.
13809 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13810 descriptors.
13811 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13812 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13813 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13814 R_386_TLS_DESC_CALL relocations.
13815 (Target_x86_64::Scan::global): Likewise.
13816 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13817 for TLS descriptors.
13818 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13819 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13820 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13821 GD-to-IE relaxation.
13822 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13823 and TLS_DESCRIPTORS.
13824 * Makefile.in: Rebuild.
13825 * configure: Rebuild.
13826 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13827 (tls_test_shared2.so): New target.
13828 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13829 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13830 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13831 (tls_shared_gd_to_ie_test_LDADD): New variable.
13832 (tls_shared_gnu2_gd_to_ie_test): New target.
13833 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13834 New targets.
13835 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13836 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13837 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13838 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13839 (tls_shared_gnu2_test): New target.
13840 (tls_test_gnu2_shared.so): New target.
13841 (tls_shared_gnu2_test_SOURCES): New variable.
13842 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13843 (tls_shared_gnu2_test_LDFLAGS): New variable.
13844 (tls_shared_gnu2_test_LDADD): New variable.
13845 * testsuite/Makefile.in: Rebuild.
13846 * testsuite/Makefile.
13847
83bfb6b7
ILT
138482008-04-11 Ian Lance Taylor <iant@google.com>
13849
13850 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13851 justsyms.t.
13852 * testsuite/Makefile.in: Rebuild.
13853
13854 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13855 long.
13856 * testsuite/script_test_2.cc (main): Adjust test.
13857
706e1f5e
ILT
138582008-04-11 David S. Miller <davem@davemloft.net>
13859 Ian Lance Taylor <iant@google.com>
13860
13861 * options.h (General_options): Add entries for '-Y' and
13862 '-relax'.
13863 * options.cc (General_options:finalize): If -Y was used, add those
13864 entries to the library path instead of the default "/lib" and
13865 "/usr/lib".
13866
7c98e6bb
DM
138672008-04-11 David S. Miller <davem@davemloft.net>
13868
13869 * testsuite/justsyms.t: Start at 0x100.
13870 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13871 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13872 long.
13873 * testsuite/script_test_2.cc: Adjust string and section length
13874 checks.
7c98e6bb 13875
99a37bfd
ILT
138762008-04-09 Ian Lance Taylor <iant@google.com>
13877
2cefc357
ILT
13878 PR gold/5996
13879 * script-sections.cc (Sections_element::allocate_to_segment): Add
13880 orphan parameter.
13881 (Output_section_definition::allocate_to_segment): Likewise.
13882 (Orphan_output_section::allocate_to_segment): Likewise.
13883 (Script_sections::attach_sections_using_phdrs_clause): Don't
13884 propagate non-PT_LOAD segments to orphan sections.
13885 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13886 readelf rather than objdump.
13887 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13888 .interp section and PT_INTERP segment are the same size.
13889 * testsuite/Makefile.in: Rebuild.
13890
99a37bfd
ILT
13891 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13892 aliases for symbols defined in the same object.
13893 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13894 (weak_alias_test_SOURCES): New variable.
13895 (weak_alias_test_DEPENDENCIES): New variable.
13896 (weak_alias_test_LDFLAGS): New variable.
13897 (weak_alias_test_LDADD): New variable.
13898 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13899 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13900 (weak_alias_test_3.o): New target.
13901 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13902 * testsuite/weak_alias_test_main.cc: New file.
13903 * testsuite/weak_alias_test_1.cc: New file.
13904 * testsuite/weak_alias_test_2.cc: New file.
13905 * testsuite/weak_alias_test_3.cc: New file.
13906
780e49c5
ILT
139072008-04-08 Ian Lance Taylor <iant@google.com>
13908
cdb0b8f5
ILT
13909 * options.h (class General_options): Add --noinhibit-exec option.
13910 * main.cc (main): Check --noinhibit-exec.
13911
0864d551
ILT
13912 * options.h (class General_options): Define --wrap as a special
13913 option. Add wrap_symbols_ field.
13914 (General_options::any_wrap_symbols): New function.
13915 (General_options::is_wrap_symbol): New function.
13916 * options.cc (General_options::parse_wrap): New function.
13917 (General_options::General_options): Initialize wrap_symbols_.
13918 * symtab.cc (Symbol_table::wrap_symbol): New function.
13919 (Symbol_table::add_from_object): Handle --wrap.
13920 * symtab.h (class Symbol_table): Declare wrap_symbol.
13921 * target.h (Target::wrap_char): New function.
13922 (Target::Target_info): Add wrap_char field.
13923 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13924 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13925 * testsuite/testfile.cc (Target_test::test_target_info):
13926 Likewise.
13927
789aa6de
ILT
13928 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13929 there is one.
13930
2c38906f
ILT
13931 * layout.h (class Layout): Add added_eh_frame_data_ field.
13932 * layout.cc (Layout::Layout): Initialize new field.
13933 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13934 output section until we find a section we merged successfully.
13935 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13936 that the size be non-zero.
13937
780e49c5
ILT
13938 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13939 qualifier.
13940
7fcd0256
ILT
139412008-04-08 Craig Silverstein <csilvers@google.com>
13942
13943 * configure.ac: Export new conditional variable HAVE_ZLIB.
13944 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13945 on HAVE_ZLIB.
13946 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13947 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13948
6835af53
ILT
139492008-04-07 Ian Lance Taylor <iant@google.com>
13950
e24f324c
ILT
13951 * version.cc (version_string): Set to "1.5".
13952
a036edd8
ILT
13953 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13954 Add issued_non_pic_error_ field. Declare check_non_pic.
13955 (Target_x86_64::Scan::check_non_pic): New function.
13956 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13957 (Target_x86_64::Scan::global): Likewise.
13958
624f8810
ILT
13959 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13960 addend parameter. Change caller. Handle merge sections.
13961 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13962 Address to Addend. Don't add in the result of
13963 local_section_offset, pass down the addend and use the returned
13964 value.
13965 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13966 Update declarations of local_section_offset and symbol_value.
13967 * testsuite/two_file_test_1.cc (t18): New function.
13968 * testsuite/two_file_test_2.cc (f18): New function.
13969 * testsuite/two_file_test_main.cc (main): Call t18.
13970 * testsuite/two_file_test.h (t18, f18): Declare.
13971
6835af53
ILT
13972 * configure.ac: Don't test for objdump, c++filt, or readelf.
13973 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13974 conditionals.
13975 (TEST_READELF): New variable.
13976 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13977 (check_PROGRAMS): Add two_file_strip_test.
13978 (two_file_strip_test): New target.
13979 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13980 (two_file_same_shared_strip_test_SOURCES): New variable.
13981 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13982 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13983 (two_file_same_shared_strip_test_LDADD): New variable.
13984 (two_file_shared_strip.so): New target.
13985 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13986 (ver_test_5.syms, ver_test_7.syms): Likewise.
13987 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13988 (strip_test_3.stdout): Use TEST_OBJDUMP.
13989 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13990
86925eef
CC
139912008-04-04 Cary Coutant <ccoutant@google.com>
13992
13993 * symtab.h (Symbol::is_weak_undefined): New function.
13994 (Symbol::is_strong_undefined): New function.
13995 (Symbol::is_absolute): New function.
13996 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13997 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13998 absolute symbols.
13999 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14000 (weak_undef_test): New target.
14001 * testsuite/Makefile.in: Rebuild.
14002 * testsuite/weak_undef_file1.cc: New file.
14003 * testsuite/weak_undef_file2.cc: New file.
14004 * testsuite/weak_undef_test.cc: New file.
14005
126f3ece
ILT
140062008-04-03 Craig Silverstein <csilvers@google.com>
14007
14008 * compressed_output.h (class Output_compressed_section): Use
14009 unsigned buffer.
14010 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14011 add zlib header.
14012 (zlib_compressed_suffix): Removed.
14013 (Output_compressed_section::set_final_data_size): Use unsigned
14014 buffers.
14015 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14016 Fix linker invocation.
14017 (flagstest_o_specialfile_and_compress_debug_sections):
14018 Likewise.
14019 * testsuite/Makefile.in: Regenerated.
14020
deae2a14
DM
140212008-04-02 David S. Miller <davem@davemloft.net>
14022
14023 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14024 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14025
70752818
ILT
140262008-04-02 Craig Silverstein <csilvers@google.com>
14027
14028 * TODO: New file.
14029
39d0cb0e
ILT
140302008-04-02 Ian Lance Taylor <iant@google.com>
14031
14032 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14033 parameters. Update for new key type to views_. Change all
14034 callers.
14035 (File_read::read): Adjust for byteshift in returned view.
14036 (File_read::add_view): New function, broken out of
14037 find_and_make_view.
14038 (File_read::make_view): New function, broken out of
14039 find_and_make_view.
14040 (File_read::find_or_make_view): Add offset and aligned
14041 parameters. Rewrite accordingly. Change all callers.
14042 (File_read::get_view): Add offset and aligned parameters. Adjust
14043 for byteshift in return value.
14044 (File_read::get_lasting_view): Likewise.
14045 * fileread.h (class File_read): Update declarations.
14046 (class File_read::View): Add byteshift_ field. Add byteshift to
14047 constructor. Add byteshift method.
14048 * archive.h (Archive::clear_uncached_views): New function.
14049 (Archive::get_view): Add aligned parameter. Change all callers.
14050 * object.h (Object::get_view): Add aligned parameter. Change all
14051 callers.
14052 (Object::get_lasting_view): Likewise.
14053
14054 * fileread.cc (File_read::release): Don't call clear_views if
14055 there are multiple objects.
14056 * fileread.h (File_read::clear_uncached_views): New function.
14057 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14058 on the archive.
14059
a1207466
CC
140602008-03-31 Cary Coutant <ccoutant@google.com>
14061
14062 Add thin archive support.
14063 * archive.cc (Archive::armagt): New const.
14064 (Archive::setup): Remove task parameter and calls to unlock.
14065 (Archive::unlock_nested_archives): New function.
14066 (Archive::read_header): Add nested_off parameter. Change
14067 all callers.
14068 (Archive::interpret_header): Likewise.
14069 (Archive::include_all_members): Change to handle thin
14070 archives.
14071 (Archive::include_member): Likewise.
14072 * archive.h (Archive::Archive): Add new parameters and
14073 initializers.
14074 (Archive::armagt): New const.
14075 (Archive::setup): Remove task parameter.
14076 (Archive::unlock_nested_archives): New function.
14077 (Archive::read_header): Add nested_off parameter.
14078 (Archive::interpret_header): Likewise.
14079 (Archive::Nested_archive_table): New typedef.
14080 (Archive::is_thin_archive_): New field.
14081 (Archive::nested_archives_): New field.
14082 (Archive::options_): New field.
14083 (Archive::dirpath_): New field.
14084 (Archive::task_): New field.
14085 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14086 for thin archives. Pass additional parameters to
14087 Archive::Archive. Unlock the archive file after calling
14088 Archive::setup.
cd536b21 14089
479f6503
ILT
140902008-03-29 Ian Lance Taylor <iant@google.com>
14091
686c8caf
ILT
14092 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14093 version symbol to be local.
14094 * testsuite/ver_test_4.sh: New file.
14095 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14096 (check_DATA): Add ver_test_4.syms.
14097 (ver_test_4.syms): New target.
14098 * testsuite/Makefile.in: Rebuild.
14099
ab794b6b
ILT
14100 * output.cc
14101 (Output_section::Input_section_sort_entry::has_priority): New
14102 function.
14103 (Output_section::Input_section_sort_entry::match_file_name): New
14104 function.
14105 (Output_section::Input_section_sort_entry::match_section_name):
14106 Remove.
14107 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14108 Remove.
14109 (Output_section::Input_section_sort_entry::match_section_file):
14110 Remove.
14111 (Output_section::Input_section_sort_compare::operator()): Rewrite
14112 using new Input_section_sort_entry functions. Sort crtbegin and
14113 crtend first. Sort sections with no priority before sections with
14114 a priority.
14115 * testsuite/initpri1.c (d3): Check j != 4.
14116 (cd5): New constructor/destructor function.
14117 (main): Check j != 2.
14118
479f6503
ILT
14119 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14120 new symbol when resolving, don't call set_is_default.
14121 * testsuite/ver_test_7.cc: New file.
14122 * testsuite/ver_test_7.sh: New file.
14123 * testsuite/Makefile.am (ver_test_7.so): New target.
14124 (ver_test_7.o): New target.
14125 (check_SCRIPTS): Add ver_test_7.sh.
14126 (check_DATA): Add ver_test_7.syms.
14127 (ver_test_7.syms): New target.
14128
2fd32231
ILT
141292008-03-28 Ian Lance Taylor <iant@google.com>
14130
14131 * layout.cc (Layout::layout): If we see an input section with a
14132 name that needs sorting, set the must_sort flag for the output
14133 section.
14134 (Layout::make_output_section): If the name of the output section
14135 indicates that it might require sorting, set the may_sort flag.
14136 * output.h (Output_section::may_sort_attached_input_sections): New
14137 function.
14138 (Output_section::set_may_sort_attached_input_sections): New
14139 function.
14140 (Output_section::must_sort_attached_input_sections): New
14141 function.
14142 (Output_section::set_must_sort_attached_input_sections): New
14143 function.
14144 (class Output_section): Declare Input_section_sort_entry. Define
14145 Input_section_sort_compare. Declare
14146 sort_attached_input_sections. Add new fields:
14147 may_sort_attached_input_sections_,
14148 must_sort_attached_input_sections_,
14149 attached_input_sections_are_sorted_.
14150 * output.cc (Output_section::Output_section): Initialize new
14151 fields.
14152 (Output_section::add_input_section): Add an entry to
14153 input_sections_ if may_sort or must_sort are true.
14154 (Output_section::set_final_data_size): Call
14155 sort_attached_input_sections if necessary.
14156 (Output_section::Input_section_sort_entry): Define new class.
14157 (Output_section::Input_section_sort_compare::operator()): New
14158 function.
14159 (Output_section::sort_attached_input_sections): New function.
14160 * configure.ac: Check whether the compiler supports constructor
14161 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14162 * testsuite/initpri1.c: New file.
14163 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14164 CONSTRUCTOR_PRIORITY.
14165 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14166 (initpri1_LDFLAGS): New variable.
14167 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14168
18e6b24e
ILT
141692008-03-27 Ian Lance Taylor <iant@google.com>
14170
49bdd526
ILT
14171 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14172 * testsuite/common_test_1.c: New file.
14173 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14174 (common_test_1_SOURCES): New variable.
14175 (common_test_1_DEPENDENCIES): New variable.
14176 (common_test_1_LDFLAGS): New variable.
14177
18e6b24e
ILT
14178 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14179 and commons_ correctly when NAME/VERSION does not override
14180 NAME/NULL.
14181 * testsuite/ver_test_6.c: New file.
14182 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14183 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14184 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14185
04bf7072
ILT
141862008-03-26 Ian Lance Taylor <iant@google.com>
14187
5871526f
ILT
14188 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14189 of an undefined symbol from a version script.
14190 * testsuite/Makefile.am (ver_test_5.so): New target.
14191 (ver_test_5.o): New target.
14192 (check_SCRIPTS): Add ver_test_5.sh.
14193 (check_DATA): Add ver_test_5.syms.
14194 (ver_test_5.syms): New target.
14195 * testsuite/ver_test_5.cc: New file.
14196 * testsuite/ver_test_5.script: New file.
14197 * testsuite/ver_test_5.sh: New file.
14198 * Makefile.in, testsuite/Makefile.in: Rebuild.
14199
04bf7072
ILT
14200 PR gold/5986
14201 Fix problems building gold with gcc 4.3.0.
14202 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14203 (gold_error_at_location, gold_warning_at_location): Use it.
14204 * configure.ac: Check whether we can compile and use a template
14205 function with a printf attribute.
14206 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14207 when jumping over bytes.
14208 * object.cc: Instantiate Object::read_section_data.
14209 * debug.h: Include <cstring>
14210 * dwarf_reader.cc: Include <algorithm>
14211 * main.cc: Include <cstring>.
14212 * options.cc: Include <cstring>.
14213 * output.cc: Include <cstring>.
14214 * script.cc: Include <cstring>.
14215 * script.h: Include <string>.
14216 * symtab.cc: Include <cstring> and <algorithm>.
14217 * target-select.cc: Include <cstring>.
14218 * version.cc: Include <string>.
14219 * testsuite/testmain.cc: Include <cstdlib>.
14220 * configure, config.in: Rebuild.
14221
874c5b28
ILT
142222008-03-25 Ian Lance Taylor <iant@google.com>
14223
819d6c3a
ILT
14224 * options.cc: Include "../bfd/bfdver.h".
14225 (options::help): Print bug reporting address.
14226
f4b2c6f5
ILT
14227 * version.cc (print_version): Adjust output for current value of
14228 BFD_VERSION_STRING.
14229
14230 * NEWS: New file.
14231
e96caa79
ILT
14232 * options.cc (options::help): Print list of supported targets.
14233 * target-select.h: Include <vector>.
14234 (class Target_selector): Make machine_, size_, and is_big_endian_
14235 fields const. Add bfd_name_ and instantiated_target_ fields.
14236 (Target_selector::Target_selector): Add bfd_name parameter.
14237 (Target_selector::recognize): Make non-virtual, call
14238 do_recognize.
14239 (Target_selector::recognize_by_name): Make non-virtual, call
14240 do_recognize_by_name.
14241 (Target_selector::supported_names): New function.
14242 (Target_selector::bfd_name): New function.
14243 (Target_selector::do_instantiate_target): New pure virtual
14244 function.
14245 (Target_selector::do_recognize): New virtual function.
14246 (Target_selector::do_recognize_by_name): New virtual function.
14247 (Target_selector::instantiate_target): New private function.
14248 (supported_target_names): Declare.
14249 * target-select.cc (Target_selector::Target_selector): Update for
14250 new parameter and fields.
14251 (select_target_by_name): Check that the name matches before
14252 calling recognize_by_name.
14253 (supported_target_names): New function.
14254 * i386.cc (class Target_selector_i386): Update Target_selector
14255 constructor call. Remove recognize and recognize_by_name. Add
14256 do_instantiate_target.
14257 * x86_64.cc (class Target_selector_x86_64): Likewise.
14258 * testsuite/testfile.cc (class Target_selector_test): Update for
14259 changes to Target_selector.
14260
874c5b28
ILT
14261 * README: Rewrite, with some notes on unsupported features.
14262
0a65a3a7
CC
142632008-03-24 Cary Coutant <ccoutant@google.com>
14264
14265 * i386.cc (Target_i386::Got_type): New enum declaration.
14266 (Target_i386::Scan::local): Updated callers of Output_data_got
14267 member functions.
14268 (Target_i386::Scan::global): Likewise.
14269 (Target_i386::Relocate::relocate): Likewise.
14270 (Target_i386::Relocate::relocate_tls): Likewise.
14271 * object.h (Got_offset_list): New class.
14272 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14273 (Sized_relobj::local_got_offset): Likewise.
14274 (Sized_relobj::set_local_got_offset): Likewise.
14275 (Sized_relobj::local_has_tls_got_offset): Removed.
14276 (Sized_relobj::local_tls_got_offset): Removed.
14277 (Sized_relobj::set_local_tls_got_offset): Removed.
14278 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14279 * output.cc (Output_data_got::add_global): Added got_type parameter.
14280 (Output_data_got::add_global_with_rel): Likewise.
14281 (Output_data_got::add_global_with_rela): Likewise.
14282 (Output_data_got::add_global_pair_with_rel): New function.
14283 (Output_data_got::add_global_pair_with_rela): New function.
14284 (Output_data_got::add_local): Added got_type parameter.
14285 (Output_data_got::add_local_with_rel): Likewise.
14286 (Output_data_got::add_local_with_rela): Likewise.
14287 (Output_data_got::add_local_pair_with_rel): New function.
14288 (Output_data_got::add_local_pair_with_rela): New function.
14289 (Output_data_got::add_global_tls): Removed.
14290 (Output_data_got::add_global_tls_with_rel): Removed.
14291 (Output_data_got::add_global_tls_with_rela): Removed.
14292 (Output_data_got::add_local_tls): Removed.
14293 (Output_data_got::add_local_tls_with_rel): Removed.
14294 (Output_data_got::add_local_tls_with_rela): Removed.
14295 * output.h (Output_data_got::add_global): Added got_type parameter.
14296 (Output_data_got::add_global_with_rel): Likewise.
14297 (Output_data_got::add_global_with_rela): Likewise.
14298 (Output_data_got::add_global_pair_with_rel): New function.
14299 (Output_data_got::add_global_pair_with_rela): New function.
14300 (Output_data_got::add_local): Added got_type parameter.
14301 (Output_data_got::add_local_with_rel): Likewise.
14302 (Output_data_got::add_local_with_rela): Likewise.
14303 (Output_data_got::add_local_pair_with_rel): New function.
14304 (Output_data_got::add_local_pair_with_rela): New function.
14305 (Output_data_got::add_global_tls): Removed.
14306 (Output_data_got::add_global_tls_with_rel): Removed.
14307 (Output_data_got::add_global_tls_with_rela): Removed.
14308 (Output_data_got::add_local_tls): Removed.
14309 (Output_data_got::add_local_tls_with_rel): Removed.
14310 (Output_data_got::add_local_tls_with_rela): Removed.
14311 * resolve.cc (Symbol::override_base_with_special): Removed
14312 reference to has_got_offset_ field.
14313 * symtab.cc (Symbol::init_fields): Replaced initialization
14314 of got_offset_ with got_offsets_. Removed initialization
14315 of has_got_offset_
53fcba31 14316 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14317 (Symbol::got_offset): Likewise.
14318 (Symbol::set_got_offset): Likewise.
14319 (Symbol::has_tls_got_offset): Removed.
14320 (Symbol::tls_got_offset): Removed.
14321 (Symbol::set_tls_got_offset): Removed.
14322 (Symbol::got_offset_): Removed.
14323 (Symbol::tls_mod_got_offset_): Removed.
14324 (Symbol::tls_pair_got_offset_): Removed.
14325 (Symbol::got_offsets_): New field.
14326 (Symbol::has_got_offset): Removed.
14327 (Symbol::has_tls_mod_got_offset): Removed.
14328 (Symbol::has_tls_pair_got_offset): Removed.
14329 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14330 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14331 member functions.
14332 (Target_x86_64::Scan::global): Likewise.
14333 (Target_x86_64::Relocate::relocate): Likewise.
14334 (Target_x86_64::Relocate::relocate_tls): Likewise.
14335
bd52eafb
BE
143362008-03-25 Ben Elliston <bje@au.ibm.com>
14337
14338 * yyscript.y: Fix spelling error in comment.
14339
8b105e34
ILT
143402008-03-24 Ian Lance Taylor <iant@google.com>
14341
8ed814a9
ILT
14342 * options.h (class General_options): Define build_id option.
14343 * layout.h (class Layout): Declare write_build_id, create_note,
14344 create_build_id. Add build_id_note_ member.
14345 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14346 "libiberty.h", "md5.h", "sha1.h".
14347 (Layout::Layout): Initialize eh_frame_data_,
14348 eh_frame_hdr_section_, and build_id_note_.
14349 (Layout::finalize): Call create_build_id.
14350 (Layout::create_note): New function, broken out of
14351 Layout::create_gold_note.
14352 (Layout::create_gold_note): Call create_note.
14353 (Layout::create_build_id): New function.
14354 (Layout::write_build_id): New function.
14355 (Close_task_runner::run): Call write_build_id.
14356
8b105e34
ILT
14357 * x86_64.cc: Correct license to GPLv3.
14358
086a1841
ILT
143592008-03-23 Ian Lance Taylor <iant@google.com>
14360
14361 * options.cc: Include "demangle.h".
14362 (parse_optional_string): New function.
14363 (parse_long_option): Handle takes_optional_argument.
14364 (parse_short_option): Update dash_z initializer. Handle
14365 takes_optional_argument.
14366 (General_options::General_options): Initialize do_demangle_.
14367 (General_options::finalize): Set do_demangle_. Handle demangling
14368 style.
14369 * options.h (parse_optional_string): Declare.
14370 (struct One_option): Add optional_arg field. Update constructor.
14371 Update call constructor calls. Add takes_optional_argument
14372 function.
14373 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14374 (DEFINE_optional_string): Define.
14375 (General_options::demangle): Change from DEFINE_bool to
14376 DEFINE_optional_string.
14377 (General_options::no_demangle): New function.
14378 (General_options::do_demangle): New function.
14379 (General_options::set_do_demangle): New function.
14380 (General_options::execstack_status_): Move definition to end of
14381 class definition.
14382 (General_options::static_): Likewise.
14383 (General_options::do_demangle_): New field.
14384 * object.cc (big_endian>::get_symbol_location_info): Call
14385 Options::do_demangle, not Options::demangle.
14386 * symtab.cc (demangle): Likewise.
14387
cbb93e63
ILT
143882008-03-22 Ian Lance Taylor <iant@google.com>
14389
14390 * gold.h: Include <cstddef> and <sys/types.h>
14391 * options.h: Include <cstring>.
14392
ec531623
ILT
143932008-03-21 Ian Lance Taylor <iant@google.com>
14394
14395 * Added source code to GNU binutils.
752937aa
NC
14396\f
14397Copyright (C) 2008-2012 Free Software Foundation, Inc.
14398
14399Copying and distribution of this file, with or without modification,
14400are permitted in any medium without royalty provided the copyright
14401notice and this notice are preserved.
14402
14403Local Variables:
14404mode: change-log
14405left-margin: 8
14406fill-column: 74
14407version-control: never
14408End:
This page took 0.881107 seconds and 4 git commands to generate.