*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
29bd8b6b
CC
12013-01-28 Cary Coutant <ccoutant@google.com>
2
3 * dwp.cc (File_list): New typedef.
4 (Dwo_name_info_reader): New class.
5 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
6 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
7 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
8 (Dwo_file::read_executable): New function.
9 (Dwo_file::read): Move common setup code to ...
10 (Dwo_file::make_object): ... here.
11 (dwp_options): Add --exec/-e.
12 (usage): Likewise.
13 (main): Likewise.
14
c6ac678d
ST
152013-01-24 Sriraman Tallam <tmsriram@google.com>
16
17 * layout.cc (Layout::layout): Check for option text_reorder.
18 (Layout::make_output_section): Ditto.
19 * options.h (text_reorder): New option.
20 * output.cc (Input_section_sort_compare): Remove special ordering
21 of section names.
22 (Output_section::
23 Input_section_sort_section_name_special_ordering_compare::
24 operator()): New function.
25 (Output_section::sort_attached_input_sections): Use new sort function
26 for .text.
27 * output.h (Input_section_sort_section_name_special_ordering_compare):
28 New struct.
29 * testsuite/Makefile.am (text_section_grouping): Test option
30 --no-text-reorder
31 * testsuite/Makefile.in: Regenerate.
32 * testsuite/text_section_grouping.sh: Check order of functions without
33 default text reordering.
34
50701cc1
MF
352013-01-18 Mike Frysinger <vapier@gentoo.org>
36
37 * options.h (General_options): Change default to true for new_dtags.
38
b1b00fcc
MF
392013-01-18 Mike Frysinger <vapier@gentoo.org>
40
41 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
42 when enable_new_dtags is false. Only add DT_RUNPATH when
43 enable_new_dtags is true.
44
ec5b8187
AM
452013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
46
47 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
48 used in declaration and definition consistent.
49 (Target_powerpc::symval_for_branch): Ditto.
50
a880d4c4
ST
512013-01-16 Sriraman Tallam <tmsriram@google.com>
52
53 * testsuite/plugin_final_layout.cc: Fix comment.
54
7c381248
ST
552013-01-16 Sriraman Tallam <tmsriram@google.com>
56
57 * layout.cc (Layout::layout): Do not do default sorting for
58 text sections when section ordering is specified.
59 (make_output_section): Ditto.
60 * testsuite/plugin_final_layout.cc: Name the function sections
61 to catch reordering issues.
62
e2458743
AM
632013-01-15 Alan Modra <amodra@gmail.com>
64
65 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
66 plt-thread-safe.
67
431ed302
AM
682013-01-15 Alan Modra <amodra@gmail.com>
69
70 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
71 * testsuite/Makefile.in: Regenerate.
72
0ec6429b
AM
732013-01-14 Alan Modra <amodra@gmail.com>
74
75 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
76 * testsuite/Makefile.in: Regenerate.
77
0bf402d5
ILT
782013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
79
36af3926 80 PR bfd/14430
0bf402d5
ILT
81 Fix mingw gold build with plugins enabled
82 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
83 * configure.ac: Export DLOPEN_LIBS and add headers check.
84 * plugin.cc: Handle non-dlfcn case.
85 * Makefile.in: Regenerate.
86 * config.in: Regenerate.
87 * configure: Regenerate.
88 * testsuite/Makefile.in: Regenerate.
89
9e9143bc
ST
902013-01-09 Sriraman Tallam <tmsriram@google.com>
91
92 * output.h (sort_attached_input_sections): Change to be public.
93 * script-sections.cc
94 (Output_section_definition::set_section_addresses): Sort
95 attached input sections according to section order before linker
96 script assigns section addresses.
97 (Orphan_output_section::set_section_addresses): Sort
98 attached input sections according to section order before linker
99 script assigns section addresses.
100 * Makefile.am (final_layout.sh): Use a simple linker script to
101 check if section ordering still works.
102 * Makefile.in: Regenerate.
103
679af368
ILT
1042013-01-09 Ben Cheng <bccheng@google.com>
105
106 * arm.cc (Target_arm::attributes_accept_div): New function.
107 (Target_arm::attributes_forbid_div): New function.
108 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
109 attribute using the same new functions as what bfd/elf32_arm.c
110 does.
111
3136a00e
CC
1122013-01-07 Cary Coutant <ccoutant@google.com>
113
114 PR gold/14993
115 * output.cc (Output_section::add_input_section): For incremental
116 updates, don't track input sections that are allocated from patch
117 space.
118
f2a6224b
L
1192013-01-07 H.J. Lu <hongjiu.lu@intel.com>
120 Ian Lance Taylor <iant@google.com>
121
122 PR gold/14897
123 * configure.ac (--enable-ld): Removed.
124 (install_as_default): Set to yes only for --enable-gold=default
125 or --disable-ld.
126 * configure: Regenerated.
127
4f46f626
L
1282013-01-07 H.J. Lu <hongjiu.lu@intel.com>
129
130 * options.h (General_options): Add -fuse-ld= for GCC linker
131 option compatibility.
132
26e4ef59
CC
1332013-01-04 Cary Coutant <ccoutant@google.com>
134
135 * configure.ac: Fix typo restoring CXXFLAGS.
136 * configure: Regenerate.
137
3d587466
CC
1382013-01-04 Cary Coutant <ccoutant@google.com>
139
4f46f626
L
140 * testsuite/Makefile.am (CXXLINK_S): New macro.
141 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
142 * testsuite/Makefile.in: Regenerate.
3d587466 143
44db6695
L
1442013-01-02 H.J. Lu <hongjiu.lu@intel.com>
145
146 * version.cc (print_version): Update copyright year to 2013.
147
edcac0c1
ILT
1482012-12-20 Ian Lance Taylor <iant@google.com>
149
150 * layout.cc (Layout::special_ordering_of_input_section): New
151 function.
152 (Layout::layout): If input section requires special ordering, must
153 sort input sections.
154 (Layout::make_output_section): May sort .text input sections.
155 (Layout::is_section_name_prefix_grouped): Remove.
156 * layout.h (class Layout): Declare
157 special_ordering_of_input_section. Don't declare
158 is_section_name_prefix_grouped.
159 * output.cc (Output_section::add_input_section): Revert last
160 change.
161 (Output_section::Input_section_sort::match_file_name): Don't crash
162 if called on output section data.
163 (Output_section::Input_section_sort_compare): Sort based on
164 special ordering.
165 (Output_section::Input_section_sort_section_order_index_compare):
166 Revert last patch.
167 (Output_section::sort_attached_input_sections): Likewise.
168
28f2a4ac
ST
1692012-12-18 Sriraman Tallam <tmsriram@google.com>
170
edcac0c1 171 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
172 * layout.h (Layout::is_section_name_prefix_grouped): New function.
173 * output.cc (Output_section::add_input_section): Check if section
174 name contains special prefix. Keep input sections to sort such
175 sections.
176 (Output_section::Input_section_sort_section_order_index_compare
177 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
178 (Output_section::sort_attached_input_sections): Add condition to
179 Input_section_entry constructor call.
28f2a4ac
ST
180 * testsuite/Makefile.am (text_section_grouping): New test.
181 * testsuite/Makefile.in: Regenerate.
182 * testsuite/text_section_grouping.cc: New file.
183 * testsuite/text_section_grouping.sh: New file.
184
5bf135a7
NC
1852012-12-17 Nick Clifton <nickc@redhat.com>
186
187 * Makefile.am: Add copyright notice.
188 * NEWS: Likewise.
189 * README: Likewise.
190 * configure.ac: Likewise.
191 * ftruncate.c: Likewise.
192 * Makefile.in: Regenerate.
193
59965708
CC
1942012-12-14 Cary Coutant <ccoutant@google.com>
195
196 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
197 --no-as-needed flag.
198 (exception_separate_shared_12_test): Likewise.
199 (incremental_copy_test): Likewise.
200 * testsuite/Makefile.in: Regenerate.
201
2a77e2ab
CC
2022012-12-14 Cary Coutant <ccoutant@google.com>
203
204 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
205 (Dwp_output_file::Dwp_index::enter_set): Add assert.
206
e3deeb9c
AM
2072012-12-12 Alan Modra <amodra@gmail.com>
208
209 * powerpc.cc (class Track_tls): New.
210 (class Relocate, class Scan): Inherit Track_tls.
211 (Target_powerpc::Scan::local, global): Track tls optimization
212 and avoid creating plt entry for __tls_get_addr if all uses
213 are optimized away.
214 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
215
d8f5a274
AM
2162012-12-12 Alan Modra <amodra@gmail.com>
217
218 * options.h (General_options): Add --toc-sort/--no-toc-sort.
219 Replace no_toc_optimize with toc_optimize.
220 * output.h (Output_section::input_sections): Provide non-const variant.
221 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
222 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
223 accessors.
224 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
225 (class Sort_toc_sections): New.
226 (Target_powerpc::do_finalize_sections): Sort toc sections.
227 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
228
4c8a1de1
RM
2292012-12-10 Roland McGrath <mcgrathr@google.com>
230
231 * testsuite/binary_unittest.cc (read_all): New function.
232 (Sized_binary_test): Use it instead of ::read.
233 * fileread.cc (do_read): Don't assume pread always reads the whole
234 amount in a single call.
235
edc27beb
AM
2362012-12-10 Alan Modra <amodra@gmail.com>
237
238 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
239 Set EM_PPC64 or EM_PPC here.
240 (Target_selector_powerpc::do_recognize): Delete.
241
906b9150
AM
2422012-12-10 Alan Modra <amodra@gmail.com>
243
244 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
245 stub_table_.
246 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
247
418c15ae
RM
2482012-12-07 Roland McGrath <mcgrathr@google.com>
249
250 * testsuite/binary_unittest.cc (Sized_binary_test):
251 Use open_descriptor rather than ::open.
252
decdd3bc
AM
2532012-12-07 Alan Modra <amodra@gmail.com>
254
255 * powerpc.cc (Stub_table::do_write): Delete redundant Address
256 typedef and invalid_address constant.
257 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
258 instantiate constants.
259
db399005
ILT
2602012-12-06 Roland McGrath <mcgrathr@google.com>
261
262 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
263 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
264 * aclocal.m4: Regenerate.
265 * configure: Regenerate.
266 * Makefile.in: Regenerate.
267 * testsuite/Makefile.in: Regenerate.
268
aba6bc71
AM
2692012-12-07 Alan Modra <amodra@gmail.com>
270
271 * options.h (General_options): Add no_toc_optimize.
272 * powerpc.cc (ok_lo_toc_insn): New function.
273 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
274
9e69ed50
AM
2752012-12-06 Alan Modra <amodra@gmail.com>
276
277 * options.h (General_options): Add plt_align, plt_static_chain,
278 plt_thread_safe. Update stub_group_size help text.
279 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
280 for new plt_thread_safe_ var.
281 (use_plt_offset): Correct comments.
282 (Target_powerpc::do_relax): Look for thread creation symbols to
283 determine default plt_thread_safe value. Clear plt call stubs
284 as well as branch stubs each iteration.
285 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
286 insn constants.
287 (l, hi, ha, write_insn): Move earlier.
288 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
289 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
290 plt stubs too.
291 (Stub_table::update_size): Adjust.
292 (Stub_table::prev_size, set_prev_size): Delete.
293 (Stub_table::stub_align): Let --plt-align affect result.
294 (Stub_table::plt_call_size): Calculate sizes for various stubs.
295 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
296 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
297 (Stub_table::do_write): Support more stub variants.
298
f43ba157
AM
2992012-12-04 Alan Modra <amodra@gmail.com>
300
301 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
302 (Target_powerpc::do_define_standard_symbols): New function.
303
34171bc5
AM
3042012-12-03 Alan Modra <amodra@gmail.com>
305
306 * output.h: Formatting, whitespace.
307
dc9589e9 3082012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
309
310 * layout.h (Layout::get_executable_sections): Declare.
311 * layout.cc (Layout::get_executable_sections): New function.
312 * arm.cc (Target_arm::group_sections): Use it.
313 (Arm_output_section::group_sections): Delete now redundant test.
314 * output.cc (Output_reloc::Output_reloc): Add is_relative.
315 param to handle relative relocs.
316 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
317 (Output_data_reloc::add_absolute): Adjust.
318 (Output_data_reloc::add_relative): New function.
319 (Output_data::reset_data_size): New function.
320 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
321 (Output_section::set_addralign): New function.
322 (Output_section::checkpoint_set_addralign): New function.
323 (Output_section::clear_section_offsets_need_adjustment): New function.
324 (Output_section::input_sections): Make public.
325 * powerpc.cc (class Output_data_brlt_powerpc): New.
326 (class Stub_table, class Stub_control): New.
327 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
328 stub_table_, set_stub_table, stub_table): New vectors and accessor
329 functions.
330 (Target_powerpc::do_may_relax, do_relax, push_branch,
331 new_stub_table, stub_tables, brlt_section, group_sections,
332 add_branch_lookup_table, find_branch_lookup_table,
333 write_branch_lookup_table, make_brlt_section): New functions.
334 (Target_powerpc::struct Sort_sections, class Branch_info): New.
335 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
336 branch_info_): New vars.
337 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
338 make call stubs here.
339 (Output_data_glink): Remove all call stub handling from this class.
340 (Target_powerpc::Scan::local, global): Save interesting branch
341 relocs and relocs for ifunc. Adjust calls to plt entry functions.
342 (Target_powerpc::do_finalize_sections): Only make reg save/restore
343 functions on final link.
344 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
345 Handle long branch destinations too.
346 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
347 do_plt_address_for_local): Adjust lookup of plt call stubs.
348
627b30b7
AM
3492012-11-30 Alan Modra <amodra@gmail.com>
350
351 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
352 relocs against protected symbols when building 32-bit shared libs.
353
40b469d7
AM
3542012-11-30 Alan Modra <amodra@gmail.com>
355
356 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
357 param. Call got_section() to make .got. Update all callers
358 and their callers and so on.
359
bb66a627
AM
3602012-11-30 Alan Modra <amodra@gmail.com>
361
362 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
363 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
364 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
365 value if it already exists.
366
d2cf1c6c
L
3672012-11-19 H.J. Lu <hongjiu.lu@intel.com>
368
369 PR gold/14858
370 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
371
edccdf7c
RM
3722012-11-14 Roland McGrath <mcgrathr@google.com>
373
374 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
375 than bfc instruction for data sandboxing.
376
6febeb74
AM
3772012-11-08 Alan Modra <amodra@gmail.com>
378
379 * po/POTFILES.in: Regenerate.
380
0a6f1bf2
AM
3812012-11-05 Alan Modra <amodra@gmail.com>
382
383 * configure.ac: Apply 2012-09-10 change to config.in here.
384 * configure: Regenerate.
385
26a4e9cb
AM
3862012-11-05 Alan Modra <amodra@gmail.com>
387
388 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
389 (struct Opd_ent): Use "Address" rather than "Offset".
390 (Output_data_got_powerpc::got_base_offset): Return Valtype.
391 (Target_powerpc::got_section): Make public.
392 (Target_powerpc::scan_relocs): Move code setting symbols..
393 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
394 Create _SDA_BASE_ only when referenced.
395
cc928013
RM
3962012-11-02 Roland McGrath <mcgrathr@google.com>
397
398 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
399 from last change.
400
50ed5eb1
RM
4012012-11-01 Roland McGrath <mcgrathr@google.com>
402
62fe925a
RM
403 * target.h (Sized_target::relocate_relocs): Use Elf_Off
404 for offset_in_output_section parameter.
405 (Sized_target::relocate_special_relocatable): Likewise.
406 * arm.cc (Target_arm::relocate_relocs): Likewise.
407 (Target_arm::relocate_special_relocatable): Likewise.
408 * i386.cc (Target_i386::relocate_relocs): Likewise.
409 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
410 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
411 * target-reloc.h (relocate_relocs): Likewise.
412 * testsuite/testfile.cc (Target_test): Likewise.
413 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
414 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
415
416 * system.h: Move inclusion of <clocale> to after <libintl.h> in
417 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
418
419 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
420 parameter, which is unused in the [!F_SETFD] case.
421
50ed5eb1
RM
422 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
423 SYMNDX to off_t before comparing it to this->data_size().
424 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
425 * incremental.cc (Output_section_incremental_inputs::do_write):
426 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
427
2cadc0bf
RM
428 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
429
3bfcb652
NC
4302012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
431
432 * gold.cc (Target_arm::do_adjust_elf_header): Add the
433 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
434 in EABI_VER5.
435
c1a8d56e
CC
4362012-10-29 Cary Coutant <ccoutant@google.com>
437
438 * dwp.cc (usage): Add file and exit status parameters;
439 add --help and --version options.
440 (print_version): New function.
441 (main): Add --help and --version options.
442
b2490a7b
L
4432012-10-25 H.J. Lu <hongjiu.lu@intel.com>
444
445 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
446 final_layout_sequence.txt.
447 * testsuite/Makefile.in: Regenerated.
448
aa543512
L
4492012-10-25 H.J. Lu <hongjiu.lu@intel.com>
450
451 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
452 COMPILE generated by automake.
453 (LINK1): Likewise.
454 (CXXCOMPILE1): Likewise.
455 (CXXLINK1): Likewise.
456 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
457 (LINK): Likewise.
458 (CXXCOMPILE): Likewise.
459 (CXXLINK): Likewise.
460 * testsuite/Makefile.in: Regenerated.
461
d361fafb
L
4622012-10-25 H.J. Lu <hongjiu.lu@intel.com>
463
464 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
465 on bad fwrite return.
466
598c7410
L
4672012-10-25 H.J. Lu <hongjiu.lu@intel.com>
468
469 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
470 on val.
471
35c813e2
CC
4722012-10-23 Cary Coutant <ccoutant@google.com>
473
474 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
475 * testsuite/Makefile.in: Regenerate.
476 * testsuite/dwp_test.h: New source file.
477 * testsuite/dwp_test_1.cc: New source file.
478 * testsuite/dwp_test_1.s: New source file.
479 * testsuite/dwp_test_1.sh: New source file.
480 * testsuite/dwp_test_1b.cc: New source file.
481 * testsuite/dwp_test_1b.s: New source file.
482 * testsuite/dwp_test_2.cc: New source file.
483 * testsuite/dwp_test_2.s: New source file.
484 * testsuite/dwp_test_2.sh: New source file.
485 * testsuite/dwp_test_main.cc: New source file.
486 * testsuite/dwp_test_main.s: New source file.
487
77429909
CC
4882012-10-23 Cary Coutant <ccoutant@google.com>
489
490 * dwp.h: New header file.
491 * dwp.cc: New source file.
492 * gold.h: Move shared declarations to system.h.
493 * system.h: New header file.
494 * Makefile.am: Add dwp.
495 * Makefile.in: Regenerate.
496
ed5d6712
CC
4972012-10-23 Cary Coutant <ccoutant@google.com>
498
499 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
500 Dwarf_info_reader::read_from_pointer.
501 (Dwarf_pubnames_table::read_header): Likewise.
502 (Dwarf_pubnames_table::next_name): Likewise.
503 (Dwarf_die::read_attributes): Likewise.
504 (Dwarf_die::skip_attributes): Likewise.
505 (Dwarf_info_reader::read_from_pointer): New function template.
506 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
507 (Dwarf_pubnames_table): Likewise.
508 (Dwarf_info_reader::read_from_pointer): New function template.
509 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
510 Dwarf_pubnames_table ctor.
511
8787852d
CC
5122012-10-23 Cary Coutant <ccoutant@google.com>
513
514 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
515 abbrev_shndx.
516 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
517 abbrev_shndx_.
518 (Dwarf_info_reader::set_abbrev_shndx): New method.
519 (Dwarf_info_reader::abbrev_shndx_): New data member.
520
9fc236f3
CC
5212012-10-23 Cary Coutant <ccoutant@google.com>
522
523 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
524 from object, not parameters.
525 (Dwarf_info_reader::parse): Likewise.
526 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
527 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
528 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
529 methods.
530
effe8365
CC
5312012-10-23 Cary Coutant <ccoutant@google.com>
532
533 * fileread.cc (Input_file::Input_file): New constructor.
534 * fileread.h (class Input_file): Add new constructor.
535
1698990d
AM
5362012-10-18 Alan Modra <amodra@gmail.com>
537
538 PR gold/14727
539 * object.cc (Relobj::is_section_name_included): Also match
540 .sdata personality section.
541
168a4726
AM
5422012-10-18 Alan Modra <amodra@gmail.com>
543
544 * target-reloc.h (class Default_comdat_behavior): New, package up..
545 (get_comdat_behaviour): ..this.
546 (relocate_section): Add Relocate_comdat_behavior template arg,
547 adjust code to suit.
548 * arm.cc (Target_arm::relocate_section): Adjust to suit.
549 (Target_arm::scan_reloc_section): Likewise.
550 * i386.cc (Target_i386::relocate_section): Likewise.
551 * sparc.cc (Target_sparc::relocate_section): Likewise.
552 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
553 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
554 * powerpc.cc (class Relocate_comdat_behavior): New.
555 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
556 gold::relocate_section with new template arg.
557
acc276d8
AM
5582012-10-18 Alan Modra <amodra@gmail.com>
559
560 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
561 dynamic relocs for GOT_TPREL got entries, without symbol if
562 resolving locally.
563 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
564 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
565 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
566
e10f9870
AM
5672012-10-17 Alan Modra <amodra@gmail.com>
568
569 PR gold/14726
570 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
571
ae034989
ST
5722012-10-16 Sriraman Tallam <tmsriram@google.com>
573
574 * layout.cc (Layout::include_section): Keep sections marked
575 SHF_EXCLUDE when doing relocatable links.
576
f3a0ed29
AM
5772012-10-16 Alan Modra <amodra@gmail.com>
578
579 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
580 (Target_powerpc::do_finalize_sections): Call it.
581 (Output_data_save_res): New class and supporting functions.
582 (Target_powerpc::symval_for_branch): Only look up .opd entry for
583 normal symbols defined in object files.
584
c6de8ed4
AM
5852012-10-12 Alan Modra <amodra@gmail.com>
586
587 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
588 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
589 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
590 section if scan_opd_relocs not yet called.
591 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
592
03e25981
AM
5932012-10-12 Alan Modra <amodra@gmail.com>
594
595 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
596 add_local_ifunc_entry): Revert last change.
597 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
598
c9824451
AM
5992012-10-05 Alan Modra <amodra@gmail.com>
600
601 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
602 do_plt_address_for_global): New functions.
603 (Output_data_got_powerpc::do_write): Don't segfault when linking
604 statically.
605 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
606 add_local_ifunc_entry): Return true on adding entry..
607 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
608 glink->add_entry call. Remove unused symtab param. Adjust calls.
609 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
610 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
611 set up symbols here.
612 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
613 syms here. Do so even when no .iplt. Don't segfault when linking
614 statically.
615 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
616 new variants without reloc param.
617 (Glink_sym_ent::Glink_sym_ent): Likewise.
618 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
619 reloc when refs will resolve to plt call stub.
620 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
621 R_PPC_PLTREL24 to resolve locally.
622 (Target_powerpc::Scan::global): Correct ifunc handling.
623 (Target_powerpc::Relocate::relocate): Correct local sym glink
624 lookup. Don't destroy "value" when we have a plt call stub,
625 and when checking plt call validity.
626 (Target_powerpc::do_dynsym_value): Simplify.
627
19fec8c1
AM
6282012-10-05 Alan Modra <amodra@gmail.com>
629
630 * i386.cc (Output_data_plt_i386::address_for_global,
631 address_for_local): Add plt offset to returned value. Adjust uses.
632 * sparc.cc (Output_data_plt_sparc::address_for_global,
633 address_for_local): Likewise.
634 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
635 address_for_local): Likewise.
636 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
637 address_for_local): Likewise.
638 * target.h (Target::plt_address_for_global, plt_address_for_local):
639 Update comment.
640 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
641 (Output_data_got::Got_entry::write): Nor here.
642 * output.h: Comment fix.
643
e867b647
WL
6442012-10-02 Jiong Wang <jiwang@tilera.com>
645
646 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
647 global_offset_table_ value for larget got.
648 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
649
e5d5f5ed
AM
6502012-09-29 Alan Modra <amodra@gmail.com>
651
652 * powerpc.cc (Target_powerpc::iplt_): New output section.
653 (Target_powerpc::iplt_section, make_iplt_section,
654 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
655 (Target_powerpc::make_plt_entry): Handle ifunc syms.
656 Target_powerpc::plt_entry_count): Count iplt entries too.
657 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
658 reloc section in constructor. New params.
659 (Target_powerpc::make_plt_section): Create reloc section here instead.
660 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
661 functions.
662 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
663 (Output_data_glink::add_entry, find_entry): New functions to
664 deal with local syms.
665 (Glink_sym_ent): Add support for local syms.
666 (Output_data_glink::do_write): Handle ifunc plt entries.
667 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
668 (Target_powerpc::Scan::local, global): Handle ifunc syms.
669 (Target_powerpc::Relocate::relocate): Likewise.
670 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
671
ec4dbad3
AM
6722012-09-25 Alan Modra <amodra@gmail.com>
673
674 * object.h (Sized_relobj_file::adjust_local_symbol,
675 do_adjust_local_symbol): New functions.
676 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
677 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
678 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
679 and irregular opd entry spacing.
680 (Powerpc_relobj::do_read_relocs): Add opd size checks.
681 (Global_symbol_visitor_opd): New functor.
682 (Target_powerpc::do_finalize_sections): Omit global symbols defined
683 on deleted opd entries.
684
5c0b3823
WL
6852012-09-15 Jiong Wang <jiwang@tilera.com>
686
687 * tilegx.cc: New file.
688 * Makefile.am (TARGETSOURCES): Add tilegx.cc
689 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
690 * configure.tgt: Add entries for tilegx*.
691 * configure.ac: Likewise.
692 * Makefile.in: Rebuild.
693 * configure: Likewise.
694 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
695 tilegx.
696
bfdfa4cd
AM
6972012-09-13 Alan Modra <amodra@gmail.com>
698
699 * target-reloc.h (scan_relocs): Call scan.local for relocs
700 against symbols in discarded sections. Pass is_discarded
701 param.
702 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
703 Add is_discarded param.
704 * powerpc (Target_powerpc::Scan::local): Likewise. Use
705 is_discarded to flag opd entry as discarded. Don't emit dyn
706 relocs on such entries.
707 (Target_powerpc::Scan::global): Similarly detect and handle
708 such opd entries.
709 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
710 opd_ent_. Update all uses.
711 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
712 (Target_powerpc::relocate_section): Zero out discarded opd
713 entry relocs.
714
d77a0555
ILT
7152012-09-12 Ian Lance Taylor <iant@google.com>
716
717 PR gold/14570
718 * output.cc: Rename Output_data_got template parameter from size
719 to got_size for all functions. Compile all variants of
720 Output_data_got.
721 (Output_data_got::Got_entry::write): Correct use of size for
722 symbol value. Use local_is_tls rather than casting to
723 Sized_relobj_file.
724 * object.h (class Object): Add local_is_tls and do_local_is_tls.
725 (class Sized_relobj_file): Add do_local_is_tls.
726 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
727
815a1205
AM
7282012-09-11 Alan Modra <amodra@gmail.com>
729
730 PR gold/14566
731 * layout.cc (Layout::set_segment_offsets): When using
732 common-page-size alignment, ensure we are on a new max-page-size
733 page.
734 * output.cc (Output_segment::set_section_addresses): Use
735 abi_pagesize, not common_pagesize for relro boundary.
736 (Output_segment::set_offset): Likewise.
737
bd73a62d
AM
7382012-09-11 Alan Modra <amodra@gmail.com>
739
740 * output.h (Output_data_got::add_global_tls, add_local_tls,
741 add_local_tls_pair): New functions.
742 (Output_data_got::add_local_pair_with_rel): Remove second
743 reloc param. Expand comment.
744 (Output_data_got::Got_entry): Rename use_plt_offset_ to
745 use_plt_or_tls_offset_, similarly for constructor param.
746 (Output_data_got::Got_entry::write): Add got_index param.
747 * output.cc (Output_data_got::add_global_tls, add_local_tls,
748 add_local_tls_pair): New functions.
749 (Output_data_got::Got_entry::write): Handle tls symbols
750 with use_plt_or_tls_offset_ set specially.
751 (Output_data_got::add_local_pair_with_rel): Only one reloc.
752 (Output_data_got::do_write): Replace iterator with index, pass
753 index to entry write function.
754 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
755 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
756 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
757 call.
758 * i386.cc (Target_i386::Scan::local): Likewise.
759 * sparc.cc (Target_sparc::Scan::local): Likewise.
760 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
761 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
762 do_tls_offset_for_global): New functions.
763 (Target_powerpc::Scan::local): Correct TLS relocations and got
764 entry values.
765 (Target_powerpc::Scan::global): Don't emit unnecessary
766 dynamic relocations on TLS GOT entries.
767
00716ab1
AM
7682012-09-10 Matthias Klose <doko@ubuntu.com>
769
770 * config.in: Disable sanity check for kfreebsd.
771
c891b3f9
SA
7722012-09-10 Sterling Augustine <saugustine@google.com>
773
774 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
775 (Gdb_index::pubtypes_read): New parameter.
776 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
777 to calls.
778 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
779 pubtypes_object_.
780
e81fea4d
AM
7812012-09-09 Alan Modra <amodra@gmail.com>
782
783 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
784 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
785 * gc.h (gc_process_relocs): Call target gc_add_reference.
786 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
787 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
788 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
789 unnecessary cast.
790 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
791 to cater for when we don't need code offset. Update use.
792 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
793 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
794 set_opd_valid): New functions.
795 (Target_powerpc::do_gc_add_reference): New function.
796 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
797 stashed refs.
798 (Target_powerpc::do_gc_mark_symbol): New function.
799
d2d60eef
CC
8002012-09-06 Cary Coutant <ccoutant@google.com>
801
802 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
803 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
804 (Dwarf_die::skip_attributes): Likewise.
805 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
806 * testsuite/gdb_index_test.cc (inline_func_1): New function.
807 (main): Call it.
808 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
809
32ed4573
L
8102012-09-05 H.J. Lu <hongjiu.lu@intel.com>
811
812 * testsuite/script_test_3.t: Add .got.plt output section
813 statement.
814 * testsuite/script_test_4.t: Likewise.
815
f4baf0d4
AM
8162012-09-05 Alan Modra <amodra@gmail.com>
817
818 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
819 update all uses and lose "enum" when using type.
820
864a1b56
AM
8212012-09-05 Alan Modra <amodra@gmail.com>
822
823 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
824 * configure: Regenerate.
825 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
826 (plugin_final_layout.stdout): Likewise.
827 (memory_test): Set page sizes to 0x1000.
828 * testsuite/Makefile.in: Regenerate.
829 * testsuite/discard_locals_test.sh: Add FIXME comment.
830 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
831 * testsuite/pr14265.t: Add .got output section statement.
832 * testsuite/script_test_2.t: Likewise.
833 * testsuite/script_test_3.t: Likewise.
834 * testsuite/script_test_4.t: Likewise.
835 * testsuite/script_test_5.t: Likewise.
836 * testsuite/script_test_6.t: Likewise.
837 * testsuite/script_test_7.t: Likewise.
838 * testsuite/script_test_9.t: Likewise.
839
3ea0a085
AM
8402012-09-05 Alan Modra <amodra@gmail.com>
841
842 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
843 (Powerpc_relocate_functions::Status): New typedef.
844 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
845 (Target_powerpc::Scan::local): Handle REL64.
846 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
847 for REL32 and REL64.
848 (Target_powerpc::symval_for_branch): New function, extracted from..
849 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
850 checks. Report overflow errors.
851
7404fe1b
AM
8522012-09-05 Alan Modra <amodra@gmail.com>
853
854 * object.h (Sized_relobj_file::emit_relocs): Delete.
855 (Sized_relobj_file::emit_relocs_reltype): Delete.
856 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
857 relocate_relocs for --emit-relocs.
858 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
859 * output.h: Update comment.
860 (Output_segment::first_section): New function.
861 (Output_segment::first_section_load_address): Use first_section.
862 * output.cc (Output_segment::first_section): New function extracted..
863 (Output_segment::first_section_load_address): ..from here. Delete.
864 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
865 * target.h (Sized_target::relocate_for_relocatable): Likewise.
866 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
867 adjust call to target.h function.
868 * i386.cc (Target_i386): Likewise.
869 * sparc.cc (Target_sparc): Likewise.
870 * x86_64.cc (Target_x86_64): Likewise.
871 * powerpc.cc (Target_powerpc): Likewise.
872 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
873 first tls section has section symbol for optimised local dynamic
874 output relocs.
875 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
876 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
877 optimised tls code.
878 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
879 Rename to relocate_relocs. Update error message.
880
957564c9
AS
8812012-09-04 Andreas Schwab <schwab@linux-m68k.org>
882
883 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
884 --just-symbols.
885
dd93cd0a
AM
8862012-08-31 Alan Modra <amodra@gmail.com>
887
888 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
889 (Powerpc_relobj::toc_base_offset): New stub function.
890 (Target_powerpc): Add tp_offset, dtp_offset. Rename
891 got_mod_index_offset to tlsld_got_offset. Update all refs.
892 (Target_powerpc::Relocate::enum skip_tls): New.
893 (Target_powerpc::call_tls_get_addr_): New var.
894 (Target_powerpc::is_branch_reloc): Move to file scope.
895 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
896 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
897 New functions.
898 (Target_powerpc::enum Got_type): Delete old values, add new ones.
899 (powerpc_info): Correct common_pagesize for ppc64.
900 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
901 (Powerpc_relocate_functions): Add overflow check enums and functions.
902 Add non-shift version of rela, rela_ua. Delete all rel public
903 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
904 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
905 addr16_ha3, addr14 functions.
906 (Output_data_got_powerpc::add_constant_pair): New function.
907 (Output_data_got_powerpc::got_base_offset): Likewise.
908 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
909 (instruction constants): Sort, add some more.
910 (Output_data_glink::do_write): Add and use Address typedef. Use
911 object->toc_base_offset() stub for 64-bit.
912 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
913 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
914 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
915 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
916 Always treat .opd relocs as against locally defined symbol.
917 Correct condition for RELATIVE relocs.
918 (Target_powerpc::do_finalize_sections): Test for NULL sections.
919 (Target_powerpc::Relocate::relocate): Use plt call stub as value
920 for 32-bit syms with a plt entry. Correct ppc64 toc base
921 calculations. Handle TLS relocs, and more. Add overflow
922 checking and adjust for Powerpc_relocate_functions changes.
923 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
924 Reinstate --emit-relocs code with FIXME.
925
a1373b60
AM
9262012-08-30 Alan Modra <amodra@gmail.com>
927
928 * layout.cc (Layout::set_segment_offsets): Set p_align to
929 abi_pagesize, not common_pagesize.
930 (Layout::relaxation_loop_body): Similarly use abi_pagesize
931 to determine whether file header can go in segment.
932
703d02da
AM
9332012-08-30 Alan Modra <amodra@gmail.com>
934
935 * output.h (Output_reloc::Output_reloc <output section>): Add
936 is_relative param. Adjust calls.
937 (Output_reloc::add_output_section_relative): New functions.
938 * output.cc (Output_reloc::Output_reloc <output section>): Handle
939 is_relative.
940 (Output_reloc::symbol_value): Handle SECTION_CODE.
941
16164a6b
ST
9422012-08-24 Sriraman Tallam <tmsriram@google.com>
943
944 * gold.cc (queue_middle_tasks): Call layout again when unique
945 segments for sections is desired.
946 * layout.cc (Layout::Layout): Initialize new members.
947 (Layout::get_output_section_flags): New function.
948 (Layout::choose_output_section): Call get_output_section_flags.
949 (Layout::layout): Make output section for mapping to a unique segment.
950 (Layout::insert_section_segment_map): New function.
951 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 952 output sections marked so.
16164a6b
ST
953 (Layout::segment_precedes): Check for unique segments when sorting.
954 * layout.h (Layout::Unique_segment_info): New struct.
955 (Layout::Section_segment_map): New typedef.
956 (Layout::insert_section_segment_map): New function.
957 (Layout::get_output_section_flags): New function.
958 (Layout::is_unique_segment_for_sections_specified): New function.
959 (Layout::set_unique_segment_for_sections_specified): New function.
960 (Layout::unique_segment_for_sections_specified_): New member.
961 (Layout::section_segment_map_): New member.
962 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
963 Rename is_gc_pass_one to is_pass_one.
964 Rename is_gc_pass_two to is_pass_two.
965 Rename is_gc_or_icf to is_two_pass.
966 Check for which pass based on whether symbols data is present.
967 Make it two pass when unique segments for sections is desired.
968 * output.cc (Output_section::Output_section): Initialize new
969 members.
970 * output.h (Output_section::is_unique_segment): New function.
971 (Output_section::set_is_unique_segment): New function.
972 (Output_section::is_unique_segment_): New member.
973 (Output_section::extra_segment_flags): New function.
974 (Output_section::set_extra_segment_flags): New function.
975 (Output_section::extra_segment_flags_): New member.
976 (Output_section::segment_alignment): New function.
977 (Output_section::set_segment_alignment): New function.
978 (Output_section::segment_alignment_): New member.
979 (Output_segment::Output_segment): Initialize is_unique_segment_.
980 (Output_segment::is_unique_segment): New function.
981 (Output_segment::set_is_unique_segment): New function.
982 (Output_segment::is_unique_segment_): New member.
983 * plugin.cc (allow_unique_segment_for_sections): New function.
984 (unique_segment_for_sections): New function.
985 (Plugin::load): Add new functions to transfer vector.
986 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
987 * Makefile.in: Regenerate.
988 * testsuite/plugin_final_layout.sh: Check if unique segment
989 functionality works.
990 * testsuite/plugin_section_order.c (onload): Check if new interfaces
991 are available.
992 (allow_unique_segment_for_sections): New global.
993 (unique_segment_for_sections): New global.
994 (claim_file_hook): Call allow_unique_segment_for_sections.
995 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 996
1e2bee4f
CC
9972012-08-22 Cary Coutant <ccoutant@google.com>
998
999 * layout.cc (Layout::include_section): Don't assert on GROUP
1000 sections with --emit-relocs.
1001
1d5dfe78
CC
10022012-08-21 Cary Coutant <ccoutant@google.com>
1003
1004 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1005 if --export-dynamic-symbol names an undef symbol.
1006
c9269dff
AM
10072012-08-18 Alan Modra <amodra@gmail.com>
1008
1009 * powerpc.cc: Formatting and white space.
1010 (Powerpc_relobj): Rename got2_section_ to special_.
1011 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1012 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1013 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1014 (Target_powerpc): Add Address typedef and invalid_address. Use
1015 throughout.
1016 (Target_powerpc::is_branch_reloc): New function.
1017 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1018 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1019 for dst_mask, value and addend.
1020 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1021 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1022 (Output_data_glink::do_write): Correct toc base. Don't try to use
1023 uint16_t for 24-bit offset. Use get_output_section_offset and
1024 check return.
1025 (Target_powerpc::Scan::local): Handle more relocs.
1026 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1027 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1028 Plug in toc restoring insn after plt calls. Translate branches
1029 to function descriptor symbols to corresponding entry point.
1030 (Target_powerpc::relocate_for_relocatable): Check return from
1031 get_output_section_offset.
1032 * symtab.h: Comment typo.
1033
b1759dce
ILT
10342012-08-14 Ian Lance Taylor <iant@google.com>
1035
1036 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1037 unsupported_relocal_local to call unsupported_reloc_global.
1038
b9b2ae8b
NC
10392012-08-14 Nick Clifton <nickc@redhat.com>
1040
1041 PR ld/14265
1042 * script-sections.cc (Sections_element::output_section_name): Add
1043 keep return parameter.
1044 (Output_section_element::match_name): Add keep return parameter.
1045 Return the value of the keep_ member.
1046 * script-sections.h (class Output_section): Update
1047 output_section_name prototype.
1048 * layout.cc (Layout::keep_input_section): New public member
1049 function.
1050 (Layout::choose_output_section): Pass keep parameter to
1051 output_section_name.
1052 * layout.h (class Layout): Add keep_input_section.
1053 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1054 sections.
1055 * testsuite/Makefile.am: Add a test.
1056 * testsuite/Makefile.in: Regenerate.
1057 * testsuite/pr14265.c: Source file for the test.
1058 * testsuite/pr14265.t: Linker script for the test.
1059 * testsuite/pr14265.sh: Shell script for the test.
1060
921b5322
AM
10612012-08-14 Alan Modra <amodra@gmail.com>
1062
1063 * target.h (Target::output_section_name): New function.
1064 (Target::do_output_section_name): New function.
1065 * layout.cc (Layout::choose_output_section): Call the above.
1066 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1067
6ce78956
AM
10682012-08-14 Alan Modra <amodra@gmail.com>
1069
1070 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1071 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1072 for replace_constant call.
1073 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1074 (Output_data_glink::do_print_to_mapfile): New function.
1075 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1076 (Target_powerpc::Relocate::relocate): Likewise.
1077
d1a8cabd
AM
10782012-08-14 Alan Modra <amodra@gmail.com>
1079
1080 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1081 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1082 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1083 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1084 all references to shndx_. Handle special case for R_PPC_PLTREL24
1085 here.
1086 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1087 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1088 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1089 here.
1090 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1091 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1092
d83ce4e3
AM
10932012-08-12 Alan Modra <amodra@gmail.com>
1094
1095 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1096 (glink insn constants): Use uint32_t.
1097 (Output_data_glink::add_entry): Use insert, not [] operator.
1098
cf43a2fe
AM
10992012-08-11 Alan Modra <amodra@gmail.com>
1100
1101 * object.h (Sized_relobj_file::find_shdr): New function.
1102 (Sized_relobj_file::find_special_sections): New function.
1103 * object.cc (Sized_relobj_file::find_shdr): New function.
1104 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1105 (Sized_relobj_file::find_special_sections): New function, split out..
1106 (Sized_relobj_file::do_read_symbols): ..from here.
1107 * output.h (Output_data_got::replace_constant): New function.
1108 (Output_data_got::num_entries): New function.
1109 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1110 (Output_data_got::got_offset): Protected rather than private.
1111 (Output_data_got::replace_got_entry): New function.
1112 * output.cc (Output_data_got::replace_got_entry): New function.
1113 * powerpc.cc (class Powerpc_relobj): New.
1114 (class Powerpc_relocate_functions): Delete all psymval variants or
1115 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1116 Implement _ha functions using corresponding _hi function.
1117 (Powerpc_relobj::find_special_sections): New function.
1118 (Target_powerpc::do_make_elf_object): New function.
1119 (class Output_data_got_powerpc): New.
1120 (class Output_data_glink): New.
1121 (class Powerpc_scan_relocatable_reloc): New.
1122 Many more changes througout file.
1123
3c892704
NC
11242012-08-09 Nick Clifton <nickc@redhat.com>
1125
1126 * po/vi.po: Updated Vietnamese translation.
1127
82435b3b
ILT
11282012-08-07 Ian Lance Taylor <iant@google.com>
1129
1130 * layout.cc (Layout::add_target_dynamic_tags): If
1131 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1132 plt_rel.
1133
a6dc81d2
NC
11342012-07-30 Nick Clifton <nickc@redhat.com>
1135
1136 * po/gold.pot: Updated template.
1137 * po/es.po: Updated Spanish translation.
1138
f1415016
CC
11392012-07-18 Cary Coutant <ccoutant@google.com>
1140
1141 PR gold/14344
1142 * configure.ac: Add check for -gpubnames support.
1143 * configure: Regenerate.
1144 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1145 support; force -gno-pubnames.
1146 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1147 support.
1148 (gdb_index_test_4): New test.
1149 * testsuite/Makefile.in: Regenerate.
1150 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1151 * testsuite/gdb_index_test_2.sh: Likewise.
1152 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1153 * testsuite/gdb_index_test_4.sh: New script.
1154 * testsuite/gdb_index_test_comm.sh: New script with common code;
1155 don't look for space after colon.
1156
b7fd7c37
ST
11572012-07-16 Sriraman Tallam <tmsriram@google.com>
1158
1159 * gold.cc (queue_middle_tasks): Update function order only after
1160 deferred objects due to plugins are processed.
1161
1f3212db
ILT
11622012-07-11 Ian Lance Taylor <iant@google.com>
1163
1164 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1165 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1166 (Target_arm::scan_reloc_for_stub): Likewise.
1167 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1168 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1169 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1170 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1171 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1172
81c82a68
ILT
11732012-07-10 Dodji Seketeli <dodji@redhat.com>
1174 Ian Lance Taylor <iant@google.com>
1175
1176 PR gold/14309
1177 * configure.ac: Test whether std::tr1::hash<off_t> works.
1178 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1179 needed.
1180 * output.h (class Output_fill): Add virtual destructor.
1181 * configure, config.in: Rebuild.
1182
eabc84f4
RM
11832012-06-22 Roland McGrath <mcgrathr@google.com>
1184
1185 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1186
370e30b6
RÁE
11872012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1188
1189 * plugin.cc (Plugin::load): Handle position independent executables.
1190
fb1b895d
CC
11912012-06-06 Cary Coutant <ccoutant@google.com>
1192
1193 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1194 add .debug_macro.
1195 (lines_only_debug_sections): Likewise.
1196 (gdb_fast_lookup_sections): New static array.
1197 (is_gdb_debug_section): Rename formal parameter.
1198 (is_lines_only_debug_section): Likewise.
1199 (is_gdb_fast_lookup_section): New function.
1200 (Layout::include_section): Check for ".zdebug_" prefix; pass
1201 section name suffix to is_gdb_debug_section, et al.; check for
1202 fast-lookup sections when building .gdb_index.
1203 * options.h (--strip-debug-gdb): Update GDB version number.
1204
7c0640fa
CC
12052012-06-06 Cary Coutant <ccoutant@google.com>
1206
1207 * configure.ac: Add check for fallocate.
1208 * configure: Regenerate.
1209 * config.in: Regenerate.
1210
1211 * options.h (class General_options): Add --mmap-output-file and
1212 --posix-fallocate options.
1213 * output.cc: (posix_fallocate): Remove; replace with...
1214 (gold_fallocate): New function.
1215 (Output_file::map_no_anonymous): Call gold_fallocate.
1216 (Output_file::map): Check --mmap-output-file option.
1217
2a49eb69
DK
12182012-06-05 Jing Yu <jingyu@google.com>
1219
1220 * gold.h (textdomain): Add do {} to empty while(0).
1221 (bindtextdomain): Likewise.
1222
fad072ac
CC
12232012-06-04 Cary Coutant <ccoutant@google.com>
1224
1225 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1226 has_dynsym_index.
1227
8cc69fb6
ST
12282012-05-25 Sriraman Tallam <tmsriram@google.com>
1229
1230 * symtab.cc (Symbol_table::define_special_symbol):
1231 Initialize *poldsym to prevent uninitialized variable errors.
1232
1be75daa
CC
12332012-05-23 Cary Coutant <ccoutant@google.com>
1234
1235 * layout.cc (Layout::section_name_mapping): Add rules to handle
1236 exact match on .data.rel.ro.local or .data.rel.ro.
1237 (Layout::output_section_name): Check for exact matches.
1238
9b689de0
CC
12392012-05-23 Cary Coutant <ccoutant@google.com>
1240
1241 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1242 more carefully.
1243
b24fdbf5
CC
12442012-05-22 Cary Coutant <ccoutant@google.com>
1245
1246 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1247 object before exporting symbol.
1248
e550e1a2
L
12492012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1250
1251 * testsuite/tls_test.cc: Include "config.h" first.
1252 * testsuite/tls_test_c.c: Likewise.
1253
df7b86aa
NC
12542012-05-17 Daniel Richard G. <skunk@iskunk.org>
1255 Nick Clifton <nickc@redhat.com>
1256
1257 PR 14072
1258 * configure.in: Add check that sysdep.h has been included before
1259 any system header files.
1260 * configure: Regenerate.
1261 * config.in: Regenerate.
1262
1007b503
CC
12632012-05-14 Cary Coutant <ccoutant@google.com>
1264
1265 * layout.cc (Layout::make_output_section): Mark .tdata section
1266 as RELRO.
1267 * testsuite/relro_test.cc: Add a TLS variable.
1268
fd885f3a
L
12692012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1270
1271 PR gold/14091
1272 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1273 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1274 R_X86_64_64.
1275
80f5885c
CC
12762012-05-08 Cary Coutant <ccoutant@google.com>
1277
1278 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1279 (lines_only_debug_sections): Likewise.
1280
2e702c99
RM
12812012-05-02 Roland McGrath <mcgrathr@google.com>
1282
1283 * nacl.cc: New file.
1284 * nacl.h: New file.
1285 * Makefile.am (CCFILES, HFILES): Add them.
1286 * Makefile.in: Regenerate.
1287 * i386.cc (Output_data_plt_i386_nacl): New class.
1288 (Output_data_plt_i386_nacl_exec): New class.
1289 (Output_data_plt_i386_nacl_dyn): New class.
1290 (Target_i386_nacl): New class.
1291 (Target_selector_i386_nacl): New class.
1292 (target_selector_i386): Use it instead of Target_selector_i386.
1293 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1294 (Target_x86_64_nacl): New class.
1295 (Target_selector_x86_64_nacl): New class.
1296 (target_selector_x86_64, target_selector_x32): Use it instead of
1297 Target_selector_x86_64.
1298 * arm.cc (Output_data_plt_arm_nacl): New class.
1299 (Target_arm_nacl): New class.
1300 (Target_selector_arm_nacl): New class.
1301 (target_selector_arm, target_selector_armbe): Use it instead of
1302 Target_selector_arm.
1303
1304 * target-select.cc (select_target): Take new Input_file* and off_t
1305 arguments, pass them on to recognize method of selector.
1306 * object.cc (make_elf_sized_object): Update caller.
1307 * parameters.cc (parameters_force_valid_target): Likewise.
1308 * incremental.cc (make_sized_incremental_binary): Likewise.
1309 * target-select.h: Update decl.
1310 (Target_selector::recognize): Take new Input_file* argument,
1311 pass it on to do_recognize.
1312 (Target_selector::do_recognize): Take new Input_file* argument.
1313 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1314 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1315 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1316 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1317
1318 * target.h (Target::Target_info): New members isolate_execinstr
1319 and rosegment_gap.
1320 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1321 * arm.cc (Target_arm::arm_info): Update initializer.
1322 * i386.cc (Target_i386::i386_info): Likewise.
1323 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1324 * sparc.cc (Target_sparc::sparc_info): Likewise.
1325 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1326 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1327 * layout.cc (Layout::attach_allocated_section_to_segment):
1328 Take new const Target* argument. If target->isolate_execinstr(), act
1329 like --rosegment.
1330 (Layout::find_first_load_seg): Take new const Target* argument;
1331 if target->isolate_execinstr(), reject PF_X segments.
1332 (Layout::relaxation_loop_body): Update caller.
1333 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1334 reset file offset to zero when we hit LOAD_SEG, and then do a second
1335 loop over the segments before LOAD_SEG to reassign offsets after
1336 addresses have been determined. Handle target->rosegment_gap().
1337 (Layout::attach_section_to_segment): Take new const Target* argument;
1338 pass it to attach_allocated_section_to_segment.
1339 (Layout::make_output_section): Update caller.
1340 (Layout::attach_sections_to_segments): Take new const Target* argument;
1341 pass it to attach_section_to_segment.
1342 * gold.cc (queue_middle_tasks): Update caller.
1343 * layout.h (Layout): Update method decls with new arguments.
1344
1345 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1346 Target_info pointer to use.
1347 (Target_arm::do_make_data_plt): New virtual method.
1348 (Target_arm::make_data_plt): New method that calls it.
1349 (Target_arm::make_plt_entry): Use it.
1350 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1351 for the section alignment.
1352 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1353 method.
1354 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1355 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1356 method.
1357 (Output_data_plt_arm::get_plt_entry_size): Call it.
1358 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1359 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1360 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1361 method.
1362 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1363 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1364 method instead of sizeof(plt_entry).
1365 (Output_data_plt_arm::add_entry): Likewise.
1366 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1367 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1368 than static method.
1369 (Target_arm::plt_entry_size): Likewise.
1370 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1371 Move to ...
1372 (Output_data_plt_arm_standard): ... here, new class.
1373 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1374 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1375 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1376
1377 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1378 Take additional argument for the PLT entry size.
1379 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1380 Use get_plt_entry_size method rather than plt_entry_size variable.
1381 (Output_data_plt_x86_64::reserve_slot): Likewise.
1382 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1383 (Output_data_plt_x86_64::add_entry): Likewise.
1384 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1385 (Output_data_plt_x86_64::address_for_global): Likewise.
1386 (Output_data_plt_x86_64::address_for_local): Likewise.
1387 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1388 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1389 Make method non-static.
1390 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1391 method.
1392 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1393 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
1394 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
1395 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
1396 virtual method.
1397 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
1398 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
1399 virtual method.
1400 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
1401 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
1402 virtual method.
1403 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
1404 (Output_data_plt_x86_64::plt_entry_size)
1405 (Output_data_plt_x86_64::first_plt_entry)
1406 (Output_data_plt_x86_64::plt_entry)
1407 (Output_data_plt_x86_64::tlsdesc_plt_entry)
1408 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
1409 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
1410 (Output_data_plt_x86_64_standard): ... here, new class.
1411 (Target_x86_64::Target_x86_64): Take optional argument for the
1412 Target_info pointer to use.
1413 (Target_x86_64::do_make_data_plt): New virtual method.
1414 (Target_x86_64::make_data_plt): New method to call it.
1415 (Target_x86_64::init_got_plt_for_update): Use that.
1416 Call this->plt_->add_eh_frame method here.
1417 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
1418 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
1419 rather than static method.
1420 (Target_x86_64::plt_entry_size): Likewise.
1421 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
1422 rather than plt_entry_size variable. Move guts of PLT filling to...
1423 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
1424 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
1425 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
1426
1427 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
1428 additional argument for the section alignment.
1429 Don't do add_eh_frame_for_plt here.
1430 (Output_data_plt_i386::first_plt_entry_offset): Make the method
1431 non-static. Use get_plt_entry_size method rather than plt_entry_size
1432 variable.
1433 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
1434 method.
1435 (Output_data_plt_i386::get_plt_entry_size): Call it.
1436 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
1437 (Output_data_plt_i386::add_eh_frame): New method to call it.
1438 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
1439 method.
1440 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
1441 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
1442 method.
1443 (Output_data_plt_i386::fill_plt_entry): New method to call it.
1444 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
1445 method instead of plt_entry_size.
1446 (Output_data_plt_i386::plt_entry_size)
1447 (Output_data_plt_i386::plt_eh_frame_fde_size)
1448 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
1449 (Output_data_plt_i386_standard): ... here, new class.
1450 (Output_data_plt_i386_exec): New class.
1451 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
1452 (Output_data_plt_i386_exec::first_plt_entry): ... here.
1453 (Output_data_plt_i386::exec_plt_entry): Move to ...
1454 (Output_data_plt_i386_exec::plt_entry): ... here.
1455 (Output_data_plt_i386_dyn): New class.
1456 (Output_data_plt_i386::first_plt_entry): Move to ...
1457 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
1458 (Output_data_plt_i386::dyn_plt_entry): Move to ...
1459 (Output_data_plt_i386_dyn::plt_entry): ... here.
1460 (Target_i386::Target_i386): Take optional argument for the Target_info
1461 pointer to use.
1462 (Target_i386::do_make_data_plt): New virtual method.
1463 (Target_i386::make_data_plt): New method to call it.
1464 (Target_i386::make_plt_section): Use that.
1465 Call this->plt_->add_eh_frame method here.
1466 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
1467 rather than plt_entry_size variable.
1468 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
1469 (Output_data_plt_i386::address_for_local): Likewise.
1470 (Output_data_plt_i386::do_write): Likewise.
1471 Move guts of PLT filling to...
1472 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
1473 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
1474 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
1475 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
1476
b9b9f2ee
CC
14772012-05-01 Cary Coutant <ccoutant@google.com>
1478
1479 * dwarf_reader.cc (Dwarf_die::read_attributes)
1480 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
1481 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
1482 * reduced_debug_output.cc
1483 (Output_reduced_debug_info_section::get_die_end): Remove
1484 DW_FORM_GNU_ref_index. Add default case.
1485
57923f48
MW
14862012-04-26 Mark Wielaard <mjw@redhat.com>
1487
1488 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
1489 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
1490 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
1491 DW_AT_high_pc as offset from DW_AT_low_pc.
1492
1493 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
1494 * testsuite/Makefile.in: Regenerate.
1495 * testsuite/gdb_index_test_3.c: New test source file.
1496 * testsuite/gdb_index_test_3.sh: New test source file.
1497
2c54b4f4
ILT
14982012-04-25 Ian Lance Taylor <iant@google.com>
1499
1500 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
1501 pointer.
1502 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
1503 as a class, not a struct.
1504 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
1505 (Target_arm::apply_cortex_a8_workaround): Likewise.
1506 * gc.h: Declare Reloc_types as a struct, not a class.
1507 * object.h: Declare Symbols_data as a struct.
1508 * reloc.h: Declare Read_relocs_data as a struct.
1509 * target.h: Declare Relocate_info as a struct.
1510
a5a5f7a3
DM
15112012-04-24 David S. Miller <davem@davemloft.net>
1512
1513 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
1514 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
1515 and R_SPARC_WPLT30.
1516
f038d496
CC
15172012-04-24 Cary Coutant <ccoutant@google.com>
1518
1519 * incremental-dump.cc (find_input_containing_global): Replace
1520 magic number with symbolic constant.
1521 (dump_incremental_inputs): Update version number.
1522 * incremental.cc (Output_section_incremental_inputs): Update version
1523 number; import symbolic constants from Incremental_inputs_reader.
1524 (Incremental_inputs::create_data_sections): Align relocations
1525 section correctly for 64-bit targets.
1526 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
1527 constants; add padding.
1528 (Output_section_incremental_inputs::write_header): Add assert for
1529 header_size.
1530 (Output_section_incremental_inputs::write_input_files): Add assert
1531 for input_entry_size.
1532 (Output_section_incremental_inputs::write_info_blocks): Add padding;
1533 add assert for object_info_size, input_section_entry_size,
1534 global_sym_entry_size.
1535 * incremental.h (Incremental_inputs_reader): Add symbolic constants
1536 for data structure sizes; use them.
1537 (Incremental_input_entry_reader): Import symbolic constants from
1538 Incremental_inputs_reader; use them.
1539
a4d85145
DM
15402012-04-23 David S. Miller <davem@davemloft.net>
1541
1542 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
1543 and elf_flags_set_.
1544 (Target_sparc::Target_sparc): Initialize new fields.
1545 (Target_sparc::do_make_elf_object): New function.
1546 (Target_sparc::do_adjust_elf_header): New function.
1547
1d509098
CC
15482012-04-23 Cary Coutant <ccoutant@google.com>
1549
1550 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
1551 CU range table of gdb index.
1552
7ebeff7f
DM
15532012-04-20 David S. Miller <davem@davemloft.net>
1554
1555 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
1556 instead of false.
1557
13cf9988
DM
15582012-04-16 David S. Miller <davem@davemloft.net>
1559
2a1079e8
DM
1560 * sparc.cc (Target_sparc::got_address): New function.
1561 (Sparc_relocate_functions::gdop_hix22): New function.
1562 (Sparc_relocate_functions::gdop_lox10): New function.
1563 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
1564 relocs.
1565 (Target_sparc::Scan::local): Likewise if the global symbol is not
1566 preemptible and is not IFUNC.
1567 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1568 transformations for local and non-preemptible non-IFUNC global
1569 symbols.
1570
0bc964fc
DM
1571 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1572 writing out 64-bit part of ranges.
1573
661d7a80
DM
1574 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1575 -fpic and -fpie respectively.
1576 * Makefile.in: Regenerate.
1577
8c2bf391
DM
1578 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1579 (Target_sparc::Target_sparc): Initialize new field.
1580 (Target_sparc::do_plt_section_for_global): New function.
1581 (Target_sparc::do_plt_section_for_local): New function.
1582 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1583 (Target_sparc::make_plt_section): New function, broken out of
1584 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1585 (Target_sparc::make_plt_entry): Call make_plt_section.
1586 (Target_sparc::make_local_ifunc_plt_entry): New function.
1587 (Target_sparc::rela_ifunc_section): New function.
1588 (Target_sparc::plt_section): Remove const.
1589 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1590 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1591 and ifunc_count_ fields.
1592 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1593 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1594 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1595 (Output_data_plt_sparc::rela_ifunc): New function.
1596 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1597 (Output_data_plt_sparc::has_ifunc_section): New function.
1598 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1599 (Output_data_plt_sparc::address_for_global): New function.
1600 (Output_data_plt_sparc::address_for_local): New function.
1601 (Output_data_plt_sparc::plt_index_to_offset): New function.
1602 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1603 and entry_count.
1604 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1605 entry_count.
1606 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1607 R_SPARC_JMP_IREL to switch.
1608 (Target_sparc::Scan::check_non_pic): Likewise.
1609 (Target_sparc::Scan::local): Handle IFUNC symbols.
1610 (Target_sparc::Scan::local): Likewise.
1611 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1612 and plt_address_for_local.
1613 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1614 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1615
13cf9988
DM
1616 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1617 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1618 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1619 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1620 global relocs too.
1621 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1622 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1623 calls.
1624 * sparc.cc (Target_sparc::Scan::global): Likewise.
1625 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1626
31821be0
CC
16272012-04-16 Cary Coutant <ccoutant@google.com>
1628
1629 * archive.cc (Library_base::should_include_member): Check for
1630 --export-dynamic-symbol.
1631 * options.h (class General_options): Add --export-dynamic-symbol.
1632 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1633 --export-dynamic-symbol.
1634 (Symbol_table::gc_mark_undef_symbols): Likewise.
1635 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1636
2615994e
DM
16372012-04-12 David S. Miller <davem@davemloft.net>
1638
1639 * sparc.cc (Reloc::wdisp10): New relocation method.
1640 (Reloc::h34): Likewise.
1641 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1642 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1643 R_SPARC_WDISP10.
1644 (Target_sparc::Scan::local): Likewise.
1645 (Target_sparc::Scan::global): Likewise.
1646 (Target_sparc::Relocate::relocate): Likewise.
1647
6782735d
CC
16482012-04-09 Cary Coutant <ccoutant@google.com>
1649
1650 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1651 low_pc == 0.
1652
8c7a0b00
ILT
16532012-04-06 Ian Lance Taylor <iant@google.com>
1654
1655 * timer.cc: #include <unistd.h>.
1656
58797674
RM
16572012-04-06 Roland McGrath <mcgrathr@google.com>
1658
1659 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1660 * config.in: Regenerate.
1661 * configure: Regenerate.
1662
44350750
NC
16632012-04-05 Nick Clifton <nickc@redhat.com>
1664
1665 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1666 (AM_LC_MESSAGES): Add.
1667 * aclocal.m4: Regenerate.
1668 * config.in: Regenerate.
1669 * configure: Regenerate.
1670
c1027032
CC
16712012-03-21 Cary Coutant <ccoutant@google.com>
1672
1673 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1674 * Makefile.in: Regenerate.
1675 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1676 (Sized_elf_reloc_mapper::symbol_section): New function.
1677 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1678 (make_elf_reloc_mapper): New function.
1679 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1680 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1681 (Dwarf_abbrev_table::do_get_abbrev): New function.
1682 (Dwarf_ranges_table::read_ranges_table): New function.
1683 (Dwarf_ranges_table::read_range_list): New function.
1684 (Dwarf_pubnames_table::read_section): New function.
1685 (Dwarf_pubnames_table::read_header): New function.
1686 (Dwarf_pubnames_table::next_name): New function.
1687 (Dwarf_die::Dwarf_die): New function.
1688 (Dwarf_die::read_attributes): New function.
1689 (Dwarf_die::skip_attributes): New function.
1690 (Dwarf_die::set_name): New function.
1691 (Dwarf_die::set_linkage_name): New function.
1692 (Dwarf_die::attribute): New function.
1693 (Dwarf_die::string_attribute): New function.
1694 (Dwarf_die::int_attribute): New function.
1695 (Dwarf_die::uint_attribute): New function.
1696 (Dwarf_die::ref_attribute): New function.
1697 (Dwarf_die::child_offset): New function.
1698 (Dwarf_die::sibling_offset): New function.
1699 (Dwarf_info_reader::check_buffer): New function.
1700 (Dwarf_info_reader::parse): New function.
1701 (Dwarf_info_reader::do_parse): New function.
1702 (Dwarf_info_reader::do_read_string_table): New function.
1703 (Dwarf_info_reader::lookup_reloc): New function.
1704 (Dwarf_info_reader::get_string): New function.
1705 (Dwarf_info_reader::visit_compilation_unit): New function.
1706 (Dwarf_info_reader::visit_type_unit): New function.
1707 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1708 Sized_elf_reloc_mapper.
1709 (Sized_dwarf_line_info::symbol_section): Remove function.
1710 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1711 (Sized_dwarf_line_info::read_line_mappings): Remove object
1712 parameter, adjust callers.
1713 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1714 * dwarf_reader.h: Include <sys/types.h>.
1715 (class Track_relocs): Remove forward declaration.
1716 (class Elf_reloc_mapper): New class.
1717 (class Sized_elf_reloc_mapper): New class.
1718 (class Dwarf_abbrev_table): New class.
1719 (class Dwarf_range_list): New class.
1720 (class Dwarf_ranges_table): New class.
1721 (class Dwarf_pubnames_table): New class.
1722 (class Dwarf_die): New class.
1723 (class Dwarf_info_reader): New class.
1724 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1725 (Sized_dwarf_line_info::symbol_section): Remove member function.
1726 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1727 base class.
1728 * gdb-index.cc: New source file.
1729 * gdb-index.h: New source file.
1730 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1731 and .debug_types sections, call Layout::add_to_gdb_index.
1732 (Sized_relobj_incr::do_section_name): Implement.
1733 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1734 return type; Implement.
1735 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1736 return type.
1737 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1738 parameter list and return type.
1739 (Sized_incr_dynobj::do_section_contents): Likewise.
1740 * layout.cc: Include gdb-index.h.
1741 (Layout::Layout): Initialize gdb_index_data_.
1742 (Layout::init_fixed_output_section): Check for .gdb_index section.
1743 (Layout::add_to_gdb_index): New function. Instantiate.
1744 * layout.h: Add forward declaration for class Gdb_index.
1745 (Layout::add_to_gdb_index): New member function.
1746 (Layout::gdb_index_data_): New data member.
1747 * main.cc: Include gdb-index.h.
1748 (main): Print statistics for gdb index.
1749 * object.cc (Object::section_contents): Move code into
1750 do_section_contents.
1751 (need_decompressed_section): Check for sections needed when building
1752 gdb index.
1753 (build_compressed_section_map): Likewise.
1754 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1755 gdb index.
1756 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1757 sections; call Layout::add_to_gdb_index.
1758 (Sized_relobj_file::do_decompressed_section_contents): Call
1759 do_section_contents directly.
1760 * object.h (Object::do_section_contents): Adjust parameter list and
1761 return type.
1762 (Object::do_decompressed_section_contents): Call do_section_contents
1763 directly.
1764 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1765 return type.
1766 * options.h (class General_options): Add --gdb-index option.
1767 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1768 list and return type.
1769 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1770 * reloc.h (Track_relocs::checkpoint): New function.
1771 (Track_relocs::reset): New function.
1772
1773 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1774 New test cases.
1775 * testsuite/Makefile.in: Regenerate.
1776 * testsuite/gdb_index_test.cc: New test source file.
1777 * testsuite/gdb_index_test_1.sh: New test source file.
1778 * testsuite/gdb_index_test_2.sh: New test source file.
1779
647f1574
DK
17802012-03-19 Doug Kwan <dougkwan@google.com>
1781
1782 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1783 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1784 __exidx_start and __exidx_end. Make symbol table parameter
1785 anonymous as it is not used.
1786 * gold.cc (queue_middle_tasks): Call target hook to define any
1787 target-specific symbols.
1788 * target.h (Target::define_standard_symbols): New method.
1789 (Target::do_define_standard_symbols): Same.
1790 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1791 * testsuite/Makefile.in: Regenerate.
1792 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1793 and __exidx_end.
1794 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1795 relocations are generated for __exidx_start and __exidx_end.
1796
7c6109da
DK
17972012-03-16 Doug Kwan <dougkwan@google.com>
1798
1799 * testsuite/Makefile.am: Disable test initpri3b.
1800 * testsuite/Makefile.in: Regenerate.
1801
7b8957f8
DK
18022012-03-15 Doug Kwan <dougkwan@google.com>
1803
1804 * arm.cc (Target_arm::got_section): Make .got section read-only
1805 if -z now is given.
1806
14dc9ef7
ILT
18072012-03-15 Ian Lance Taylor <iant@google.com>
1808
1809 PR gold/13850
1810 * layout.cc (Layout::make_output_section): Correctly mark
1811 SHT_INIT_ARRAY, et. al., as relro.
1812
fa40b62a
DK
18132012-03-14 Doug Kwan <dougkwan@google.com>
1814
1815 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1816 dynamic relocations for protected symbols in shared objects.
1817
fd325007
ILT
18182012-03-13 Ian Lance Taylor <iant@google.com>
1819
1820 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1821 keep the larger alignment.
1822
e8dd54e1
CC
18232012-03-12 Cary Coutant <ccoutant@google.com>
1824
1825 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1826 handling of DW_LNE_define_file.
1827
feb5f3b0
CC
18282012-03-12 Cary Coutant <ccoutant@google.com>
1829
1830 * reduced_debug_output.cc
1831 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1832 codes to switch.
1833
a1fb4256
CC
18342012-02-29 Cary Coutant <ccoutant@google.com>
1835
1836 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1837
5dd8762a
CC
18382012-02-29 Cary Coutant <ccoutant@google.com>
1839
1840 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1841 Call Object::decompressed_section_contents.
1842 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1843 New dtor.
1844 (Sized_dwarf_line_info::buffer_start_): New data member.
1845 * merge.cc (Output_merge_data::do_add_input_section): Call
1846 Object::decompressed_section_contents.
1847 (Output_merge_string::do_add_input_section): Likewise.
1848 * object.cc (need_decompressed_section): New function.
1849 (build_compressed_section_map): Decompress sections needed later.
1850 (Sized_relobj_file::do_decompressed_section_contents): New function.
1851 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1852 * object.h (Object::decompressed_section_contents): New function.
1853 (Object::discard_decompressed_sections): New function.
1854 (Object::do_decompressed_section_contents): New function.
1855 (Object::do_discard_decompressed_sections): New function.
1856 (Compressed_section_info): New type.
1857 (Compressed_section_map): Include decompressed section contents.
1858 (Sized_relobj_file::do_decompressed_section_contents): New function.
1859 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1860
7b5de7ee
CC
18612012-02-16 Cary Coutant <ccoutant@google.com>
1862
1863 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1864 * testsuite/Makefile.in: Regenerate.
1865
f9fa4a63
CC
18662012-02-14 Cary Coutant <ccoutant@google.com>
1867
1868 * options.cc (General_options::finalize): Disallow -pie and -static.
1869
2c175ebc
DK
18702012-02-03 Doug Kwan <dougkwan@google.com>
1871
1872 * arm.cc (Arm_relocate_functions::abs8,
1873 Arm_relocate_functions::abs16): Use
1874 Bits::has_signed_unsigned_overflow32.
1875 (Arm_relocate_functions::thm_abs8): Correct range of
1876 overflow check.
1877 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1878 in assertions.
1879
90cff06f
DK
18802012-02-02 Doug Kwan <dougkwan@google.com>
1881
1882 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1883 position independent outputs, not just shared objects.
1884
63887f3d
L
18852012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1886
1887 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1888 * configure: Regenerated.
1889
bef2b434
ILT
18902012-01-27 Ian Lance Taylor <iant@google.com>
1891
1892 * reloc.h (Bits): New class with static functions, copied from
1893 namespace utils in arm.cc.
1894 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1895 instead.
1896
c335b55d
L
18972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1898
1899 * incremental.cc (write_info_blocks): Correct relocation offset.
1900
41194d9f
L
19012012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1902
1903 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1904 (Relocate::tls_gd_to_le): Likewise.
1905
1bae613c
L
19062012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1907
1908 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1909
24482ca0
L
19102012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1911
1912 * configure.ac: Check if -mcmodel=medium works.
1913 * configure: Regenerated.
1914
c2c7840a
CC
19152012-01-24 Cary Coutant <ccoutant@google.com>
1916
1917 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1918 definition and ...
1919 (read_unsigned_LEB_128_x): ... this new function.
1920 (read_signed_LEB_128): Replaced with inline definition and ...
1921 (read_signed_LEB_128_x): ... this new function.
1922 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1923 (read_unsigned_LEB_128): Add inline definition.
1924 (read_signed_LEB_128_x): New function.
1925 (read_signed_LEB_128): Add inline definition.
1926 * testsuite/Makefile.am (leb128_unittest): New unit test.
1927 * testsuite/Makefile.in: Regenerate.
1928 * testsuite/leb128_unittest.cc: New unit test.
1929
833de760 19302012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1931
1932 PR gold/13617
1933 * i386.cc (Target_i386::do_code_fill): When using a jmp
1934 instruction, pad with nop instructions.
1935 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1936
618d6666
L
19372012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1938
1939 * x86_64.cc (gc_process_relocs): Add typename on types used in
1940 template.
1941 (scan_relocs): Likewise.
1942 (relocate_section): Likewise.
1943 (apply_relocation): Likewise.
1944
3660ff06
L
19452012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1946
1947 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1948 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1949 under x32.
1950
fc51264f
L
19512012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1952
1953 * x86_64.cc: Initial support for x32.
1954
dd74ae06
CC
19552012-01-03 Cary Coutant <ccoutant@google.com>
1956
1957 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1958 Use abstract base class for GOT.
1959 * gold/output.h (class Output_data_got_base): New abstract base class.
1960 (class Output_data_got): Derive from new base class, adjust ctors.
1961 (Output_data_got::reserve_slot): Make virtual; rename to
1962 do_reserve_slot; Adjust callers.
1963 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1964 pointer to abstract base class.
1965 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1966
83896202
ILT
19672011-12-18 Ian Lance Taylor <iant@google.com>
1968
1969 * object.h (Relobj::local_symbol_value): New function.
1970 (Relobj::local_plt_offset): New function.
1971 (Relobj::local_has_got_offset): New function.
1972 (Relobj::local_got_offset): New function.
1973 (Relobj::set_local_got_offset): New function.
1974 (Relobj::do_local_symbol_value): New pure virtual function.
1975 (Relobj::do_local_plt_offset): Likewise.
1976 (Relobj::do_local_has_got_offset): Likewise.
1977 (Relobj::do_local_got_offset): Likewise.
1978 (Relobj::do_set_local_got_offset): Likewise.
1979 (Sized_relobj::do_local_has_got_offset): Rename from
1980 local_has_got_offset.
1981 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1982 (Sized_relobj::do_set_local_got_offset): Rename from
1983 set_local_got_offset.
1984 (Sized_relobj_file::do_local_plt_offset): Rename from
1985 local_plt_offset.
1986 (Sized_relobj_file::do_local_symbol_value): New function.
1987 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1988 local_plt_offset.
1989 * output.cc (Output_data_got::Got_entry::write): Change object to
1990 Relobj. Use local_symbol_value.
1991 (Output_data_got::add_global_with_rel): Change rel_dyn to
1992 Output_data_reloc_generic*. Use add_global_generic.
1993 (Output_data_got::add_global_with_rela): Remove. Change all
1994 callers to use add_global_with_rel.
1995 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1996 Output_data_reloc_generic*. Use add_global_generic.
1997 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1998 callers to use add_global_pair_with_rel.
1999 (Output_data_got::add_local): Change object to Relobj*.
2000 (Output_data_got::add_local_plt): Likewise.
2001 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2002 change rel_dyn to Output_data_reloc_generic*. Use
2003 add_local_generic.
2004 (Output_data_got::add_local_with_rela): Remove. Change all
2005 callers to use all_local_with_rel.
2006 (Output_data_got::add_local_pair_with_rel): Change object to
2007 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2008 add_output_section_generic.
2009 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2010 callers to use add_local_pair_with_rel.
2011 (Output_data_got::reserve_local): Change object to Relobj*.
2012 * output.h: (class Output_data_reloc_generic): Add pure virtual
2013 declarations for add_global_generic, add_local_generic,
2014 add_output_section_generic.
2015 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2016 functions for Output_data_reloc_generic. Update declarations for
2017 changes listed in output.cc.
2018 (class Output_data_got): Change template parameter to got_size.
2019 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2020 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2021 function.
2022 (Sized_relobj_incr::do_local_plt_offset): New function.
2023 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2024 add_global_generic.
2025
76677ad0
CC
20262011-12-17 Cary Coutant <ccoutant@google.com>
2027
2028 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2029 * resolve.cc (Symbol_table::resolve): Likewise.
2030 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2031 arrays.
2032 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2033
8b8dd8d5
ILT
20342011-12-16 Ian Lance Taylor <iant@google.com>
2035
2036 * output.h (Output_data_reloc_generic::add): Only call
2037 add_dynamic_reloc if this is a dynamic reloc section.
2038
d55525b9
L
20392011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2040
2041 PR gold/13505
2042 * target-reloc.h (apply_relocation): Replace <64, false> with
2043 <size, big_endian>.
2044
ff81c7c1
NC
20452011-11-25 Nick Clifton <nickc@redhat.com>
2046
2047 * po/it.po: New Italian translation.
2048
628f39be
SA
20492011-11-17 Sterling Augustine <saugustine@google.com>
2050
2051 * script.cc (script_include_directive): Implement.
2052 (read_script_file): New local variables name and search_path. Update
2053 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2054 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2055 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2056
98ef3ea4
SA
20572011-11-11 Sterling Augustine <saugustine@google.com>
2058
2059 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2060 (file_or_sections_cmd): Likewise.
2061
f4a8b6d7
DK
20622011-11-11 Doug Kwan <dougkwan@google.com>
2063
2064 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2065 if --just-symbols is given.
2066
29ab395d
DK
20672011-11-10 Doug Kwan <dougkwan@google.com>
2068
2069 PR gold/13362
2070 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2071 when processing data relocs.
2072 * reloc.h (Relocate_functions::rel_unaligned): New method.
2073 (Relocate_functions::pcrel_unaligned): Ditto.
2074 (Relocate_functions::rel32_unaligned): Ditto.
2075 (Relocate_functions::pcrel32_unaligned): Ditto.
2076
2c339f71
DK
20772011-11-09 Doug Kwan <dougkwan@google.com>
2078
2079 PR gold/13362
2080 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2081 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2082 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2083 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2084 (Relocate_functions::rel_unaligned): New.
2085 (Relocate_functions::rel32_unaligned): New.
2086 * target-reloc.h (relocate_for_relocatable): Add code to handle
2087 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2088 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2089 arm_unaligned_reloc_r): New targets.
2090 * testsuite/Makefile.in: Regenerate.
2091 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2092 linking.
2093
3f3cddf1
ILT
20942011-11-02 Ian Lance Taylor <iant@google.com>
2095
2096 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2097 NATIVE_LINKER.
2098 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2099 * options.cc (General_options::finalize): Use library search path
2100 from configure script if specified. If not native and no sysroot,
2101 only search TOOLLIBDIR.
2102 * options.h (Search_directory::Search_directory): Change name to
2103 const std::string&.
2104 (General_options::add_to_library_path_with_sysroot): Change arg to
2105 const std::string&.
2106 * configure, Makefile.in, config.in: Rebuild.
2107
a8e2273b
ILT
21082011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2109
2110 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2111 we are working around the ARM1176 Erratum.
2112 * options.h (General_options::fix_arm1176): Add option.
2113 * testsuite/Makefile.am: Add testcases, and keep current ones
2114 working.
2115 * testsuite/Makefile.in: Regenerate.
2116 * testsuite/arm_fix_1176.s: New file.
2117 * testsuite/arm_fix_1176.sh: Likewise.
2118
cd6eab1c
ILT
21192011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2120
2121 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2122 may_use_blx_.
2123 (Target_arm::may_use_blx): Remove method.
2124 (Target_arm::set_may_use_blx): Likewise.
2125 (Target_arm::may_use_v4t_interworking): New method.
2126 (Target_arm::may_use_v5t_interworking): Likewise.
2127 (Target_arm::may_use_blx_): Remove member variable.
2128 (Arm_relocate_functions::arm_branch_common): Check for v5T
2129 interworking.
2130 (Arm_relocate_functions::thumb_branch_common): Likewise.
2131 (Reloc_stub::stub_type_for_reloc): Likewise.
2132 (Target_arm::do_finalize_sections): Correct interworking checks.
2133 * testsuite/Makefile.am: Add new tests.
2134 * testsuite/Makefile.in: Regenerate.
2135 * testsuite/arm_farcall_arm_arm.s: New test.
2136 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2137 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2138 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2139 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2140 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2141 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2142 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2143
286adcf4
CC
21442011-10-31 Cary Coutant <ccoutant@google.com>
2145
2146 PR gold/13023
2147 * expression.cc (Expression::eval_with_dot): Add
2148 is_section_dot_assignment parameter.
2149 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2150 absolute and assigning to dot within a section.
2151 * script-sections.cc
2152 (Output_section_element_assignment::set_section_addresses): Pass
2153 dot_section to set_if_absolute.
2154 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2155 as is_section_dot_assignment flag to eval_with_dot.
2156 (Output_section_element_dot_assignment::set_section_addresses):
2157 Likewise.
2158 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2159 parameter. Also set value if relative to dot_section; set the
2160 symbol's output_section.
2161 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2162 parameter. Adjust all callers.
2163 (Expression::eval_maybe_dot): Likewise.
2164 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2165 Adjust all callers.
2166 * testsuite/script_test_2.t: Test assignment of an absolute value
2167 to dot within an output section element.
2168
9634ed06
CC
21692011-10-31 Cary Coutant <ccoutant@google.com>
2170
2171 * options.h (class General_options): Add --[no-]gnu-unique options.
2172 * symtab.cc (Symbol_table::sized_write_globals): Convert
2173 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2174
de4101c7
CC
21752011-10-31 Cary Coutant <ccoutant@google.com>
2176
2177 PR gold/13359
2178 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2179 unnecessary assertion.
2180 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2181
7257cc92
ST
21822011-10-31 Sriraman Tallam <tmsriram@google.com>
2183
2184 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2185 gc_mark_symbol.
2186 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2187 gc_mark_symbol.
2188 Change to just keep the section associated with symbol.
2189 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2190 they are externally visible and --export-dynamic is turned on.
2191 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2192
bfc34b3f
ILT
21932011-10-19 Ian Lance Taylor <iant@google.com>
2194
2195 PR gold/13163
2196 * script-sections.cc
2197 (Output_section_element_dot_assignment::needs_output_section): New
2198 function.
2199
ea0d8c47
ILT
22002011-10-19 Ian Lance Taylor <iant@google.com>
2201
2202 PR gold/13204
2203 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2204 --section-start option was seen.
2205 * options.h (General_options::any_section_start): New function.
2206
abd242a9
DM
22072011-10-18 David S. Miller <davem@davemloft.net>
2208
2209 PR binutils/13301
2210 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2211 member to track relocation locations that have moved during TLS
2212 reloc optimizations.
2213 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2214 (Target_sparc::Relocate::relocate): Adjust view down by 4
2215 bytes if it matches reloc_adjust_addr_.
2216 (Target_sparc::Relocate::relocate_tls): Always move the
2217 __tls_get_addr call delay slot instruction forward 4 bytes when
2218 performing relaxation.
2219
bab9090f
CC
22202011-10-18 Cary Coutant <ccoutant@google.com>
2221
2222 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2223 (Output_file::map_no_anonymous): Check for non-zero
2224 return code from posix_fallocate.
2225
f7c5b166
CC
22262011-10-17 Cary Coutant <ccoutant@google.com>
2227
2228 PR gold/13245
2229 * plugin.cc (is_visible_from_outside): Check for symbols
2230 referenced from dynamic objects.
2231 * resolve.cc (Symbol_table::resolve): Don't count references
2232 from dynamic objects as references from real ELF files.
2233 * testsuite/plugin_test_2.sh: Adjust expected result.
2234
b490c0bb
CC
22352011-10-17 Cary Coutant <ccoutant@google.com>
2236
2237 * gold.cc: Include timer.h.
2238 (queue_middle_tasks): Stamp time.
2239 (queue_final_tasks): Likewise.
2240 * main.cc (main): Store timer in parameters. Print timers
2241 for each pass.
2242 * parameters.cc (Parameters::Parameters): Initialize timer_.
2243 (Parameters::set_timer): New function.
2244 (set_parameters_timer): New function.
2245 * parameters.h (Parameters::set_timer): New function.
2246 (Parameters::timer): New function.
2247 (Parameters::timer_): New data member.
2248 (set_parameters_timer): New function.
2249 * timer.cc (Timer::stamp): New function.
2250 (Timer::get_pass_time): New function.
2251 * timer.h (Timer::stamp): New function.
2252 (Timer::get_pass_time): New function.
2253 (Timer::pass_times_): New data member.
2254
f475cf7b
CC
22552011-10-17 Cary Coutant <ccoutant@google.com>
2256
2257 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2258 task for members of lib groups.
2259
cdd7e244
CC
22602011-10-17 Cary Coutant <ccoutant@google.com>
2261
2262 PR gold/13288
4f95c8b4 2263 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2264 (File_read::make_view): Move bounds check (replace with assert)...
2265 (File_read::find_or_make_view): ... to here.
2266
dfb45471
CC
22672011-10-12 Cary Coutant <ccoutant@google.com>
2268
4f95c8b4 2269 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2270 ::read returns less than requested size.
2271
53bbcc1b
CC
22722011-10-10 Cary Coutant <ccoutant@google.com>
2273
4f95c8b4 2274 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2275 Initialize defined_count_.
2276 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2277 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2278 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2279 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2280 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2281 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2282 member.
2283 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2284 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2285 Return zeroes instead of internal error.
2286
397b129b
CC
22872011-10-10 Cary Coutant <ccoutant@google.com>
2288
2289 PR gold/13249
4f95c8b4 2290 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2291 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2292 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2293 (Output_reloc::type_): Adjust size of bit field.
2294 (Output_reloc::use_plt_offset_): New bit field.
2295 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2296 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2297 flag. Adjust all callers.
4f95c8b4 2298 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2299 creating RELATIVE relocations.
2300
d5698657
NC
23012011-10-10 Nick Clifton <nickc@redhat.com>
2302
2303 * po/es.po: Updated Spanish translation.
2304 * po/fi.po: Updated Finnish translation.
2305
6a59a5c2
DN
23062011-10-03 Diego Novillo <dnovillo@google.com>
2307
2308 * options.cc (parse_uint): Fix dereference of RETVAL.
2309
f0558624
ST
23102011-09-29 Sriraman Tallam <tmsriram@google.com>
2311
2312 * layout.h (section_order_map_): New member.
2313 (get_section_order_map): New member function.
2314 * output.cc (Output_section::add_input_section): Check for patterns
2315 only when --section-ordering-file is specified.
2316 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2317 output_sections have been formed.
2318 * layout.cc (Layout_Layout): Initialize section_order_map_.
2319 * plugin.cc (update_section_order): Store order in order_map. Do not
2320 update the order.
2321 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2322 * testsuite/Makefile.in: Regenerate.
2323 * testsuite/plugin_section_order.c: New file.
2324 * testsuite/plugin_final_layout.cc: New file.
2325 * testsuite/plugin_final_layout.sh: New file.
2326
a7dac153
CC
23272011-09-29 Cary Coutant <ccoutant@google.com>
2328
4f95c8b4 2329 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2330 Check for NULL.
4f95c8b4 2331 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2332 symbols during incremental update.
2333 (Symbol_table::add_from_dynobj): Likewise.
2334
eebd87a5
ILT
23352011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2336 Ian Lance Taylor <iant@google.com>
2337
2338 * symtab.cc (Symbol_table::define_special_symbol): Always
2339 canonicalize version string.
2340
403a3331
CC
23412011-09-26 Cary Coutant <ccoutant@google.com>
2342
4f95c8b4
CC
2343 * gold.cc (queue_initial_tasks): Move option checks ...
2344 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2345 some options; make others fatal.
2346
235061c2
CC
23472011-09-26 Cary Coutant <ccoutant@google.com>
2348
2349 gcc PR lto/47247
2350 * plugin.cc (get_symbols_v2): New function.
2351 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2352 (is_referenced_from_outside): New function.
2353 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2354 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2355 (get_symbols): Pass version parameter.
2356 (get_symbols_v2): New function.
2357 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2358 parameter.
2359 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2360 (onload): Add LDPT_GET_SYMBOLS_V2.
2361 (all_symbols_read_hook): Use get_symbols_v2; check for
2362 LDPR_PREVAILING_DEF_IRONLY_EXP.
2363 * testsuite/plugin_test_3.sh: Update expected results.
2364
dc87f620
ILT
23652011-09-23 Simon Baldwin <simonb@google.com>
2366
2367 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2368 configuration options.
2369 * configure: Regenerate.
2370 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2371 * Makefile.in: Regenerate.
2372 * testsuite/Makefile.in: Regenerate.
2373
a8279f82
ST
23742011-09-19 Sriraman Tallam <tmsriram@google.com>
2375
2376 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2377
0c9350c8
CC
23782011-09-19 Cary Coutant <ccoutant@google.com>
2379
2380 * incremental.cc (can_incremental_update): Fix typo in comment.
2381 * incremental.h (can_incremental_update): Likewise.
2382
aa06ae28
CC
23832011-09-18 Cary Coutant <ccoutant@google.com>
2384
2385 * incremental.cc (can_incremental_update): New function.
2386 * incremental.h (can_incremental_update): New function.
2387 * layout.cc (Layout::init_fixed_output_section): Call it.
2388 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2389 * object.cc (Sized_relobj_file::do_layout): Call
2390 can_incremental_update.
2391
ebb300b2
CC
23922011-09-13 Cary Coutant <ccoutant@google.com>
2393
2394 * configure.ac: Check for glibc support for gnu_indirect_function
2395 support with static linking, setting automake conditional
2396 IFUNC_STATIC.
2397 * Makefile.in: Regenerate.
2398 * configure: Regenerate.
2399
2400 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
2401 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
2402 for IFUNC_STATIC.
2403 * testsuite/Makefile.in: Regenerate.
2404
1206d0d5
CC
24052011-09-13 Cary Coutant <ccoutant@google.com>
2406
2407 * incremental.cc (Sized_relobj_incr::do_layout): Call
2408 report_comdat_group for kept comdat sections.
2409 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
2410 * testsuite/Makefile.in: Regenerate.
2411 * testsuite/incr_comdat_test_1.cc: New source file.
2412 * testsuite/incr_comdat_test_2_v1.cc: New source file.
2413 * testsuite/incr_comdat_test_2_v2.cc: New source file.
2414 * testsuite/incr_comdat_test_2_v3.cc: New source file.
2415
40b29874
ILT
24162011-09-13 Ian Lance Taylor <iant@google.com>
2417
2418 * object.cc (Sized_relobj_file::do_layout): Remove unused local
2419 variable external_symbols_offset.
2420
1b045aac
ILT
24212011-09-12 Ian Lance Taylor <iant@google.com>
2422
2423 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
2424 triggered if object has no symbols.
2425
24c6c55a
DM
24262011-09-09 David S. Miller <davem@davemloft.net>
2427
2428 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
2429 (Output_fill_debug_line::do_write): Likewise.
2430
66570254
CC
24312011-08-29 Cary Coutant <ccoutant@google.com>
2432
2433 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
2434 casts to match formatting specs.
2435 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
2436
8ea8cd50
CC
24372011-08-26 Cary Coutant <ccoutant@google.com>
2438
2439 * layout.cc (Free_list::allocate): Provide guarantee of minimum
2440 remaining hole size when allocating.
2441 (Layout::make_output_section): Set fill methods for debug sections.
2442 * layout.h (Free_list::Free_list_node): Move from private to
2443 public.
2444 (Free_list::set_min_hole_size): New function.
2445 (Free_list::begin, Free_list::end): New functions.
2446 (Free_list::min_hole_): New data member.
2447 * output.cc: Include dwarf.h.
2448 (Output_fill_debug_info::do_minimum_hole_size): New function.
2449 (Output_fill_debug_info::do_write): New function.
2450 (Output_fill_debug_line::do_minimum_hole_size): New function.
2451 (Output_fill_debug_line::do_write): New function.
2452 (Output_section::Output_section): Initialize new data member.
2453 (Output_section::set_final_data_size): Ensure patch space is larger
2454 than minimum hole size.
2455 (Output_section::do_write): Fill holes in debug sections.
2456 * output.h (Output_fill): New class.
2457 (Output_fill_debug_info): New class.
2458 (Output_fill_debug_line): New class.
2459 (Output_section::set_free_space_fill): New function.
2460 (Output_section::free_space_fill_): New data member.
2461 * testsuite/Makefile.am (incremental_test_3): Add
2462 --incremental-patch option.
2463 (incremental_test_4): Likewise.
2464 (incremental_test_5): Likewise.
2465 (incremental_test_6): Likewise.
2466 (incremental_copy_test): Likewise.
2467 (incremental_common_test_1): Likewise.
2468 * testsuite/Makefile.in: Regenerate.
2469
7cf80422
NC
24702011-08-26 Nick Clifton <nickc@redhat.com>
2471
2472 * po/es.po: Updated Spanish translation.
2473
c3f7b0e5
CC
24742011-08-01 Cary Coutant <ccoutant@google.com>
2475
2476 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
2477 * gold/testsuite/Makefile.in: Regenerate.
2478 * gold/testsuite/justsyms_exec.c: New source file.
2479 * gold/testsuite/justsyms_lib.c: New source file.
2480
9590bf25
CC
24812011-08-01 Cary Coutant <ccoutant@google.com>
2482
2483 * layout.cc (Layout::set_segment_offsets): Don't realign text
2484 segment if -Ttext was specified.
2485 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
2486 file type.
2487 * object.h (Sized_relobj_file::e_type): New function.
2488 (Sized_relobj_file::e_type_): New data member.
2489 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
2490 base address for ET_EXEC files.
2491 * target.cc (Target::do_make_elf_object_implementation): Allow
2492 ET_EXEC files with --just-symbols option.
2493
dcd8d12e
CC
24942011-07-28 Cary Coutant <ccoutant@google.com>
2495
2496 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
2497 Add thread_number parameter.
2498 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
2499 * workqueue-threads.cc
2500 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
2501 current thread if its thread number is greater than desired thread
2502 count.
2503 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
2504 Add thread_number parameter.
2505 (Workqueue::should_cancel_thread): Likewise.
2506 (Workqueue::find_runnable_or_wait): Pass thread_number to
2507 should_cancel_thread.
2508 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
2509 parameter.
2510
804eb480
ST
25112011-07-22 Sriraman Tallam <tmsriram@google.com>
2512
2513 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
2514 only after checking if it cannot be forced local.
2515 * symtab.h (is_externally_visible): Check if the symbol is not forced
2516 local.
2517
f1ddb600
ILT
25182011-07-15 Ian Lance Taylor <iant@google.com>
2519
2520 * options.h (class General_options): Add --print-output-format.
2521 Move -EL next to -EB, for better --help output.
2522 * target-select.cc: Include <cstdio>, "options.h", and
2523 "parameters.h".
2524 (Target_selector::do_target_bfd_name): New function.
2525 (print_output_format): New function.
2526 * target-select.h (class Target_selector): Update declarations.
2527 (Target_selector::target_bfd_name): New function.
2528 (print_output_format): Declare.
2529 * main.cc: Include "target-select.h".
2530 (main): Handle --print-output-format.
2531 * gold.cc: Include "target-select.h".
2532 (queue_initial_tasks): Handle --print-output-format when there are
2533 no input files.
2534 * parameters.cc (parameters_force_valid_target): Give a better
2535 error message if -EB/-EL does not match target.
2536 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
2537 function.
2538
7d172687
ILT
25392011-07-15 Ian Lance Taylor <iant@google.com>
2540
2541 * i386.cc (class Output_data_plt_i386): Add layout_ field.
2542 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
2543 (Output_data_plt_i386::do_write): Write address of .dynamic
2544 section to first entry in .got.plt section.
2545 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
2546 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2547 Initialize layout_.
2548 (Output_data_plt_x86_64::do_write): Write address of .dynamic
2549 section to first entry in .got.plt section.
2550 * layout.h (Layout::dynamic_section): New function.
2551
e9552f7e
ST
25522011-07-13 Sriraman Tallam <tmsriram@google.com>
2553
2554 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
2555 to claim_file call.
2556 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
2557 input_section_position_, and input_section_glob_.
2558 (read_layout_from_file): Call function section_ordering_specified.
2559 * layout.h (is_section_ordering_specified): New function.
2560 (section_ordering_specified): New function.
2561 (section_ordering_specified_): New boolean member.
2562 * main.cc(main): Call load_plugins after layout object is defined.
2563 * output.cc (Output_section::add_input_section): Use
2564 function section_ordering_specified to check if section ordering is
2565 needed.
2566 * output.cc (Output_section::add_relaxed_input_section): Use
2567 function section_ordering_specified to check if section ordering is
2568 needed.
2569 (Output_section::update_section_layout): New function.
2570 (Output_section::sort_attached_input_sections): Check if input section
2571 must be reordered.
2572 * output.h (Output_section::update_section_layout): New function.
2573 * plugin.cc (get_section_count): New function.
2574 (get_section_type): New function.
2575 (get_section_name): New function.
2576 (get_section_contents): New function.
2577 (update_section_order): New function.
58797674 2578 (allow_section_ordering): New function.
e9552f7e
ST
2579 (Plugin::load): Add the new interfaces to the transfer vector.
2580 (Plugin_manager::load_plugins): New parameter.
2581 (Plugin_manager::all_symbols_read): New parameter.
2582 (Plugin_manager::claim_file): New parameter. Save the elf object for
2583 unclaimed objects.
2584 (Plugin_manager::get_elf_object): New function.
2585 (Plugin_manager::get_view): Change to directly use the bool to check
2586 if get_view is called from claim_file_hook.
2587 * plugin.h (input_objects): New function
2588 (Plugin__manager::load_plugins): New parameter.
2589 (Plugin_manager::claim_file): New parameter.
2590 (Plugin_manager::get_elf_object): New function.
2591 (Plugin_manager::in_claim_file_handler): New function.
2592 (Plugin_manager::in_claim_file_handler_): New member.
2593 (layout): New function.
2594 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2595 handler with an extra parameter. Make the elf object before calling
2596 claim_file handler.
2597 * testsuite/plugin_test.c (get_section_count): New function pointer.
2598 (get_section_type): New function pointer.
2599 (get_section_name): New function pointer.
2600 (get_section_contents): New function pointer.
2601 (update_section_order): New function pointer.
2602 (allow_section_ordering): New function pointer.
2603 (onload): Check if the new interfaces exist.
2604
9446efde
ILT
26052011-07-13 Ian Lance Taylor <iant@google.com>
2606
2607 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2608 relro section.
2609 * x86_64.cc (Target_x86_64::got_section): Likewise.
2610 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2611 (relro_now_test_SOURCES): New variable.
2612 (relro_now_test_DEPENDENCIES): New variable.
2613 (relro_now_test_LDFLAGS): New variable.
2614 (relro_now_test_LDADD): New variable.
2615 (relro_now_test.so): New target.
2616 * testsuite/Makefile.in: Rebuild.
2617
07aa62f2
ILT
26182011-07-12 Ian Lance Taylor <iant@google.com>
2619
2620 PR gold/12980
2621 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2622 GLOB_DAT relocation rather than a RELATIVE relocation for a
2623 protected symbol when creating a shared library.
2624 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2625 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2626 * testsuite/protected_main_1.cc (main): Test that protected
2627 function has same address.
2628
e2153196
ILT
26292011-07-11 Ian Lance Taylor <iant@google.com>
2630
2631 PR gold/12979
2632 * options.h (class General_options): Add -Bgroup.
2633 * options.cc (General_options::finalize): If -Bgroup is set,
2634 default to --unresolved-symbols=report-all.
2635 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2636 * target-reloc.h (issue_undefined_symbol_error): Handle
2637 --unresolved-symbols=report-all.
2638
6daf5215
ILT
26392011-07-08 Ian Lance Taylor <iant@google.com>
2640
2641 PR gold/11985
2642 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2643 if linker script discards key sections.
2644 (Layout::create_dynamic_symtab): Likewise.
2645 (Layout::assign_local_dynsym_offsets): Likewise.
2646 (Layout::sized_create_version_sections): Likewise.
2647 (Layout::create_interp): Likewise.
2648 (Layout::finish_dynamic_section): Likewise.
2649 (Layout::set_dynamic_symbol_size): Likewise.
2650
beabb2c6
ILT
26512011-07-08 Ian Lance Taylor <iant@google.com>
2652
2653 PR gold/12386
2654 * options.h (class General_options): Add --unresolved-symbols.
2655 * target-reloc.h (issue_undefined_symbol_error): Check
2656 --unresolved-symbols. Add comments.
2657
9c16daf1
ILT
26582011-07-08 Ian Lance Taylor <iant@google.com>
2659
2660 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2661 expression more complex.
2662
191f1a2d
ILT
26632011-07-08 Ian Lance Taylor <iant@google.com>
2664
2665 PR gold/11317
2666 * target-reloc.h (issue_undefined_symbol_error): New inline
2667 function, broken out of relocate_section.
2668 (relocate_section): Call issue_undefined_symbol_error.
2669 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2670 there is no TLS segment if we are about to issue an undefined
2671 symbol error.
2672 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2673
62855347
ILT
26742011-07-08 Ian Lance Taylor <iant@google.com>
2675
2676 PR gold/12279
2677 * resolve.cc (Symbol_table::should_override): Add fromtype
2678 parameter. Change all callers. Give error when linking together
2679 TLS and non-TLS symbol.
2680 (Symbol_table::should_override_with_special): Add fromtype
2681 parameter. Change all callers.
2682 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2683 there is no TLS segment if we have reported some errors.
2684 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2685
67181c72
ILT
26862011-07-08 Ian Lance Taylor <iant@google.com>
2687
2688 PR gold/12372
2689 * target.h (Target::plt_address_for_global): New function.
2690 (Target::plt_address_for_local): New function.
2691 (Target::plt_section_for_global): Remove.
2692 (Target::plt_section_for_local): Remove.
2693 (Target::do_plt_address_for_global): New virtual function.
2694 (Target::do_plt_address_for_local): New virtual function.
2695 (Target::do_plt_section_for_global): Remove.
2696 (Target::do_plt_section_for_local): Remove.
2697 (Target::register_global_plt_entry): Add Symbol_table and Layout
2698 parameters.
2699 * output.cc (Output_data_got::Got_entry::write): Use
2700 plt_address_for_global and plt_address_for_local.
2701 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2702 address of output section.
2703 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2704 got_irelative_, and irelative_count_ fields. Update
2705 declarations.
2706 (Output_data_plt_i386::has_irelative_section): New function.
2707 (Output_data_plt_i386::entry_count): Add irelative_count_.
2708 (Output_data_plt_i386::set_final_data_size): Likewise.
2709 (class Target_i386): Add got_irelative_ and rel_irelative_
2710 fields. Update declarations.
2711 (Target_i386::Target_i386): Initialize new fields.
2712 (Target_i386::do_plt_address_for_global): New function replacing
2713 do_plt_section_for_global.
2714 (Target_i386::do_plt_address_for_local): New function replacing
2715 do_plt_section_for_local.
2716 (Target_i386::got_section): Create got_irelative_.
2717 (Target_i386::rel_irelative_section): New function.
2718 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2719 fields. Don't define __rel_iplt_{start,end}.
2720 (Output_data_plt_i386::add_entry): Add symtab and layout
2721 parameters. Change all callers. Use different PLT and GOT for
2722 IFUNC symbols.
2723 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2724 layout parameters. Change all callers. Use different PLT and
2725 GOT.
2726 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2727 (Output_data_plt_i386::rel_irelative): New function.
2728 (Output_data_plt_i386::address_for_global): New function.
2729 (Output_data_plt_i386::address_for_local): New function.
2730 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2731 IRELATIVE GOT when changing IFUNC GOT entries.
2732 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2733 reloc.
2734 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2735 if we didn't create an IRELATIVE GOT.
2736 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2737 plt_address_for_local.
2738 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2739 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2740 got_irelative_, and irelative_count_ fields. Update
2741 declarations.
2742 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2743 Initialize new fields. Remove symtab parameter. Change all
2744 callers.
2745 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2746 irelative_count_.
2747 (Output_data_plt_x86_64::has_irelative_section): New function.
2748 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2749 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2750 fields. Update declarations.
2751 (Target_x86_64::Target_x86_64): Initialize new fields.
2752 (Target_x86_64::do_plt_address_for_global): New function replacing
2753 do_plt_section_for_global.
2754 (Target_x86_64::do_plt_address_for_local): New function replacing
2755 do_plt_section_for_local.
2756 (Target_x86_64::got_section): Create got_irelative_.
2757 (Target_x86_64::rela_irelative_section): New function.
2758 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2759 all callers. Don't create __rel_iplt_{start,end}.
2760 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2761 parameters. Change all callers. Use different PLT and GOT for
2762 IFUNC symbols.
2763 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2764 layout parameters. Change all callers. Use different PLT and
2765 GOT.
2766 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2767 parameters. Change all callers. Use different PLT and GOT for
2768 IFUNC symbols.
2769 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2770 (Output_data_plt_x86_64::rela_irelative): New function.
2771 (Output_data_plt_x86_64::address_for_global): New function.
2772 (Output_data_plt_x86_64::address_for_local): New function.
2773 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2774 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2775 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2776 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2777 parameters.
2778 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2779 reloc.
2780 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2781 symbols if we didn't create an IRELATIVE GOT.
2782 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2783 plt_address_for_local.
2784 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2785 * testsuite/ifuncvar1.c: New test file.
2786 * testsuite/ifuncvar2.c: New test file.
2787 * testsuite/ifuncvar3.c: New test file.
2788 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2789 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2790 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2791 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2792 * testsuite/Makefile.in: Rebuild.
2793
33c15b45
CC
27942011-07-07 Cary Coutant <ccoutant@google.com>
2795
2796 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2797 (two_file_test_1_ndebug.o): Likewise.
2798 (two_file_test_1b_ndebug.o): Likewise.
2799 (two_file_test_2_ndebug.o): Likewise.
2800 (two_file_test_main_ndebug.o): Likewise.
2801 (incremental_test_2): Link with no-debug versions.
2802
f48b5fb7
CC
28032011-07-06 Cary Coutant <ccoutant@google.com>
2804
2805 * gold/incremental.cc
2806 (Output_section_incremental_inputs::write_info_blocks): Check for
2807 hidden and internal symbols.
2808
221597a5
CC
28092011-07-06 Cary Coutant <ccoutant@google.com>
2810
2811 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2812 Check disposition for startup file.
2813 (Incremental_inputs::report_command_line): Ignore
2814 --incremental-startup-unchanged option.
2815 * options.cc (General_options::parse_incremental_startup_unchanged):
2816 New function.
2817 (General_options::General_options): Initialize new data member.
2818 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2819 (General_options): Add --incremental-startup-unchanged option.
2820 (General_options::incremental_startup_disposition): New function.
2821 (General_options::incremental_startup_disposition_): New data member.
2822
e24719f6
CC
28232011-07-06 Cary Coutant <ccoutant@google.com>
2824
2825 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2826 input file index to Script_info ctor.
2827 (Sized_incremental_binary::do_file_has_changed): Find the
2828 command-line argument for files named in scripts.
2829 * incremental.h (Script_info::Script_info): New ctor
2830 with input file index.
2831 (Script_info::input_file_index): New function.
2832 (Script_info::input_file_index_): New data member.
2833 (Incremental_binary::get_library): Add const.
2834 (Incremental_binary::get_script_info): Add const.
2835 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2836 * testsuite/Makefile.am (incremental_test_5): New test case.
2837 (incremental_test_6): New test case.
2838 * testsuite/Makefile.in: Regenerate.
2839
8f7c81e8
CC
28402011-07-06 Cary Coutant <ccoutant@google.com>
2841
2842 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2843 debug output when command lines differ.
2844
9fbd3822
CC
28452011-07-06 Cary Coutant <ccoutant@google.com>
2846
2847 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2848 --incremental-patch option.
2849 * layout.cc (Free_list::allocate): Extend allocation beyond original
2850 end if enabled.
2851 (Layout::make_output_section): Mark sections that should get
2852 patch space.
2853 * options.cc (parse_percent): New function.
2854 * options.h (parse_percent): New function.
2855 (DEFINE_percent): New macro.
2856 (General_options): Add --incremental-patch option.
2857 * output.cc (Output_section::Output_section): Initialize new data
2858 members.
2859 (Output_section::add_input_section): Print section name when out
2860 of patch space.
2861 (Output_section::add_output_section_data): Likewise.
2862 (Output_section::set_final_data_size): Add patch space when
2863 doing --incremental-full.
2864 (Output_section::do_reset_address_and_file_offset): Remove patch
2865 space.
2866 (Output_segment::set_section_list_addresses): Print debug output
2867 only if --incremental-update.
2868 * output.h (Output_section::set_is_patch_space_allowed): New function.
2869 (Output_section::is_patch_space_allowed_): New data member.
2870 (Output_section::patch_space_): New data member.
2871 * parameters.cc (Parameters::incremental_full): New function.
2872 * parameters.h (Parameters::incremental_full): New function
2873 * testsuite/Makefile.am (incremental_test_2): Add test for
2874 --incremental-patch option.
2875 * testsuite/Makefile.in: Regenerate.
2876 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2877 (t18): Remove function body.
2878
f6cccc2c
DK
28792011-07-05 Doug Kwan <dougkwan@google.com>
2880
2881 PR gold/12771
2882 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2883 Arm_Address type for relocation result.
2884 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2885 overflow check.
2886 (Arm_relocate_functions::abs32): Use unaligned access.
2887 (Arm_relocate_functions::rel32): Ditto.
2888 (Arm_relocate_functions::prel31): Ditto.
2889 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2890 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2891 static data relocations.
2892 * testsuite/Makefile.in: Regnerate.
2893 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2894
28a13fec
ILT
28952011-07-05 Ian Lance Taylor <iant@google.com>
2896
2897 PR gold/12392
2898 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2899 symbols if necessary.
2900 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2901
24d47b34
ILT
29022011-07-05 Ian Lance Taylor <iant@google.com>
2903
2904 PR gold/12952
2905 * resolve.cc (Symbol::override_base_with_special): Simply override
2906 version with special symbol version, ignoring previous version.
2907
41f9cbbe
ILT
29082011-07-05 Ian Lance Taylor <iant@google.com>
2909
2910 * object.cc (Sized_relobj_file::include_section_group): Add
2911 information to comment about signature location.
2912
886288f1
ILT
29132011-07-02 Ian Lance Taylor <iant@google.com>
2914
2915 PR gold/12957
2916 * options.h (class General_options): Add -f and -F.
2917 * options.cc (General_options::finalize): Fatal error if -f/-F
2918 are used without -shared.
2919 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2920
ae3a6d4f
ILT
29212011-07-02 Ian Lance Taylor <iant@google.com>
2922
2923 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2924
21131061
ILT
29252011-07-01 Ian Lance Taylor <iant@google.com>
2926
2927 PR gold/12525
2928 PR gold/12952
2929 * resolve.cc (Symbol::override_base_with_special): Don't override
2930 the version if the overriding symbol has a different name.
2931 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2932 all callers. If we give an error about an undefined version,
2933 define the base version if necessary.
2934 * dynobj.h (class Versions): Update declaration.
2935 * testsuite/weak_alias_test_5.cc: New file.
2936 * testsuite/weak_alias_test.script: New file.
2937 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2938 and versioned_alias have the right value, and call t2.
2939 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2940 weak_alias_test_5.so.
2941 (weak_alias_test_LDADD): Likewise.
2942 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2943 * testsuite/Makefile.in: Rebuild.
2944
611062c0
ILT
29452011-07-01 Ian Lance Taylor <iant@google.com>
2946
2947 PR gold/12525
2948 * options.h (class General_options): Support -z notext.
2949 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2950 -Wl,-z,notext.
2951 (two_file_shared_nonpic.so): Likewise.
2952 (two_file_shared_mixed.so): Likewise.
2953 (two_file_shared_mixed_1.so): Likewise.
2954 (weak_undef_lib_nonpic.so): Likewise.
2955 (alt/weak_undef_lib_nonpic.so): Likewise.
2956 (tls_test_shared_nonpic.so): Likewise.
2957 * testsuite/Makefile.in: Rebuild.
2958
328c7c2f
ILT
29592011-07-01 Ian Lance Taylor <iant@google.com>
2960
2961 PR gold/12525
2962 * configure.ac: Test whether static linking works, setting
2963 the automake conditional HAVE_STATIC.
2964 * testsuite/Makefile.am: Disable tests using -static if
2965 HAVE_STATIC is not true.
2966 * configure, testsuite/Makefile.in: Rebuild.
2967
02d7cd44
ILT
29682011-07-01 Ian Lance Taylor <iant@google.com>
2969
2970 PR gold/12525
2971 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2972 Assert if we see DW_EH_PE_indirect.
2973 * target.h (Target::ehframe_datarel_base): New function.
2974 (Target::do_ehframe_datarel_base): New target function.
2975 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2976 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2977 function.
2978
07a60597
ILT
29792011-07-01 Ian Lance Taylor <iant@google.com>
2980
2981 PR gold/12571
2982 * options.h (class General_options): Add
2983 --ld-generated-unwind-info.
2984 * ehframe.cc (Fde::write): Add address parameter. Change all
2985 callers. If associated with PLT, fill in address and size.
2986 (Cie::set_output_offset): Only add merge mapping if there is an
2987 object.
2988 (Cie::write): Add address parameter. Change all callers.
2989 (Eh_frame::add_ehframe_for_plt): New function.
2990 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2991 input_offset_ fields into union u_, with new plt field.
2992 (Fde::Fde): Adjust for new union field.
2993 (Fde::Fde) [Output_data version]: New constructor.
2994 (Fde::add_mapping): Only add merge mapping if there is an object.
2995 (class Cie): Update declarations.
2996 (class Eh_frame): Declare add_ehframe_for_plt.
2997 * layout.cc (Layout::layout_eh_frame): Break out code into
2998 make_eh_frame_section, and call it.
2999 (Layout::make_eh_frame_section): New function.
3000 (Layout::add_eh_frame_for_plt): New function.
3001 * layout.h (class Layout): Update declarations.
3002 * merge.cc (Merge_map::add_mapping): Add assertion.
3003 * i386.cc: Include "dwarf.h".
3004 (class Output_data_plt_i386): Make first_plt_entry,
3005 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3006 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3007 and plt_eh_frame_fde.
3008 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3009 boundary. Call add_eh_frame_for_plt if appropriate.
3010 * x86_64.cc: Include "dwarf.h".
3011 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3012 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3013 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3014 and plt_eh_frame_fde.
3015 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3016 appropriate.
3017
14788a3f
ILT
30182011-06-29 Ian Lance Taylor <iant@google.com>
3019
3020 PR gold/12629
3021 * object.cc (Sized_relobj_file::layout_section): Change shdr
3022 parameter to be const.
3023 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3024 out of do_layout.
3025 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3026 appropriate. Call layout_eh_frame_section.
3027 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3028 sections.
3029 * object.h (class Sized_relobj_file): Update declarations.
3030
6c21fce1
ILT
30312011-06-29 Ian Lance Taylor <iant@google.com>
3032
37e41b03 3033 PR gold/12652
6c21fce1
ILT
3034 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3035 modifier.
3036 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3037
4d5e4e62
ILT
30382011-06-29 Ian Lance Taylor <iant@google.com>
3039
3040 PR gold/12675
3041 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3042 SHT_X86_64_UNWIND.
3043 * layout.cc (Layout::layout_eh_frame): Likewise.
3044
886f533a
ILT
30452011-06-29 Ian Lance Taylor <iant@google.com>
3046
3047 PR gold/12695
3048 * layout.cc (Layout::symtab_section_shndx): New function.
3049 * layout.h (class Layout): Declare symtab_section_shndx.
3050 * output.cc (Output_section::write_header): Call it.
3051
f3ae1b28
ILT
30522011-06-29 Ian Lance Taylor <iant@google.com>
3053
3054 PR gold/12818
3055 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3056 symbols which are not used in a relocation.
3057
aecf301f
ILT
30582011-06-28 Ian Lance Taylor <iant@google.com>
3059
3060 PR gold/12898
3061 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3062 script create indistinguishable segments.
3063 (Layout::set_segment_offsets): Use stable_sort when sorting
3064 segments. Pass this to Compare_segments constructor.
3065 * layout.h (class Layout): Make segment_precedes non-static.
3066 (class Compare_segments): Change from struct to class. Add
3067 layout_ field. Add constructor.
3068 * script-sections.cc
3069 (Script_sections::attach_sections_using_phdrs_clause): Rename
3070 local orphan to is_orphan. Don't report failure to put empty
3071 section in segment. On attachment failure, report name of
3072 section, and attach to first PT_LOAD segment.
3073
03ef7571
ILT
30742011-06-28 Ian Lance Taylor <iant@google.com>
3075
3076 PR gold/12934
3077 * target-select.cc (Target_selector::Target_selector): Add
3078 emulation parameter. Change all callers.
3079 (select_target_by_bfd_name): Rename from select_target_by_name.
3080 Change all callers.
3081 (select_target_by_emulation): New function.
3082 (supported_emulation_names): New function.
3083 * target-select.h (class Target_selector): Add emulation_ field.
3084 Update declarations.
3085 (Target_selector::recognize_by_bfd_name): Rename from
3086 recognize_by_name. Change all callers.
3087 (Target_selector::supported_bfd_names): Rename from
3088 supported_names. Change all callers.
3089 (Target_selector::recognize_by_emulation): New function.
3090 (Target_selector::supported_emulations): New function.
3091 (Target_selector::emulation): New function.
3092 (Target_selector::do_recognize_by_bfd_name): Rename from
3093 do_recognize_by_name. Change all callers.
3094 (Target_selector::do_supported_bfd_names): Rename from
3095 do_supported_names. Change all callers.
3096 (Target_selector::do_recognize_by_emulation): New function.
3097 (Target_selector::do_supported_emulations): New function.
3098 (select_target_by_bfd_name): Change name in declaration.
3099 (select_target_by_emulation): Declare.
3100 (supported_emulation_names): Declare.
3101 * parameters.cc (parameters_force_valid_target): Try to find
3102 target based on emulation from -m option.
3103 * options.h (class General_options): Change doc string for -m.
3104 * options.cc (help): Print emulations.
3105 (General_options::parse_V): Likewise.
3106 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3107 Add emulation parameter. Change all callers.
3108
200b2bb9
ILT
31092011-06-28 Ian Lance Taylor <iant@google.com>
3110
3111 * target.h (class Target): Add osabi_ field.
3112 (Target::osabi): New function.
3113 (Target::set_osabi): New function.
3114 (Target::Target): Initialize osabi_.
3115 (Target::do_adjust_elf_header): Make pure virtual.
3116 (Sized_target::do_adjust_elf_header): Declare.
3117 * target.cc (Sized_target::do_adjust_elf_header): New function.
3118 (class Sized_target): Instantiate all versions.
3119 * freebsd.h (class Target_freebsd): Remove.
3120 (Target_selector_freebsd::do_recognize): Call set_osabi on
3121 Target.
3122 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3123 (Target_selector_freebsd::set_osabi): Remove.
3124 * i386.cc (class Target_i386): Inherit from Sized_target rather
3125 than Target_freebsd.
3126 * x86_64.cc (class Target_x86_64): Likewise.
3127
b3ce541e
ILT
31282011-06-28 Ian Lance Taylor <iant@google.com>
3129
3130 * target.h (Target::can_check_for_function_pointers): Rewrite.
3131 Make non-virtual.
3132 (Target::can_icf_inline_merge_sections): Likewise.
3133 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3134 (Target::Target_info): Add can_icf_inline_merge_sections field.
3135 (Target::do_can_check_for_function_pointers): New virtual
3136 function.
3137 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3138 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3139 from can_check_for_function_pointers, move in file.
3140 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3141 section_may_have_icf_unsafe_poineters, move in file.
3142 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3143 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3144 Rename from can_check_for_function_pointers, move in file.
3145 (Target_i386::can_icf_inline_merge_sections): Remove.
3146 (Target_i386::i386_info): Initialize
3147 can_icf_inline_merge_sections.
3148 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3149 Initialize can_icf_inline_merge_sections.
3150 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3151 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3152 Rename from can_check_for_function_pointers, move in file.
3153 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3154 (Target_x86_64::x86_64_info): Initialize
3155 can_icf_inline_merge_sections.
3156 * testsuite/testfile.cc (Target_test::test_target_info):
3157 Likewise.
3158 * icf.cc (get_section_contents): Correct formatting.
3159
6d1c4efb
ILT
31602011-06-27 Ian Lance Taylor <iant@google.com>
3161
3162 * symtab.cc (Symbol::versioned_name): New function.
3163 (Symbol_table::add_to_final_symtab): Use versioned_name when
3164 appropriate.
3165 (Symbol_table::sized_write_symbol): Likewise.
3166 * symtab.h (class Symbol): Declare versioned_name.
3167 * stringpool.h (class Stringpool_template): Add variant of add
3168 which takes a std::basic_string.
3169 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3170 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3171 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3172 (ver_test_12.o): New target.
3173 * testsuite/Makefile.in: Rebuild.
3174
57eb9b50
DK
31752011-06-27 Doug Kwan <dougkwan@google.com>
3176
3177 * arm.cc (Arm_relocate_functions::thm_jump8,
3178 Arm_relocate_functions::thm_jump11): Use a wider signed
3179 type to compute offset.
3180 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3181 arm_thm_jump8.
3182 * testsuite/Makefile.in: Regenerate.
3183 * testsuite/arm_branch_in_range.sh: Check test results of
3184 arm_thm_jump11 and arm_thm_jump8.
3185 * testsuite/arm_thm_jump11.s: New test source file.
3186 * testsuite/arm_thm_jump11.t: New linker script.
3187 * testsuite/arm_thm_jump8.s: New test source file.
3188 * testsuite/arm_thm_jump8.t: New linker script.
3189
487b39df
ILT
31902011-06-24 Ian Lance Taylor <iant@google.com>
3191
3192 * layout.cc: Include "object.h".
3193 (ctors_sections_in_init_array): New static variable.
3194 (Layout::is_ctors_in_init_array): New function.
3195 (Layout::layout): Add entry to ctors_sections_in_init_array if
3196 appropriate.
3197 * layout.h (class Layout): Declare is_ctors_in_init_array.
3198 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3199 is_ctors_reverse_view is set.
3200 (Sized_relobj_file::write_sections): Add layout parameter. Change
3201 all callers. Set is_ctors_reverse_view field of View_size.
3202 (Sized_relobj_file::reverse_words): New function.
3203 * object.h (Sized_relobj_file::View_size): Add
3204 is_ctors_reverse_view field.
3205 (class Sized_relobj_file): Update declarations.
3206 * testsuite/initpri3.c: New test.
3207 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3208 initpri3b.
3209 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3210 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3211 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3212 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3213 * testsuite/Makefile.in: Rebuild.
3214
472076e4
CC
32152011-06-24 Cary Coutant <ccoutant@google.com>
3216
3217 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3218 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3219 (debug_msg_cdebug.err): New targets.
3220 * testsuite/Makefile.in: Regenerate.
3221 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3222 Fix checks for link with shared library.
3223
a60af0db
DK
32242011-06-24 Doug Kwan <dougkwan@google.com>
3225
3226 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3227 skip empty text sections.
3228 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3229
5393d741
ILT
32302011-06-22 Ian Lance Taylor <iant@google.com>
3231
3232 PR gold/12910
3233 * options.h (class General_options): Add --ctors-in-init-array.
3234 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3235 friends as SHT_PROGBITS for merging sections.
3236 (Layout::layout): Remove special handling of .init_array and
3237 friends. Don't sort if doing relocatable link. Sort for .ctors
3238 and .dtors if ctors_in_init_array.
3239 (Layout::make_output_section): Force correct section types for
3240 .init_array and friends. Don't sort if doing relocatable link,
3241 Don't sort .ctors and .dtors if ctors_in_init_array.
3242 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3243 (Layout::output_section_name): Add relobj parameter. Change all
3244 callers. Handle .ctors. and .dtors. in code rather than table.
3245 Handle .ctors and .dtors if ctors_in_init_array.
3246 (Layout::match_file_name): New function, moved from output.cc.
3247 * layout.h (class Layout): Update declarations.
3248 * output.cc: Include "layout.h".
3249 (Input_section_sort_entry::get_priority): New function.
3250 (Input_section_sort_entry::match_file_name): Just call
3251 Layout::match_file_name.
3252 (Output_section::Input_section_sort_init_fini_compare::operator()):
3253 Handle .ctors and .dtors. Sort by explicit priority rather than
3254 by name.
3255 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3256 * testsuite/initpri2.c: New test.
3257 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3258 (check_PROGRAMS): Add initpri2.
3259 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3260 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3261 * configure, testsuite/Makefile.in: Rebuild.
3262
e1f74f98
ILT
32632011-06-19 Ian Lance Taylor <iant@google.com>
3264
3265 PR gold/12880
3266 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3267 .interp section to a PT_INTERP segment even if we have seen a
3268 --dynamic-linker option. Don't do it if we have seen a PHDRS
3269 clause in a linker script.
3270 (Layout::finalize): Don't create a .interp section if we've
3271 already create a PT_INTERP segment.
3272 (Layout::create_interp): Always call choose_output_section (revert
3273 patch of 2011-06-17). Don't create PT_INTERP segment.
3274 * script-sections.cc
3275 (Script_sections::create_note_and_tls_segments): Add a .interp
3276 section to a PT_INTERP segment even if we have seen a
3277 --dynamic-linker option.
3278
766f91bb
ILT
32792011-06-18 Ian Lance Taylor <iant@google.com>
3280
3281 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3282 merely because a non-PT_LOAD segment has a dynamic reloc.
3283
0d212c3a
ILT
32842011-06-18 Ian Lance Taylor <iant@google.com>
3285
3286 * layout.cc (Layout::finish_dynamic_section): Don't create
3287 DT_FLAGS entry if not needed.
3288
911a5072
ILT
32892011-06-18 Ian Lance Taylor <iant@google.com>
3290
3291 PR gold/12745
3292 * layout.cc (Layout::layout_eh_frame): Correct handling of
3293 writable .eh_frame section.
3294
534b4e5f
ILT
32952011-06-17 Ian Lance Taylor <iant@google.com>
3296
3297 PR gold/12893
3298 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3299 symbol is redefined with the exact same object and value.
3300
10b4f102
ILT
33012011-06-17 Ian Lance Taylor <iant@google.com>
3302
3303 PR gold/12880
3304 * layout.h (class Layout): Add interp_segment_ field.
3305 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3306 (Layout::attach_allocated_section_to_segment): If making shared
3307 library, put .interp section in PT_INTERP segment.
3308 (Layout::finalize): Also call create_interp if -dynamic-linker
3309 option was used.
3310 (Layout::create_interp): Assert that there is no PT_INTERP
3311 segment. If not using a SECTIONS clause, use make_output_section.
3312 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3313 * script-sections.cc
3314 (Script_sections::create_note_and_tls_segments): If making shared
3315 library, put .interp section in PT_INTERP segment.
3316
a29b0dad
ILT
33172011-06-17 Ian Lance Taylor <iant@google.com>
3318
e588ea8d
ILT
3319 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3320 when making a shared library.
3321
33222011-06-17 Ian Lance Taylor <iant@google.com>
3323
3324 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3325 parameter. Change all callers. Don't issue warning about PC32
3326 against locally defined symbol.
a29b0dad 3327
9d3b0698
ILT
33282011-06-16 Ian Lance Taylor <iant@google.com>
3329
3330 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3331 occurs in same object.
3332
85b0f90c
AM
33332011-06-14 Alan Modra <amodra@gmail.com>
3334
3335 * po/POTFILES.in: Regenerate.
3336
a94907d9
ILT
33372011-06-09 Ian Lance Taylor <iant@google.com>
3338
3339 * script-sections.cc
3340 (Orphan_output_section::set_section_addresses): For a relocatable
3341 link set address to 0.
3342
4fb3a1c3
CC
33432011-06-09 Cary Coutant <ccoutant@google.com>
3344
3345 PR gold/12804
3346 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3347 used with --compress-debug-sections.
3348 * gold/object.cc (Sized_relobj_file::do_layout): Report
3349 uncompressed size of compressed input sections.
3350
61220854
CC
33512011-06-08 Cary Coutant <ccoutant@google.com>
3352
3353 PR gold/12804
3354 * testsuite/two_file_test_2_v1.cc: Change initialization of
3355 v2 to keep it in .data.
3356
e6455dfb
CC
33572011-06-07 Cary Coutant <ccoutant@google.com>
3358
3359 * common.cc (Symbol_table::do_allocate_commons_list): Call
3360 gold_fallback.
3361 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3362 (Errors::fallback): New function.
3363 (gold_fallback): New function.
3364 * errors.h (Errors::fallback): New function.
3365 * gold.cc (gold_exit): Change status parameter to enum; adjust
3366 all callers.
3367 (queue_initial_tasks): Call gold_fallback.
3368 * gold.h: Include cstdlib.
3369 (Exit_status): New enum type.
3370 (gold_exit): Change status parameter to enum.
3371 (gold_fallback): New function.
3372 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3373 (Layout::create_symtab_sections): Likewise.
3374 (Layout::create_shdrs): Likewise.
3375 * main.cc (main): Adjust call to gold_exit.
3376 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3377 (Output_data_got::add_got_entry_pair): Likewise.
3378 (Output_section::add_input_section): Likewise.
3379 (Output_section::add_output_section_data): Likewise.
3380 (Output_segment::set_section_list_addresses): Likewise.
3381 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3382
fb0e076f
CC
33832011-06-07 Cary Coutant <ccoutant@google.com>
3384
3385 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3386 for incremental links.
3387 * output.cc (Output_segment::set_section_list_addresses): Remove
3388 FIXME and test for TLS or BSS.
3389
a5ee4d5d
CC
33902011-06-07 Cary Coutant <ccoutant@google.com>
3391
3392 * testsuite/Makefile.am: Add incremental_copy_test,
3393 incremental_common_test_1.
3394 * testsuite/Makefile.in: Regenerate.
3395 * testsuite/common_test_1_v1.c: New source file.
3396 * testsuite/common_test_1_v2.c: New source file.
3397 * testsuite/copy_test_v1.cc: New source file.
3398
5146f448
CC
33992011-06-07 Cary Coutant <ccoutant@google.com>
3400
3401 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
3402 update, allocate common from bss section's free list.
3403 * incremental-dump.cc (dump_incremental_inputs): Print flag for
3404 linker-defined symbols.
3405 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
3406 Skip GOT and PLT entries that are no longer referenced.
3407 (Output_section_incremental_inputs::write_info_blocks): Mark
3408 linker-defined symbols.
3409 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
3410 * output.cc (Output_section::allocate): New function.
3411 * output.h (Output_section::allocate): New function.
3412 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
3413 linker-defined symbols.
3414 (Symbol::override_base_with_special): Copy is_predefined_ flag.
3415 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
3416 (Symbol::init_base_output_data): Likewise.
3417 (Symbol::init_base_output_segment): Likewise.
3418 (Symbol::init_base_constant): Likewise.
3419 (Sized_symbol::init_output_data): Likewise.
3420 (Sized_symbol::init_output_segment): Likewise.
3421 (Sized_symbol::init_constant): Likewise.
3422 (Symbol_table::do_define_in_output_data): Likewise.
3423 (Symbol_table::do_define_in_output_segment): Likewise.
3424 (Symbol_table::do_define_as_constant): Likewise.
3425 * symtab.h (Symbol::is_predefined): New function.
3426 (Symbol::init_base_output_data): Add is_predefined parameter.
3427 (Symbol::init_base_output_segment): Likewise.
3428 (Symbol::init_base_constant): Likewise.
3429 (Symbol::is_predefined_): New data member.
3430 (Sized_symbol::init_output_data): Add is_predefined parameter.
3431 (Sized_symbol::init_output_segment): Likewise.
3432 (Sized_symbol::init_constant): Likewise.
3433 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
3434
26d3c67d
CC
34352011-06-07 Cary Coutant <ccoutant@google.com>
3436
3437 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
3438 instead of emit_copy_reloc.
3439 (Copy_relocs::emit_copy_reloc): Refactor.
3440 (Copy_relocs::make_copy_reloc): New function.
3441 (Copy_relocs::add_copy_reloc): Remove.
3442 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
3443 section.
3444 (Copy_relocs::make_copy_reloc): New function.
3445 (Copy_relocs::add_copy_reloc): Remove.
3446 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
3447 unchanged input files.
3448 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
3449 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
3450 Reserve BSS space for COPY relocations.
3451 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3452 (Output_section_incremental_inputs::write_info_blocks): Record
3453 whether a symbol is copied from a shared object.
3454 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
3455 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
3456 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
3457 (Incremental_input_entry_reader::get_output_symbol_index): Add
3458 is_copy parameter.
3459 (Incremental_binary::emit_copy_relocs): New function.
3460 (Incremental_binary::do_emit_copy_relocs): New function.
3461 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3462 new data member.
3463 (Sized_incremental_binary::add_copy_reloc): New function.
3464 (Sized_incremental_binary::do_emit_copy_relocs): New function.
3465 (Sized_incremental_binary::Copy_reloc): New struct.
3466 (Sized_incremental_binary::Copy_relocs): New typedef.
3467 (Sized_incremental_binary::copy_relocs_): New data member.
3468 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
3469 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
3470 * target.h (Sized_target::emit_copy_reloc): New function.
3471 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
3472
7cdb37d9
CC
34732011-06-02 Cary Coutant <ccoutant@google.com>
3474
3475 PR gold/12163
3476 * gold/archive.cc (Archive::Archive): Initialize new data member.
3477 (Archive::include_all_members): Return if archive has already been
3478 included.
3479 * gold/archive.h (Archive::include_all_members_): New data member.
3480
cc643b88
NC
34812011-06-02 Nick Clifton <nickc@redhat.com>
3482
3483 * dynobj.h: Fix spelling mistake in comment.
3484 * output.cc: Likewise.
3485
f62a3ca7 34862011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 3487 Asier Llano
f62a3ca7
DK
3488
3489 PR gold/12826
cc643b88 3490 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
3491 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
3492 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
3493 redundant arm_exidx_test.so.
3494 * testsuite/Makefile.in: Regenerate.
3495 (check_SCRIPTS): Add pr12826.sh
3496 (check_DATA): Add pr12826.stdout
3497 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
3498 * testsuite/pr12826.sh: New file.
3499 * testsuite/pr12826_1.s: Ditto.
3500 * testsuite/pr12826_1.s: Ditto.
3501
8dbe1edc
ILT
35022011-05-30 Ian Lance Taylor <iant@google.com>
3503
3504 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
3505 sections.
3506
c49875be
ILT
35072011-05-29 Ian Lance Taylor <iant@google.com>
3508
3509 PR gold/12804
3510 * testsuite/Makefile.am: Use different file name for two_file_test
3511 temporary file for each incremental test.
3512 * testsuite/Makefile.in: Rebuild.
3513
69d53f7a
ILT
35142011-05-29 Ian Lance Taylor <iant@google.com>
3515
3516 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
3517 binary input file is empty.
3518
41d0ab5f
ILT
35192011-05-27 Ian Lance Taylor <iant@google.com>
3520
3521 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
3522 (ver_test_9.so): Likewise.
3523 * testsuite/Makefile.in: Rebuild.
3524
89d8a36b
CC
35252011-05-26 Cary Coutant <ccoutant@google.com>
3526
3527 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
3528 * incremental.cc (Incremental_inputs::report_input_section): Fix
3529 comment, indentation.
3530 (Incremental_inputs::report_comdat_group): New function.
3531 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3532 of data for incremental input file entry.
3533 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
3534 group count, COMDAT group signatures.
3535 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
3536 an unchanged input file.
3537 * incremental.h (Incremental_object_entry::Incremental_object_entry):
3538 Initialize new data member.
3539 (Incremental_object_entry::add_comdat_group): New function.
3540 (Incremental_object_entry::get_comdat_group_count): New function.
3541 (Incremental_object_entry::get_comdat_signature_key): New function.
3542 (Incremental_object_entry::groups_): New data member.
3543 (Incremental_inputs::report_comdat_group): New function.
3544 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
3545 data for incremental input file entry.
3546 (Incremental_input_entry_reader::get_comdat_group_count): New function.
3547 (Incremental_input_entry_reader::get_input_section): Adjust size of
3548 data for incremental input file entry.
3549 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
3550 (Incremental_input_entry_reader::get_comdat_group_signature): New
3551 function.
3552 * object.cc (Sized_relobj::include_section_group): Report kept
3553 COMDAT groups for incremental links.
3554
1706a06f
ILT
35552011-05-24 David Meyer <pdox@google.com>
3556
3557 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
3558 with name parameter. Add found_name parameter.
3559 * fileread.cc (Input_file::find_file): Adjust code accordingly.
3560 * dirsearch.h (class Dirsearch): Update declaration.
3561
a10ae760
ILT
35622011-05-24 Ian Lance Taylor <iant@google.com>
3563
3564 * archive.cc (Library_base::should_include_member): Pull in object
3565 from archive if it defines the entry symbol.
3566 * parameters.cc (Parameters::entry): New function.
3567 * parameters.h (class Parameters): Declare entry.
3568 * output.h (class Output_file_header): Remove entry_ field.
3569 * output.cc (Output_file_header::Output_file_header): Remove entry
3570 parameter. Change all callers.
3571 (Output_file_header::entry): Use parameters->entry.
3572 * gold.cc (queue_middle_tasks): Likewise.
3573 * plugin.cc (Plugin_hook::run): Likewise.
3574
aa92d6ed
CC
35752011-05-24 Cary Coutant <ccoutant@google.com>
3576
3577 * gold.cc (queue_initial_tasks): Pass incremental base filename
3578 to Output_file::open_base_file; don't print error message.
3579 * incremental-dump.cc (main): Adjust call to
3580 Output_file::open_for_modification.
3581 * incremental-dump.cc (main): Likewise.
3582 * incremental.cc (Incremental_inputs::report_command_line):
3583 Ignore --incremental-base option when comparing command lines.
3584 Ignore parameter when given as separate argument.
3585 * options.h (class General_options): Add --incremental-base.
3586 * output.cc (Output_file::Output_file):
3587 (Output_file::open_base_file): Add base_name and writable parameters;
3588 read base file into new file; print error message here.
3589 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3590 callers.
3591 * output.h (Output_file::open_for_modification): Rename to...
3592 (Output_file::open_base_file): ...this; add base_name and
3593 writable parameters; adjust all callers.
3594 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3595 callers.
3596 * testsuite/Makefile.am (incremental_test_4): Test
3597 --incremental-base.
3598 * testsuite/Makefile.in: Regenerate.
3599
2eedd706
CC
36002011-05-24 Cary Coutant <ccoutant@google.com>
3601
3602 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3603 incremental_test_4.
3604 * testsuite/Makefile.in: Regenerate.
3605 * testsuite/two_file_test_1_v1.cc: New test source file.
3606 * testsuite/two_file_test_1b_v1.cc: New test source file.
3607 * testsuite/two_file_test_2_v1.cc: New test source file.
3608
0f1c85a6
CC
36092011-05-24 Cary Coutant <ccoutant@google.com>
3610
3611 * dynobj.h (Dynobj::do_dynobj): New function.
3612 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3613 flag and soname for shared objects.
3614 * incremental.cc (Incremental_inputs::report_object): Make
3615 either Incremental_object_entry or Incremental_dynobj_entry; add
3616 soname to string table.
3617 (Incremental_inputs::report_input_section): Add assertion.
3618 (Output_section_incremental_inputs::set_final_data_size): Adjust
3619 type of input file entry for shared libraries; adjust size of
3620 shared library info entry.
3621 (Output_section_incremental_inputs::write_input_files): Write
3622 as_needed flag for shared libraries.
3623 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3624 of input file entry for shared libraries; write soname.
3625 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3626 soname from incremental info.
3627 * incremental.h (enum Incremental_input_flags): Add
3628 INCREMENTAL_INPUT_AS_NEEDED.
3629 (Incremental_input_entry::Incremental_input_entry): Initialize new
3630 data member.
3631 (Incremental_input_entry::set_as_needed): New function.
3632 (Incremental_input_entry::as_needed): New function.
3633 (Incremental_input_entry::do_dynobj_entry): New function.
3634 (Incremental_input_entry::as_needed_): New data member.
3635 (Incremental_object_entry::Incremental_object_entry): Don't check
3636 for shared library.
3637 (Incremental_object_entry::do_type): Likewise.
3638 (class Incremental_dynobj_entry): New class.
3639 (Incremental_input_entry_reader::as_needed): New function.
3640 (Incremental_input_entry_reader::get_soname): New function.
3641 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3642 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3643 size of shared library info entry.
58797674 3644 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3645 incremental link when adding DT_NEEDED entries.
3646 * object.h (Object::Object): Initialize new data member.
3647 (Object::dynobj): New function.
3648 (Object::set_as_needed): New function.
3649 (Object::as_needed): New function.
3650 (Object::do_dynobj): New function.
3651 (Object::as_needed_): New data member.
3652
6fa2a40b
CC
36532011-05-24 Cary Coutant <ccoutant@google.com>
3654
3655 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3656 info; adjust display of GOT entries.
3657 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3658 vector of input objects; remove file_status_.
3659 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3660 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3661 got_plt reader; call target hooks to reserve GOT entries.
3662 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3663 of input file info header and GOT info entry.
3664 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3665 relocation info.
3666 (Got_plt_view_info::got_descriptor): Remove.
3667 (Got_plt_view_info::sym_index): New data member.
3668 (Got_plt_view_info::input_index): New data member.
3669 (Local_got_offset_visitor::visit): Write input file index.
3670 (Global_got_offset_visitor::visit): Write 0 for input file index.
3671 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3672 with sym_index and input_index.
3673 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3674 incremental info GOT entry; replace got_descriptor with input_index.
3675 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3676 map from input file index to object.
3677 (Sized_relobj_incr::do_layout): Replace direct data member reference
3678 with accessor function.
3679 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3680 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3681 Adjust size of input file info header.
3682 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3683 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3684 (Incremental_input_entry_reader::get_input_section): Adjust size of
3685 input file info header.
3686 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3687 of incremental info GOT entry.
3688 (Incremental_got_plt_reader::get_got_desc): Remove.
3689 (Incremental_got_plt_reader::get_got_symndx): New function.
3690 (Incremental_got_plt_reader::get_got_input_index): New function.
3691 (Sized_incremental_binary::Sized_incremental_binary): Remove
3692 file_status_; add input_objects_.
3693 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3694 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3695 (Sized_incremental_binary::file_is_unchanged): Remove.
3696 (Sized_incremental_binary::set_input_object): New function.
3697 (Sized_incremental_binary::input_object): New function.
3698 (Sized_incremental_binary::file_status_): Remove.
3699 (Sized_incremental_binary::input_objects_): New data member.
3700 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3701 references.
3702 (Sized_relobj_incr::invalid_address): Move to base class.
3703 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3704 class.
3705 (Sized_relobj_incr::do_output_section_offset): Likewise.
3706 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3707 (Sized_relobj_incr::section_offsets_): Likewise.
3708 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3709 function.
3710 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3711 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3712 with accessor function.
3713 (Sized_relobj_file::do_layout): Likewise.
3714 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3715 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3716 (Sized_relobj_file::compute_final_local_value): Replace refs to
3717 section_offsets_ with accessor function.
3718 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3719 * object.h (Relobj::Relobj): Initialize new data members.
3720 (Relobj::add_dyn_reloc): New function.
3721 (Relobj::first_dyn_reloc): New function.
3722 (Relobj::dyn_reloc_count): New function.
3723 (Relobj::first_dyn_reloc_): New data member.
3724 (Relobj::dyn_reloc_count_): New data member.
3725 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3726 references.
3727 (Sized_relobj::Address): New typedef.
3728 (Sized_relobj::invalid_address): Move here from child class.
3729 (Sized_relobj::Sized_relobj): Initialize new data members.
3730 (Sized_relobj::sized_relobj): New function.
3731 (Sized_relobj::is_output_section_offset_invalid): Move here from
3732 child class.
3733 (Sized_relobj::get_output_section_offset): Likewise.
3734 (Sized_relobj::local_has_got_offset): Likewise.
3735 (Sized_relobj::local_got_offset): Likewise.
3736 (Sized_relobj::set_local_got_offset): Likewise.
3737 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3738 (Sized_relobj::clear_got_offsets): New function.
3739 (Sized_relobj::section_offsets): Move here from child class.
3740 (Sized_relobj::do_output_section_offset): Likewise.
3741 (Sized_relobj::do_set_section_offset): Likewise.
3742 (Sized_relobj::Local_got_offsets): Likewise.
3743 (Sized_relobj::local_got_offsets_): Likewise.
3744 (Sized_relobj::section_offsets_): Likewise.
3745 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3746 references.
3747 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3748 class.
3749 (Sized_relobj_file::sized_relobj): New function
3750 (Sized_relobj_file::local_has_got_offset): Move to base class.
3751 (Sized_relobj_file::local_got_offset): Likewise.
3752 (Sized_relobj_file::set_local_got_offset): Likewise.
3753 (Sized_relobj_file::get_output_section_offset): Likewise.
3754 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3755 (Sized_relobj_file::do_output_section_offset): Likewise.
3756 (Sized_relobj_file::do_set_section_offset): Likewise.
3757 (Sized_relobj_file::Local_got_offsets): Likewise.
3758 (Sized_relobj_file::local_got_offsets_): Likewise.
3759 (Sized_relobj_file::section_offsets_): Likewise.
3760 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3761 (all constructors).
3762 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3763 (Output_reloc::get_symbol_index): Likewise.
3764 (Output_reloc::local_section_offset): Likewise.
3765 (Output_reloc::get_address): Likewise.
3766 (Output_reloc::symbol_value): Likewise.
3767 (Output_data_got::reserve_slot): Move to class definition.
3768 (Output_data_got::reserve_local): New function.
3769 (Output_data_got::reserve_slot_for_global): Remove.
3770 (Output_data_got::reserve_global): New function.
3771 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3772 (all constructors, two instantiations).
3773 (Output_reloc::get_relobj): New function (two instantiations).
3774 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3775 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3776 (Output_data_reloc::add_global): Adjust type of relobj.
3777 (Output_data_reloc::add_global_relative): Likewise.
3778 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3779 (Output_data_reloc::add_local): Likewise.
3780 (Output_data_reloc::add_local_relative): Likewise.
3781 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3782 (Output_data_reloc::add_local_section): Likewise.
3783 (Output_data_reloc::add_output_section): Likewise.
3784 (Output_data_reloc::add_absolute): Likewise.
3785 (Output_data_reloc::add_target_specific): Likewise.
3786 (Output_data_got::reserve_slot): Move definition here.
3787 (Output_data_got::reserve_local): New function.
3788 (Output_data_got::reserve_global): New function.
3789 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3790 section_offsets_ with accessor function.
3791 (Sized_relobj_file::write_sections): Likewise.
3792 (Sized_relobj_file::do_relocate_sections): Likewise.
3793 * target.h (Sized_target::reserve_local_got_entry): New function.
3794 (Sized_target::reserve_global_got_entry): New function.
3795 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3796 (Target_x86_64::reserve_global_got_entry): New function.
3797 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3798
4829d394
CC
37992011-05-23 Cary Coutant <ccoutant@google.com>
3800
3801 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3802 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3803 bit when checking got_type.
3804 * incremental.cc (Sized_incremental_binary::setup_readers):
3805 Store symbol table and string table locations; initialize bit vector
3806 of file status flags.
3807 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3808 unchanged files.
3809 (Sized_incremental_binary::do_process_got_plt): New function.
3810 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3811 (Output_section_incremental_inputs::set_final_data_size): Record
3812 file index for each input file.
3813 (Output_section_incremental_inputs::write_got_plt): Store file index
3814 instead of input entry offset for each GOT entry.
3815 * incremental.h
3816 (Incremental_input_entry::Incremental_input_entry): Initialize new
3817 data member.
3818 (Incremental_input_entry::set_offset): Store file index.
3819 (Incremental_input_entry::get_file_index): New function.
3820 (Incremental_input_entry::file_index_): New data member.
3821 (Incremental_binary::process_got_plt): New function.
3822 (Incremental_binary::do_process_got_plt): New function.
3823 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3824 data members.
3825 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3826 (Sized_incremental_binary::set_file_is_unchanged): New function.
3827 (Sized_incremental_binary::file_is_unchanged): New function.
3828 (Sized_incremental_binary::do_process_got_plt): New function.
3829 (Sized_incremental_binary::file_status_): New data member.
3830 (Sized_incremental_binary::main_symtab_loc_): New data member.
3831 (Sized_incremental_binary::main_strtab_loc_): New data member.
3832 * output.cc (Output_data_got::Got_entry::write): Add case
3833 RESERVED_CODE.
3834 (Output_data_got::add_global): Call add_got_entry.
3835 (Output_data_got::add_global_plt): Likewise.
3836 (Output_data_got::add_global_with_rel): Likewise.
3837 (Output_data_got::add_global_with_rela): Likewise.
3838 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3839 (Output_data_got::add_global_pair_with_rela): Likewise.
3840 (Output_data_got::add_local): Call add_got_entry.
3841 (Output_data_got::add_local_plt): Likewise.
3842 (Output_data_got::add_local_with_rel): Likewise.
3843 (Output_data_got::add_local_with_rela): Likewise.
3844 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3845 (Output_data_got::add_local_pair_with_rela): Likewise.
3846 (Output_data_got::reserve_slot): New function.
3847 (Output_data_got::reserve_slot_for_global): New function.
3848 (Output_data_got::add_got_entry): New function.
3849 (Output_data_got::add_got_entry_pair): New function.
3850 (Output_section::add_output_section_data): Edit FIXME.
3851 * output.h
3852 (Output_section_data_build::Output_section_data_build): New
3853 constructor with size parameter.
3854 (Output_data_space::Output_data_space): Likewise.
3855 (Output_data_got::Output_data_got): Initialize new data member; new
3856 constructor with size parameter.
3857 (Output_data_got::add_constant): Call add_got_entry.
3858 (Output_data_got::reserve_slot): New function.
3859 (Output_data_got::reserve_slot_for_global): New function.
3860 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3861 (Output_data_got::add_got_entry): New function.
3862 (Output_data_got::add_got_entry_pair): New function.
3863 (Output_data_got::free_list_): New data member.
3864 * target.h (Sized_target::init_got_plt_for_update): New function.
3865 (Sized_target::register_global_plt_entry): New function.
3866 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3867 Initialize new data member; call init; add constructor with PLT count.
3868 (Output_data_plt_x86_64::init): New function.
3869 (Output_data_plt_x86_64::add_relocation): New function.
3870 (Output_data_plt_x86_64::reserve_slot): New function.
3871 (Output_data_plt_x86_64::free_list_): New data member.
3872 (Target_x86_64::init_got_plt_for_update): New function.
3873 (Target_x86_64::register_global_plt_entry): New function.
3874 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3875 incremental updates.
3876 (Output_data_plt_x86_64::add_relocation): New function.
3877 * testsuite/object_unittest.cc (Object_test): Set default options.
3878
ec69d6da
ILT
38792011-05-16 Ian Lance Taylor <iant@google.com>
3880
3881 * options.h (class General_options): Make -i a synonym for -r.
3882
732e31de
ILT
38832011-05-16 Ian Lance Taylor <iant@google.com>
3884
3885 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3886
403676b5
CC
38872011-05-10 Cary Coutant <ccoutant@google.com>
3888
3889 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3890 strip_all (-s).
3891
5b7b7d6e
ILT
38922011-05-06 Ian Lance Taylor <iant@google.com>
3893
3894 * layout.cc (Layout::layout): If the output section flags change,
3895 update the ordering.
3896
f0f9babf
CC
38972011-04-25 Cary Coutant <ccoutant@google.com>
3898
3899 * incremental-dump.cc (dump_incremental_inputs): Print local
3900 symbol info for each input file.
3901 * incremental.cc
3902 (Output_section_incremental_inputs::set_final_data_size): Add local
3903 symbol info to input file entries in incremental info.
3904 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3905 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3906 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3907 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3908 implementation.
3909 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3910 (Sized_incr_relobj::do_relocate): Write the local symbols.
3911 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3912 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3913 Adjust size of input file header.
3914 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3915 (Incremental_inputs_reader::get_local_symbol_count): New function.
3916 (Incremental_inputs_reader::get_input_section): Adjust size of input
3917 file header.
3918 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3919 (Sized_incr_relobj::This): New typedef.
3920 (Sized_incr_relobj::sym_size): New const data member.
3921 (Sized_incr_relobj::Local_symbol): New struct.
3922 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3923 (Sized_incr_relobj::do_local_symbol_offset): New function.
3924 (Sized_incr_relobj::local_symbol_count_): New data member.
3925 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3926 (Sized_incr_relobj::local_symbol_index_): New data member.
3927 (Sized_incr_relobj::local_symbol_offset_): New data member.
3928 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3929 (Sized_incr_relobj::local_symbols_): New data member.
3930 * object.h (Relobj::output_local_symbol_count): New function.
3931 (Relobj::local_symbol_offset): New function.
3932 (Relobj::do_output_local_symbol_count): New function.
3933 (Relobj::do_local_symbol_offset): New function.
3934 (Sized_relobj::do_output_local_symbol_count): New function.
3935 (Sized_relobj::do_local_symbol_offset): New function.
3936
d0a9ace3
ILT
39372011-04-22 Vladimir Simonov <sv@sw.ru>
3938
3939 * descriptors.cc (set_close_on_exec): New function.
3940 (Descriptors::open): Use set_close_on_exec.
3941 * output.cc (S_ISLNK): Define if not defined.
3942
94a3fc8b
CC
39432011-04-22 Cary Coutant <ccoutant@google.com>
3944
3945 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3946 global symbol map.
3947 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3948 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3949 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3950 relocations.
3951 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3952 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3953 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3954 * incremental.h
3955 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3956 function.
3957 (Incremental_binary::apply_incremental_relocs): New function.
3958 (Incremental_binary::do_apply_incremental_relocs): New function.
3959 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3960 data member.
3961 (Sized_incremental_binary::add_global_symbol): New function.
3962 (Sized_incremental_binary::global_symbol): New function.
3963 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3964 (Sized_incremental_binary::symbol_map_): New data member.
3965 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3966 * target.h (Sized_target::apply_relocation): New function.
3967 * target-reloc.h (apply_relocation): New function.
3968 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3969
c87e4302
DK
39702011-04-22 Doug Kwan <dougkwan@google.com>
3971
3972 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3973 flag of a SHT_ARM_EXIDX section.
2e702c99 3974 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3975 * testsuite/Makefile.in: Regenerate.
3976 * testsuite/arm_exidx_test.s: New file.
3977 * testsuite/arm_exidx_test.sh: Same.
3978
e7782cf6
CC
39792011-04-20 Cary Coutant <ccoutant@google.com>
3980
3981 PR gold/12689
3982 * archive.h (Incremental_archive_entry::Archive_member):
3983 Initialize arg_serial_ (second constructor).
3984
308ecdc7
ILT
39852011-04-17 Ian Lance Taylor <iant@google.com>
3986
3987 * object.cc (Relocate_info::location): Simplify location string.
3988 * errors.cc (Errors::error_at_location): Don't print program
3989 name.
3990 (Errors::warning_at_location): Likewise.
3991 (Errors::undefined_symbol): Likewise.
3992 * testsuite/debug_msg.sh: Update accordingly.
3993
bec5b579
CC
39942011-04-14 Cary Coutant <ccoutant@google.com>
3995
3996 * gold/layout.cc (Layout::symtab_section_offset): New function.
3997 * gold/layout.h (Layout::symtab_section_offset): New function.
3998 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3999
88597d34
ILT
40002011-04-12 Ian Lance Taylor <iant@google.com>
4001
4002 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4003 with MREMAP_MAYMOVE.
4004 * output.h (class Output_file): Add map_is_allocated_ field.
4005 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4006 not available, provide stubs. If mremap is not available, #define
4007 it to gold_mremap.
4008 (MREMAP_MAYMOVE): Define if not defined.
4009 (Output_file::Output_file): Initialize map_is_allocated_.
4010 (Output_file::resize): Check map_is_allocated_.
4011 (Output_file::map_anonymous): If mmap fails, use malloc.
4012 (Output_file::unmap): Don't do anything for an anonymous map.
4013 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4014 is not available, provide stubs.
4015 (File_read::View::~View): Use free rather than delete[].
4016 (File_read::make_view): Use malloc rather than new[]. If mmap
4017 fails, use malloc.
4018 (File_read::find_or_make_view): Use malloc rather than new[].
4019 * gold.h: Remove HAVE_REMAP code.
4020 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4021 exists. Rename mremap to gold_mremap. If mmap is not available
4022 don't do anything.
4023 * configure, config.in: Rebuild.
4024
11e361bc
ILT
40252011-04-11 Ian Lance Taylor <iant@google.com>
4026
4027 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4028 initialize local variable v.
4029
cdc29364
CC
40302011-04-11 Cary Coutant <ccoutant@google.com>
4031
4032 * archive.cc (Archive::include_member): Adjust call to
4033 report_object.
4034 (Add_archive_symbols::run): Track argument serial numbers.
4035 (Lib_group::include_member): Likewise.
4036 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4037 * archive.h (Incremental_archive_entry::Archive_member):
4038 Initialize arg_serial_.
4039 (Archive_member::arg_serial_): New data member.
4040 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4041 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4042 incremental link.
4043 (Sized_dynobj::do_for_all_local_got_entries): New function.
4044 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4045 function.
4046 * fileread.cc (get_mtime): New function.
4047 * fileread.h (get_mtime): New function.
4048 * gold.cc (queue_initial_tasks): Check for incremental update.
4049 (process_incremental_input): New function.
4050 (queue_middle_tasks): Don't force valid target for incremental
4051 update.
4052 * incremental-dump.cc (find_input_containing_global): Adjust
4053 size of symbol info entry.
4054 (dump_incremental_inputs): Dump argument serial number and
4055 in_system_directory flag; bias shndx by 1; print symbol names
4056 when dumping per-file symbol lists; use new symbol info readers.
4057 * incremental.cc
4058 (Output_section_incremental_inputs:update_data_size): New function.
4059 (Sized_incremental_binary::setup_readers): Setup input readers
4060 for each input file; build maps for files added from libraries
4061 and scripts.
4062 (Sized_incremental_binary::check_input_args): New function.
4063 (Sized_incremental_binary::do_check_inputs): Build map of argument
4064 serial numbers to input arguments.
4065 (Sized_incremental_binary::do_file_has_changed): Rename
4066 do_file_is_unchanged to this; compare file modification times.
4067 (Sized_incremental_binary::do_init_layout): New function.
4068 (Sized_incremental_binary::do_reserve_layout): New function.
4069 (Sized_incremental_binary::do_get_input_reader): Remove.
4070 (Sized_incremental_binary::get_symtab_view): New function.
4071 (Incremental_checker::can_incrementally_link_output_file): Remove.
4072 (Incremental_inputs::report_command_line): Exclude --debug options.
4073 (Incremental_inputs::report_archive_begin): Add parameter; track
4074 argument serial numbers; don't put input file entry for archive
4075 before archive members.
4076 (Incremental_inputs::report_archive_end): Put input file entry
4077 for archive after archive members.
4078 (Incremental_inputs::report_object): Add parameter; track argument
4079 serial numbers and in_system_directory flag.
4080 (Incremental_inputs::report_script): Add parameter; track argument
4081 serial numbers.
4082 (Output_section_incremental_inputs::set_final_data_size): Adjust
4083 size of symbol info entry; check for forwarding symbols.
4084 (Output_section_incremental_inputs::write_input_files): Write
4085 in_system_directory flag and argument serial number.
4086 (Output_section_incremental_inputs::write_info_blocks): Map section
4087 indices between incremental info and original input file; store
4088 input section index for each symbol.
4089 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4090 change operator() to visit().
4091 (class Global_got_offset_visitor): Likewise.
4092 (class Global_symbol_visitor_got_plt):
4093 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4094 classes.
4095 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4096 (Sized_incr_relobj::do_read_symbols): New function.
4097 (Sized_incr_relobj::do_layout): New function.
4098 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4099 (Sized_incr_relobj::do_add_symbols): New function.
4100 (Sized_incr_relobj::do_should_include_member): New function.
4101 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4102 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4103 (Sized_incr_relobj::do_section_size): New function.
4104 (Sized_incr_relobj::do_section_name): New function.
4105 (Sized_incr_relobj::do_section_contents): New function.
4106 (Sized_incr_relobj::do_section_flags): New function.
4107 (Sized_incr_relobj::do_section_entsize): New function.
4108 (Sized_incr_relobj::do_section_address): New function.
4109 (Sized_incr_relobj::do_section_type): New function.
4110 (Sized_incr_relobj::do_section_link): New function.
4111 (Sized_incr_relobj::do_section_info): New function.
4112 (Sized_incr_relobj::do_section_addralign): New function.
4113 (Sized_incr_relobj::do_initialize_xindex): New function.
4114 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4115 (Sized_incr_relobj::do_read_relocs): New function.
4116 (Sized_incr_relobj::do_gc_process_relocs): New function.
4117 (Sized_incr_relobj::do_scan_relocs): New function.
4118 (Sized_incr_relobj::do_count_local_symbols): New function.
4119 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4120 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4121 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4122 (Sized_incr_relobj::do_relocate): New function.
4123 (Sized_incr_relobj::do_set_section_offset): New function.
4124 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4125 (Sized_incr_dynobj::do_read_symbols): New function.
4126 (Sized_incr_dynobj::do_layout): New function.
4127 (Sized_incr_dynobj::do_add_symbols): New function.
4128 (Sized_incr_dynobj::do_should_include_member): New function.
4129 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4130 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4131 (Sized_incr_dynobj::do_section_size): New function.
4132 (Sized_incr_dynobj::do_section_name): New function.
4133 (Sized_incr_dynobj::do_section_contents): New function.
4134 (Sized_incr_dynobj::do_section_flags): New function.
4135 (Sized_incr_dynobj::do_section_entsize): New function.
4136 (Sized_incr_dynobj::do_section_address): New function.
4137 (Sized_incr_dynobj::do_section_type): New function.
4138 (Sized_incr_dynobj::do_section_link): New function.
4139 (Sized_incr_dynobj::do_section_info): New function.
4140 (Sized_incr_dynobj::do_section_addralign): New function.
4141 (Sized_incr_dynobj::do_initialize_xindex): New function.
4142 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4143 (make_sized_incremental_object): New function.
4144 (Incremental_library::copy_unused_symbols): New function.
4145 (Incremental_library::do_for_all_unused_symbols): New function.
4146 * incremental.h (enum Incremental_input_flags): New type.
4147 (class Incremental_checker): Remove.
4148 (Incremental_input_entry::Incremental_input_entry): Add argument
4149 serial number.
4150 (Incremental_input_entry::arg_serial): New function.
4151 (Incremental_input_entry::set_is_in_system_directory): New function.
4152 (Incremental_input_entry::is_in_system_directory): New function.
4153 (Incremental_input_entry::arg_serial_): New data member.
4154 (Incremental_input_entry::is_in_system_directory_): New data member.
4155 (class Script_info): Move here from script.h.
4156 (Script_info::Script_info): Add filename parameter.
4157 (Script_info::filename): New function.
4158 (Script_info::filename_): New data member.
4159 (Incremental_script_entry::Incremental_script_entry): Add argument
4160 serial number.
4161 (Incremental_object_entry::Incremental_object_entry): Likewise.
4162 (Incremental_object_entry::add_input_section): Build list of input
4163 sections with map to original shndx.
4164 (Incremental_object_entry::get_input_section_index): New function.
4165 (Incremental_object_entry::shndx_): New data member.
4166 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4167 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4168 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4169 serial number.
4170 (Incremental_inputs::report_archive_begin): Likewise.
4171 (Incremental_inputs::report_object): Likewise.
4172 (Incremental_inputs::report_script): Likewise.
4173 (class Incremental_global_symbol_reader): New class.
4174 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4175 and store flags and input file type.
4176 (Incremental_input_entry_reader::arg_serial): New function.
4177 (Incremental_input_entry_reader::type): Extract type from flags.
4178 (Incremental_input_entry_reader::is_in_system_directory): New function.
4179 (Incremental_input_entry_reader::get_input_section_count): Call
4180 accessor function for type.
4181 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4182 function for type; adjust size of global symbol entry.
4183 (Incremental_input_entry_reader::get_global_symbol_count): Call
4184 accessor function for type.
4185 (Incremental_input_entry_reader::get_object_count): Likewise.
4186 (Incremental_input_entry_reader::get_object_offset): Likewise.
4187 (Incremental_input_entry_reader::get_member_count): Likewise.
4188 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4189 (Incremental_input_entry_reader::get_member_offset): Likewise.
4190 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4191 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4192 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4193 (Incremental_input_entry_reader::get_global_symbol_reader): New
4194 function.
4195 (Incremental_input_entry_reader::get_output_symbol_index): New
4196 function.
4197 (Incremental_input_entry_reader::type_): Remove.
4198 (Incremental_input_entry_reader::flags_): New data member.
4199 (Incremental_inputs_reader::input_file_offset): New function.
4200 (Incremental_inputs_reader::input_file_index): New function.
4201 (Incremental_inputs_reader::input_file): Call input_file_offset.
4202 (Incremental_inputs_reader::input_file_at_offset): New function.
4203 (Incremental_relocs_reader::get_r_type): Reformat.
4204 (Incremental_relocs_reader::get_r_shndx): Reformat.
4205 (Incremental_relocs_reader::get_r_offset): Reformat.
4206 (Incremental_relocs_reader::data): New function.
4207 (Incremental_binary::Incremental_binary): Initialize new data members.
4208 (Incremental_binary::check_inputs): Add cmdline parameter.
4209 (Incremental_binary::file_is_unchanged): Remove.
4210 (Input_reader::arg_serial): New function.
4211 (Input_reader::get_unused_symbol_count): New function.
4212 (Input_reader::get_unused_symbol): New function.
4213 (Input_reader::do_arg_serial): New function.
4214 (Input_reader::do_get_unused_symbol_count): New function.
4215 (Input_reader::do_get_unused_symbol): New function.
4216 (Incremental_binary::input_file_count): New function.
4217 (Incremental_binary::get_input_reader): Change signature to use
4218 index instead of filename.
4219 (Incremental_binary::file_has_changed): New function.
4220 (Incremental_binary::get_input_argument): New function.
4221 (Incremental_binary::get_library): New function.
4222 (Incremental_binary::get_script_info): New function.
4223 (Incremental_binary::init_layout): New function.
4224 (Incremental_binary::reserve_layout): New function.
4225 (Incremental_binary::output_file): New function.
4226 (Incremental_binary::do_check_inputs): New function.
4227 (Incremental_binary::do_file_is_unchanged): Remove.
4228 (Incremental_binary::do_file_has_changed): New function.
4229 (Incremental_binary::do_init_layout): New function.
4230 (Incremental_binary::do_reserve_layout): New function.
4231 (Incremental_binary::do_input_file_count): New function.
4232 (Incremental_binary::do_get_input_reader): Change signature.
4233 (Incremental_binary::input_args_map_): New data member.
4234 (Incremental_binary::library_map_): New data member.
4235 (Incremental_binary::script_map_): New data member.
4236 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4237 new data members.
4238 (Sized_incremental_binary::output_section): New function.
4239 (Sized_incremental_binary::inputs_reader): Add const.
4240 (Sized_incremental_binary::symtab_reader): Add const.
4241 (Sized_incremental_binary::relocs_reader): Add const.
4242 (Sized_incremental_binary::got_plt_reader): Add const.
4243 (Sized_incremental_binary::get_symtab_view): New function.
4244 (Sized_incremental_binary::Inputs_reader): New typedef.
4245 (Sized_incremental_binary::Input_entry_reader): New typedef.
4246 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4247 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4248 (Sized_incremental_binary::do_file_has_changed): New function.
4249 (Sized_incremental_binary::do_init_layout): New function.
4250 (Sized_incremental_binary::do_reserve_layout): New function.
4251 (Sized_input_reader::Inputs_reader): Remove.
4252 (Sized_input_reader::Input_entry_reader): Remove.
4253 (Sized_input_reader::do_arg_serial): New function.
4254 (Sized_input_reader::do_get_unused_symbol_count): New function.
4255 (Sized_input_reader::do_get_unused_symbol): New function.
4256 (Sized_incremental_binary::do_input_file_count): New function.
4257 (Sized_incremental_binary::do_get_input_reader): Change signature;
4258 use index instead of filename.
4259 (Sized_incremental_binary::section_map_): New data member.
4260 (Sized_incremental_binary::input_entry_readers_): New data member.
4261 (class Sized_incr_relobj): New class.
4262 (class Sized_incr_dynobj): New class.
4263 (make_sized_incremental_object): New function.
4264 (class Incremental_library): New class.
4265 * layout.cc (Free_list::num_lists): New static data member.
4266 (Free_list::num_nodes): New static data member.
4267 (Free_list::num_removes): New static data member.
4268 (Free_list::num_remove_visits): New static data member.
4269 (Free_list::num_allocates): New static data member.
4270 (Free_list::num_allocate_visits): New static data member.
4271 (Free_list::init): New function.
4272 (Free_list::remove): New function.
4273 (Free_list::allocate): New function.
4274 (Free_list::dump): New function.
4275 (Free_list::print_stats): New function.
4276 (Layout_task_runner::run): Resize output file for incremental updates.
4277 (Layout::Layout): Initialize new data members.
4278 (Layout::set_incremental_base): New function.
4279 (Layout::init_fixed_output_section): New function.
4280 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4281 incremental updates.
4282 (Layout::create_gold_note): Do not create gold note section for
4283 incremental updates.
4284 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4285 for incremental updates.
4286 (Layout::set_section_offsets): For incremental updates, allocate space
4287 from free list.
4288 (Layout::create_symtab_sections): Layout with offsets relative to
4289 start of section; for incremental updates, allocate space from free
4290 list.
4291 (Layout::create_shdrs): For incremental updates, allocate space from
4292 free list.
4293 (Layout::finish_dynamic_section): For incremental updates, do not
4294 check --as-needed (fixed in subsequent patch).
4295 * layout.h (class Free_list): New class.
4296 (Layout::set_incremental_base): New function.
4297 (Layout::incremental_base): New function.
4298 (Layout::init_fixed_output_section): New function.
4299 (Layout::allocate): New function.
4300 (Layout::incremental_base_): New data member.
4301 (Layout::free_list_): New data member.
4302 * main.cc (main): Print Free_list statistics.
4303 * object.cc (Relobj::finalize_incremental_relocs): Add
4304 clear_counts parameter; clear counts only when clear_counts is set.
4305 (Sized_relobj::Sized_relobj): Initialize new base class.
4306 (Sized_relobj::do_layout): Don't report special sections.
4307 (Sized_relobj::do_for_all_local_got_entries): New function.
4308 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4309 symtab_off to all symbol table offsets.
4310 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4311 * object.h (class Got_offset_list): Move to top of file.
4312 (Object::Object): Allow case where input_file == NULL.
4313 (Object::~Object): Likewise.
4314 (Object::input_file): Assert that input_file != NULL.
4315 (Object::lock): Allow case where input_file == NULL.
4316 (Object::unlock): Likewise.
4317 (Object::is_locked): Likewise.
4318 (Object::token): Likewise.
4319 (Object::release): Likewise.
4320 (Object::is_incremental): New function.
4321 (Object::get_mtime): New function.
4322 (Object::for_all_local_got_entries): New function.
4323 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4324 (Object::set_is_in_system_directory): New function.
4325 (Object::is_in_system_directory): New function.
4326 (Object::do_is_incremental): New function.
4327 (Object::do_get_mtime): New function.
4328 (Object::do_for_all_local_got_entries): New function.
4329 (Object::is_in_system_directory_): New data member.
4330 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4331 (class Sized_relobj_base): New class.
4332 (class Sized_relobj): Derive from Sized_relobj_base.
4333 (class Sized_relobj::Symbols): Redeclare from base class.
4334 (class Sized_relobj::local_got_offset_list): Remove.
4335 (class Sized_relobj::Output_sections): Redeclare from base class.
4336 (class Sized_relobj::do_for_all_local_got_entries): New function.
4337 (class Sized_relobj::write_local_symbols): Add offset parameter.
4338 (class Sized_relobj::local_symbol_offset_): Update comment.
4339 (class Sized_relobj::local_dynsym_offset_): Update comment.
4340 * options.cc (Input_arguments::add_file): Remove const.
4341 * options.h (Input_file_argument::Input_file_argument):
4342 Initialize arg_serial_ (all constructors).
4343 (Input_file_argument::set_arg_serial): New function.
4344 (Input_file_argument::arg_serial): New function.
4345 (Input_file_argument::arg_serial_): New data member.
4346 (Input_arguments::Input_arguments): Initialize file_count_.
4347 (Input_arguments::add_file): Remove const.
4348 (Input_arguments::number_of_input_files): New function.
4349 (Input_arguments::file_count_): New data member.
4350 (Command_line::number_of_input_files): Call
4351 Input_arguments::number_of_input_files.
4352 * output.cc (Output_segment_headers::Output_segment_headers):
4353 Set current size.
4354 (Output_section::Input_section::current_data_size): New function.
4355 (Output_section::Output_section): Initialize new data members.
4356 (Output_section::add_input_section): Don't do merge sections for
4357 an incremental link; allocate space from free list for an
4358 incremental update.
4359 (Output_section::add_output_section_data): Allocate space from
4360 free list for an incremental update.
4361 (Output_section::update_data_size): New function.
4362 (Output_section::set_fixed_layout): New function.
4363 (Output_section::reserve): New function.
4364 (Output_segment::set_section_addresses): Remove const.
4365 (Output_segment::set_section_list_addresses): Remove const; allocate
4366 space from free list for an incremental update.
4367 (Output_segment::set_offset): Adjust size of RELRO segment for an
4368 incremental update.
4369 * output.h (Output_data::current_data_size): Move here from
4370 child classes.
4371 (Output_data::pre_finalize_data_size): New function.
4372 (Output_data::update_data_size): New function.
4373 (Output_section_headers::update_data_size): new function.
4374 (Output_section_data_build::current_data_size): Move to Output_data.
4375 (Output_data_strtab::update_data_size): New function.
4376 (Output_section::current_data_size): Move to Output_data.
4377 (Output_section::set_fixed_layout): New function.
4378 (Output_section::has_fixed_layout): New function.
4379 (Output_section::reserve): New function.
4380 (Output_section::update_data_size): New function.
4381 (Output_section::has_fixed_layout_): New data member.
4382 (Output_section::free_list_): New data member.
4383 (Output_segment::set_section_addresses): Remove const.
4384 (Output_segment::set_section_list_addresses): Remove const.
4385 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4386 New function.
4387 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4388 New function.
4389 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4390 parameter when calling Add_symbols constructor; store argument
4391 serial number for members of a lib group.
4392 (Add_symbols::locks): Allow case where token == NULL.
4393 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
4394 (Read_member::~Read_member): New function.
4395 (Read_member::is_runnable): New function.
4396 (Read_member::locks): New function.
4397 (Read_member::run): New function.
4398 (Check_script::~Check_script): New function.
4399 (Check_script::is_runnable): New function.
4400 (Check_script::locks): New function.
4401 (Check_script::run): New function.
4402 (Check_library::~Check_library): New function.
4403 (Check_library::is_runnable): New function.
4404 (Check_library::locks): New function.
4405 (Check_library::run): New function.
4406 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
4407 (Add_symbols::library_): New data member.
4408 (class Read_member): New class.
4409 (class Check_script): New class.
4410 (class Check_library): New class.
4411 * reloc.cc (Read_relocs::is_runnable): Allow case where
4412 token == NULL.
4413 (Read_relocs::locks): Likewise.
4414 (Scan_relocs::locks): Likewise.
4415 (Relocate_task::locks): Likewise.
4416 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
4417 to clear counters.
4418 (Sized_relobj::incremental_relocs_scan): Fix comment.
4419 (Sized_relobj::do_relocate): Pass output file offset to
4420 write_local_symbols.
4421 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
4422 from class declaration.
4423 * script.cc (read_input_script): Allocate Script_info; pass
4424 argument serial number to report_script.
4425 * script.h (class Script_info): Move to incremental.h.
4426 * symtab.cc (Symbol_table::add_from_incrobj): New function.
4427 * symtab.h (Symbol_table::add_from_incrobj): New function.
4428 (Symbol_table::set_file_offset): New function.
4429
b961d0d7
CC
44302011-04-05 Cary Coutant <ccoutant@google.com>
4431
4432 * incremental-dump.cc (dump_incremental_inputs): Change signature
4433 to take a Sized_incremental_binary; change caller. Use readers
4434 in Sized_incremental_binary.
4435 * incremental.cc
4436 (Sized_incremental_binary::find_incremental_inputs_sections):
4437 Rename do_find_incremental_inputs_sections to this.
4438 (Sized_incremental_binary::setup_readers): New function.
4439 (Sized_incremental_binary::do_check_inputs): Check
4440 has_incremental_info_ flag; move setup code to setup_readers;
4441 use input readers.
4442 (Sized_incremental_binary::do_file_is_unchanged): New function.
4443 (Sized_incremental_binary::do_get_input_reader): New function.
4444 * incremental.h (class Incremental_binary): Move to end of file.
4445 (Incremental_binary::file_is_unchanged): New function.
4446 (Incremental_binary::do_file_is_unchanged): New function.
4447 (Incremental_binary::Input_reader): New class.
4448 (Incremental_binary::get_input_reader): New function.
4449 (class Sized_incremental_binary): Move to end of file.
4450 (Sized_incremental_binary::Sized_incremental_binary): Setup the
4451 input section reader classes.
4452 (Sized_incremental_binary::has_incremental_info): New function.
4453 (Sized_incremental_binary::inputs_reader): New function.
4454 (Sized_incremental_binary::symtab_reader): New function.
4455 (Sized_incremental_binary::relocs_reader): New function.
4456 (Sized_incremental_binary::got_plt_reader): New function.
4457 (Sized_incremental_binary::do_file_is_unchanged): New function.
4458 (Sized_incremental_binary::Sized_input_reader): New class.
4459 (Sized_incremental_binary::get_input_reader): New function.
4460 (Sized_incremental_binary::find_incremental_inputs_sections):
4461 Rename do_find_incremental_inputs_sections to this.
4462 (Sized_incremental_binary::setup_readers): New function.
4463 (Sized_incremental_binary::has_incremental_info_): New data member.
4464 (Sized_incremental_binary::inputs_reader_): New data member.
4465 (Sized_incremental_binary::symtab_reader_): New data member.
4466 (Sized_incremental_binary::relocs_reader_): New data member.
4467 (Sized_incremental_binary::got_plt_reader_): New data member.
4468 (Sized_incremental_binary::current_input_file_): New data member.
4469
a869183f
PP
44702011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
4471
4472 PR gold/12640
4473 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
4474 violation.
4475
44762011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
4477
4478 * archive.cc (Archive::include_member): Adjust call to report_object.
4479 (Add_archive_symbols::run): Add script_info to call to
4480 report_archive_begin.
4481 (Lib_group::include_member): Adjust call to report_object.
4482 (Add_lib_group_symbols::run): Adjust call to report_object.
4483 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
4484 blocks. Add object count for script input files.
4485 * incremental.cc (Incremental_inputs::report_archive_begin): Add
4486 script_info parameter; change all callers.
4487 (Incremental_inputs::report_object): Add script_info parameter;
4488 change all callers.
4489 (Incremental_inputs::report_script): Store backpointer to
4490 incremental info entry.
4491 (Output_section_incremental_inputs::set_final_data_size): Record
4492 additional information for scripts.
4493 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4494 * incremental.h (Incremental_script_entry::add_object): New function.
4495 (Incremental_script_entry::get_object_count): New function.
4496 (Incremental_script_entry::get_object): New function.
4497 (Incremental_script_entry::objects_): New data member; adjust
4498 constructor.
4499 (Incremental_inputs::report_archive_begin): Add script_info parameter.
4500 (Incremental_inputs::report_object): Add script_info parameter.
4501 (Incremental_inputs_reader::get_object_count): New function.
4502 (Incremental_inputs_reader::get_object_offset): New function.
4503 * options.cc (Input_arguments::add_file): Return reference to
4504 new input argument.
4505 * options.h (Input_argument::set_script_info): New function.
4506 (Input_argument::script_info): New function.
4507 (Input_argument::script_info_): New data member; adjust all
4508 constructors.
4509 (Input_file_group::add_file): Return reference to new input argument.
4510 (Input_file_lib::add_file): Likewise.
4511 (Input_arguments::add_file): Likewise.
4512 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
4513 * script.cc (Parser_closure::Parser_closure): Add script_info
4514 parameter; adjust all callers.
4515 (Parser_closure::script_info): New function.
4516 (Parser_closure::script_info_): New data member.
4517 (read_input_script): Report scripts earlier to incremental info.
4518 (script_add_file): Set script_info in Input_argument.
4519 (script_add_library): Likewise.
4520 * script.h (Script_options::Script_info): Rewrite class.
4521
a869183f 45222011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
4523
4524 * archive.cc (Library_base::should_include_member): Move
4525 method here from class Archive.
4526 (Archive::Archive): Initialize base class.
4527 (Archive::should_include_member): Move to base class.
4528 (Archive::do_for_all_unused_symbols): New function.
4529 (Add_archive_symbols::run): Remove redundant access to
4530 incremental_inputs.
4531 (Lib_group::Lib_group): Initialize base class.
4532 (Lib_group::do_filename): New function.
4533 (Lib_group::include_member): Pass pointer to Lib_group to
4534 report_object.
4535 (Lib_group::do_for_all_unused_symbols): New function.
4536 (Add_lib_group_symbols::run): Report archive information for
4537 incremental links.
4538 * archive.h (class Library_base): New base class.
4539 (class Archive): Derive from Library_base.
4540 (Archive::filename): Move to base class.
4541 (Archive::set_incremental_info): Likewise.
4542 (Archive::incremental_info): Likewise.
4543 (Archive::Should_include): Likewise.
4544 (Archive::should_include_member): Likewise.
4545 (Archive::Armap_entry): Remove.
4546 (Archive::Unused_symbol_iterator): Remove.
4547 (Archive::unused_symbols_begin): Remove.
4548 (Archive::unused_symbols_end): Remove.
4549 (Archive::do_filename): New function.
4550 (Archive::do_get_mtime): New function.
4551 (Archive::do_for_all_unused_symbols): New function.
4552 (Archive::task_): Move to base class.
4553 (Archive::incremental_info_): Likewise.
4554 (class Lib_group): Derive from Library_base.
4555 (Lib_group::do_filename): New function.
4556 (Lib_group::do_get_mtime): New function.
4557 (Lib_group::do_for_all_unused_symbols): New function.
4558 (Lib_group::task_): Move to base class.
4559 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
4560 function.
4561 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
4562 function.
4563 * incremental.cc (Incremental_inputs::report_archive_begin):
4564 Use Library_base; call library's get_mtime; add incremental inputs
4565 entry before members.
4566 (class Unused_symbol_visitor): New class.
4567 (Incremental_inputs::report_archive_end): Use Library_base; use
4568 visitor class to record unused symbols; don't add incremental inputs
4569 entry after members.
4570 (Incremental_inputs::report_object): Use Library_base.
4571 * incremental.h
4572 (Incremental_archive_entry::Incremental_archive_entry): Remove
4573 unused Archive parameter.
4574 (Incremental_inputs::report_archive_begin): Use Library_base.
4575 (Incremental_inputs::report_archive_end): Likewise.
4576 (Incremental_inputs::report_object): Likewise.
4577 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4578 function.
4579 * object.h (Object::for_all_global_symbols): New function.
4580 (Object::do_for_all_global_symbols): New function.
4581 (Sized_relobj::do_for_all_global_symbols): New function.
4582 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4583 function.
4584 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4585 function.
4586
61ab3e40
ILT
45872011-03-27 Ian Lance Taylor <iant@google.com>
4588
4589 * archive.cc (Archive::interpret_header): Return -1 if something
4590 goes wrong. Change callers accordingly.
4591
30e1f9e6
CC
45922011-03-25 Cary Coutant <ccoutant@google.com>
4593
4594 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4595 * testsuite/Makefile.in: Regenerate.
4596
9370ce59 45972011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4598
4599 * plugin.cc (get_view): New.
4600 (Plugin::load): Pass get_view to the plugin.
4601 (Plugin_manager::get_view): New.
4602
9312bb0a
ILT
46032011-03-21 Ian Lance Taylor <iant@google.com>
4604
4605 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4606 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4607
7e12ba9e
ST
46082011-03-21 Sriraman Tallam <tmsriram@google.com>
4609
4610 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4611 Change == to -eq.
4612 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4613 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4614 Change == to -eq.
4615 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4616 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4617
fd7a005d
ILT
46182011-03-14 Ian Lance Taylor <iant@google.com>
4619
4620 * script-sections.cc (Sort_output_sections::script_compare):
4621 Rename from is_before, change return type.
4622 (Sort_output_sections::operator()): Adjust accordingly.
4623
ed16fd1b
ILT
46242011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4625
4626 PR gold/12572
4627 * testsuite/odr_violation2.cc: Add comment to make all error line
4628 numbers double digits.
4629 * testsuite/debug_msg.sh: Adjust expected errors.
4630
71ff8986
ILT
46312011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4632
4633 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4634 but mark earlier ones as non-canonical
4635 (offset_to_iterator): Update search target and example
4636 (do_addr2line): Return extra lines in a vector*
4637 (format_file_lineno): Extract from do_addr2line
4638 (one_addr2line): Add vector* out-param
4639 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4640 when a lineno entry appeared last for its instruction
4641 (Dwarf_line_info): Add vector* out-param
4642 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4643 * symtab.cc (Odr_violation_compare): Include the lineno in the
4644 comparison again.
4645 (linenos_from_loc): New. Combine the canonical line for an
4646 address with its other lines.
4647 (True_if_intersect): New. Helper functor to make
4648 std::set_intersection a query.
4649 (detect_odr_violations): Compare sets of lines instead of just
4650 one line for each function. This became less deterministic, but
4651 has fewer false positives.
4652 * symtab.h: Declarations.
4653 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4654 mix an optimized and non-optimized object in the same binary
4655 (odr_violation2.so): Same.
4656 * testsuite/Makefile.in: Regenerate from Makefile.am.
4657 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4658 * testsuite/debug_msg.sh: Update line numbers and add
4659 assertions.
4660 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4661 non-optimized context.
4662 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4663 isn't inlined, and use OdrDerived in an optimized context.
4664 * testsuite/odr_header1.h: Defines OdrDerived, where
4665 optimization will change the
4666 first-instruction-in-the-destructor's file and line number.
4667 * testsuite/odr_header2.h: Defines OdrBase.
4668
a19fefdc
ILT
46692011-03-09 Ian Lance Taylor <iant@google.com>
4670
4671 * fileread.cc (File_read::clear_views): Don't delete the whole
4672 file view.
4673
ecb351e9
ILT
46742011-03-08 Ian Lance Taylor <iant@google.com>
4675
4676 PR gold/12525
4677 * fileread.cc: #include <climits>.
4678 (GOLD_IOV_MAX): Define.
4679 (File_read::read_multiple): Limit number of entries by iov_max.
4680 * fileread.h (class File_read): Always set max_readv_entries to
4681 128.
4682
b821d13c
ILT
46832011-03-07 Ian Lance Taylor <iant@google.com>
4684
4685 PR gold/12525
4686 * options.h (class General_options): Add -dy and -dn.
4687
89243142
CC
46882011-03-02 Cary Coutant <ccoutant@google.com>
4689
4690 * testsuite/script_test_9.t: Add TLS segment.
4691
d0773f31
ILT
46922011-03-02 Simon Baldwin <simonb@google.com>
4693
4694 * configure.ac: Add check for gnu_indirect_function support in
4695 the toolchain building binutils.
4696 * configure: Rebuild.
4697
9370ce59 46982011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4699
4700 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4701 plugin only symbols.
4702 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4703 in plugin files as not needed in the symbol table.
4704
4cf7a849
ST
47052011-02-11 Sriraman Tallam <tmsriram@google.com>
4706
4707 * output.cc (Output_section::add_input_section): Delay fill
4708 generation for section ordering.
4709
b578bd7d
ILT
47102011-02-09 Ian Lance Taylor <iant@google.com>
4711
4712 PR gold/12316
4713 * object.h (class Sized_relobj): Remove clear_local_symbols.
4714 * reloc.cc (Sized_relobj::do_relocate): Don't call
4715 clear_local_symbols.
4716
9370ce59 47172011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4718
4719 * plugin.cc (is_visible_from_outside): Return true for symbols
4720 in the -u option.
4721
55382fb7
ILT
47222011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4723
4724 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4725 filename.
4726
4e271fff
ST
47272011-02-02 Sriraman Tallam <tmsriram@google.com>
4728
4729 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4730 to std::string.
4e271fff 4731 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4732 section_name to be std::string.
4e271fff
ST
4733 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4734
d433c3ac
ILT
47352011-01-25 Ian Lance Taylor <iant@google.com>
4736
4737 * script.cc (script_add_extern): Rewrite to use
4738 add_symbol_reference.
4739
880473a6
DK
47402011-01-25 Doug Kwan <dougkwan@google.com>
4741
d433c3ac 4742 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4743
f30f86fa
ILT
47442011-01-24 Ian Lance Taylor <iant@google.com>
4745
4746 * options.h (class General_options): Accept
4747 --no-detect-odr-violations.
4748
8e51a0b9
ILT
47492011-01-24 Ian Lance Taylor <iant@google.com>
4750
4751 * version.cc (version_string): Bump to 1.11.
4752
0f3b89d8
ILT
47532011-01-24 Ian Lance Taylor <iant@google.com>
4754
4755 * plugin.cc (class Plugin_rescan): Define new class.
4756 (Plugin_manager::claim_file): Set any_claimed_.
4757 (Plugin_manager::save_archive): New function.
4758 (Plugin_manager::save_input_group): New function.
4759 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4760 necessary.
4761 (Plugin_manager::new_undefined_symbol): New function.
4762 (Plugin_manager::rescan): New function.
4763 (Plugin_manager::rescannable_defines): New function.
4764 (Plugin_manager::add_input_file): Set any_added_.
4765 * plugin.h (class Plugin_manager): define new fields rescannable_,
4766 undefined_symbols_, any_claimed_, and any_added_. Declare
4767 Plugin_rescan as friend. Declare new functions.
4768 (Plugin_manager::Rescannable): Define type.
4769 (Plugin_manager::Rescannable_list): Define type.
4770 (Plugin_manager::Undefined_symbol_list): Define type.
4771 (Plugin_manager::Plugin_manager): Initialize new fields.
4772 * archive.cc (Archive::defines_symbol): New function.
4773 (Add_archive_symbols::run): Pass archive to plugins if any.
4774 * archive.h (class Archive): Declare defines_symbol.
4775 * readsyms.cc (Input_group::~Input_group): New function.
4776 (Finish_group::run): Pass input_group to plugins if any.
4777 * readsyms.h (class Input_group): Declare destructor.
4778 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4779 any.
4780
3bb951e5
ILT
47812011-01-10 Ian Lance Taylor <iant@google.com>
4782
4783 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4784 section as relro.
4785 (Layout::set_segment_offsets): Reset increase_relro before calling
4786 set_section_addresses a second time.
4787
0aa45fac
CC
47882011-01-04 Cary Coutant <ccoutant@google.com>
4789
4790 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4791 sections before NOBITS sections.
4792
0db46eb4
L
47932011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4794
4795 * version.cc (print_version): Update copyright to 2011.
4796
829c9745
CC
47972010-12-23 Cary Coutant <ccoutant@google.com>
4798
4799 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4800 of OS to this->add. Add OD parameter to second form of the function.
4801
7500420b
ILT
48022010-12-20 Ian Lance Taylor <iant@google.com>
4803
4804 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4805 second of two consecutive entries with same offset.
4806
f8e9a930
RW
48072010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4808
4809 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4810 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4811 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4812 to avoid unneeded links against $(LDADD).
4813 * testsuite/Makefile.in: Regenerate.
4814
2fbb4320
ILT
48152010-12-15 Ian Lance Taylor <iant@google.com>
4816
4817 PR gold/12324
4818 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4819 for R_X86_64_32 and R_X86_64_PC32.
4820 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4821 ver_matching_def_pic.o.
4822 (ver_matching_def_pic.o): New target.
4823
fedb228d
RW
48242010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4825
4826 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4827 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4828 Move definition before File_read::View member definitions.
4829 (File_read::View::~View): Initialize and hold lock before
4830 updating current_mapped_bytes.
4831
9b547ce6
RW
48322010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4833
4834 * dwarf_reader.cc: Remove outdated comment.
4835 * gold-threads.cc: Fix typo in error message.
4836 * archive.cc: Fix typos in comments.
4837 * archive.h: Likewise.
4838 * arm-reloc-property.cc: Likewise.
4839 * arm-reloc-property.h: Likewise.
4840 * arm-reloc.def: Likewise.
4841 * arm.cc: Likewise.
4842 * attributes.h: Likewise.
4843 * cref.cc: Likewise.
4844 * ehframe.cc: Likewise.
4845 * fileread.h: Likewise.
4846 * gold.h: Likewise.
4847 * i386.cc: Likewise.
4848 * icf.cc: Likewise.
4849 * incremental.h: Likewise.
4850 * int_encoding.cc: Likewise.
4851 * layout.h: Likewise.
4852 * main.cc: Likewise.
4853 * merge.h: Likewise.
4854 * object.cc: Likewise.
4855 * object.h: Likewise.
4856 * options.cc: Likewise.
4857 * readsyms.cc: Likewise.
4858 * reduced_debug_output.cc: Likewise.
4859 * reloc.cc: Likewise.
4860 * script-sections.cc: Likewise.
4861 * sparc.cc: Likewise.
4862 * symtab.h: Likewise.
4863 * target-reloc.h: Likewise.
4864 * target.cc: Likewise.
4865 * target.h: Likewise.
4866 * timer.cc: Likewise.
4867 * timer.h: Likewise.
4868 * x86_64.cc: Likewise.
4869
83e17bd5
CC
48702010-12-09 Cary Coutant <ccoutant@google.com>
4871
4872 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4873 stack.
4874 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4875 parameter; change all callers.
4876 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4877 * options.h (warn_execstack): New option.
4878
017257f8
DK
48792010-12-07 Doug Kwan <dougkwan@google.com>
4880
4881 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4882 like function call relocations.
4883
c20cbc06
ILT
48842010-12-07 Ian Lance Taylor <iant@google.com>
4885
4886 * archive.cc (Archive::get_elf_object_for_member): Permit
4887 punconfigured to be NULL.
4888 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4889 (Archive::include_member): Pass NULL to get_elf_object_for_member
4890 if we searched for the archive and this is the first included
4891 object.
4892
4dbfafcc
ILT
48932010-12-01 Ian Lance Taylor <iant@google.com>
4894
4895 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4896 track_relocs_type_ field.
4897 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4898 Set track_relocs_type_.
4899 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4900 contents when using RELA relocs.
4901 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4902 reloc_map_.
4903 * reloc.cc (Track_relocs::next_addend): New function.
4904 * reloc.h (class Track_relocs): Declare next_addend.
4905
e5e19edd
ILT
49062010-12-01 Ian Lance Taylor <iant@google.com>
4907
4908 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4909 virtual destructor.
4910
9a5ce24c
ILT
49112010-12-01 Ian Lance Taylor <iant@google.com>
4912
4913 * README: Update compilers known to work and fail.
4914
c7791212
NC
49152010-11-23 Matthias Klose <doko@ubuntu.com>
4916
4917 * configure.in: For --enable-gold, handle value `default' instead of
4918 `both*'. Always install ld as ld.bfd, install as ld if gold is
4919 not the default.
4920 * configure: Regenerate.
4921
0ad220c9
DK
49222010-11-18 Doug Kwan <dougkwan@google.com>
4923
4924 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4925 and right_alignment to be zero. Store result alignment only if it is
4926 greater than existing alignment.
4927
ab8056e0
CC
49282010-11-16 Cary Coutant <ccoutant@google.com>
4929
4930 PR gold/12220
4931 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4932 Check for ".zdebug_line".
4933
fd064a5b
CC
49342010-11-16 Doug Kwan <dougkwan@google.com>
4935 Cary Coutant <ccoutant@google.com>
4936
4937 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4938 by reference; adjust all callers.
4939 * output.cc (Output_segment::set_section_addresses): Adjust references
4940 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4941 list is empty.
4942 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4943 end at page boundary.
4944
6fc6ea19
CC
49452010-11-16 Cary Coutant <ccoutant@google.com>
4946
4947 PR gold/12220
4948 * layout.cc (Layout::choose_output_section): Transform names of
4949 compressed sections even when using a script with a SECTIONS clause.
4950 (Layout::output_section_name): Remove code to transform
4951 compressed debug section names.
4952 * output.cc (Output_section::add_input_section): Use uncompressed
4953 section size when tracking input sections.
4954
95a2c8d6
RS
49552010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4956
4957 * symtab.h (Symbol::NON_PIC_REF): Remove.
4958 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4959 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4960 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4961 (Symbol::use_plt_offset): Take a flags argument and pass it
4962 directly to needs_dynamic_reloc. Restrict check for undefined
4963 weak symbols to function calls.
4964 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4965 (Target_arm::Scan::global): Use it.
4966 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4967 (Target_arm::Relocate::relocate): Likewise.
4968 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4969 parameter with an r_type parameter. Use get_reference_flags
4970 to get the flags.
4971 (Target_arm::Relocate::relocate): Update accordingly.
4972 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4973 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4974 (Target_i386::Scan::global): Likewise.
4975 (Target_i386::Relocate::relocate): Likewise.
4976 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4977 parameter with an r_type parameter. Use get_reference_flags
4978 to get the flags.
4979 (Target_i386::Relocate::relocate): Update accordingly.
4980 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4981 (Target_powerpc::Scan::global): Use it.
4982 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4983 (Target_powerpc::Relocate::relocate): Likewise.
4984 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4985 (Target_sparc::Scan::global): Use it.
4986 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4987 (Target_sparc::Relocate::relocate): Likewise.
4988 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4989 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4990 (Target_x86_64::Scan::global): Likewise.
4991 (Target_x86_64::Relocate::relocate): Likewise.
4992
f625ae50
DK
49932010-11-08 Doug Kwan <dougkwan@google.com>
4994 Cary Coutant <ccoutant@google.com>
4995
4996 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4997 (Arm_exidx_merge_section::section_contents_): New data member.
4998 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4999 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5000 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5001 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5002 in parameters instead of calling Object::section_contents without
5003 locking.
5004 (Arm_output_section::group_section): New parameter TASK. Pass it
5005 to callees that need locking objects.
5006 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5007 to lock EXIDX input sections. Fix a formatting issue. Call
5008 Arm_exidx_merged_section::build_contents to create merged section
5009 contents.
5010 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5011 to lock object of stub table owner.
5012 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5013 TEXT_SIZE to initialize data member TEXT_SIZE_.
5014 (Arm_exidx_input_section::addralign): Fix typo in comment.
5015 (Arm_exidx_input_section::text_size): New method.
5016 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5017 that require locking objects. Lock objects before scanning for stubs
5018 and updating local symbols.
5019 (Arm_input_section<big_endian>::init): Copy contents of original
5020 input section.
2e702c99 5021 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5022 original input section instead of calling Object::section_contents
5023 without locking.
5024 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5025 size without calling Object::section_size().
5026 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5027 for size. Allocate a buffer for merged EXIDX entries.
5028 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5029 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5030 building code to Arm_exidx_merged_section::build_contetns. Write
5031 out contetns in buffer instead of building it on the fly.
5032 (Arm_relobj::make_exidx_input_section): Also pass text section size
5033 to Arm_exidx_input_section constructor.
5034 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5035 (Arm_dynobj::do_read_symbols): Fix memory leak.
5036 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5037 * target.h: (class Task): Add forward declaration.
5038 (Target::relax): Add new parameter TASK and pass it to
5039 Target::do_relax().
5040 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5041
5f9bcf58
CC
50422010-11-05 Cary Coutant <ccoutant@google.com>
5043
5044 PR gold/10708
5045 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5046 object when reading from the file.
5047 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5048 second layout pass.
5049 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5050 when reading section contents.
5051 (get_section_contents): Likewise.
5052 (icf::find_identical_sections): Likewise.
5053 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5054 object when reading from the file.
5055 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5056 the object when doing deferred section layout.
5057
e597fa08
NC
50582010-11-03 Nick Clifton <nickc@redhat.com>
5059
5060 PR gold/12001
5061 * script.h (class Symbol_assignment: name): New member. Returns
5062 the name of the symbol.
5063 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5064 Returns true if the given symbol name is on the list of
5065 assignments wating to be processed.
5066 * archive.cc (should_incldue_member): If the symbol is undefined,
5067 check to see if it is on the list of symbols pending assignment.
5068
3f9a3278
ILT
50692010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5070
5071 * script-sections.cc (Script_sections::find_memory_region): Check
5072 for a NULL output section pointer.
5073
d06fb4d1
DK
50742010-10-29 Doug Kwan <dougkwan@google.com>
5075
5076 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5077 Output_section::add_relaxed_input_section.
5078 * output.cc (Output_section::add_relaxed_input_section): Add new
5079 arguments LAYOUT and NAME. Set section order index.
5080 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5081 Copy section order index.
5082 * output.h (Output_section::add_relaxed_input_section): Add new
5083 arguments LAYOUT and NAME.
5084
90e24de5
ILT
50852010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5086
5087 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5088 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5089 * testsuite/Makefile.in: Regenerate.
5090
c9484ea5
DK
50912010-10-20 Doug Kwan <dougkwan@google.com>
5092
5093 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5094 without SHF_LINK_ORDER flags.
5095 * layout.cc (Layout::choose_output_section): Do not filter
5096 SHF_LINK_ORDER flag in a relocatable link.
5097
5bc2f5be
CC
50982010-10-17 Cary Coutant <ccoutant@google.com>
5099
5100 * output.h (Output_segment::set_section_addresses): Change function
5101 signature. Update all callers.
5102 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5103 sections.
5104 (Output_segment::set_section_addresses): Align after last TLS
5105 section. Add padding before last relro section instead of after.
5106
0c91cf04
DK
51072010-10-17 Doug Kwan <dougkwan@google.com>
5108
5109 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5110 GOT output section to be writable.
5111
8c21d9d3
CC
51122010-10-14 Cary Coutant <ccoutant@google.com>
5113
5114 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5115 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5116 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5117 mode.
5118 * incremental.cc (report_command_line): Ignore all forms of
5119 --incremental.
5120 * layout.cc (Layout::Layout): Check parameters for incremental link
5121 mode.
5122 * options.cc (General_options::parse_incremental): New function.
5123 (General_options::parse_no_incremental): New function.
5124 (General_options::parse_incremental_full): New function.
5125 (General_options::parse_incremental_update): New function.
5126 (General_options::incremental_mode_): New data member.
5127 (General_options::finalize): Check incremental_mode_.
5128 * options.h (General_options): Update help text for --incremental.
5129 Add --no-incremental, --incremental-full, --incremental-update.
5130 (General_options::Incremental_mode): New enum type.
5131 (General_options::incremental_mode): New function.
5132 (General_options::incremental_mode_): New data member.
5133 * parameters.cc (Parameters::incremental_mode_): New data member.
5134 (Parameters::set_options): Set incremental_mode_.
5135 (Parameters::set_incremental_full): New function.
5136 (Parameters::incremental): New function.
5137 (Parameters::incremental_update): New function.
5138 (set_parameters_incremental_full): New function.
5139 * parameters.h (Parameters::set_incremental_full): New function.
5140 (Parameters::incremental): New function.
5141 (Parameters::incremental_update): New function.
5142 (Parameters::incremental_mode_): New data member.
5143 (set_parameters_incremental_full): New function.
5144 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5145 incremental link mode.
5146 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5147 (Sized_relobj::do_relocate_sections): Likewise.
5148 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5149 option.
5150 * testsuite/Makefile.in: Regenerate.
5151 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5152
bb32aa18 51532010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5154
5155 * script-sections.h (class Script_sections): Make
5156 Sections_elements typedef public.
5157 * script-sections.cc (class Sort_output_sections): Add elements_
5158 field. Add constructor which sets it; change all callers.
5159 (Sort_output_sections::is_before): New function.
5160 (Sort_output_sections::operator()): Call is_before.
5161 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5162 conditional.
5163 * testsuite/script_test_10.sh: New test. Test script section
5164 order.
5165 * testsuite/script_test_10.t: Likewise.
5166 * testsuite/script_test_10.s: Likewise.
5167 * testsuite/Makefile.am: Wrap the cross linker tests and the
5168 common tests into NATIVE_OR_CROSS_LINKER.
5169 (check_SCRIPTS): Add script_test_10.sh.
5170 (check_DATA): Add script_test_10.stdout.
5171 (script_test_10.o, script_test_10): New targets.
5172 (script_test_10.stdout): New target.
5173 * configure, testsuite/Makefile.in: Regenerate.
5174
3cef7179
ILT
51752010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5176
5177 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5178 error for the deprecated relocations.
5179 (Target_arm::Scan::global): Likewise.
5180 (Target_arm::Relocate::relocate): Likewise.
5181
7411e9a8
RS
51822010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5183
5184 * fileread.cc (Input_file::find_file): Initialize *found_name
5185 and *namep when using the fallback search for case 4.
5186
6a9da32a
CC
51872010-10-11 Cary Coutant <ccoutant@google.com>
5188
5189 * options.h (class General_options): Redefine -z lazy as an alias for
5190 the negation of -z now.
5191
ac897c20
ILT
51922010-10-11 Ian Lance Taylor <iant@google.com>
5193
5194 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5195 binding.
5196
ea5cae92
NC
51972010-10-06 Nick Clifton <nickc@redhat.com>
5198
5199 * script-sections.cc(class Memory_region): Remove
5200 current_lma_offset_ field. Rename current_vma_offset_ to
5201 current_offset_. Add last_section_ field.
5202 (Memory_region::get_current_vma_address): Rename to
5203 get_current_address.
5204 (Memory_region::get_current_lma_address): Delete.
5205 (Memory_region::increment_vma_offset): Rename to
5206 increment_offset.
5207 (Memory_region::increment_lma_offset): Delete.
5208 (Memory_region::attributes_compatible): New method. Returns
5209 true if the provided section is compatible with the region.
5210 (Memory_region::get_last_section): New method. Returns the last
5211 section to use the region.
5212 (Memory_region::set_last_section): New method. Stores the last
5213 section to use the region.
5214 (Script_sections::block_in_region): New method. Returns true if
5215 a block of memory is contained within a region.
5216 (Script_sections::find_memory_region): New method. Locates a
5217 memory region to be used to set a VMA or LMA address.
5218 (Output_section_definition::set_section_addresses): Add code to
5219 check for addresses set by memory regions.
5220 (Output_segment::set_section_addresses): Remove memory region
5221 walking code.
5222 (Script_sections::create_segment): Add a warning if a header
5223 segment is created outside of any region.
5224 * script-sections.h (class Script_sections): Add prototypes for
5225 find_memory_region and block_in_region methods.
5226 * testsuite/memory_test.s: Use .long instead of .word.
5227 * testsuite/memory_test.t: Add some more output sections.
5228 * testsuite/memory_test.sh: Update expected output.
5229
a9bfd952
DK
52302010-10-02 Doug Kwan <dougkwan@google.com>
5231
5232 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5233 defintion to symtab.h
5234 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5235 declaration to defintion.
5236
bacff3ab
NC
52372010-10-01 Nick Clifton <nickc@redhat.com>
5238
5239 * expression.cc (eval): Replace dummy argument with NULL.
5240 (eval_maybe_dot): Check for a NULL result section pointer.
5241 (Symbol_expression::value): Likewise.
5242 (Dot_expression::value): Likewise.
5243 (BINARY_EXPRESSION): Likewise.
5244 (Max_expression::value): Likewise.
5245 (Min_expression::value): Likewise.
5246 (Absolute_expression::value): Likewise.
5247 (Addr_expression::value_from_output_section): Likewise.
5248 (Loaddddr_expression::value_from_output_section): Likewise.
5249 (Segment_start_expression::value): Likewise.
5250 * script-sections.cc
5251 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5252 argument with NULL.
5253 (Sections_elememt_dot_assignment::set_section_addresses):
5254 Likewise.
5255 (Output_data_expression::do_write_to_buffer): Likewise.
5256 (Output_section_definition::finalize_symbols): Likewise.
5257 (Output_section_definition::set_section_addresses): Likewise.
5258
f81bc8b5
DK
52592010-09-30 Doug Kwan <dougkwan@google.com>
5260
5261 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5262
c95e9f27
ST
52632010-09-28 Sriraman Tallam <tmsriram@google.com>
5264
5265 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5266 function.
c95e9f27
ST
5267 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5268 virtual function.
5269 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5270 virtual function.
5271 * icf.cc (get_section_contents): Inline merge sections only when
5272 target allows it.
5273
3cac54d2
RW
52742010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5275
5276 * configure: Regenerate.
5277
2904037a
ILT
52782010-09-17 Ian Lance Taylor <iant@google.com>
5279
5280 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5281 * testsuite/Makefile.am (memory_test.o): New target.
5282 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5283 memory_test.t.
5284 * testsuite/Makefile.in: Rebuild.
2904037a 5285
bca7fb63
DK
52862010-09-17 Doug Kwan <dougkwan@google.com>
5287
5288 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5289 defintion if relocation uses GOT entries of the symbol.
5290 * testsuite/icf_safe_test.sh: Fix test.
5291 * testsuite/icf_safe_so_test.sh: Fix test.
5292
4ef28648
CC
52932010-09-16 Cary Coutant <ccoutant@google.com>
5294
5295 * script_sections.cc (class Memory_region): Remove "NULL" from
5296 vector initializations.
5297
793990de
CC
52982010-09-15 Cary Coutant <ccoutant@google.com>
5299
5300 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5301 Resolve forwarding symbols.
5302
81e015e2
DK
53032010-09-15 Doug Kwan <dougkwan@google.com>
5304
5305 * gold/testsuite/script_test_3.t: Add ARM special sections.
5306 * gold/testsuite/script_test_4.t: Same.
5307 * gold/testsuite/script_test_5.t: Same.
5308 * gold/testsuite/script_test_6.t: Same.
5309 * gold/testsuite/script_test_7.t: Same.
5310 * gold/testsuite/script_test_7.t: Same.
5311 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5312
36171d64
CC
53132010-09-14 Cary Coutant <ccoutant@google.com>
5314
5315 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5316 (Target_x86_64::Relocate::relocate_tls): Replace check for
5317 saw_tls_block_reloc_ with test for executable section.
5318
d89051bd
CC
53192010-09-12 Cary Coutant <ccoutant@google.com>
5320
5321 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5322 position-independent executables to shared libraries need dynamic
5323 relocations.
5324 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5325 position-independent executables.
5326 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5327 * testsuite/Makefile.in: Regenerate.
5328
fca41f0f
NC
53292010-09-10 Nick Clifton <nickc@redhat.com>
5330
5331 PR gold/11997
5332 * testsuite/memory_test.t: Discard any sections that are not
5333 needed.
5334
6695e4b3
L
53352010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5336
5337 PR gold/11996
5338 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5339 "This::" to work around a bug in gcc 4.2.
5340
5341 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5342
0f72bf6f
RÁE
53432010-09-09 Rafael Espindola <espindola@google.com>
5344
5345 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5346 sections with different PF_X flags in the same segment.
5347 (Layout::find_first_load_seg): Search all segments to find the first
5348 one.
5349 * options.h (rosegment): New.
5350
53512010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5352
05a79166 5353 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5354
aa98ff75
DK
53552010-09-08 Doug Kwan <dougkwan@google.com>
5356
5357 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5358 (Arm_relobj::do_relocate_sections): Add new parameter for output
5359 file to match the parent.
5360 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5361 of local symbols instead of input values. Update code to track
5362 changes in gold::relocate_section.
5363 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5364 (Sized_relobj::compute_final_local_value_internal): New methods.
5365 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5366 body into private version of Sized_relobj::compute_final_local_value.
5367 Call the inline method.
5368 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5369 merged symbol value if there is one.
5370 (Symbol_value::has_output_value): New method defintiion.
5371 (Sized_relobj::Compute_final_local_value_status): New enum type.
5372 (Sized_relobj::compute_final_local_value): New methods.
5373 (Sized_relobj::compute_final_local_value_internal): New methods.
5374 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5375 and arm_cortex_a8.sh.
5376 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5377 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5378 New tests.
5379 * Makefile.in: Regenerate.
5380 * testsuite/arm_bl_out_of_range.s: Update test.
5381 * testsuite/thumb_bl_out_of_range.s: Ditto.
5382 * testsuite/thumb_blx_out_of_range.s: Ditto.
5383 * testsuite/arm_branch_out_of_range.sh: New file.
5384 * testsuite/arm_cortex_a8.sh: Ditto.
5385 * testsuite/arm_cortex_a8_b.s: Ditto.
5386 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5387 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5388 * testsuite/arm_cortex_a8_bl.s: Ditto.
5389 * testsuite/arm_cortex_a8_blx.s: Ditto.
5390 * testsuite/arm_cortex_a8_local.s: Ditto.
5391 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5392 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5393
05a79166
L
53942010-09-08 Rafael Espindola <espindola@google.com>
5395
5396 * Makefile.am (memory_test.stdout): Run readelf with -W.
5397 * Makefile.in: Regenerate.
5398 * testsuite/memory_test.sh: Make the regexps accept both 32 and
5399 64 bit output.
5400
33dbc701
RÁE
54012010-09-08 Rafael Espindola <espindola@google.com>
5402
5403 * script-sections.cc (Script_sections::add_memory_region): Convert
5404 field precision to int.
5405 * script.cc (script_set_section_region, script_set_section_region):
5406 Convert field precision to int.
5407
731ca54a
RÁE
54082010-09-08 Rafael Espindola <espindola@google.com>
5409
5410 * arm.cc (do_finalize_sections): Create the __exidx_start and
5411 __exdix_end symbols even when the section is missing.
5412
7f8cd844
NC
54132010-09-08 Nick Clifton <nickc@redhat.com>
5414
5415 * README: Remove claim that MEMORY is not supported.
5416 * expression.cc (script_exp_function_origin)
5417 (script_exp_function_length): Move from here to ...
5418 * script.cc: ... here.
5419 (script_set_section_region, script_add_memory)
5420 (script_parse_memory_attr, script_include_directive): New
5421 functions.
5422 * script-sections.cc
5423 (class Memory_region): New class.
5424 (class Output_section_definition): Add set_memory_region,
5425 set_section_vma, set_section_lma and get_section_name methods.
5426 (class Script_Sections): Add add_memory_region,
5427 find_memory_region, find_memory_region_origin,
5428 find_memory_region_length and set_memory_region methods.
5429 Have set_section_addresses method walk the list of set memory
5430 regions.
5431 Extend the print methos to display memory regions.
5432 * script-sections.h: Add prototypes for new methods.
5433 Add enum for MEMORY region attributes.
5434 * yyscript.y: Add support for parsing MEMORY regions.
5435 * script-c.h: Add prototypes for new functions.
5436 * testsuite/Makefile.am: Add test of MEMORY region functionality.
5437 * testsuite/Makefile.in: Regenerate.
5438 * testsuite/memory_test.sh: New script.
5439 * testsuite/memory_test.s: New assembler source file.
5440 * testsuite/memory_test.t: New linker script.
5441
a4649286
DK
54422010-08-27 Doug Kwan <dougkwan@google.com>
5443
5444 * gold/resolve.cc (Symbol_table::should_override): Let a weak
5445 reference override an existing dynamic weak reference.
5446 * testsuite/Makefile.am: Add new test dyn_weak_ref.
5447 * testsuite/Makefile.in: Regenerate.
5448 * testsuite/dyn_weak_ref.sh: New file.
5449 * testsuite/dyn_weak_ref_1.c: Ditto.
5450 * testsuite/dyn_weak_ref_2.c: Ditto.
5451
b56648ad
ILT
54522010-08-27 Ian Lance Taylor <iant@google.com>
5453
5454 * incremental.h (class Incremental_input_entry): Add virtual
5455 destructor.
5456
809313cb
ILT
54572010-08-27 Ian Lance Taylor <iant@google.com>
5458
5459 * testsuite/start_lib_test_3.c: Mark t3 as used.
5460
11e32464
NC
54612010-08-27 Nick Clifton <nickc@redhat.com>
5462
5463 * options.cc (version_script): Fix small typo in previous
5464 whitespace tidyup.
5465
ca09d69a
NC
54662010-08-25 Nick Clifton <nickc@redhat.com>
5467
5468 * archive.cc: Formatting fixes: Remove whitespace between
5469 typename and following asterisk. Remove whitespace between
5470 function name and opening parenthesis.
5471 * archive.h: Likewise.
5472 * arm.cc: Likewise.
5473 * attributes.cc: Likewise.
5474 * attributes.h: Likewise.
5475 * common.cc: Likewise.
5476 * copy-relocs.cc: Likewise.
5477 * dirsearch.h: Likewise.
5478 * dynobj.cc: Likewise.
5479 * ehframe.cc: Likewise.
5480 * ehframe.h: Likewise.
5481 * expression.cc: Likewise.
5482 * fileread.cc: Likewise.
5483 * fileread.h: Likewise.
5484 * gc.h: Likewise.
5485 * gold-threads.cc: Likewise.
5486 * gold.cc: Likewise.
5487 * i386.cc: Likewise.
5488 * icf.h: Likewise.
5489 * incremental-dump.cc: Likewise.
5490 * incremental.cc: Likewise.
5491 * layout.cc: Likewise.
5492 * layout.h: Likewise.
5493 * main.cc: Likewise.
5494 * merge.cc: Likewise.
5495 * merge.h: Likewise.
5496 * object.cc: Likewise.
5497 * object.h: Likewise.
5498 * options.cc: Likewise.
5499 * options.h: Likewise.
5500 * output.cc: Likewise.
5501 * output.h: Likewise.
5502 * plugin.cc: Likewise.
5503 * plugin.h: Likewise.
5504 * powerpc.cc: Likewise.
5505 * reloc.cc: Likewise.
5506 * script-c.h: Likewise.
5507 * script-sections.cc: Likewise.
5508 * script.cc: Likewise.
5509 * stringpool.cc: Likewise.
5510 * symtab.cc: Likewise.
5511 * symtab.h: Likewise.
5512 * target.cc: Likewise.
5513 * timer.cc: Likewise.
5514 * timer.h: Likewise.
5515 * version.cc: Likewise.
5516 * x86_64.cc: Likewise.
5517
b8fa8750
NC
55182010-08-24 Nick Clifton <nickc@redhat.com>
5519
5520 PR 11899
5521 * layout.cc (segment_precedes): Sort segments by their physical
5522 addresses, if they have been set.
5523
9919d93b
CC
55242010-08-23 Cary Coutant <ccoutant@google.com>
5525
5526 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
5527 symbols data.
5528 (Lib_group::include_member): Unlock object after deleting its
5529 symbols data.
5530 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
5531 the bug fixed here.
5532
97b4be1c
CC
55332010-08-19 Neil Vachharajani <nvachhar@google.com>
5534 Cary Coutant <ccoutant@google.com>
5535
5536 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
5537 constructor, and set_blocker.
5538 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
5539 readsyms_blocker_.
5540 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
5541 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
5542 * testsuite/Makefile.am (start_lib_test): New test case.
5543 * testsuite/Makefile.in: Regenerate.
5544 * testsuite/start_lib_test_main.c: New file.
5545 * testsuite/start_lib_test_1.c: New file.
5546 * testsuite/start_lib_test_2.c: New file.
5547 * testsuite/start_lib_test_3.c: New file.
5548
dd0b1884
ILT
55492010-08-19 Ian Lance Taylor <iant@google.com>
5550
5551 * Makefile.in: Rebuild with automake 1.11.1.
5552 * aclocal.m4: Likewise.
5553 * testsuite/Makefile.in: Likewise.
5554
7223e9ca
ILT
55552010-08-19 Ian Lance Taylor <iant@google.com>
5556
5557 PR 10893
5558 * i386.cc (class Output_data_plt_i386): Update declarations.
5559 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
5560 local_ifuncs_ fields.
5561 (Target_i386::do_plt_section_for_global): New function.
5562 (Target_i386::do_plt_section_for_local): New function.
5563 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
5564 parameter; change all callers. Initialize global_ifuncs_ and
5565 local_ifuncs_. If doing a static link define __rel_iplt_start and
5566 __rel_iplt_end.
5567 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5568 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5569 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5570 symbols.
5571 (Target_i386::make_plt_section): New function, broken out of
5572 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5573 (Target_i386::make_plt_entry): Call make_plt_section.
5574 (Target_i386::make_local_ifunc_plt_entry): New function.
5575 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5576 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5577 R_386_IRELATIVE to switch.
5578 (Target_i386::Scan::global): Likewise.
5579 (Target_i386::Relocate::relocate): Likewise.
5580 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5581 switch.
5582 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5583 (Target_x86_64::do_plt_section_for_global): New function.
5584 (Target_x86_64::do_plt_section_for_local): New function.
5585 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5586 parameter; change all callers. If doing a static link define
5587 __rela_iplt_start and __rela_iplt_end.
5588 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5589 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5590 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5591 to point to .plt.
5592 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5593 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5594 switch.
5595 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5596 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5597 R_X86_64_IRELATIVE to switch.
5598 (Target_x86_64::Scan::global): Likewise.
5599 (Target_x86_64::Relocate::relocate): Likewise.
5600 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5601 switch.
5602 * target.h (class Target): Add plt_section_for_global and
5603 plt_section_for_local functions. Add do_plt_section_for_global
5604 and do_plt_section_for_local virtual functions.
5605 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5606 clarifying comments.
5607 (Symbol::use_plt_offset): Handle IFUNC symbol.
5608 * object.cc (Sized_relobj::Sized_relobj): Initialize
5609 local_plt_offsets_.
5610 (Sized_relobj::local_has_plt_offset): New function.
5611 (Sized_relobj::local_plt_offset): New function.
5612 (Sized_relobj::set_local_plt_offset): New function.
5613 (Sized_relobj::do_count): Handle IFUNC symbol.
5614 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5615 a bit away from input_shndx_ field. Add set_is_func_symbol and
5616 is_ifunc_symbol functions.
5617 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5618 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5619 local_plt_offsets_ field.
5620 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5621 * output.h (class Output_section_data): Add non-const
5622 output_section function.
5623 (class Output_data_got): Update declarations.
5624 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5625 Add use_plt_offset parameter to global and local constructors.
5626 Change all callers. Change local_sym_index_ field to 31 bits.
5627 Change GSYM_CODE and CONSTANT_CODE accordingly.
5628 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5629 doing a static link don't set sh_link field.
5630 (Output_data_got::Got_entry::write): Use PLT offset if
5631 appropriate.
5632 (Output_data_got::add_global_plt): New function.
5633 (Output_data_got::add_local_plt): New function.
5634 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5635 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5636 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5637 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5638 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5639 IFUNC conditional.
5640 * testsuite/ifunc-sel.h: New file.
5641 * testsuite/ifuncmain1.c: New file.
5642 * testsuite/ifuncmain1vis.c: New file.
5643 * testsuite/ifuncmod1.c: New file.
5644 * testsuite/ifuncdep2.c: New file.
5645 * testsuite/ifuncmain2.c: New file.
5646 * testsuite/ifuncmain3.c: New file.
5647 * testsuite/ifuncmod3.c: New file.
5648 * testsuite/ifuncmain4.c: New file.
5649 * testsuite/ifuncmain5.c: New file.
5650 * testsuite/ifuncmod5.c: New file.
5651 * testsuite/ifuncmain6pie.c: New file.
5652 * testsuite/ifuncmod6.c: New file.
5653 * testsuite/ifuncmain7.c: New file.
5654 * configure, testsuite/Makefile.in: Rebuild.
5655
56f75c03
ILT
56562010-08-18 Ian Lance Taylor <iant@google.com>
5657
5658 * incremental.cc
5659 (Output_section_incremental_inputs::write_input_files): Add cast
5660 to avoid signed/unsigned comparison warning.
5661 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5662
55455f89
CC
56632010-08-12 Cary Coutant <ccoutant@google.com>
5664
5665 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5666
e2054bcb
ILT
56672010-08-13 Ian Lance Taylor <iant@google.com>
5668
5669 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5670
74f67560
DK
56712010-08-12 Cary Coutant <ccoutant@google.com>
5672 Doug Kwan <dougkwan@google.com>
5673
5674 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5675 defintion overrides non-weak undef, remember that the original undef
5676 is not weak.
5677 * symtab.cc (Symbol_table::sized_write_global): For undef without
5678 an original weak binding, set binding to global in output.
5679 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5680 * testsuite/Makefile.in: Regenerate.
5681 * testsuite/strong_ref_weak_def.sh: New file.
5682 * testsuite/strong_ref_weak_def_1.c: Ditto.
5683 * testsuite/strong_ref_weak_def_2.c: Ditto.
5684
d1238d12
CC
56852010-08-12 Cary Coutant <ccoutant@google.com>
5686
5687 * testsuite/incremental_test.sh: Rewrite.
5688 * testsuite/incremental_test_1.c: Rewrite.
5689 * testsuite/incremental_test_2.c: Rewrite.
5690
0e70b911
CC
56912010-08-12 Cary Coutant <ccoutant@google.com>
5692
5693 * arm.cc (Target_arm::got_size): Add const.
5694 (Target_arm::got_entry_count): New function.
5695 (Target_arm::plt_entry_count): New function.
5696 (Target_arm::first_plt_entry_offset): New function.
5697 (Target_arm::plt_entry_size): New function.
5698 (Output_data_plt_arm::entry_count): New function.
5699 (Output_data_plt_arm::first_plt_entry_offset): New function.
5700 (Output_data_plt_arm::get_plt_entry_size): New function.
5701 * i386.cc (Target_i386::got_size): Add const.
5702 (Target_i386::got_entry_count): New function.
5703 (Target_i386::plt_entry_count): New function.
5704 (Target_i386::first_plt_entry_offset): New function.
5705 (Target_i386::plt_entry_size): New function.
5706 (Output_data_plt_i386::entry_count): New function.
5707 (Output_data_plt_i386::first_plt_entry_offset): New function.
5708 (Output_data_plt_i386::get_plt_entry_size): New function.
5709 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5710 find_incremental_inputs_sections. Dump incremental_got_plt section.
5711 * incremental.cc: Include target.h.
5712 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5713 parameter. Adjust all callers. Find incremental_got_plt section.
5714 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5715 section.
5716 (Output_section_incremental_inputs::set_final_data_size): Calculate
5717 size of incremental_got_plt section.
5718 (Output_section_incremental_inputs::do_write): Write the
5719 incremental_got_plt section.
5720 (Got_plt_view_info): New struct.
5721 (Local_got_offset_visitor): New class.
5722 (Global_got_offset_visitor): New class.
5723 (Global_symbol_visitor_got_plt): New class.
5724 (Output_section_incremental_inputs::write_got_plt): New function.
5725 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5726 Add parameter. Adjust all callers.
5727 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5728 (Incremental_inputs::got_plt_section): New function.
5729 (Incremental_inputs::got_plt_section_): New data member.
5730 (Incremental_got_plt_reader): New class.
5731 * layout.cc (Layout::create_incremental_info_sections): Add the
5732 incremental_got_plt section.
5733 * object.h (Got_offset_list::get_list): New function.
5734 (Got offset_list::for_all_got_offsets): New function.
5735 (Sized_relobj::local_got_offset_list): New function.
5736 * powerpc.cc (Target_powerpc::got_size): Add const.
5737 (Target_powerpc::got_entry_count): New function.
5738 (Target_powerpc::plt_entry_count): New function.
5739 (Target_powerpc::first_plt_entry_offset): New function.
5740 (Target_powerpc::plt_entry_size): New function.
5741 (Output_data_plt_powerpc::entry_count): New function.
5742 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5743 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5744 * sparc.cc (Target_sparc::got_size): Add const.
5745 (Target_sparc::got_entry_count): New function.
5746 (Target_sparc::plt_entry_count): New function.
5747 (Target_sparc::first_plt_entry_offset): New function.
5748 (Target_sparc::plt_entry_size): New function.
5749 (Output_data_plt_sparc::entry_count): New function.
5750 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5751 (Output_data_plt_sparc::get_plt_entry_size): New function.
5752 * symtab.h (Symbol::got_offset_list): New function.
5753 (Symbol_table::for_all_symbols): New function.
5754 * target.h (Sized_target::got_entry_count): New function.
5755 (Sized_target::plt_entry_count): New function.
5756 (Sized_target::plt_entry_size): New function.
5757 * x86_64.cc (Target_x86_64::got_size): Add const.
5758 (Target_x86_64::got_entry_count): New function.
5759 (Target_x86_64::plt_entry_count): New function.
5760 (Target_x86_64::first_plt_entry_offset): New function.
5761 (Target_x86_64::plt_entry_size): New function.
5762 (Output_data_plt_x86_64::entry_count): New function.
5763 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5764 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5765
09ec0418
CC
57662010-08-12 Cary Coutant <ccoutant@google.com>
5767
5768 * archive.cc: Include incremental.h.
5769 (Archive::Archive): Initialize incremental_info_.
5770 (Archive::include_member): Record archive members in incremental info.
5771 (Add_archive_symbols::run): Record begin and end of an archive in
5772 incremental info.
5773 (Lib_group::include_member): Record objects in incremental info.
5774 * archive.h (Incremental_archive_entry): Forward declaration.
5775 (Archive::set_incremental_info): New member function.
5776 (Archive::incremental_info): New member function.
5777 (Archive::Unused_symbol_iterator): New class.
5778 (Archive::unused_symbols_begin): New member function.
5779 (Archive::unused_symbols_end): New member function.
5780 (Archive::incremental_info_): New data member.
5781 * incremental-dump.cc (find_input_containing_global): New function.
5782 (dump_incremental_inputs): Dump new incremental info sections.
5783 * incremental.cc: Include symtab.h.
5784 (Output_section_incremental_inputs): New class.
5785 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5786 new incremental info sections.
5787 (Sized_incremental_binary::do_check_inputs): Likewise.
5788 (Incremental_inputs::report_archive): Remove.
5789 (Incremental_inputs::report_archive_begin): New function.
5790 (Incremental_inputs::report_archive_end): New function.
5791 (Incremental_inputs::report_object): New function.
5792 (Incremental_inputs::finalize_inputs): Remove.
5793 (Incremental_inputs::report_input_section): New function.
5794 (Incremental_inputs::report_script): Rewrite.
5795 (Incremental_inputs::finalize): Do nothing but finalize string table.
5796 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5797 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5798 (Incremental_inputs::create_data_sections): New function.
5799 (Incremental_inputs::relocs_entsize): New function.
5800 (Output_section_incremental_inputs::set_final_data_size): New function.
5801 (Output_section_incremental_inputs::do_write): New function.
5802 (Output_section_incremental_inputs::write_header): New function.
5803 (Output_section_incremental_inputs::write_input_files): New function.
5804 (Output_section_incremental_inputs::write_info_blocks): New function.
5805 (Output_section_incremental_inputs::write_symtab): New function.
5806 * incremental.h (Incremental_script_entry): Forward declaration.
5807 (Incremental_object_entry): Forward declaration.
5808 (Incremental_archive_entry): Forward declaration.
5809 (Incremental_inputs): Forward declaration.
5810 (Incremental_inputs_header_data): Remove.
5811 (Incremental_inputs_header): Remove.
5812 (Incremental_inputs_header_write): Remove.
5813 (Incremental_inputs_entry_data): Remove.
5814 (Incremental_inputs_entry): Remove.
5815 (Incremental_inputs_entry_write): Remove.
5816 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5817 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5818 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5819 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5820 Likewise.
5821 (Incremental_input_entry): New class.
5822 (Incremental_script_entry): New class.
5823 (Incremental_object_entry): New class.
5824 (Incremental_archive_entry): New class.
5825 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5826 (Incremental_inputs::report_inputs): Remove.
5827 (Incremental_inputs::report_archive): Remove.
5828 (Incremental_inputs::report_archive_begin): New function.
5829 (Incremental_inputs::report_archive_end): New function.
5830 (Incremental_inputs::report_object): Change prototype.
5831 (Incremental_inputs::report_input_section): New function.
5832 (Incremental_inputs::report_script): Change prototype.
5833 (Incremental_inputs::get_reloc_count): New function.
5834 (Incremental_inputs::set_reloc_count): New function.
5835 (Incremental_inputs::create_data_sections): New function.
5836 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5837 (Incremental_inputs::inputs_section): New function.
5838 (Incremental_inputs::symtab_section): New function.
5839 (Incremental_inputs::relocs_section): New function.
5840 (Incremental_inputs::get_stringpool): Add const.
5841 (Incremental_inputs::command_line): Add const.
5842 (Incremental_inputs::inputs): Remove.
5843 (Incremental_inputs::command_line_key): New function.
5844 (Incremental_inputs::input_file_count): New function.
5845 (Incremental_inputs::input_files): New function.
5846 (Incremental_inputs::relocs_entsize): New function.
5847 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5848 (Incremental_inputs::finalize_inputs): Remove.
5849 (Incremental_inputs::Input_info): Remove.
5850 (Incremental_inputs::lock_): Remove.
5851 (Incremental_inputs::inputs_): Change type.
5852 (Incremental_inputs::inputs_map_): Remove.
5853 (Incremental_inputs::current_object_entry_): New data member.
5854 (Incremental_inputs::inputs_section_): New data member.
5855 (Incremental_inputs::symtab_section_): New data member.
5856 (Incremental_inputs::relocs_section_): New data member.
5857 (Incremental_inputs::reloc_count_): New data member.
5858 (Incremental_inputs_reader): New class.
5859 (Incremental_symtab_reader): New class.
5860 (Incremental_relocs_reader): New class.
5861 * layout.cc (Layout::finalize): Move finalization of incremental info
5862 and creation of incremental info sections to follow finalization of
5863 symbol table. Set offsets for postprocessing sections.
5864 (Layout::create_incremental_info_sections): Call
5865 Incremental_inputs::create_data_sections. Add incremental symtab
5866 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5867 sections to layout after input sections.
5868 * layout.h (struct Timespec): Forward declaration.
5869 (Layout::incremental_inputs): Add const.
5870 (Layout::create_incremental_info_sections): Add parameter.
5871 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5872 * object.cc: Include incremental.h.
5873 (Relobj::finalize_incremental_relocs): New function.
5874 (Sized_relobj::do_layout): Record input sections in incremental info.
5875 * object.h (Object::output_section): New function.
5876 (Object::output_section_offset): Moved from Relobj.
5877 (Object::get_incremental_reloc_base): New function.
5878 (Object::get_incremental_reloc_count): New function.
5879 (Object::do_output_section): New function.
5880 (Object::do_output_section_offset): Moved from Relobj.
5881 (Object::do_get_incremental_reloc_base): New function.
5882 (Object::do_get_incremental_reloc_count): New function.
5883 (Object::Object): Initialize new data members.
5884 (Relobj::output_section): Renamed do_output_section and moved to
5885 protected.
5886 (Relobj::output_section_offset): Moved to Object.
5887 (Relobj::do_get_incremental_reloc_base): New function.
5888 (Relobj::do_get_incremental_reloc_count): New function.
5889 (Relobj::allocate_incremental_reloc_counts): New function.
5890 (Relobj::count_incremental_reloc): New function.
5891 (Relobj::finalize_incremental_relocs): New function.
5892 (Relobj::next_incremental_reloc_index): New function.
5893 (Relobj::reloc_counts_): New data member.
5894 (Relobj::reloc_bases_): New data member.
5895 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5896 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5897 (Sized_relobj::incremental_relocs_scan): New function.
5898 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5899 (Sized_relobj::incremental_relocs_write): New function.
5900 (Sized_relobj::incremental_relocs_write_reltype): New function.
5901 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5902 incremental link.
5903 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5904 archives and object files elsewhere.
5905 (Add_symbols::run): Report object files here.
5906 (Finish_group::run): Report end of archive at end of group.
5907 * reloc.cc: Include layout.h, incremental.h.
5908 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5909 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5910 (Sized_relobj::incremental_relocs_scan): New function.
5911 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5912 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5913 (Sized_relobj::incremental_relocs_write): New function.
5914 (Sized_relobj::incremental_relocs_write_reltype): New function.
5915 * script.cc (read_input_script): Rewrite test for incremental link.
5916 Change call to Incremental_inputs::report_script.
5917 * symtab.h (Symbol_table::first_global_index): New function.
5918 (Symbol_table::output_count): New function.
5919
ce0d1972
DK
59202010-08-12 Doug Kwan <dougkwan@google.com>
5921
5922 * arm.cc (Target_arm::merge_object_attributes): Check command line
5923 options --no-wchar-size-warning and --no-enum-size-warning.
5924 * options.h (General_options): Add ld-compatible options
5925 --no-enum-size-warning and --no-wchar-size-warning.
5926
6e5710ce
ILT
59272010-08-04 Ian Lance Taylor <iant@google.com>
5928
5929 * x86_64.cc (Target_x86_64::Scan::local): Use
5930 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5931 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5932 (Target_x86_64::Scan::global): Likewise.
5933 (Target_x86_64::Relocate::relocate): Likewise.
5934 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5935 Likewise.
5936
fef830db
CC
59372010-08-03 Cary Coutant <ccoutant@google.com>
5938
5939 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5940 to reserve space in merged_strings vector. Keep total input size
5941 for stats.
5942 (Output_merge_string::do_print_merge_stats): Print total input size.
5943 * merge.h (Output_merge_string): Add input_size_ field.
5944 * stringpool.cc (Stringpool_template::string_length): Move
5945 implementations out of Stringpool_template class and place in
5946 stringpool.h.
5947 * stringpool.h (string_length): Move out of Stringpool_template.
5948
1e3811b0
ILT
59492010-08-03 Ian Lance Taylor <iant@google.com>
5950
5951 PR 11712
5952 * layout.cc (relaxation_loop_body): If address of load segment is
5953 set, adjust address to include headers if possible.
5954
7af0c620
ILT
59552010-08-03 Ian Lance Taylor <iant@google.com>
5956
5957 * version.cc (version_string): Bump to 1.10.
5958
22f0da72
ILT
59592010-08-03 Ian Lance Taylor <iant@google.com>
5960
5961 PR 11805
5962 * layout.h (enum Output_section_order): Define.
5963 (class Layout): Update declarations.
5964 * layout.cc (Layout::get_output_section): Add order parameter.
5965 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5966 is_first_non_relro parameters. Change all callers.
5967 (Layout::choose_output_section): Likewise.
5968 (Layout::add_output_section_data): Likewise.
5969 (Layout::make_output_section): Likewise. Set order.
5970 (Layout::default_section_order): New function.
5971 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5972 * output.cc (Output_section::Output_section): Initialize order_.
5973 Don't initialize deleted fields.
5974 (Output_segment::Output_segment): Don't initialize deleted
5975 fields.
5976 (Output_segment::add_output_section_to_load): New function
5977 replacing add_output_section. Change all callers to call this or
5978 add_output_section_to_nonload.
5979 (Output_segment::add_output_section_to_nonload): New function.
5980 (Output_segment::remove_output_section): Rewrite.
5981 (Output_segment::add_initial_output_data): Likewise.
5982 (Output_segment::has_any_data_sections): Likewise.
5983 (Output_segment::is_first_section_relro): Likewise.
5984 (Output_segment::maximum_alignment): Likewise.
5985 (Output_segment::has_dynamic_reloc): New function replacing
5986 dynamic_reloc_count. Change all callers.
5987 (Output_segment::has_dynamic_reloc_list): New function replacing
5988 dynamic_reloc_count_list. Change all callers.
5989 (Output_segment::set_section_addresses): Rewrite.
5990 (Output_segment::set_offset): Rewrite.
5991 (Output_segment::find_first_and_last_list): Remove.
5992 (Output_segment::set_tls_offsets): Rewrite.
5993 (Output_segment::first_section_load_address): Likewise.
5994 (Output_segment::output_section_count): Likewise.
5995 (Output_segment::section_with_lowest_load_address): Likewise.
5996 (Output_segment::write_section_headers): Likewise.
5997 (Output_segment::print_sections_to_map): Likewise.
5998 * output.h (class Output_data): Remove dynamic_reloc_count_
5999 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6000 (Output_data::add_dynamic_reloc): Rewrite.
6001 (Output_data::has_dynamic_reloc): New function.
6002 (Output_data::dynamic_reloc_count): Remove.
6003 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6004 is_last_relro_, is_first_non_relro_, is_interp_,
6005 is_dynamic_linker_section_ fields. Add order and set_order
6006 functions. Remove is_relro_local, set_is_relro_local,
6007 is_last_relro, set_is_last_relro, is_first_non_relro,
6008 set_is_first_non_relro functions, is_interp, set_is_interp,
6009 is_dynamic_linker_section, and set_is_dynamic_linker_section
6010 functions.
6011 (class Output_segment): Change Output_data_list from std::list to
6012 std:;vector. Add output_lists_ field. Remove output_data_ and
6013 output_bss_ fields. Update declarations.
6014
3ff2ccb0
ILT
60152010-08-02 Ian Lance Taylor <iant@google.com>
6016
6017 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6018 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6019 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6020
88a4108b
ILT
60212010-08-02 Ian Lance Taylor <iant@google.com>
6022
6023 PR 11855
6024 * script.cc (Script_options::Script_options): Initialize
6025 symbol_definitions_ and symbol_references_.
6026 (Script_options::add_symbol_assignment): Update
6027 symbol_definitions_ and symbol_references_.
6028 (Script_options::add_symbol_reference): New function.
6029 (script_symbol): New function.
6030 * script.h (class Script_options): Add symbol_definitions_ and
6031 symbol_references_ fields.
6032 (Script_options::referenced_const_iterator): New type.
6033 (Script_options::referenced_begin): New function.
6034 (Script_options::referenced_end): New function.
6035 (Script_options::is_referenced): New function.
6036 (Script_options::any_unreferenced): New function.
6037 * script-c.h (script_symbol): Declare.
6038 * yyscript.y (exp): Call script_symbol.
6039 * symtab.cc: Include "script.h".
6040 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6041 Change all callers. Check symbols referenced by scripts.
6042 (Symbol_table::add_undefined_symbols_from_command_line): Add
6043 layout parameter. Change all callers.
6044 (Symbol_table::do_add_undefined_symbols_from_command_line):
6045 Likewise. Break out loop body. Check symbols referenced by
6046 scripts.
6047 (Symbol_table::add_undefined_symbol_from_command_line): New
6048 function broken out of
6049 do_add_undefined_symbols_from_command_line.
6050 * symtab.h (class Symbol_table): Update declarations.
6051 * archive.cc: Include "layout.h".
6052 (Archive::should_include_member): Add layout parameter. Change
6053 all callers. Check for symbol mentioned in expression.
6054 * archive.h (class Archive): Update declaration.
6055 * object.cc (Sized_relobj::do_should_include_member): Add layout
6056 parameter.
6057 * object.h (Object::should_include_member): Add layout parameter.
6058 Change all callers.
6059 (Object::do_should_include_member): Add layout parameter.
6060 (class Sized_relobj): Update declaration.
6061 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6062 parameter.
6063 * dynobj.h (class Sized_dynobj): Update declaration.
6064 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6065 layout parameter.
6066 * plugin.h (class Sized_pluginobj): Update declaration.
6067
5f1ab67a
ILT
60682010-08-02 Ian Lance Taylor <iant@google.com>
6069
6070 PR 11866
6071 * output.cc (Output_segment::set_offset): Search for the first and
6072 last sections rather than assuming that the list is in order.
6073 (Output_segment::find_first_and_last_list): New function.
6074 * output.h (class Output_segment): Update declarations.
6075 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6076 (relro_strip_test_SOURCES): New variable.
6077 (relro_strip_test_DEPENDENCIES): New variable.
6078 (relro_strip_test_LDFLAGS): New variable.
6079 (relro_strip_test_LDADD): New variable.
6080 (relro_strip_test.so): New target.
6081
a8df5856
ILT
60822010-08-02 Ian Lance Taylor <iant@google.com>
6083
6084 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6085 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6086 (Target_i386::got_tlsdesc_section): New function.
6087 (Target_i386::got_section): Create space for GOT entries for
6088 TLSDESC relocations.
6089 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6090 R_386_TLS_GOTDESC.
6091 (Target_i386::Scan::global): Likewise.
6092 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6093 using TLSDESC GOT.
6094 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6095 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6096 (Target_x86_64::got_tlsdesc_section): New function.
6097 (Target_x86_64::got_section): Create space for GOT entries for
6098 TLSDESC relocations.
6099 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6100 R_386_TLS_GOTDESC.
6101 (Target_x86_64::Scan::global): Likewise.
6102 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6103 using TLSDESC GOT.
6104
0c10a0a6
ILT
61052010-08-02 Ian Lance Taylor <iant@google.com>
6106
6107 * testsuite/final_layout.sh: Use dc to convert from hex to
6108 decimal.
6109
41cbeecc
ST
61102010-07-29 Sriraman Tallam <tmsriram@google.com>
6111
6112 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6113 paramter to the call to gold::gc_process_relocs.
6114 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6115 paramter to the call to gold::gc_process_relocs.
6116 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6117 parameter to the call to gold::gc_process_relocs.
6118 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6119 template parameter to the call to gold::gc_process_relocs.
6120 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6121 paramter to the call to gold::gc_process_relocs.
6122 * gc.h (get_embedded_addend_size): New function.
6123 (gc_process_relocs): Save the size of the reloc for use by ICF.
6124 * icf.cc (get_section_contents): Get the addend from the text section
6125 for SHT_REL relocation sections.
6126 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6127 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6128 * int_encoding.h (read_from_pointer): New overloaded function.
6129 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6130 * testsuite/icf_sht_rel_addend_test.sh: New file.
6131 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6132 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6133
6ea55b82
RW
61342010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6135
6136 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6137 * Makefile.in: Regenerate.
6138 * testsuite/Makefile.in: Regenerate.
6139
9691462b
ILT
61402010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6141
6142 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6143 * gold/testsuite/debug_msg.cc: Likewise.
6144 * gold/testsuite/odr_violation1.cc
6145 * gold/testsuite/odr_violation2.cc
6146
76897331
CC
61472010-07-21 Cary Coutant <ccoutant@google.com>
6148
6149 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6150 string, and length fields.
6151 (Output_merge_string::Merged_strings_list): New type.
6152 (Output_merge_string::Merged_strings_lists): New typedef.
6153 (Output_merge_string): Replace merged_strings_ with
6154 merged_strings_lists_.
6155 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6156 Merged_strings_list per input object and section. Don't store pointer
6157 to the string. Don't store length with each merged string entry.
6158 (Output_merge_string::finalize_merged_data): Loop over list of merged
6159 strings lists. Recompute length of each merged string.
6160
78384e8f
CC
61612010-07-15 Cary Coutant <ccoutant@google.com>
6162
6163 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6164 here.
6165
783659f9
ILT
61662010-07-14 Ian Lance Taylor <iant@google.com>
6167
6168 * descriptors.cc (Descriptors::open): Report correct name in error
6169 message.
6170
131687b4
DK
61712010-07-13 Doug Kwan <dougkwan@google.com>
6172
6173 * arm.cc (Arm_input_section::Arm_input_section): For a
6174 SHT_ARM_EXIDX section, always keeps the input sections.
6175 (Arm_input_section::set_exidx_section_link): New method.
6176 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6177 has_errors_ to false.
6178 (Arm_exidx_input_section::has_errors,
6179 Arm_exidx_input_section::set_has_errors): New methods.
6180 (Arm_exidx_input_section::has_errors_): New data member.
6181 (Arm_relobj::get_exidx_shndx_list): New method.
6182 (Arm_output_section::append_text_sections_to_list): Do not skip
6183 section without SHF_EXECINSTR.
6184 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6185 errors.
2e702c99 6186 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6187 section header. Make error messages more verbose. Check for
6188 a non-executable section linked to an EXIDX section.
6189 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6190 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6191 check that there is no deferred EXIDX section if we exit early.
6192 Instead of not making an EXIDX section in case of an error, make one
6193 and set the has_errors flag of it.
6194 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6195 in a relocatable link.
6196 (Target_arm::do_relax): Look for the EXIDX output section instead of
6197 assuming that it is called .ARM.exidx.
2e702c99 6198 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6199 section list. Do not check for SHF_EXECINSTR section flags but
6200 skip any input section with errors.
6201 * output.cc (Output_section::Output_section): Initialize
6202 always_keeps_input_sections_ to false.
6203 (Output_section::add_input_section): Check for
6204 always_keeps_input_sections_.
6205 * output.h (Output_section::always_keeps_input_sections,
6206 Output_section::set_always_keeps_input_sections): New methods.
6207 (Output_section::always_keeps_input_sections): New data member.
6208
69517287
RÁE
62092010-07-13 Rafael Espindola <espindola@google.com>
6210
6211 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6212 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6213
82742395
ILT
62142010-07-13 Philip Herron <herron.philip@googlemail.com>
6215 Ian Lance Taylor <iant@google.com>
6216
6217 * output.h (Output_section_lookup_maps::add_merge_section):
6218 Correct check of whether value was inserted.
6219 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6220 (Output_section_lookup_maps::add_relaxed_input_section):
6221 Likewise.
6222 * arm.cc (Target_arm::got_section): Remove used local os.
6223 * i386.cc (Target_i386::got_section): Likewise.
6224 * x86_64.cc (Target_x86_64::got_section): Likewise.
6225 * sparc.cc (Target_sparc::got_section): Likewise.
6226 (Target_sparc::relocate): Remove unused local have_got_offset.
6227 * powerpc.cc (Target_powerpc::relocate): Likewise.
6228
f2d707b5
ILT
62292010-07-13 Ian Lance Taylor <iant@google.com>
6230
241531d6
ILT
6231 * compressed_output.cc (zlib_decompress): Fix signature in
6232 !HAVE_ZLIB_H case.
6233
f2d707b5
ILT
6234 * archive.cc (Archive::include_member): Unlock an external member
6235 of a thin archive. Don't bother to delete an object we know is
6236 NULL.
6237
a2e47362
CC
62382010-07-12 Cary Coutant <ccoutant@google.com>
6239
6240 * compressed_output.cc (zlib_decompress): New function.
6241 (get_uncompressed_size): New function.
6242 (decompress_input_section): New function.
6243 * compressed_output.h (get_uncompressed_size): New function.
6244 (decompress_input_section): New function.
6245 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6246 Handle compressed debug sections.
6247 * layout.cc (is_compressed_debug_section): New function.
6248 (Layout::output_section_name): Map compressed section names to
6249 canonical names.
6250 * layout.h (is_compressed_debug_section): New function.
6251 (is_debug_info_section): Recognize compressed debug sections.
6252 * merge.cc: Include compressed_output.h.
6253 (Output_merge_data::do_add_input_section): Handle compressed
6254 debug sections.
6255 (Output_merge_string::do_add_input_section): Handle compressed
6256 debug sections.
6257 * object.cc: Include compressed_output.h.
6258 (Sized_relobj::Sized_relobj): Initialize new data members.
6259 (build_compressed_section_map): New function.
6260 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6261 * object.h (Object::section_is_compressed): New method.
6262 (Object::do_section_is_compressed): New method.
6263 (Sized_relobj::Compressed_section_map): New type.
6264 (Sized_relobj::do_section_is_compressed): New method.
6265 (Sized_relobj::compressed_sections_): New data member.
6266 * output.cc (Output_section::add_input_section): Handle compressed
6267 debug sections.
6268 * reloc.cc: Include compressed_output.h.
6269 (Sized_relobj::write_sections): Handle compressed debug sections.
6270
ce279a62
CC
62712010-07-08 Cary Coutant <ccoutant@google.com>
6272
6273 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6274 weak when resolving to a dynamic def.
6275 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6276 for weak undef/dynamic def cases. Adjust callers.
6277 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6278 undef_binding_weak_.
6279 (Symbol_table::sized_write_globals): Adjust symbol binding.
6280 (Symbol_table::sized_write_symbol): Add binding parameter.
6281 * symtab.h (Symbol::set_undef_binding): New method.
6282 (Symbol::is_undef_binding_weak): New method.
6283 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6284 (Symbol_table::should_override): Add new parameter.
6285 (Symbol_table::sized_write_symbol): Add new parameter.
6286
6287 * testsuite/weak_undef_file1.cc: Add new test case.
6288 * testsuite/weak_undef_file2.cc: Fix header comment.
6289 * testsuite/weak_undef_test.cc: Add new test case.
6290
b2286c10
DK
62912010-06-29 Doug Kwan <dougkwan@google.com>
6292
6293 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6294 Initialize USE_SYMBOL_.
6295 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6296 definition.
6297 (Arm_reloc_property::uses_symbol_): New data member declaration.
6298 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6299 uses symbol value and symbol is undefined but not weakly undefined.
6300
4802450a
RÁE
63012010-06-28 Rafael Espindola <espindola@google.com>
6302
6303 * plugin.cc (Plugin::load): Use dlerror.
6304
e5ca47ba
ILT
63052010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6306
6307 * symtab.cc (detect_odr_violations): When reporting an ODR
6308 violation, report an object where the symbol is defined.
6309
8a75a161
DK
63102010-06-25 Doug Kwan <dougkwan@google.com>
6311
6312 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6313 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6314 definition.
6315 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6316 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6317 target hook to detect function points.
6318 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6319 * icf.h (Icf::check_section_for_function_pointers): Change type of
6320 parameter SECTION_NAME to const reference to std::string. Use
6321 target hook to determine if section may have unsafe pointers.
6322 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6323 method definition.
6324
42218b9f
RÁE
63252010-06-21 Rafael Espindola <espindola@google.com>
6326
6327 * fileread.cc (Input_file::find_fie): New
6328 (Input_file::open): Use Input_file::find_fie.
6329 * fileread.h (Input_file::find_fie): New
6330 * plugin.cc (set_extra_library_path): New.
6331 (Plugin::load): Add set_extra_library_path to the transfer vector.
6332 (Plugin_manager::set_extra_library_path): New.
6333 (Plugin_manager::add_input_file): Use the extra search path if set.
6334 (set_extra_library_path(): New.
6335 * plugin.h (Plugin_manager): Add set_extra_library_path and
6336 extra_search_path_.
6337
a0506cca
CC
63382010-06-19 Cary Coutant <ccoutant@google.com>
6339
6340 * layout.cc (gdb_sections): Add .debug_types.
6341 (lines_only_debug_sections): Likewise.
6342
6508b958
RÁE
63432010-06-18 Rafael Espindola <espindola@google.com>
6344
6345 * plugin.cc (add_input_file,add_input_library)
6346 (Plugin_manager::add_input_file): Make filename arguments const.
6347 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6348 const.
6349
3e235302
DK
63502010-06-16 Doug Kwan <dougkwan@google.com>
6351
6352 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6353 .ARM.attributes section if we have not merged any input
6354 attributes sections.
6355
106e8a6c
DK
63562010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6357
6358 * arm.cc: Allow combining objects with no EABI version
6359 information.
6360
91ff43fe
RÁE
63612010-06-15 Rafael Espindola <espindola@google.com>
6362
6363 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6364
68ed838c
ILT
63652010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6366
6367 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6368 (struct iovec): Correct !HAVE_READV definition.
6369
f3a2388f
CC
63702010-06-10 Cary Coutant <ccoutant@google.com>
6371
6372 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6373 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6374 reloc sections.
6375 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6376
6377 PR 11683
6378 * symtab.h (Symbol::is_placeholder): New member function.
6379 * target-reloc.h (relocate_section): Check for placeholder symbols.
6380
6381 * testsuite/Makefile.am (plugin_test_8): New test.
6382 (plugin_test_9): New test.
6383 * testsuite/Makefile.in: Regenerate.
6384
e1df38aa
NC
63852010-06-09 Nick Clifton <nickc@redhat.com>
6386
6387 * yyscript.y (input_list_element): Allow strings prefixed with
6388 the '-' character. Treat these as libraries.
6389 * script.cc (script_add_library): New function. Adds a library
6390 specified by "-l<name>" found in an input script.
6391 * script-c.h: Add prototype for script_add_library.
6392
25bbe950
DK
63932010-06-07 Doug Kwan <dougkwan@google.com>
6394
6395 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
6396 Restrict stub-group size to be within long conditional branch
6397 range when working around cortex-A8 erratum.
6398
0f32ea4c
ILT
63992010-06-07 Damien Diederen <dd@crosstwine.com>
6400
6401 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
6402 #ifdef typo.
6403
8fe2a369
ST
64042010-06-03 Sriraman Tallam <tmsriram@google.com>
6405
6406 PR gold/11658
6407 * output.cc
6408 (Output_section::Input_section_sort_entry::compare_section_ordering):
6409 Change to return non-zero correctly.
6410 (Output_section::Input_section_sort_section_order_index_compare
6411 ::operator()): Change to fix ambiguity in comparisons.
6412
6e9ba2ca
ST
64132010-06-01 Sriraman Tallam <tmsriram@google.com>
6414
6415 * gold.h (is_wildcard_string): New function.
6416 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
6417 (Layout::layout_eh_frame): Ditto.
6418 (Layout::find_section_order_index): New method.
6419 (Layout::read_layout_from_file): New method.
6420 * layout.h (Layout::find_section_order_index): New method.
6421 (Layout::read_layout_from_file): New method.
6422 (Layout::input_section_position_): New private member.
6423 (Layout::input_section_glob_): New private member.
6424 * main.cc (main): Call read_layout_from_file here.
6425 * options.h (--section-ordering-file): New option.
6426 * output.cc (Output_section::input_section_order_specified_): New
6427 member.
6428 (Output_section::Output_section): Initialize new member.
6429 (Output_section::add_input_section): Add new parameter.
6430 Keep input sections when --section-ordering-file is used.
6431 (Output_section::set_final_data_size): Sort input sections when
6432 section ordering file is specified.
6433 (Output_section::Input_section_sort_entry): Add new parameter.
6434 Check sorting type.
6435 (Output_section::Input_section_sort_entry::compare_section_ordering):
6436 New method.
6437 (Output_section::Input_section_sort_compare::operator()): Change to
6438 consider section_order_index.
6439 (Output_section::Input_section_sort_init_fini_compare::operator()):
6440 Change to consider section_order_index.
6441 (Output_section::Input_section_sort_section_order_index_compare
6442 ::operator()): New method.
6443 (Output_section::sort_attached_input_sections): Change to sort
6444 according to section order when specified.
e1df38aa
NC
6445 (Output_section::add_input_section<32, true>): Add new parameter.
6446 (Output_section::add_input_section<64, true>): Add new parameter.
6447 (Output_section::add_input_section<32, false>): Add new parameter.
6448 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
6449 * output.h (Output_section::add_input_section): Add new parameter.
6450 (Output_section::input_section_order_specified): New
6451 method.
6452 (Output_section::set_input_section_order_specified): New method.
6453 (Input_section::Input_section): Initialize section_order_index_.
6454 (Input_section::section_order_index): New method.
6455 (Input_section::set_section_order_index): New method.
6456 (Input_section::section_order_index_): New member.
6457 (Input_section::Input_section_sort_section_order_index_compare): New
6458 struct.
6459 (Output_section::input_section_order_specified_): New member.
6460 * script-sections.cc (is_wildcard_string): Delete and move modified
6461 method to gold.h.
6462 (Output_section_element_input::Output_section_element_input): Modify
6463 call to is_wildcard_string.
6464 (Output_section_element_input::Input_section_pattern
6465 ::Input_section_pattern): Ditto.
6466 (Output_section_element_input::Output_section_element_input): Ditto.
6467 * testsuite/Makefile.am (final_layout): New test case.
6468 * testsuite/Makefile.in: Regenerate.
6469 * testsuite/final_layout.cc: New file.
6470 * testsuite/final_layout.sh: New file.
6471
3537c84b
RÁE
64722010-06-01 Rafael Espindola <espindola@google.com>
6473
6474 * plugin.cc (Plugin::load): Pass the output name to the plugin.
6475
105b6afd
RÁE
64762010-06-01 Rafael Espindola <espindola@google.com>
6477
6478 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
6479 visibility of symbols.
6480
29e11421
DK
64812010-05-27 Doug Kwan <dougkwan@google.com>
6482
6483 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
6484 from start of output section instead of address for a local symbol
6485 in a merged or relaxed section when doing a relocatable link.
6486
5e0f337e
RÁE
64872010-05-26 Rafael Espindola <espindola@google.com>
6488
703d02da 6489 PR 11604
5e0f337e
RÁE
6490 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
6491 adding sections the garbage collector removed.
6492 * gold/testsuite/Makefile.am: Add test.
6493 * gold/testsuite/Makefile.in: Regenerate.
6494 * gold/testsuite/plugin_test_7.sh: New.
6495 * gold/testsuite/plugin_test_7_1.c: New.
6496 * gold/testsuite/plugin_test_7_2.c: New.
6497
f4187277
RÁE
64982010-05-26 Rafael Espindola <espindola@google.com>
6499
6500 * script-sections.cc (Output_section_definition::set_section_addresses):
6501 Check for --section-start.
6502
5c388529
DK
65032010-05-26 Doug Kwan <dougkwan@google.com>
6504
6505 * arm.cc (Arm_scan_relocatable_relocs): New class.
6506 (Target_arm::relocate_special_relocatable): New method.
6507 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
6508 (Arm_relocate_functions::thumb_branch_common): Same.
6509 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
6510 instead of Default_scan_relocatable_relocs.
6511 * target-reloc.h (relocate_for_relocatable): Let target handle
6512 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
6513 * target.h (Sized_target::relocate_special_relocatable): New method.
6514
bca1c3ae
ILT
65152010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6516
6517 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
6518
0439c796
DK
65192010-05-23 Doug Kwan <dougkwan@google.com>
6520
6521 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
6522 instead of a cast.
6523 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
6524 with a direct branch, not a conditional branch, to a stub.
6525 * merge.cc (Output_merge_base::record_input_section): New method
6526 defintion.
6527 (Output_merge_data::do_add_input_section): Record input section if
6528 keeps-input-sections flag is set.
6529 (Output_merge_string::do_add_input_section): Ditto.
6530 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
6531 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
6532 INPUT_SECTIONS_.
6533 (Output_merge_base::keeps_input_sections,
6534 Output_merge_base::set_keeps_input_sections,
6535 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
6536 method definitions.
6537 (Output_merge_base::Input_sections): New type declaration.
6538 (Output_merge_base::input_sections_begin,
6539 Output_merge_base::input_sections_end,
6540 Output_merge_base::do_set_keeps_input_sections): New method definitions.
6541 (Output_merge_base::bool keeps_input_sections_,
6542 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
6543 Output_merge_base::input_sections_): New data members.
6544 (Output_merge_data::do_set_keeps_input_sections): New method
6545 defintion.
6546 (Output_merge_string::do_set_keeps_input_sections): Ditto.
6547 * output.cc (Output_section::Input_section::relobj): Move method
6548 defintion from class declaration to here and handle merge sections.
6549 (Output_section::Input_section::shndx): Ditto.
6550 (Output_section::Output_section): Remove initializations of removed
6551 data members and initialize new data member LOOKUP_MAPS_.
6552 (Output_section::add_input_section): Set keeps-input-sections flag
6553 for a newly created merge output section as appropriate. Adjust code
6554 to use Output_section_lookup_maps class.
6555 (Output_section::add_relaxed_input_section): Adjst code for lookup
6556 maps code refactoring.
2e702c99 6557 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
6558 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
6559 class. If adding input section to a newly created merge output
6560 section fails, remove the new merge section.
6561 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 6562 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 6563 (Output_section::find_merge_section): Ditto.
0439c796 6564 (Output_section::build_lookup_maps): New method defintion.
2e702c99 6565 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6566 Output_section_lookup_maps class.
6567 (Output_section::get_input_sections): Export merge sections. Adjust
6568 code to use Output_section_lookup_maps class.
6569 (Output_section:::add_script_input_section): Adjust code to use
6570 Output_section_lookup_maps class. Update lookup maps for merge
6571 sections also.
6572 (Output_section::discard_states): Use Output_section_lookup_maps.
6573 (Output_section::restore_states): Same.
6574 * output.h (Merge_section_properties): Move class defintion out of
6575 Output_section.
6576 (Output_section_lookup_maps): New class.
6577 (Output_section::Input_section::is_merge_section): New method
6578 defintion.
6579 (Output_section::Input_section::relobj): Move defintion out of class
6580 defintion. Declare method only.
6581 (Output_section::Input_section::shndx): Ditto.
6582 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6583 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6584 (Output_section::Merge_section_by_properties_map,
6585 Output_section::Output_section_data_by_input_section_map,
6586 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6587 Remove types.
2e702c99 6588 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6589 KEEPS_INPUT_SECTIONS.
6590 (Output_section::build_lookup_maps): New method declaration.
6591 (Output_section::merge_section_map_,
6592 Output_section::merge_section_by_properties_map_,
6593 Output_section::relaxed_input_section_map_,
6594 Output_section::is_relaxed_input_section_map_valid_): Remove data
6595 members.
6596 (Output_section::lookup_maps_): New data member.
6597
76295588
L
65982010-05-21 Doug Kwan <dougkwan@google.com>
6599
6600 PR gold/11619
6601 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6602 avoid a compilation error.
6603
d103a984
RÁE
66042010-05-19 Rafael Espindola <espindola@google.com>
6605
6606 * script-sections.cc (Output_section_definition::allocate_to_segment):
6607 Update the phdrs_list even when the output section is NULL.
6608 * testsuite/Makefile.am: Add test.
6609 * testsuite/Makefile.in: Regenerate.
6610 * testsuite/script_test_9.cc: New.
6611 * testsuite/script_test_9.sh: New.
6612 * testsuite/script_test_9.t: New.
6613
6625d24e
DK
66142010-05-19 Doug Kwan <dougkwan@google.com>
6615
6616 * arm.cc (Arm_input_section::original_size): New method.
6617 (Arm_input_section::do_addralign): Add a cast.
6618 (Arm_input_section::do_output_offset): Remove static cast.
6619 (Arm_input_section::original_addralign,
6620 Arm_input_section::original_size_): Change type to uint32_t.
6621 (Arm_input_section::init): Add safe casts for section alignment
6622 and size.
6623 (Arm_input_section::set_final_data_size): Do not set address and
6624 offset of stub table.
6625 (Arm_output_section::fix_exidx_coverage): Change use of of
6626 Output_section::Simple_input_section to that of
6627 Output_section::Input_section.
6628 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6629 except for the first pass.
6630 * output.cc (Output_section::get_input_sections): Change type of
6631 input_sections to std::list<Input_section>.
6632 (Output_section::add_script_input_section): Rename from
6633 Output_section::add_simple_input_section. Change type of SIS
6634 parameter from Simple_input_section to Input_section.
6635 * output.h (Output_section::Simple_input_section): Remove class.
6636 (Output_section::Input_section): Change class visibility to public.
6637 (Output_section::Input_section::addralign): Use stored alignments
6638 for special input sections if set.
6639 (Output_section::Input_section::set_addralign): New method.
6640 (Output_section::get_input_sections): Change parameter type from
6641 list of Simple_input_section to list of Input_section.
6642 (Output_section::add_script_input_section): Rename from
6643 Output_section::add_simple_input_section. Change first parameter's
6644 type from Simple_input_section to Input_section and remove the
6645 second and third parameters.
6646 * script-sections.cc (Input_section::Input_section_list): Change
6647 type to list of Output_section::Input_section/
6648 (Input_section_info::Input_section_info): Change parameter type of
6649 INPUT_SECTION to Output_section::Input_section.
6650 (Input_section_info::input_section): Change return type.
6651 (Input_section_info::input_section_): Change type to
6652 Output_section::Input_section.
6653 (Output_section_element_input::set_section_addresses): Adjust code
6654 to use Output_section::Input_section instead of
6655 Output_section::Simple_input_section. Adjust code for renaming
6656 of Output_section::add_simple_input_section.
6657 (Orphan_output_section::set_section_addresses): Ditto.
6658
e1e82ea4
RW
66592010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6660
6661 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6662 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6663
91e75c8a
RÁE
66642010-05-18 Rafael Espindola <espindola@google.com>
6665
6666 * options.cc (General_options::finalize): Handle -nostdlib.
6667 * options.h (nostdlib): New option.
6668 * script.cc (script_add_search_dir): Handle -nostdlib.
6669
da59ad79
DK
66702010-05-12 Doug Kwan <dougkwan@google.com>
6671
6672 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6673 attributes section only if there no attributes section after merging.
6674 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6675 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6676 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6677 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6678 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6679 and arm_attr_merge_7.stdout.
6680 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6681 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6682 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6683 arm_attr_merge_7b.o): New rules.
6684 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6685 arm_attr_merge_7
6686 * testsuite/Makefile.in: Regenerate.
6687 * testsuite/arm_attr_merge.sh: New file.
6688 * testsuite/arm_attr_merge_[67][ab].s: Same.
6689
3e01a7fd
NC
66902010-05-05 Nick Clifton <nickc@redhat.com>
6691
6692 * po/es.po: Updated Spanish translation.
6693
7ad2014a
L
66942010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6695
6696 * Makefile.am (install-exec-local): Properly install gold as
6697 default cross linker.
6698 * Makefile.in: Regenerated.
6699
4fda8867
NC
67002010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6701 Nick Clifton <nickc@redhat.com>
6702
6703 * configure.ac (install_as_default): Define and set to false
6704 unless --enable-gold or --enable-gold=both/gold has been
6705 specified.
6706 * configure: Regenerate.
6707
6708 * Makefile.am (install-exec-local): Install the executable as
6709 'ld.gold'. If install_as_default is true then also install it as
6710 'ld'.
6711 * Makefile.in: Regenerated.
6712
bd288ea2
ILT
67132010-04-24 Ian Lance Taylor <iant@google.com>
6714
6715 * layout.cc (Layout::layout_reloc): In relocatable link don't
6716 combine reloc sections for grouped sections.
6717
ef38fd8a
ST
67182010-04-23 Sriraman Tallam <tmsriram@google.com>
6719
6720 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6721 sections that are not ordinary to icf.
6722 * icf.cc (get_section_contents): Handle relocation pointing to section
6723 with no object or shndx information.
6724 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6725 * testsuite/Makefile.in: Regenerate.
6726 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6727 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6728
f6973bdc
ILT
67292010-04-22 Ian Lance Taylor <iant@google.com>
6730
6731 * expression.cc (Expression::Expression_eval_info): Add
6732 result_alignment_pointer field.
6733 (Expression::eval_with_dot): Add result_alignment_pointer
6734 parameter. Change all callers.
6735 (Expression::eval_maybe_dot): Likewise.
6736 (class Binary_expression): Add alignment_pointer parameter to
6737 left_value and right_value. Change all callers.
6738 (BINARY_EXPRESSION): Set result alignment.
6739 (class Trinary_expression): Add alignment_pointer parameter to
6740 arg2_value and arg3_value. Change all callers.
6741 (Trinary_cond::value): Set result alignment.
6742 (Max_expression::value, Min_expression::value): Likewise.
6743 (Align_expression::value): Likewise.
6744 * script-sections.cc (class Sections_element): Add dot_alignment
6745 parameter to set_section_addresses virtual function. Update
6746 instantiations.
6747 (class Output_section_element): Likewise.
6748 (Script_sections::create_segments): Add dot_alignment parameter.
6749 Change all callers.
6750 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6751 (Script_sections::set_phdrs_clause_addresses): Likewise.
6752 * script-sections.h: Update declarations.
6753 * script.h: Update declarations.
6754 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6755 min_p_align.
6756 * testsuite/script_test_3.t: Set large alignment.
6757 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6758 segment has expected alignment.
6759
9c9c98a5
NC
67602010-04-22 Nick Clifton <nickc@redhat.com>
6761
6762 * po/gold.pot: Updated by the Translation project.
6763 * po/vi.po: Updated Vietnamese translation.
6764
2253bfba
L
67652010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6766
6767 * testsuite/Makefile.am (check_PROGRAMS): Add
6768 icf_virtual_function_folding_test.
6769 * testsuite/Makefile.in: Regenerated.
6770
85fdf906
AH
67712010-04-15 Andrew Haley <aph@redhat.com>
6772
6773 * options.h (merge_exidx_entries): New option.
6774 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6775 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6776 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6777 (Target_arm::merge_exidx_entries): New function.
6778 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6779 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6780 to Arm_exidx_fixup constructor.
6781 Add new arg, merge_exidx_entries.
6782 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6783 Arm_output_section::fix_exidx_coverage.
6784
ce97fa81
ST
67852010-04-18 Sriraman Tallam <tmsriram@google.com>
6786
6787 * icf.cc (get_section_contents): Check for preemptible functions.
6788 Ignore addend when appropriate.
6789 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6790 section folded.
6791 (add_from_relobj): Check for section folded.
6792 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6793 * symtab.h (should_add_dynsym_entry): Add new parameter.
6794 * target-reloc.h (scan_relocs): Check for section folded.
6795 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6796 Check reloc types for function pointers in shared objects.
6797 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6798 case.
6799 (icf_preemptible_functions_test): New test case.
6800 (icf_string_merge_test): New test case.
6801 * testsuite.Makefile.in: Regenerate.
6802 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6803 bar_glob. Refactor code.
6804 * testsuite/icf_preemptible_functions_test.cc: New file.
6805 * testsuite/icf_preemptible_functions_test.sh: New file.
6806 * testsuite/icf_string_merge_test.cc: New file.
6807 * testsuite/icf_string_merge_test.sh: New file.
6808 * testsuite/icf_virtual_function_folding_test.cc: New file.
6809 * testsuite/icf_virtual_function_folding_test.sh: New file.
6810
04ceb17c
DK
68112010-04-14 Doug Kwan <dougkwan@google.com>
6812
6813 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6814 for local symbol recounting if we remove a section due to ICF.
6815 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6816 there are no regular objects in input.
6817
153e7da4
DK
68182010-04-13 Doug Kwan <dougkwan@google.com>
6819
6820 * arm.cc (Arm_input_section::set_final_data_size): Compute
6821 accurate final data size instead of using current data size.
6822
4dbd9faf
DK
68232010-04-09 Doug Kwan <dougkwan@google.com>
6824
6825 * layout.cc (Layout::choose_output_section): Handle script section
6826 types.
6827 (Layout::make_output_section_for_script): Add section type parameter.
6828 Handle script section types.
6829 * layout.h (Layout::make_output_section_for_script): Add section
6830 type parameter.
6831 * output.cc (Output_section::Output_section): Initialize data member
6832 is_noload_.
6833 (Output_section::do_reset_address_and_file_offset): Do not set address
6834 to 0 if section is a NOLOAD section.
6835 * output.h (Output_section::is_noload): New method.
6836 (Output_section::set_is_noload): Ditto.
6837 (Output_section::is_noload_): New data member.
6838 * script-c.h (Script_section_type): New enum type.
6839 (struct Parser_output_section_header): Add new file section_type.
6840 * script-sections.cc (Sections_element::output_section_name): Add
6841 parameter for returning script section type.
6842 (Output_section_definition::output_section_name): Ditto.
6843 (Output_section_definition::section_type)P; New method.
6844 (Output_section_definiton::script_section_type_name): Ditto.
6845 (Output_section_definition::script_section_type_): New data member.
6846 (Output_section_definition::Output_section_definition): Initialize
6847 data member Output_section_definition::script_section_type_.
6848 (Output_section_definition::create_sections): Pass script section type
6849 to Layout::make_output_section_for_script.
6850 (Output_section_definition::output_section_name): Return script
6851 section type to caller.
6852 (Output_section_definition::set_section_address): Do not advance
6853 dot value and load address if section type is NOLOAD. Set address
6854 of NOLOAD sections regardless of section flags.
6855 (Output_section_definition::print): Print section type if it is
6856 not SCRIPT_SECTION_TYPE_NONE.
6857 (Output_section_definition::section_type): New method.
6858 (Output_section_definition::script_section_type_name): Ditto.
6859 (Script_sections::output_section_name): Add new parameter
6860 PSECTION_TYPE for returning script section type. Pass it to
6861 section elements. Handle discard sections.
6862 (Sort_output_sections::operator()): Handle NOLOAD sections.
6863 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6864 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6865 returning script section type.
6866 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6867 INFO and NOLOAD.
6868 * yyscript.y (union): Add new field SECTION_TYPE.
6869 (COPY, DSECT, INFO, NOLOAD): New tokens.
6870 (opt_address_and_section_type): Change type to output_section_header.
6871 (section_type): New non-terminal
6872 (section_header): Handle section type.
2253bfba 6873 (opt_address_and_section_type): Return section type value.
4dbd9faf 6874
721ea635
L
68752010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6876
6877 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6878 * testsuite/plugin_common_test_2.c (foo): Likewise.
6879
6bf924b0
DK
68802010-04-08 Doug Kwan <dougkwan@google.com>
6881
6882 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6883 Output_merge_data.
6884 * output.cc (Output_section::add_merge_input_section): Simplify
6885 code and return status of Output_merge_base::add_input_section.
e1df38aa 6886 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6887 returns true.
6888
24af6f92
DK
68892010-04-07 Doug Kwan <dougkwan@google.com>
6890
6891 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6892 if section is marked as containing instructions but has no mapping
6893 symbols.
6894 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6895 correct section index.
6896 (Arm_relobj::find_linked_text_section): Ditto.
6897
00698fc5
CC
68982010-04-07 Cary Coutant <ccoutant@google.com>
6899
6900 * archive.cc (include_member): Destroy Read_symbols_data object before
6901 releasing file.
6902 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6903 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6904 (Read_symbols_data::~Read_symbols_data) New destructor.
6905 (Section_relocs::Section_relocs) New constructor.
6906 (Section_relocs::~Section_relocs) New destructor.
6907 (Read_relocs_data::Read_relocs_data) New constructor.
6908 (Read_relocs_data::~Read_relocs_data) New destructor.
6909 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6910 pointers to NULL after deleting.
6911
7296d933
DK
69122010-04-07 Doug Kwan <dougkwan@google.com>
6913
6914 * arm.cc: Replace "endianity" with "endianness" in comments.
6915 (Arm_exidx_cantunwind): Ditto.
6916 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6917 (Arm_relobj::merge_flags_and_attributes): New method.
6918 (Arm_relobj::merge_flags_and_attributes_): New data member.
6919 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6920 (Arm_relobj::scan_sections_for_stubs): Ditto.
6921 (Arm_relobj::do_read_symbols): Check to see if we really want to
6922 merge processor-specific flags and attributes. Exit early if
6923 an object is empty except for section names and the undefined symbol.
6924 (Target_arm::do_finalize_sections): Move check for ELF format to
6925 Arm_relobj::do_read_symbols. Merge processor specific flags and
6926 attributes from a regular object only when we have determined that
6927 it is aapropriate. Do not create an .ARM.attributes section in
6928 output if there is no regular input object.
6929 (Target_arm::merge_processor_specific_flags): Check
6930 --warn-mismatch before printing any error.
6931 (Target_arm::merge_object_attributes): Ditto.
6932 * gold.cc (queue_middle_tasks): Handle the case in which there is
6933 no regular object in input.
6934 * options.cc (General_options::parse_EB): New method.
6935 (General_options::parse_EL): Same.
6936 (General_options::General_options): Initialize endianness_.
6937 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6938 New options.
6939 (General_options::Endianness): New enum.
6940 (General_options::endianness): New method.
6941 (General_options::endianness_): New data member.
6942 * parameters.cc (Parameters::set_options): Check target endianness.
6943 (Parameters::set_target_once): Ditto.
6944 (Parameters::check_target_endianness): New method.
6945 (parameters_force_valid_target): If either -EL or -EB is specified,
6946 use it to define endianness of default target.
6947 * parameters.h (Parameters::check_target_endianness): New method
6948 declaration.
6949 * target.h (class Target): Change "endianity" to "endianness"
6950 in comments.
6951
efc8d4f2
RW
69522010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6953
6954 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6955 * configure: Regenerate.
6956 * Makefile.in: Regenerate.
6957 * testsuite/Makefile.in: Regenerate.
6958
be234d88
CC
69592010-04-06 Cary Coutant <ccoutant@google.com>
6960
6961 gcc PR lto/42757
6962 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6963 prevailing definitions of common symbols.
6964 * testsuite/plugin_test_6.sh: New test case.
6965 * testsuite/plugin_common_test_1.c: New test case.
6966 * testsuite/plugin_common_test_2.c: New test case.
6967 * testsuite/Makefile.am (plugin_test_6): New test case.
6968 * testsuite/Makefile.in: Regenerate.
6969
bd32c6bd
NC
69702010-04-06 Nick Clifton <nickc@redhat.com>
6971
6972 * po/vi.po: New Vietnamese translation.
6973
323c532f
DK
69742010-03-30 Doug Kwan <dougkwan@google.com>
6975
6976 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6977
4fcd97eb
DK
69782010-03-25 Doug Kwan <dougkwan@google.com>
6979
6980 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6981 to avoid a conversion warning on a 32-bit host.
6982
4ebf39db
ILT
69832010-03-24 Ian Lance Taylor <iant@google.com>
6984
6985 * testsuite/script_test_3.t: Add a TLS segment.
6986 * testsuite/Makefile.am (check_PROGRAMS): Add
6987 tls_phdrs_script_test.
6988 (tls_phdrs_script_test_SOURCES): Define.
6989 (tls_phdrs_script_test_DEPENDENCIES): Define.
6990 (tls_phdrs_script_test_LDFLAGS): Define.
6991 (tls_phdrs_script_test_LDADD): Define.
6992 * testsuite/Makefile.in: Rebuild.
6993
4a599bdd
CC
69942010-03-23 Cary Coutant <ccoutant@google.com>
6995
6996 * fileread.cc (find_or_make_view): Fix comment.
6997
6c93b22c
ILT
69982010-03-23 Ian Lance Taylor <iant@google.com>
6999
7000 * script-sections.cc (class Orphan_section_placement): Define
7001 PLACE_TLS and PLACE_TLS_BSS.
7002 (Orphan_section_placement::Orphan_section_placement): Initialize
7003 new places.
7004 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7005 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7006 (tls_script_test_SOURCES): Define.
7007 (tls_script_test_DEPENDENCIES): Define.
7008 (tls_script_test_LDFLAGS): Define.
7009 (tls_script_test_LDADD): Define.
7010 * testsuite/Makefile.in: Rebuild.
7011
a2c7281b
DK
70122010-03-22 Doug Kwan <dougkwan@google.com>
7013
7014 * arm.cc (Arm_relocate_functions::abs8,
7015 Arm_relocate_functions::abs16): Use correct check for overflow
7016 specified in the ARM ELF specs.
7017 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7018 target of a BLX instruction specially.
7019 (Reloc_stub::stub_type_for_reloc): Ditto.
7020 (Relocate::relocate): Use symbolic names instead of numeric relocation
7021 codes to report error.
7022 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7023 workaround.
7024 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7025 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7026 thumb2_blx_out_of_range.stdout
7027 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7028 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7029 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7030 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7031 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7032 thumb2_blx_in_range, thumb2_blx_in_range.o,
7033 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7034 thumb2_blx_out_of_range.o): New rules.
2e702c99 7035 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7036 thumb2_blx_in_range and thumb2_blx_out_of_range.
7037 * testsuite/Makefile.in: Regenerate.
7038 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7039 * testsuite/thumb_blx_in_range.s: New file.
7040 * testsuite/thumb_blx_out_of_range.s: New file.
7041
b0193076
RÁE
70422010-03-22 Rafael Espindola <espindola@google.com>
7043
7044 * archive.cc (Should_include): Move to archive.h.
7045 (should_include_member): Make it a member of Archive.
7046 (Lib_group): New.
7047 (Add_lib_group_symbols): New.
7048 * archive.h: Include options.h.
7049 (Archive_member): Moved from Archive.
7050 (Should_include): Moved from archive.cc.
7051 (Lib_group): New.
7052 (Add_lib_group_symbols): New.
7053 * dynobj.cc (do_should_include_member): New.
7054 * dynobj.h (do_should_include_member): New.
7055 * gold.cc (queue_initial_tasks): Update call to queue.
7056 * main.cc (main): Print lib group stats.
7057 * object.cc (do_should_include_member): New.
7058 * object.h: Include archive.h.
7059 (Object::should_include_member): New.
7060 (Object::do_should_include_member): New.
7061 (Sized_relobj::do_should_include_member): New.
7062 * options.cc (General_options::parse_start_lib): New.
7063 (General_options::parse_end_lib): New.
7064 (Input_arguments::add_file): Handle lib groups.
7065 (Input_arguments::start_group): Check we are not in a lib.
7066 (Input_arguments::start_lib): New.
7067 (Input_arguments::end_lib): New.
7068 * options.h (General_options): Add start_lib and end_lib.
7069 (Input_argument::lib_): New.
7070 (Input_argument::lib): New.
7071 (Input_argument::is_lib): New.
7072 (Input_file_lib): New.
7073 (Input_arguments::in_lib_): New.
7074 (Input_arguments::in_lib): New.
7075 (Input_arguments::start_lib): New.
7076 (Input_arguments::end_lib_): New.
7077 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7078 in unused members as preempted.
7079 (Sized_pluginobj::do_should_include_member): New.
7080 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7081 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7082 return the blocker.
7083 (Read_symbols::do_whole_lib_group): New.
7084 (Read_symbols::do_lib_group): New.
7085 (Read_symbols::do_read_symbols): Handle lib groups.
7086 (Read_symbols::get_name): Handle lib groups.
7087 * readsyms.h (Read_symbols): Add an archive member pointer.
7088 (Read_symbols::do_whole_lib_group): New.
7089 (Read_symbols::do_lib_group): New.
7090 (Read_symbols::member_): New.
7091 * script.cc (read_input_script): Update call to queue_soon.
7092
d099120c
DK
70932010-03-19 Doug Kwan <dougkwan@google.com>
7094
7095 * arm.cc (Stub_table::Stub_table): Initialize new data members
7096 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7097 (Stub_table::add_reloc_stub): Assign stub offset and update
7098 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7099 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7100 New data members.
2e702c99 7101 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7102 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7103 instead of going over all reloc stubs.
2e702c99 7104 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7105 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7106 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7107 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7108 Stringpool_template::offset_.
7109 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7110 Stringpool_template::offset_ to zero.
7111
1aa37384
DK
71122010-03-15 Doug Kwan <dougkwan@google.com>
7113
7114 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7115 offset_.
7116 (Stringpool_template::new_key_offset): New method.
7117 (Stringpool_template::add_string): Assign offsets when adding new
7118 strings.
7119 (Stringpool_template::set_string_offsets): Do not set string offsets
7120 when not optimizing.
7121 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7122 member size_.
2e702c99
RM
7123 (Chunked_vector::clear): Clear size_.
7124 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7125 (Chunked_vector::size): Return size_.
7126 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7127 (Chunked_vector::size_): New data member.
1aa37384
DK
7128 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7129 (Stringpool_template::new_key_offset): New method declaration.
7130 (Stringpool_template::offset_): New data member.
7131
b672b057
RÁE
71322010-03-15 Rafael Espindola <espindola@google.com>
7133
7134 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7135 Add_symbols' constructor.
7136 * readsyms.h (Add_symbols): Remove the input_group member.
7137
b6848d3c
ILT
71382010-03-10 Ian Lance Taylor <iant@google.com>
7139
7140 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7141 target to ask whether a reference to a symbol requires a stack
7142 split.
7143 * target.h (Target::is_call_to_non_split): New function.
7144 (Target::do_is_call_to_non_split): Declare virtual function.
7145 * target.cc: Include "symtab.h".
7146 (Target::do_is_call_to_non_split): New function.
7147 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7148
a2a5469e
CC
71492010-03-10 Cary Coutant <ccoutant@google.com>
7150
7151 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7152 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7153 (File_read::open[2]): Add whole_file_view_ to list of views.
7154 (File_read::make_view): Remove test of whole_file_view_.
7155 (File_read::find_or_make_view): Create whole_file_view_ if
7156 necessary.
7157 (File_read::clear_views): Replace bool parameter with enum;
7158 adjust all callers. Don't delete views with permanent data;
7159 do delete cached views and views from archives if
7160 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7161 if clearing the corresponding view.
7162 * fileread.h (File_read::Clear_views_mode): New enum.
7163 (File_read::View::is_permanent_view): New method.
7164 (File_read::clear_views): Replace bool parameter
7165 with enum; adjust all callers.
7166 * options.h (General_options): Change keep_files_mapped option;
7167 add map_whole_files.
7168 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7169 releasing the file.
7170 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7171 the file.
7172
8861f32b
DM
71732010-03-10 David S. Miller <davem@davemloft.net>
7174
7175 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7176
d62d0f5f
ST
71772010-03-09 Sriraman Tallam <tmsriram@google.com>
7178
7179 * icf.cc (get_section_contents): Add '@' marker after processing the
7180 merge reloc.
7181
9177756d
DK
71822010-03-08 Doug Kwan <dougkwan@google.com>
7183
7184 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7185 due to a conversion warning.
7186 (Arm_relobj::update_output_local_symbol_count): Check for local
7187 symbol with unset output index.
7188
9e9e071b
ILT
71892010-03-05 Ian Lance Taylor <iant@google.com>
7190
7191 * options.h (class General_options): Add --spare-dynamic-tags.
7192 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7193 --spare-dynamic-tags.
7194
a81ee015
ILT
71952010-03-05 Ian Lance Taylor <iant@google.com>
7196
7197 * incremental.cc: Include "libiberty.h".
7198
44ec90b9
RO
71992010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7200
7201 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7202 function, is_info_ member.
7203 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7204 (Versions::Versions): Update caller.
7205 (Versions::define_base_version): Likewise.
7206 (Versions::add_def): Likewise.
7207
0897ed3b
ST
72082010-03-03 Sriraman Tallam <tmsriram@google.com>
7209
7210 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7211 (Scan::possible_function_pointer_reloc): New function.
7212 (Scan::local_reloc_may_be_function_pointer): Change to call
7213 possible_function_pointer_reloc.
7214 (Scan::global_reloc_may_be_function_pointer): Ditto.
7215 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7216 relocations in ".data.rel.ro._ZTV" section.
7217 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7218 * testsuite/icf_safe_so_test.cc: Ditto.
7219 * testsuite/icf_safe_test.cc: Ditto.
7220 * testsuite/icf_safe_test.sh: Ditto.
7221
d3bbad62
ILT
72222010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7223 Ian Lance Taylor <iant@google.com>
7224
7225 * target-reloc.h (relocate_section): Check the symbol table index
7226 for -1U before setting the local symbol index.
7227 (scan_relocatable_relocs): If copying the relocation, record that
7228 the local symbol is required.
7229 * object.h (Symbol_value::is_output_symtab_index_set): New
7230 function.
7231 (Symbol_value::may_be_discarded_from_output_symtab): New
7232 function.
7233 (Symbol_value::has_output_symtab_entry): New function.
7234 (Symbol_value::needs_output_symtab_entry): Remove.
7235 (Symbol_value::output_symtab_index): Make sure the symbol index is
7236 set.
7237 (Symbol_value::set_output_symtab_index): Make sure the symbol
7238 index is not set. Make sure the new index is valid.
7239 (Symbol_value::set_must_have_output_symtab_entry): New function.
7240 (Symbol_value::has_output_dynsym_entry): New function.
7241 (Symbol_value::set_output_dynsym_index): Make sure the new index
7242 is valid.
7243 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7244 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7245 local symbol if permitted.
7246 (Sized_relobj::do_finalize_local_symbols): Call
7247 is_output_symtab_index_set rather than needs_output_symtab_entry.
7248 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7249 rather than needs_output_symtab_entry. Call
7250 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7251 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7252 is_output_symtab_index_set rather than needs_output_symtab_entry.
7253 * testsuite/discard_locals_relocatable_test.c: New file.
7254 * testsuite/discard_locals_test.sh: Test -r.
7255 * testsuite/Makefile.am (check_DATA): Add
7256 discard_locals_relocatable_test1.syms,
7257 discard_local_relocatable_test2.syms.
7258 (MOSTLYCLEANFILES): Likewise. Also add
7259 discard_locals_relocatable_test1.lout and
7260 discard_locals_relocatable_test2.out.
7261 (discard_locals_relocatable_test1.syms): New target.
7262 (discard_locals_relocatable_test.o): New target.
7263 (discard_locals_relocatable_test1.out): New target.
7264 (discard_locals_relocatable_test2.syms): New target.
7265 (discard_locals_relocatable_test2.out): New target.
7266 (various): Add missing ../ld-new dependencies.
7267 * testsuite/Makefile.in: Rebuild.
7268
7e8ccf26
NC
72692010-03-03 Nick Clifton <nickc@redhat.com>
7270
7271 * po/fi.po: New Finnish translation.
7272
2a0ff005
DK
72732010-03-01 Doug Kwan <dougkwan@google.com>
7274
7275 * layout.cc (Layout::Layout): Force section types of .init_array*,
7276 .preinit_array* and .fini_array* sections.
7277 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7278 Fix check of return value of std::string::find.().
7279 (Output_section::Input_section_sort_compare::operator()): Remove
7280 comment about .init_array.
7281 (Output_section::Input_section_sort_init_fini_compare::operator()):
7282 New method.
7283 (Output_section::sort_attached_input_sections): Handle .init_array
7284 and .fini_array specially.
7285 * output.h (Output_section::Inut_section_sort_compare): Update
7286 comment.
7287 (Output_section::Input_section_sort_init_fini_compare): New struct.
7288
c3e4ae29
DK
72892010-02-26 Doug Kwan <dougkwan@google.com>
7290
7291 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7292 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7293 * testsuite/debug_msg.sh: Avoid matching source line number for
7294 use of global variable undef_int.
7295
2fd9ae7a
DK
72962010-02-26 Doug Kwan <dougkwan@google.com>
7297
7298 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7299 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7300 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7301 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7302 * options.cc (General_options::General_options): Initialize member
7303 fix_v4bx_.
7304 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7305 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7306 and rm_no_fix_v4bx.stdout
7307 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7308 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7309 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7310 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7311 and arm_no_fix_v4bx.
7312 * Makefile.in: Regenerate.
7313 * testsuite/arm_fix_v4bx.s: New file.
7314 * testsuite/arm_fix_v4bx.sh: Ditto.
7315
67ec7d0b
DK
73162010-02-24 Doug Kwan <dougkwan@google.com>
7317
7318 * arm.cc (Target_arm::got_section): Make the .got section the first
7319 non RELRO section in the data segment.
7320 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7321 suffixes of section names.
7322
10165461
DK
73232010-02-24 Doug Kwan <dougkwan@google.com>
7324
7325 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7326 flags and attributes merging if an input file is a binary file.
7327 * fileread.cc (Input_file::open): Record format of original file.
7328 * fileread.h (Input_file::Format): New enum type.
2e702c99 7329 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7330 (Input_file::format): New method definition.
7331 (Input_file::format_):: New data member.
7332
4a54abbb
DK
73332010-02-24 Doug Kwan <dougkwan@google.com>
7334
7335 * arm.cc (Arm_output_data_got): New class.
7336 (ARM_TCB_SIZE): New constant
7337 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7338 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7339 If user uses a script with a SECTIONS clause, issue only a warning
7340 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7341 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7342 garbage collection.
7343 (Target_arm::got_mode_index_entry): Handle static linking.
7344 (Target_arm::Scan::local): Ditto.
7345 (Target_arm::Scan::global): Ditto.
7346 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7347 all incorrectly implemented relocations.
e1df38aa 7348 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7349 Arm_output_section::fix_exidx_coverage.
7350 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7351 from ".ARM.exidx." and ".ARM.extab.".
7352
ca419a6f
ILT
73532010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7354
7355 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7356 section if it does not already exist.
7357 * attributes.cc (Attributes_section_data::Attributes_section_data):
7358 Don't crash if size is zero.
7359
135b9c78
ILT
73602010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7361 Ian Lance Taylor <iant@google.com>
7362
7363 * gold.cc (queue_middle_tasks): If no input files were opened,
7364 exit.
7365 * workqueue.h (Task_function::Task_function): Assert that there is
7366 a blocker.
7367
bb0bfe4f
DK
73682010-02-22 Doug Kwan <dougkwan@google.com>
7369
7370 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7371 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7372 types to avoid warnings due to different uint64_t implementations
7373 on different hosts.
7374
2a2b6d42
DK
73752010-02-21 Doug Kwan <dougkwan@google.com>
7376
7377 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7378 handling of the maximum backward branch offset.
2e702c99 7379 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7380 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7381 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7382 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7383 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7384 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7385 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7386 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7387 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7388 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7389 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7390 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7391 thumb2_bl_out_of_range.o): New rules.
7392 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7393 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
7394 thumb2_bl_out_of_range
7395 * testsuite/Makefile.in: Regenerate.
7396 * testsuite/arm_bl_in_range.s: New file.
7397 * testsuite/arm_bl_out_of_range.s: Ditto.
7398 * testsuite/arm_branch_in_range.sh: Ditto.
7399 * testsuite/arm_branch_range.t: Ditto.
7400 * testsuite/thumb2_branch_range.t: Ditto.
7401 * testsuite/thumb_bl_in_range.s: Ditto.
7402 * testsuite/thumb_bl_out_of_range.s: Ditto.
7403 * testsuite/thumb_branch_range.t: Ditto.
7404
b487ad64
ST
74052010-02-20 Sriraman Tallam <tmsriram@google.com>
7406
7407 * gc.h (gc_process_relocs): Change vectors to point to the new list.
7408 Add reloc offset information.
7409 * icf.cc (get_section_contents): Change iterators to point to the new
7410 vectors. Add reloc offset information to the contents.
7411 * icf.h (Icf::Sections_reachable_info): New typedef.
7412 (Icf::Sections_reachable_list): New typedef.
7413 (Icf::Offset_info): New typedef.
7414 (Icf::Reloc_info): New struct typedef.
7415 (Icf::Reloc_info_list): New typedef.
7416 (Icf::symbol_reloc_list): Delete method.
7417 (Icf::addend_reloc_list): Delete method.
7418 (Icf::section_reloc_list): Delete method.
7419 (Icf::reloc_info_list): New method.
7420 (Icf::reloc_info_list_): New member.
7421
f96accdf
DK
74222010-02-19 Doug Kwan <dougkwan@google.com>
7423
7424 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
7425 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
7426 * arm.cc (Arm_relocation_functions): New forward declaration.
7427 (Target_arm::Target_arm): Initialize new data members
7428 got_mod_index_offset_ and tls_base_symbol_defined_.
7429 (Target_arm::Relocate::relocate_tls): New method.
7430 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
7431 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
7432 New methods.
2e702c99 7433 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
7434 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
7435 (Target_arm::got_mod_index_offset_,
7436 Target_arm::tls_base_symbol_defined_): New data members.
7437 (Target_arm::Scan::local, Target::Scan::global,
7438 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
7439 relocations.
7440
c8761b9a
DK
74412010-02-18 Doug Kwan <dougkwan@google.com>
7442
7443 * arm.cc (Arm_relobj::find_linked_text_section): New method.
7444 (Arm_relobj::make_exidx_input_section): Pass section index of linked
7445 text section as a parameter becuase some broken tools may not set
7446 the link in section header.
7447 (Target_arm::has_got_section): New method.
7448 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
7449 without any mapping symbol as data only. Remove warning.
7450 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
7451 link in its section header, try to discover the link by inspecting the
7452 REL31 relocation at the beginning of the section.
7453 (Target_arm::Scan::check_non_pic): Report name of offending relocation
7454 in error message.
7455 (Target_arm::Scan::global): Treat any reference to the symbol
7456 _GLOBAL_OFFSET_TABLE_ as a GOT access.
7457
21bb3914
ST
74582010-02-12 Sriraman Tallam <tmsriram@google.com>
7459
7460 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
7461 (Scan::global_reloc_may_be_function_pointer): New function.
7462 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7463 (Scan::global_reloc_may_be_function_pointer): New function.
7464 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
7465 (Scan::global_reloc_may_be_function_pointer): New function.
7466 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
7467 (Scan::global_reloc_may_be_function_pointer): New function.
7468 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
7469 (Scan::global_reloc_may_be_function_pointer): New function.
7470 (Scan::possible_function_pointer_reloc): New function.
7471 (Target_x86_64::can_check_for_function_pointers): New function.
7472 * gc.h (gc_process_relocs): Scan relocation types to determine if
7473 function pointers were taken for targets that support it.
7474 * icf.cc (Icf::find_identical_sections): Include functions for
7475 folding in safe ICF whose pointer is not taken.
7476 * icf.h (Secn_fptr_taken_set): New typedef.
7477 (fptr_section_id_): New member.
7478 (section_has_function_pointers): New function.
7479 (set_section_has_function_pointers): New function.
7480 (check_section_for_function_pointers): New function.
7481 * options.h: Fix comment for safe ICF option.
7482 * target.h (can_check_for_function_pointers): New function.
7483 * testsuite/Makefile.am: Add icf_safe_so_test test case.
7484 Modify icf_safe_test for X86-64.
7485 * testsuite/Makefile.in: Regenerate.
7486 * testsuite/icf_safe_so_test.cc: New file.
7487 * testsuite/icf_safe_so_test.sh: New file.
7488 * testsuite/icf_safe_test.cc (kept_func_3): New function.
7489 (main): Change to take pointer to function kept_func_3.
7490 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
7491 folding is done correctly for X86-64.
7492
0da6fa6c
DM
74932010-02-12 David S. Miller <davem@davemloft.net>
7494
7495 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
7496 is_symbolless parameter.
7497 (Output_reloc<SHT_REL>::is_symbolless): New.
7498 (Output_reloc<SHT_REL>::is_symbolless_): New.
7499 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
7500 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
7501 (Output_reloc<SHT_RELA>::is_symbolless): New.
7502 (Output_data_reloc::add_global): Handle is_symbolless.
7503 (Output_data_reloc::add_global_relative): Likewise.
7504 (Output_data_reloc::add_local): Likewise.
7505 (Output_data_reloc::add_local_relative): Likewise.
7506 (Output_data_reloc::add_symbolless_global_addend): New.
7507 (Output_data_reloc::add_symbolless_local_addend): New.
7508 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
7509 is_symbolless.
7510 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
7511 instead of ->is_relative_
7512 (Output_reloc::write): Likewise.
7513 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
7514 (Output_reloc::write_rel): Simplify.
7515
7516 * sparc.cc (Target_sparc::Scan::local): Use
7517 ->add_symbolless_local_addend as needed.
7518 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
7519 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
7520 based upon relocation offset.
7521
e4782e83
DK
75222010-02-11 Doug Kwan <dougkwan@google.com>
7523
7524 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
7525 (Target_arm::Scan::global): Ditto. Also remove a comment before the
7526 beginning of function.
7527 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
7528 and MOVT_ABS relocations. Those are non issued in scanning. Fix
7529 parameter is_32bit in calls to should_apply_static_reloc.
7530 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
7531 (check_DATA): Add arm_abs_global.stdout.
7532 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
7533 arm_abs_global.stdout): New rules.
7534 (MOSTLLYCLEANFILES): Add arm_abs_global
7535 * Makefile.in: Regenerate.
7536 * testsuite/arm_abs_global.s: New file.
7537 * testsuite/arm_abs_global.sh: Ditto.
7538 * testsuite/arm_abs_lib.s: Ditto.
7539
93ceb764
ILT
75402010-02-11 Ian Lance Taylor <iant@google.com>
7541
7542 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
7543 Read_relocs task.
7544 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
7545 Allocate_commons_task first.
7546 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
7547 task, rather than symtab_lock_.
7548 (Gc_process_relocs::~Gc_process_relocs): New function.
7549 (Gc_process_relocs::is_runnable): Check this_blocker_.
7550 (Gc_process_relocs::locks): Use next_blocker_ rather than
7551 blocker_.
7552 (Scan_relocs::~Scan_relocs): New function.
7553 (Scan_relocs::is_runnable): Check this_blocker_ rather than
7554 symtab_lock_.
7555 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
7556 next_blocker_.
7557 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
7558 fields. Add this_blocker_ and next_blocker_ fields. Adjust
7559 constructor accordingly.
7560 (class Gc_process_relocs): Likewise.
7561 (class Scan_relocs): Likewise.
7562 * common.h (class Allocate_commons_task): Remove symtab_lock_
7563 field, and corresponding constructor parameter.
7564 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
7565 symtab_lock_.
7566 (Allocate_commons_task::locks): Likewise.
7567
114dfbe1
ILT
75682010-02-11 Ian Lance Taylor <iant@google.com>
7569
7570 * gold-threads.h (class Once): Define.
7571 (class Initialize_lock): Rewrite as child of Once.
7572 * gold-threads.cc (class Once_initialize): Define.
7573 (once_pointer_control): New static variable.
7574 (once_pointer, once_arg): New static variables.
7575 (c_run_once): New static function.
7576 (Once::Once, Once::run_once, Once::internal_run): New functions.
7577 (class Initialize_lock_once): Remove.
7578 (initialize_lock_control): Remove.
7579 (initialize_lock_pointer): Remove.
7580 (initialize_lock_once): Remove.
7581 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7582 (Initialize_lock::initialize): Rewrite.
7583 (Initialize_lock::do_run_once): New function.
7584 * archive.cc (Archive::interpret_header): Only clear name if it is
7585 not already empty.
7586 * fileread.cc: Include "gold-threads.h"
7587 (file_counts_lock): New static variable.
7588 (file_counts_initialize_lock): Likewise.
7589 (File_read::release): Only increment counts when using --stats.
7590 Use a lock around the increment.
7591 * parameters.cc (class Set_parameters_target_once): Define.
7592 (set_parameters_target_once): New static variable.
7593 (Parameters::Parameters): Move here from parameters.h.
7594 (Parameters::set_target): Rewrite.
7595 (Parameters::set_target_once): New function.
7596 (Parameters::clear_target): Move here and rewrite.
7597 * parameters.h (class Parameters): Update declarations. Add
7598 set_parameters_target_once_ field.
7599 (Parameters::Parameters): Move to parameters.cc.
7600 (Parameters::clear_target): Likewise.
7601 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7602 task.
7603 (Start_group::~Start_group): New function.
7604 (Start_group::is_runnable): New function.
7605 (Start_group::locks, Start_group::run): New functions.
7606 (Finish_group::run): Change saw_undefined to size_t.
7607 * readsyms.h (class Start_group): Define.
7608 (class Finish_group): Change saw_undefined_ field to size_t.
7609 (Finish_group::Finish_group): Remove saw_undefined and
7610 this_blocker parameters. Change all callers.
7611 (Finish_group::set_saw_undefined): New function.
7612 (Finish_group::set_blocker): New function.
7613 * symtab.h (class Symbol_table): Change saw_undefined to return
7614 size_t. Change saw_undefined_ field to size_t.
7615 * target-select.cc (Set_target_once::do_run_once): New function.
7616 (Target_selector::Target_selector): Initialize set_target_once_
7617 field. Don't initialize lock_ and initialize_lock_ fields.
7618 (Target_selector::instantiate_target): Rewrite.
7619 (Target_selector::set_target): New function.
7620 * target-select.h (class Set_target_once): Define.
7621 (class Target_selector): Update declarations. Make
7622 Set_target_once a friend. Remove lock_ and initialize_lock_
7623 fields. Add set_target_once_ field.
7624
fa17a3f4
ILT
76252010-02-10 Ian Lance Taylor <iant@google.com>
7626
7627 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7628 queueing any tasks.
7629 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7630 (queue_middle_tasks): Add all blockers before queueing any tasks.
7631 (queue_final_tasks): Likewise.
7632 * token.h (Task_token::add_blockers): New function.
7633 * object.h (Input_objects::number_of_relobjs): New function.
7634
c7177d31
ILT
76352010-02-10 Ian Lance Taylor <iant@google.com>
7636
5de0e392
ILT
7637 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7638 shared, not if not position independent.
7639 * x86_64.cc (Relocate::relocate_tls): Likewise.
7640 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7641 (tls_pie_pic_test): New target.
7642 * testsuite/Makefile.in: Rebuild.
7643
c7177d31
ILT
7644 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7645 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7646 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7647 * testsuite/Makefile.in: Rebuild.
7648
684b268a
DM
76492010-02-09 David S. Miller <davem@davemloft.net>
7650
7651 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7652 R_SPARC_RELATIVE using ->add_local_relative().
7653 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7654
612a8d3d
DM
7655 * output.h (Output_data_dynamic::add_section_size): New method
7656 that takes two Output_data objects.
7657 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7658 entry param. Handle it in initializers.
7659 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7660 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7661 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7662 arg.
7663 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7664 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7665 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7666 for dynrel_includes_plt.
7667 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7668 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7669 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7670 before .rela.plt
7671 (Target_sparc::do_finalize_sections): Update to pass true for
7672 dynrel_includes_plt.
7673 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7674 output before .rela.plt
7675 (Target_powerpc::do_finalize_sections): Update to pass true for
7676 dynrel_includes_plt when 32-bit.
7677
cb1be87e
DK
76782010-02-08 Doug Kwan <dougkwan@google.com>
7679
7680 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7681 method.
7682 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7683 Arm_relobj::scan_section_for_cortex_a8_stubs,
7684 Arm_relobj::do_relocation_section): Instead of calling
7685 Output_section::output_address, use faster
7686 Arm_relobj::simple_input_section_output_address.
7687
705b5121
DM
76882010-02-08 David S. Miller <davem@davemloft.net>
7689
7690 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7691 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7692 relocation helper function.
7693
024c4466
DM
7694 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7695 just like R_SPARC_GOT{10,13,22}.
7696 (Target_sparc::Scan::local): Likewise.
7697 (Target_sparc::Relocate:relocate): Likewise.
7698
9109c078
ILT
76992010-02-06 Ian Lance Taylor <iant@google.com>
7700
7701 * configure.ac: Rewrite targetobjs duplicate removal code to use
7702 only shell constructs.
7703 * configure: Rebuild.
7704
cf846138
DK
77052010-02-05 Doug Kwan <dougkwan@google.com>
7706
7707 PR 11247
7708 * arm.cc (Arm_relobj::section_is_scannable): New method.
7709 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7710 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7711
6cfaf60b
DK
77122010-02-04 Doug Kwan <dougkwan@google.com>
7713
7714 PR 11247
7715 * arm-reloc-property.cc (cstdio): Include.
7716 * configure.ac (targetobjs): Remove duplicates.
7717 * configure: Regenerate.
7718 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7719 big and little endian version for a given address size.
7720
5c57f1be
DK
77212010-02-03 Doug Kwan <dougkwan@google.com>
7722
7723 * arm-reloc-property.cc
7724 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7725 definition.
7726 * arm-reloc-property.h
7727 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7728 New method definition.
7729 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7730 declaration.
7731 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7732 overflow to N.
7733 (GOT_PREL): Change implemented to Y.
7734 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7735 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7736 (Arm_relocate_functions::movw_abs_nc): Remove method.
7737 (Arm_relocate_functions::movt_abs): Ditto.
7738 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7739 (Arm_relocate_functions::thm_movt_abs): Ditto.
7740 (Arm_relocate_functions::movw_rel_nc): Ditto.
7741 (Arm_relocate_functions::movw_rel): Ditto.
7742 (Arm_relocate_functions::movt_rel): Ditto.
7743 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7744 (Arm_relocate_functions:thm_movw_rel): Ditto.
7745 (Arm_relocate_functions:thm_movt_rel): Ditto.
7746 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7747 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7748 New method definitions.
7749 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7750 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7751 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7752 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7753 (Target_arm::Relocate::relocate): Check for non-static or
7754 unimplemented relocation code and exit early. Change calls to
7755 Target_arm::reloc_uses_thumb_bit and
7756 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7757 instead. Refactor code to handle similar relocations to increase
7758 code sharing. Remove check for unsupported relocation code in switch
7759 statement.
7760 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7761 relocation property table to find out size. Change error message to
7762 print out the name of a relocation code instead of the numeric value.
7763 (Target_arm::scan_reloc_for_stub): Use relocation property table
7764 instead of calling Target_arm::reloc_uses_thumb_bit().
7765
218c5831
DK
77662010-02-02 Doug Kwan <dougkwan@google.com>
7767
7768 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7769 types of relaxed input section.
7770
0d31c79d
DK
77712010-02-02 Doug Kwan <dougkwan@google.com>
7772
7773 * Makefile.am (HFILES): Add arm-reloc-property.h.
7774 (DEFFILES): New.
2e702c99
RM
7775 (TARGETSOURCES): Add arm-reloc-property.cc
7776 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7777 (libgold_a_SOURCES): $(DEFFILES)
7778 * Makefile.in: Regenerate.
7779 * arm-reloc-property.cc: New file.
7780 * arm-reloc-property.h: New file.
7781 * arm-reloc.def: New file.
7782 * arm.cc: Update comments.
7783 (arm-reloc-property.h): New included header.
7784 (arm_reloc_property_table): New global variable.
7785 (Target_arm::do_select_as_default_target): New method definition.
7786 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7787 arm-reloc-property to targ_extra_obj.
7788 * parameters.cc (set_parameters_target): Call
7789 Target::select_as_default_target().
7790 * target.h (Target::select_as_default_target): New method definition.
7791 (Target::do_select_as_default_target): Same.
7792
546c7457
DK
77932010-02-01 Doug Kwan <dougkwan@google.com>
7794
7795 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7796 first_output_text_section_.
7797 (Arm_exidx_fixup::first_output_text_section): New method definition.
7798 (Arm_exidx_fixup::first_output_text_section_): New data member.
7799 (Arm_exidx_fixup::process_exidx_section): Record the first text
7800 output section seen.
7801 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7802 and entsize in output section header.
7803
11b861d5
DK
78042010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7805
7806 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7807 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7808 (Arm_relocate_functions::thm_alu11): New Method.
7809 (Arm_relocate_functions::thm_pc8): New Method.
7810 (Arm_relocate_functions::thm_pc12): New Method.
7811 (Target_arm::Scan::local): Handle the relocations.
7812 (Target_arm::Scan::global): Likewise.
7813 (Target_arm::Relocate::relocate): Likewise.
7814 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7815
c9a2c125
DK
78162010-01-29 Doug Kwan <dougkwan@google.com>
7817
7818 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7819 of relocation types as ld.
7820
1521477a
DK
78212010-01-29 Doug Kwan <dougkwan@google.com>
7822
7823 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7824 to public.
7825 (Arm_relocate_functions::thumb_branch_common): Ditto.
7826 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7827 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7828 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7829 Arm_relocate_functions::jump24): Remove.
7830 (Target_arm::Relocate::relocate): Adjust code to call
7831 Arm_relocation_functions::arm_branch_common and
7832 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7833 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7834
e7eca48c
DK
78352010-01-29 Doug Kwan <dougkwan@google.com>
7836
7837 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7838 output_local_symbol_count_needs_update_.
7839 (Arm_relobj::output_local_symbol_count_needs_update,
7840 Arm_relobj::set_output_local_symbol_count_needs_update,
7841 Arm_relobj::update_output_local_symbol_count): New methods.
7842 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7843 member.
7844 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7845 of pointed function as in a R_ARM_PREL31 relocation.
7846 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7847 for output local symbol count updating.
7848 (Target_arm::do_relax): Update output local symbol counts in objects
7849 if necessary.
7850 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7851
02961d7e
ILT
78522010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7853
7854 * arm.cc: Added support for the ARM relocations:
7855 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7856 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7857 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7858 movw_prel_nc).
7859 (Arm_relocate_functions::movw_rel): New method.
7860 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7861 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7862 thm_movw_prel_nc).
7863 (Arm_relocate_functions::thm_movw_rel): New method.
7864 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7865 thm_movt_prel).
7866 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7867 relocations.
7868 (Target_arm::Scan::global): Likewise.
7869 (Target_arm::Relocate::relocate): Likewise.
7870 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7871 Likewise.
7872
b10d2873
ILT
78732010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7874
7875 * arm.cc: Added support for ARM group relocations.
7876 (Target_arm::reloc_needs_sym_origin): New method.
7877 (Arm_relocate_functions::calc_grp_kn): New method.
7878 (Arm_relocate_functions::calc_grp_residual): New method.
7879 (Arm_relocate_functions::calc_grp_gn): New method.
7880 (Arm_relocate_functions::arm_grp_alu): New Method.
7881 (Arm_relocate_functions::arm_grp_ldr): New Method.
7882 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7883 (Arm_relocate_functions::arm_grp_ldc): New Method.
7884 (Target_arm::Scan::local): Handle the ARM group relocations.
7885 (Target_arm::Scan::global): Likewise.
7886 (Target_arm::Relocate::relocate): Likewise.
7887 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7888 Likewise.
7889
2b328d4e
DK
78902010-01-26 Doug Kwan <dougkwan@google.com>
7891
7892 * arm.cc (set): Include.
7893 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7894 pointer type.
2e702c99 7895 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7896 (Arm_output_section::append_text_sections_to_list): New method.
7897 (Arm_output_section::fix_exidx_coverage): Ditto.
7898 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7899 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7900 Relobj::set_section_offset() instead of
7901 Sized_relobj::invalidate_section_offset().
2e702c99 7902 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7903 parameter for section headers. Ignore relocation sections for
7904 unallocated sections and EXIDX sections.
7905 (Target_arm::fix_exidx_coverage): New method.
7906 (Target_arm::output_section_address_less_than): New type.
7907 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7908 linked text section instead of the EXIDX section.
7909 (Arm_output_section::create_stub_group): Add an assertion to check
7910 that this is not an EXIDX output section.
7911 (Arm_output_section::append_text_sections_to_list): New method.
7912 (Arm_output_section::fix_exidx_coverage): Ditto.
7913 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7914 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7915 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7916 first pass.
7917 (Target_arm::fix_exidx_coverage): New method.
7918 * object.h (Relobj::set_output_section): New method.
7919 (Sized_relobj::invalidate_section_offset): Remove method.
7920 (Sized_relobj::do_invalidate_section_offset): Remove method.
7921 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7922
c7f3c371
DK
79232010-01-25 Doug Kwan <dougkwan@google.com>
7924
7925 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7926 Fix warning due to signed and unsigned comparison on a 32-bit host.
7927
8923b24c
DK
79282010-01-22 Doug Kwan <dougkwan@google.com>
7929
7930 * arm.cc (Target_arm::do_relax): Record an output section for section
7931 offset adjustment it contains any stub table that has changed.
7932 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7933 offsets in an output section if necessary.
7934 * output.cc (Output_section::Output_section): Initialize
7935 section_offsets_need_adjustments_.
7936 (Output_section::add_input_section_for_script): Renamed to
7937 Output_section::add_simple_input_section.
7938 (Output_section::save_states): Add a comment.
7939 (Output_section::discard_states): New method defintion.
7940 (Output_section::adjust_section_offsets): Same.
7941 * output.h (Output_section::add_input_section_for_script): Renamed to
7942 Output_section::add_simple_input_section.
7943 (Output_section::discard_states): New method declaration.
7944 (Output_section::adjust_section_offsets): Same.
7945 (Output_section::section_offsets_need_adjustment,
7946 Output_section::set_section_offsets_need_adjustment): New method
7947 definitions.
7948 (Output_section::section_offsets_need_adjustment_): New data member.
7949 * script-sections.cc
7950 (Output_section_element_input::set_section_address): Adjust code for
7951 renaming of Output_section::add_input_section_for_script.
7952 (Orphan_output_section::set_section_address): Same.
7953
9b2fd367
DK
79542010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7955
7956 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7957 Fix_v4bx enum values .
7958 * gold/options.h (General_options): New option definitions.
7959 (General_options::fix_v4bx): New method.
7960 (General_options::Fix_v4bx): New enum.
7961 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7962 (General_options::parse_fix_v4bx_interworking): New method.
7963
80d0d023
DK
79642010-01-22 Doug Kwan <dougkwan@google.com>
7965
7966 * arm.cc (Arm_exidx_fixup): New class.
7967
af2cdeae
DK
79682010-01-21 Doug Kwan <dougkwan@google.com>
7969
7970 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7971 classes.
7972 (Arm_exidx_section_offset_map): New type.
7973
993d07c1
DK
79742010-01-21 Doug Kwan <dougkwan@google.com>
7975
7976 * arm.cc (Arm_exidx_input_section): New class.
7977 (Arm_relobj::exidx_input_section_by_link,
7978 Arm_relobj::exidx_input_section_by_shndx,
7979 Arm_relobj::make_exidx_input_section): New methods.
7980 (read_arm_attributes_section): Remove.
7981 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7982 information about them.
7983 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7984 to here.
7985
5ac169d4
DK
79862010-01-20 Doug Kwan <dougkwan@google.com>
7987
7988 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7989 Input_section_specifier to Section_id.
7990 (Target_arm::new_arm_input_section: Adjust code for change of key
7991 type.
7992 (Target_arm::find_arm_input_section): Ditto.
7993 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7994 (Section_id): Remove.
7995 (Garbage_collection::Section_id_hash): Remove.
7996 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7997 (Section_id): Remove.
7998 (Icf::Section_id_hash): Remove.
7999 * object.h (Section_id, Const_section_id, Section_id_hash,
8000 Const_section_id_hash): New type definitions.
8001 * output.cc (Output_section::add_relaxed_input_section): Change to
8002 use Const_section_id instead of Input_section_specifier as key type.
8003 (Output_section::add_merge_input_section): Ditto.
8004 (Output_section::build_relaxation_map): Change to use Section_id
8005 instead of Input_section_specifier as key type.
2e702c99 8006 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8007 Ditto.
8008 (Output_section::convert_input_sections_to_relaxed_sections): Change
8009 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8010 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8011 (Output_section::find_relaxed_input_section): Ditto.
8012 * output.h (Input_section_specifier): Remove class.
8013 (Output_section::Output_section_data_by_input_section_map): Change
8014 key type to Const_section_id.
8015 (Output_section::Output_relaxed_input_section_by_input_section_map):
8016 Ditto.
8017 (Output_section::Relaxation_map): Change key type to Section_id.
8018
a2162063
ILT
80192010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8020
8021 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8022 (class Arm_v4bx_stub): New class.
8023 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8024 (Stub_factory::make_arm_v4bx_stub): New method.
8025 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8026 (Stub_table::empty): Handle v4bx stubs.
8027 (Stub_table::add_arm_v4bx_stub): New method.
8028 (Stub_table::find_arm_v4bx_stub): New method.
8029 (Arm_relocate_functions::v4bx): New method.
8030 (Target_arm::fix_v4bx): New method.
8031 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8032 (Stub_table::relocate_stubs): Likewise.
8033 (Stub_table::do_write): Likewise.
8034 (Stub_table::update_data_size_and_addralign): Likewise.
8035 (Stub_table::finalize_stubs): Likewise.
8036 (Target_arm::Scan::local): Likewise.
8037 (Target_arm::Scan::global): Likewise.
8038 (Target_arm::do_finalize_sections): Likewise.
8039 (Target_arm::Relocate::relocate): Likewise.
8040 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8041 Likewise.
8042 (Target_arm::scan_reloc_for_stub): Likewise.
8043 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8044
5696ab0b
ILT
80452010-01-19 Ian Lance Taylor <iant@google.com>
8046
8047 * output.cc (Output_section_headers::do_sized_write): Write large
8048 segment count to sh_info field.
8049 (Output_file_header::do_sized_write): For large segment count,
8050 write PN_XNUM to e_phnum field.
8051
800d0f56
ILT
80522010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8053
8054 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8055 (Arm_relocate_functions::thm_jump8): New function.
8056 (Arm_relocate_functions::thm_jump11): New function.
8057 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8058 R_ARM_THM_JUMP11.
8059 (Target_arm::Scan::global): Likewise.
8060 (Target_arm::Relocate::relocate): Likewise.
8061 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8062 Likewise.
8063
41263c05
DK
80642010-01-14 Doug Kwan <dougkwan@google.com>
8065
8066 * arm.cc (map, utility): Include headers.
8067 (Target_arm::apply_cortex_a8_workaround): New method.
8068 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8069 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8070 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8071 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8072 the --[no-]fix-cortex-a8 command line options.
8073 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8074 (Target_arm::relocate_stub): Use addend in instruction template.
8075 * options.h (DEFINE_bool): Set the user-set flag.
8076 (General_options): Add --[no-]-fix-cortex options.
8077 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8078 : Update fast look-up map after conversion.
41263c05 8079
459e9b03
ST
80802010-01-14 Sriraman Tallam <tmsriram@google.com>
8081
8082 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8083 in the first pass of do_layout.
8084
b521dfe4
DK
80852010-01-13 Doug Kwan <dougkwan@google.com>
8086
8087 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8088 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8089 apparent compiler problem of not folding static constant integral
8090 data members of elfcpp::Elf_sizes<32>.
8091
44272192
DK
80922010-01-13 Doug Kwan <dougkwan@google.com>
8093
8094 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8095 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8096 Arm_relobj::scan_section_for_cortex_a8_erratum,
8097 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8098 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8099 sections to scan for relocation stubs into a new method
8100 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8101 relocation and Cortex-A8 stub scanning.
8102 (Target_arm::do_relax): Force stubs to be after stubbed sections
8103 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8104 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8105 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8106
44b71ece
ILT
81072010-01-12 Ian Lance Taylor <iant@google.com>
8108
8109 * target-reloc.h (visibility_error): New inline function.
8110 (relocate_section): Call visibility_error.
8111 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8112 (MOSTLYCLEANFILES): Likewise.
8113 (protected_4_pic.o, protected_3.err): New targets.
8114 * testsuite/protected_4.cc: New file.
8115
a120bc7f
DK
81162010-01-12 Doug Kwan <dougkwan@google.com>
8117
8118 * arm.cc (Cortex_a8_reloc): New class.
8119 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8120 and cortex_a8_relocs_info_.
8121 (Target_arm::fix_cortex_a8): New method definition.
8122 (Target_arm::Cortex_a8_relocs_info): New type.
8123 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8124 New data member declarations.
8125 (Target_arm::scan_reloc_for_stub): Record information about
8126 relocations for THUMB branches that might be exempted from the
8127 Cortex-A8 workaround.
8128 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8129 at the beginning of a relaxation pass.
8130
20138696
DK
81312010-01-12 Doug Kwan <dougkwan@google.com>
8132
8133 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8134 (Arm_relobj::Mapping_symbol_position,
8135 Arm_reloj::Mapping_symbol_position_less,
8136 Arm_relobj::Mapping_symbols_info): New types.
8137 (Target_arm::is_mapping_symbol_name): New method definition.
8138 (Arm_relobj::do_count_local_symbols): Save information about mapping
8139 symbols.
8140
089d69dc
DK
81412010-01-11 Doug Kwan <dougkwan@google.com>
8142
8143 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8144 Arm_relocate_functions::thumb32_branch_upper,
8145 Arm_relocate_functions::thumb32_branch_lower,
8146 Arm_relocate_functions::thumb32_cond_branch_offset,
8147 Arm_relocate_functions::thumb32_cond_branch_upper,
8148 Arm_relocate_functions::thumb32_cond_branch_lower,
8149 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8150 branch offset encoding.
8151 (Arm_relocate_functions::thumb_branch_common): Use new branch
8152 offset encoding methods to avoid code duplication.
8153 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8154 (Stub_addend_reader::operator()): Use new branch encoding method
8155 to avoid code duplication.
8156
99e5bff2
DK
81572010-01-11 Doug Kwan <dougkwan@google.com>
8158
8159 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8160 (Target_arm::do_finalize_sections): Define special EXIDX section
8161 symbols only if referenced.
8162 * gc.h (Garbage_collection::add_reference): New method.
8163 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8164 code duplication.
8165
98e090bd
ILT
81662010-01-11 Ian Lance Taylor <iant@google.com>
8167
d0a91bd8
ILT
8168 * script.cc (Version_script_info::build_expression_list_lookup):
8169 Change complaing about duplicate wildcard match from error to
8170 warning.
8171
98e090bd
ILT
8172 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8173 of 2009-12-30.
8174 (Version_script_info::Version_script_info): Initialize globs_,
8175 default_version_, default_is_global_, and exact_. Don't
8176 initialize globals_ or locals_.
8177 (Version_script_info::build_lookup_tables): Build local symbols
8178 first.
8179 (Version_script_info::unquote): New function.
8180 (Version_script_info::add_exact_match): New function.
8181 (Version_script_info::build_expression_list_lookup): Remove lookup
8182 parameter. Add is_global parameter. Change all callers. Handle
8183 wildcard pattern specially. Unquote pattern. Call
8184 add_exact_match.
8185 (Version_script_info::get_name_to_match): New function.
8186 (Version_script_info::get_symbol_version): New function.
8187 (Version_script_info::get_symbol_version_helper): Remove.
8188 (Version_script_info::check_unmatched_names): Call unquote.
8189 * script.h (class Version_script_info): Change get_symbol_version
8190 to be non-inline and add is_global parameter; change all callers.
8191 Rewrite symbol_is_local. Update declarations. Define struct
8192 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8193 Remove globals_ and locals_ members. Add exact_, globs_,
8194 default_version_, is_global_.
8195 (Version_script_info::Glob): Remove pattern, add expression and
8196 is_global. Update constructor. Change all callers.
8197 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8198 default version.
8199 (Versions::symbol_section_contents): If a symbol is undefined, or
8200 defined in a dynamic object, set the version index to
8201 VER_NDX_LOCAL.
8202 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8203 symbol_is_local.
8204 (Symbol_table::add_from_pluginobj): Likewise.
8205 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8206
d56962d3
DK
82072010-01-11 Doug Kwan <dougkwan@google.com>
8208
8209 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8210 (incremental_dump_LDADD): Add linking option for libintl.
8211 * Makefile.in: Regenerate.
8212
94e6ee91
L
82132010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8214
8215 PR gold/11144
8216 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8217 instead of -Ds.
8218 * testsuite/Makefile.in: Regenerated.
8219
e96c574b
DK
82202010-01-10 Doug Kwan <dougkwan@google.com>
8221
8222 * options.h (DEFINE_var): Use parentheses around argument varname__
8223 in macro body to avoid any unintended subsequent substitutions.
8224
7198066b
ILT
82252010-01-10 Ian Lance Taylor <iant@google.com>
8226
ba4d53bf
ILT
8227 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8228 candidates before doing symbol resolution.
8229
7198066b
ILT
8230 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8231 ODR candidates if only one is weak.
8232
a2beed37
ILT
82332010-01-08 Ian Lance Taylor <iant@google.com>
8234
8235 * script.cc (Version_script_info::build_expression_list_lookup):
8236 Don't warn about ambiguous version, just record the ambiguity.
8237 (Version_script_info::get_symbol_version_helper): Give error if
8238 version is ambiguous.
8239
2fb7225c
DK
82402010-01-08 Doug Kwan <dougkwan@google.com>
8241
8242 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8243 prev_data_size_ and prev_addralign_. Remove initializer for
8244 deleted data member has_been_changed_.
8245 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8246 to determine if the table is empty.
8247 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8248 Remove.
8249 (Stub_table::add_reloc_stub): Define method in class definition
8250 instead of just declaring it there.
8251 (Stub_table::add_cortex_a8_stub): New method definition.
8252 (Stub_table::update_data_size_and_addralign): Ditto.
8253 (Stub_table::finalize_stubs): Ditto.
8254 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8255 (Stub_table::do_addralign_): Return address alignment in the
8256 (Stub_table::do_reset_address_and_file_offset): Define method in
8257 class definition instead of declaring it there. Set current data
8258 size to be the data size of the previous pass.
8259 (Stub_table::set_final_data_size): Use current data size as the
8260 final data size.
8261 (Stub_table::relocate_stub): Change parameter type of stub from
8262 Reloc_stub pointer to Stub pointer.
8263 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8264 (Stub_table::Cortex_a8_stub_list): New typedef.
8265 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8266 Stub_table::prev_addralign_): New data member.
8267 (Arm_relobj::Arm_relobj): Initialize data member
8268 section_has_cortex_a8_workaround_.
8269 (Arm_relobj::section_has_cortex_a8_workaround,
8270 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8271 definitions.
8272 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8273 declarations.
8274 (Target_arm::relocate_stub): Change parameter type of stub from
8275 Reloc_stub pointer to Stub pointer.
8276 (Insn_template::size, Insn_template::alignment): Handle
8277 THUMB16_SPECIAL_TYPE.
8278 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8279 Stub_table::update_data_size_and_addralign,
8280 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8281 definitions.
8282 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8283 (Stub_table::do_write): Ditto.
8284 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8285
880cd20d
ILT
82862010-01-08 Ian Lance Taylor <iant@google.com>
8287
8288 PR 11108
8289 * symtab.h (class Symbol): Remove fields is_target_special_ and
8290 has_plt_offset_. Add field is_defined_in_discarded_section_.
8291 (Symbol::is_defined_in_discarded_section): New function.
8292 (Symbol::set_is_defined_in_discarded_section): New function.
8293 (Symbol::has_plt_offset): Rewrite.
8294 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8295 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8296 Don't initialize is_target_special_ or has_plt_offset_.
8297 Initialize is_defined_in_discarded_section_.
8298 (Symbol_table::add_from_relobj): If appropriate, set
8299 is_defined_in_discarded_section.
8300 * resolve.cc (Symbol::override_base_with_special): Don't test
8301 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8302 * target-reloc.h (relocate_section): Do special handling for
8303 symbols defined in discarded sections for global symbols as well
8304 as local symbols.
8305
2703e3eb
ILT
83062010-01-08 Ian Lance Taylor <iant@google.com>
8307
8308 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8309 the SHT_SYMTAB case.
8310
339d40a3
ILT
83112010-01-08 Ian Lance Taylor <iant@google.com>
8312
8313 * object.cc (Sized_relobj::do_layout): Don't get confused if
8314 layout_eh_frame returns NULL.
8315
abecea76
ILT
83162010-01-08 Ian Lance Taylor <iant@google.com>
8317
8318 PR 11084
8319 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8320 dynamic symbol table, use the normal symbol table.
8321 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8322 symbol table.
8323
6b7dd3f3
ILT
83242010-01-08 Ian Lance Taylor <iant@google.com>
8325
8326 PR 11072
8327 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8328 sections.
8329
36c50e63
L
83302010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8331
8332 * version.cc (print_version): Change to "Copyright 2010".
8333
e291e7b9
ILT
83342010-01-08 Ian Lance Taylor <iant@google.com>
8335
8336 PR 10287
8337 PR 11063
8338 * i386.cc (class Target_i386): Change return type of plt_section
8339 to be non-const.
8340 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8341 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8342 tls_desc_rel_ field.
8343 (Output_data_plt_i386::rel_tls_desc): New function.
8344 (Target_i386::rel_tls_desc_section): New function.
8345 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8346 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8347 R_386_TLS_DESC reloc in rel_tls_desc_section.
8348 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8349 Define struct Tlsdesc_info.
8350 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8351 (Target_x86_64::do_reloc_symbol_index): New function.
8352 (Target_x86_64::add_tlsdesc_info): New function.
8353 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8354 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8355 tlsdesc_rel_ field.
8356 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8357 all callers.
8358 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8359 (Target_x86_64::rela_tlsdesc_section): New function.
8360 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8361 handling.
8362 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8363 (Target_x86_64::do_reloc_addend): New function.
8364 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8365 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8366 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8367 (Output_reloc::type): New function.
8368 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8369 (Output_reloc::is_target_specific): New function.
8370 (Output_reloc::target_arg): New function.
8371 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8372 absolute relocs and target specific relocs.
8373 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8374 add_target_specific.
8375 (class Output_data_reloc) [SHT_RELA]: Likewise.
8376 * output.cc (Output_reloc::Output_reloc): Add four new versions
8377 for absolute relocs and target specific relocs.
8378 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8379 (Output_reloc::get_symbol_index): Likewise.
8380 (Output_reloc::local_section_offset): Check that local_sym_index_
8381 is not TARGET_CODE or 0.
8382 (Output_reloc::symbol_value): Likewise.
8383 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8384 reloc.
8385 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8386 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8387 functions.
8388 * layout.cc (add_target_dynamic_tags): Use output section for
8389 DT_PLTRELSZ and DT_JMPREL.
8390
3a44184e
ILT
83912010-01-07 Ian Lance Taylor <iant@google.com>
8392
8393 PR 11061
8394 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
8395 function.
8396 (class Output_data_reloc_generic): Define.
8397 (class Output_data_reloc_base): Change base class to
8398 Output_data_reloc_generic. Change add() method to call
8399 bump_relative_reloc_count for a relative reloc. Remove
8400 sort_relocs_ field.
8401 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
8402 to sort_relocs().
8403 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
8404 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
8405 appropriate.
8406 * layout.h (class Layout): Update declaration.
8407
ea715a34
ILT
84082010-01-07 Ian Lance Taylor <iant@google.com>
8409
8410 * output.h (class Output_data): Add const version of
8411 output_section and do_output_section.
8412 (class Output_section_data): Add const version of
8413 do_output_section.
8414 (class Output_section): Likewise.
8415 * layout.cc (Layout::add_target_dynamic_tags): New function.
8416 * layout.h (class Layout): Update declarations.
8417 * arm.cc (Target_arm::do_finalize_sections): Use
8418 add_target_dynamic_tags.
8419 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8420 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8421 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8422 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8423
659948a4
ILT
84242010-01-07 Ian Lance Taylor <iant@google.com>
8425
8426 PR 11042
8427 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
8428 object as needed.
8429
9d3b86f6
ILT
84302010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
8431 Ian Lance Taylor <iant@google.com>
8432
8433 PR 11019
8434 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
8435 Xindex::read_symtab_xindex.
8436
bb0d3eb0
DK
84372010-01-07 Doug Kwan <dougkwan@google.com>
8438
8439 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
8440 (Insn_template::thumb16_bcond_insn): New method declaration.
8441 (Insn_template): Fix spelling.
8442 (Stub::thumb16_special): New method declaration.
8443 (Stub::do_write): Define virtual method which was previously pure
8444 virtual.
8445 (Stub::do_thumb16_special): New method declaration.
8446 (Stub::do_fixed_endian_write): New template member.
8447 (Reloc_stub::do_write): Remove.
8448 (Reloc_stub::do_fixed_endian_write): Remove.
8449 (Cortex_a8_stub): New class definition.
8450 (Stub_factory::make_cortex_a8_stub): New method definition.
8451 (Stub_factory::Stub_factory): Add missing static storage class
8452 qualifier for elf32_arm_stub_a8_veneer_blx.
8453
ffeef7df
ILT
84542010-01-07 Ian Lance Taylor <iant@google.com>
8455
dc3f80fe
ILT
8456 PR 10980
8457 * options.h (class General_options): Add --warn-unresolved-symbols
8458 and --error-unresolved-symbols.
8459 * errors.cc (Errors::undefined_symbol): Implement
8460 --warn-unresolved-symbols.
8461
ffeef7df
ILT
8462 * options.h (class General_options): Add -z text and -z textoff.
8463 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
8464
f1ec9ded
ST
84652010-01-06 Sriraman Tallam <tmsriram@google.com>
8466
8467 * gc.h (Garbage_collection::Cident_section_map): New typedef.
8468 (Garbage_collection::cident_sections): New function.
8469 (Garbage_collection::add_cident_section): New function.
8470 (Garbage_collection::cident_sections_): New member.
8471 (gc_process_relocs): Add references to sections whose names are C
8472 identifiers.
8473 * gold.h (cident_section_start_prefix): New constant.
8474 (cident_section_stop_prefix): New constant.
8475 (is_cident): New function.
8476 * layout.cc (Layout::define_section_symbols): Replace string constants
8477 with the newly defined constants.
8478 * object.cc (Sized_relobj::do_layout): Track sections whose names are
8479 C identifiers.
8480 * testsuite/Makefile.am: Add gc_orphan_section_test.
8481 * testsuite/Makefile.in: Regenerate.
8482 * testsuite/gc_orphan_section_test.cc: New file.
8483 * testsuite/gc_orphan_section_test.sh: New file.
8484
6eda8c29
ILT
84852010-01-06 Ian Lance Taylor <iant@google.com>
8486
b9674e17
ILT
8487 PR 10980
8488 * options.h (class General_options): Add --warn-shared-textrel.
8489 * layout.cc (Layout::finish_dynamic_section): Implement
8490 --warn-shared-textrel.
8491
6eda8c29
ILT
8492 PR 10980
8493 * options.h (class General_options): Add --warn-multiple-gp.
8494
32dcd44e
ILT
84952010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8496
8497 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
8498 $(THREADSLIB) and $(LIBDL).
8499 * Makefile.in: Rebuild.
8500
a192ba05
ILT
85012010-01-06 Ian Lance Taylor <iant@google.com>
8502
8503 PR 10980
8504 * options.cc (General_options::parse_section_start): New function.
8505 (General_options::section_start): New function.
8506 (General_options::General_options): Initialize all members.
8507 * options.h: Include <map>
8508 (class General_options): Add --section-start. Add section_starts_
8509 member.
8510 * layout.cc (Layout::attach_allocated_section_to_segment): If
8511 --section-start was used, set the address of the segment. Remove
8512 local sort_sections.
8513 (Layout::relaxation_loop_body): If the address of the load segment
8514 has been set by --section-start, don't use it.
8515 * output.h (Output_segment::update_flags_for_output_section): New
8516 function.
8517 * output.cc (Output_segment::add_output_section): Call
8518 update_flags_for_output_section.
8519
dde3f402
ILT
85202010-01-05 Ian Lance Taylor <iant@google.com>
8521
62dfdd4d
ILT
8522 PR 10980
8523 * options.h (class General_options): Add --undefined-version.
8524 * script.cc (struct Version_expression): Add was_matched_by_symbol
8525 field.
8526 (Version_script_info::matched_symbol): New function.
8527 (Version_script_info::get_symbol_version_helper): Call
8528 matched_symbol.
8529 (Version_script_info::check_unmatched_names): New function.
8530 * script.h (class Version_script_info): Update declarations.
8531 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
8532
9c4ae156
ILT
8533 * options.h (class General_options): Use DEFINE_bool_alias for
8534 allow_multiple_definition.
8535 * resolve.cc (Symbol_table::should_override): Don't test
8536 allow_multiple_definition.
8537
dde3f402
ILT
8538 PR 10980
8539 * options.h (class General_options): Add --cref.
8540 * main.cc (main): Print cref table if --cref. Don't close mapfile
8541 until after printing cref table.
8542 * cref.cc: Include "symtab.h".
8543 (class Cref_inputs): Define Cref_table_compare and Cref_table.
8544 (Cref_table_compare::operator()): New function.
8545 (Cref_inputs::gather_cref): New function.
8546 (filecol): New static const.
8547 (Cref_inputs::print_cref): New function.
8548 (Cref::print_cref): New function.
8549 * cref.h: Include <cstdio>.
8550 (class Cref): Update declarations.
8551 * mapfile.h (Mapfile::file): New function.
8552 * object.h (class Object): Define Symbols. Declare virtual
8553 do_get_global_symbols.
8554 (Object::get_global_symbols): New function.
8555 * object.cc (Input_objects::add_object): Pass object to cref_ if
8556 --cref.
8557 (Input_objects::archive_start): Likewise.
8558 (Input_objects::archive_stop): Likewise.
8559 (Input_objects::print_cref): New function.
8560 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
8561 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
8562 --cref.
8563 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
8564 function.
8565 * plugin.h (class Sized_pluginobj): Update declarations.
8566
8781f709
ILT
85672010-01-05 Ian Lance Taylor <iant@google.com>
8568
8569 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8570 to is_default_version. Rename insdef to insdefault.
8571 (Symbol_table::add_from_relobj): Rename def to is_default_version
8572 and local to is_forced_local.
8573 (Symbol_table::add_from_pluginobj): Likewise.
8574 (Symbol_table::add_from_dynobj): Likewise.
8575 (Symbol_table::define_special_symbol): Rename insdef to
8576 insdefault.
8577
fe35d28d
ILT
85782010-01-04 Ian Lance Taylor <iant@google.com>
8579
30bc8c46
ILT
8580 PR 10980
8581 * options.h (class General_options): Add
8582 --allow-multiple-definition and -z muldefs.
8583 * resolve.cc (Symbol_table::should_override): Don't warn about a
8584 multiple symbol definition if --allow-multiple-definition or -z
8585 muldefs.
8586
7eaea549
ILT
8587 PR 10980
8588 * options.h (class General_options): Add --add-needed and
8589 --copy-dt-needed-entries. Tweak --as-needed help entry.
8590 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8591 error if --copy-dt-needed-entries aka --add-needed is used and
8592 would cause a change in behaviour.
8593
fe35d28d
ILT
8594 PR 10980
8595 * options.h (class General_options): Add -G as a short version of
8596 --shared. Add no-op options -assert, -g, and -i.
8597
55a2bb35
ST
85982010-01-04 Sriraman Tallam <tmsriram@google.com>
8599
8600 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8601 check for .text or .gnu.linkonce.t sections.
8602 * icf.cc (Icf::find_identical_sections): Ditto.
8603 Change the detection for mangled function name within the section
8604 name.
8605 * icf.h (is_section_foldable_candidate): New function.
8606
719328e1
ILT
86072009-12-30 Ian Lance Taylor <iant@google.com>
8608
8609 PR 10980
8610 * options.h (class General_options): Permit two dashes with
8611 --retain-symbols-file.
8612
d7bb5745
ILT
86132009-12-30 Ian Lance Taylor <iant@google.com>
8614
403a15dd
ILT
8615 PR 10979
8616 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8617 don't put the file header and segment headers in the text
8618 segment.
8619
eda294df
ILT
8620 PR 10979
8621 * common.cc (Sort_commons::operator()): Stabilize sort when both
8622 entries are NULL.
8623 (Symbol_table::do_allocate_commons_list): When allocating common
8624 symbols, skip a symbol which is no longer common.
8625 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8626 an object before checking its type.
8627 * testsuite/common_test_2.c: New file.
8628 * testsuite/common_test_3.c: New file.
8629 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8630 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8631 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8632 (common_test_2_pic.o, common_test_2.so): New targets.
8633 (common_test_3_pic.o, common_test_3.so): New targets.
8634 * testsuite/Makefile.in: Rebuild.
8635
d7bb5745
ILT
8636 PR 10979
8637 * script.cc (read_input_script): If we see a new SECTIONS clause,
8638 and we have added an input section, give an error.
8639 * layout.h (class Layout): Add have_added_input_section function.
8640 Add have_added_input_section_ field.
8641 * layout.cc (Layout::Layout): Initialize
8642 have_added_input_section_.
8643 (Layout::layout): Set have_added_input_section_.
8644 (Layout::layout_eh_frame): Likewise.
8645
fc59c572
ILT
86462009-12-30 Ian Lance Taylor <iant@google.com>
8647
8648 PR 10931
8649 * options.h (class General_options): Add --sort-common option.
8650 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8651 * common.cc (Sort_common): Add sort_order parameter to
8652 constructor. Add sort_order_ field.
8653 (Sort_commons::operator): Check sort_order_.
8654 (Symbol_table::allocate_commons): Determine the sort order.
8655 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8656 Change all callers.
8657 (Symbol_table::do_allocate_commons_list): Likewise.
8658
1c74fab0
ILT
86592009-12-30 Ian Lance Taylor <iant@google.com>
8660
8661 PR 10916
8662 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8663 symbols from this object, don't change the visibility of an
8664 undefined symbol.
8665 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8666
6affe781
ILT
86672009-12-30 Ian Lance Taylor <iant@google.com>
8668
8669 PR 10861
8670 * script.h (class Version_script_info): Define Language enum.
8671 Update declarations. Define Glob, Exact, and Lookup types. Add
8672 new fields globals_, locals_, and is_finalized_.
8673 * script.cc: Various formatting fixes.
8674 (class Parser_closure): Change language_stack_ from a vector of
8675 std::string to one of Version_script_info::Language. Adjust all
8676 uses accordingly.
8677 (class Lazy_demangler): Remove.
8678 (struct Version_expression): Change language from std::string to
8679 Version_script_info::Language.
8680 (Version_script_info::Version_script_info): New function.
8681 (Version_script_info::~Version_script_info): Don't call clear.
8682 (Version_script_info::finalize): New function.
8683 (Version_script_info::build_lookup_tables): New function.
8684 (Version_script_info::build_expression_list_lookup): New
8685 function.
8686 (Version_script_info::get_symbol_version_helper): Rewrite to use
8687 lookup tables.
8688 (Version_script_info::print_expression_list): Adjust to use
8689 Version_script_info::Language.
8690 (script_push_lex_into_version_mode): Check that the version script
8691 has not been finalized.
8692 (version_script_push_lang): Change language string to
8693 Version_script_info::Language.
8694 * options.cc (Command_line::version_script): New function.
8695 * options.h (class General_options): Add finalize_dynamic_list
8696 function. Change version_script from declaration to definition.
8697 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8698 * testsuite/version_script.map: Remove duplicate def of foo.
8699 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8700 version_script.map.
8701 * testsuite/Makefile.in: Rebuild.
8702
818bf354
ILT
87032009-12-30 Ian Lance Taylor <iant@google.com>
8704
8705 PR 10843
8706 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8707 if the input symbol index is 0, make the output symbol index 0.
8708
ebcc8304
ILT
87092009-12-30 Ian Lance Taylor <iant@google.com>
8710
8711 PR 10670
8712 * options.h (class General_options): Add -x/--discard-all.
8713 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8714 --discard-all. If the local symbol needs a dynamic entry, check
8715 that before handling --discard-locals.
8716
176fe33f
ILT
87172009-12-30 Ian Lance Taylor <iant@google.com>
8718
bb321bb1
ILT
8719 PR 10450
8720 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8721 flags to PF_R.
8722 (Output_segment::add_output_section): Don't change the flags if
8723 the type is PT_TLS.
8724
176fe33f
ILT
8725 PR 10450
8726 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8727 GNU hash table if they need a dynamic value. Otherwise, don't add
8728 them if they are defined in a dynamic object or are forced local.
8729
e8cd95c7
ILT
87302009-12-29 Ian Lance Taylor <iant@google.com>
8731
1b81fb71
ILT
8732 PR 10450
8733 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8734 .gnu.hash table for a 32-bit target.
8735
8d6d383d
ILT
8736 PR 10450
8737 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8738 regular and a dynamic object only needs a dynamic symbol table
8739 entry if it is externally visible.
8740
e785ec03
ILT
8741 PR 10450
8742 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8743 constructor. Add global_offset_table_ field.
8744 (Target_i386::got_section): Set global_offset_table_.
8745 (Target_i386::do_finalize_sections): Set global_offset_table_
8746 size.
8747 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8748 in constructor. Add global_offset_table_ field.
8749 (Target_x86_64::got_section): Set global_offset_table_.
8750 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8751 size.
8752
1a2dff53
ILT
8753 * layout.cc (Layout::Layout): Initialize increase_relro_.
8754 (Layout::get_output_section): Add is_relro, is_last_relro, and
8755 is_first_non_relro parameters. Change all callers.
8756 (Layout::choose_output_section): Likewise.
8757 (Layout::add_output_section_data): Likewise.
8758 (Layout::make_output_section): Likewise.
8759 (Layout::set_segment_offsets): Clear increase_relro when using a
8760 linker script.
8761 * layout.h (class Layout): Add increase_relro method. Add
8762 increase_relro_ field. Update declarations.
8763 * output.cc (Output_section::Output_section): Initialize
8764 is_last_relro_ and is_first_non_relro_.
8765 (Output_segment::add_output_section): Group relro sections is
8766 do_sort is true. Handle is_last_relro and is_first_non_relro.
8767 (Output_segment::maximum_alignment): Remove relro handling.
8768 (Output_segment::set_section_addresses): Add increase_relro
8769 parameter. Change all callers. Add initial alignment to align
8770 relro sections on separate page. Remove old relro handling.
8771 (Output_segment::set_section_list_addresses): Remove in_relro
8772 parameter. Change all callers.
8773 (Output_segment::set_offset): Add increase parameter. Change all
8774 callers. Remove old relro handling.
8775 * output.h (class Output_section): Add new methods: is_last_relro,
8776 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8777 Add is_last_relro_ and is_first_non_relro_ fields.
8778 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8779 Create separate .got.plt section. Call increase_relro.
8780 * x86_64.cc (Target_x86_64::got_section): Likewise.
8781 * testsuite/relro_script_test.t: Add .got.plt.
8782
f0ba79e2
ILT
8783 PR 10450
8784 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8785 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8786 (Layout::finalize): Call set_dynamic_symbol_size.
8787 (Layout::set_dynamic_symbol_size): New function.
8788 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8789 set_dynamic_symbol_size.
8790
e8cd95c7
ILT
8791 PR 10450
8792 * output.h (class Output_section): Add is_entsize_zero_ field.
8793 * output.cc (Output_section::Output_section): Initialize
8794 is_entsize_zero_.
8795 (Output_section::set_entsize): If two different entsizes are
8796 requested, force it to zero.
8797 (Output_section::add_input_section): Set flags for .debug_str
8798 before updating section flags. Set entsize.
8799 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8800 and SHF_STRING if all input sections have those flags.
8801
3e1b9a8a
RÁE
88022009-12-29 Rafael Espindola <espindola@google.com>
8803
8804 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8805 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8806 reporting.
3e1b9a8a 8807
3dcad376
ST
88082009-12-29 Sriraman Tallam <tmsriram@google.com>
8809
8810 * options.cc (General_options::parse_version): Allow -v to exit
8811 without an error if there is nothing to link.
8812
084e2665
ILT
88132009-12-29 Ian Lance Taylor <iant@google.com>
8814
8815 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8816 using a version of gcc before 4.1.
8817 * configure: Rebuild.
8818
250acde3
CD
88192009-12-28 Chris Demetriou <cgd@google.com>
8820
8821 * attributes.cc (Output_attributes_section_data::do_write): Use
8822 std::vector::front rather than std::vector::data.
8823
99fff23b
ILT
88242009-12-28 Ian Lance Taylor <iant@google.com>
8825
8826 * symtab.h (class Symbol_table): Add enum Defined.
8827 * resolve.cc (Symbol_table::should_override): Add defined
8828 parameter. Change all callers. Test whether object is NULL
8829 before calling a method on it.
8830 (Symbol_table::report_resolve_problem): Add defined parameter.
8831 Change all callers.
8832 (Symbol_table::should_override_with_special): Likewise.
8833 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8834 parameter. Change all callers.
8835 (Symbol_table::do_define_in_output_data): Likewise.
8836 (Symbol_table::define_in_output_segment): Likewise.
8837 (Symbol_table::do_define_in_output_segment): Likewise.
8838 (Symbol_table::define_as_constant): Likewise.
8839 (Symbol_table::do_define_as_constant): Likewise.
8840 * script.h (class Symbol_assignment): Add is_defsym parameter to
8841 constructor; change all callers.
8842 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8843 parameter. Change all callers. Add is_defsym_ field.
8844 (class Parser_closure): Add parsing_defsym parameter to
8845 constructor; change all callers. Add parsing_defsym accessor
8846 function. Add parsing_defsym_ field.
8847
556bd683
ILT
88482009-12-28 Ian Lance Taylor <iant@google.com>
8849
8850 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8851 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8852
1782c879
ILT
88532009-12-23 Ian Lance Taylor <iant@google.com>
8854
8855 * i386.cc (Target_i386::do_calls_non_split): Recognize
8856 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8857 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8858 -fsplit-stack prologue when using %r11.
1782c879 8859
329ca2b1
ST
88602009-12-21 Sriraman Tallam <tmsriram@google.com>
8861
8862 * options.cc (General_options::parse_version): Make -v continue and do
8863 the link like GNU ld does.
8864
d675ff46
RÁE
88652009-12-17 Rafael Avila de Espindola <espindola@google.com>
8866
8867 * Makefile.am (CCFILES): Add timer.cc.
8868 (HFILES): Add timer.h.
8869 * configure.ac: Check for sysconf and times.
8870 * main.cc: include timer.h.
8871 (main): Use Timer instead of get_run_time.
8872 * timer.cc: New.
8873 * timer.h: New.
8874 * workqueue.cc: include timer.h.
8875 (Workqueue::find_and_run_task):
8876 Report user, sys and wall time.
8877 * Makefile.in: Regenerate.
8878 * config.in: Regenerate.
8879 * configure: Regenerate.
8880
d6344fb5
DK
88812009-12-16 Doug Kwan <dougkwan@google.com>
8882
8883 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8884 sections.
8885 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8886 relaxed input sections.
8887 * output.cc (Output_section::find_relaxed_input_section): Change
8888 return type to Output_relaxed_input_section pointer. Adjust code
8889 for new type of relaxed_input_section_map_.
8890 * output.h (Output_section::find_relaxed_input_section): Change
8891 return type to Output_relaxed_input_section pointer.
8892 (Output_section::Output_relaxed_input_section_by_input_section_map):
8893 New type.
8894 (Output_section::relaxed_input_section_map_): Change type to
8895 Output_section::Output_relaxed_input_section_by_input_section_map.
8896 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8897 input section.
8898
0e0d5469
ILT
88992009-12-15 Ian Lance Taylor <iant@google.com>
8900
8901 * layout.cc (Layout::create_shstrtab): Only write out after input
8902 sections if we are compressing debug sections.
8903
0649a889
ILT
89042009-12-15 Ian Lance Taylor <iant@google.com>
8905
8906 * archive.cc (Archive::add_symbols): Only look up a symbol without
8907 a version if there is, in fact, a version.
8908
2ea97941
ILT
89092009-12-14 Ian Lance Taylor <iant@google.com>
8910
8911 Revert -Wshadow changes, all changes from:
8912 2009-12-11 Doug Kwan <dougkwan@google.com>
8913 2009-12-11 Nick Clifton <nickc@redhat.com>
8914 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8915
b0eec2cc
DK
89162009-12-11 Doug Kwan <dougkwan@google.com>
8917
8918 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8919 due to -Wshadow.
8920 * attributes.cc (Object_attribute::size): Ditto.
8921 (Attributes_section_data::size): Ditto.
8922 (Attributes_section_data::Attributes_section_data): Ditto.
8923 (Output_attributes_section_data::do_write): Ditto.
8924 * attributes.h (Object_attribute::set_type): Ditto.
8925 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8926
91d6fa6a
NC
89272009-12-11 Nick Clifton <nickc@redhat.com>
8928
8929 * archive.cc: Fix shadowed variable warnings.
8930 * arm.cc: Likewise.
8931 * compressed_output.cc: Likewise.
8932 * compressed_output.h: Likewise.
8933 * configure: Likewise.
8934 * dwarf_reader.cc: Likewise.
8935 * dynobj.cc: Likewise.
8936 * dynobj.h: Likewise.
8937 * ehframe.cc: Likewise.
8938 * ehframe.h: Likewise.
8939 * errors.cc: Likewise.
8940 * expression.cc: Likewise.
8941 * fileread.cc: Likewise.
8942 * fileread.h: Likewise.
8943 * freebsd.h: Likewise.
8944 * i386.cc: Likewise.
8945 * icf.cc: Likewise.
8946 * incremental.h: Likewise.
8947 * layout.cc: Likewise.
8948 * layout.h: Likewise.
8949 * mapfile.cc: Likewise.
8950 * merge.cc: Likewise.
8951 * merge.h: Likewise.
8952 * object.cc: Likewise.
8953 * object.h: Likewise.
8954 * options.h: Likewise.
8955 * output.cc: Likewise.
8956 * output.h: Likewise.
8957 * parameters.cc: Likewise.
8958 * plugin.cc: Likewise.
8959 * powerpc.cc: Likewise.
8960 * reduced_debug_output.cc: Likewise.
8961 * reduced_debug_output.h: Likewise.
8962 * reloc.cc: Likewise.
8963 * reloc.h: Likewise.
8964 * resolve.cc: Likewise.
8965 * script-sections.cc: Likewise.
8966 * script.cc: Likewise.
8967 * script.h: Likewise.
8968 * sparc.cc: Likewise.
8969 * symtab.cc: Likewise.
8970 * symtab.h: Likewise.
8971 * target-select.cc: Likewise.
8972 * target-select.h: Likewise.
8973 * token.h: Likewise.
8974 * workqueue.cc: Likewise.
8975 * workqueue.h: Likewise.
8976 * x86_64.cc: Likewise.
8977
a0351a69
DK
89782009-12-10 Doug Kwan <dougkwan@google.com>
8979
8980 * arm.cc (attributes.h): New include.
8981 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8982 (Arm_relobj::~Arm_relobj): Delete object pointed by
8983 attributes_section_data_.
8984 (Arm_relobj::attributes_section_data): New method definition.
8985 (Arm_relobj::attributes_section_data_): New data member declaration.
8986 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8987 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8988 attributes_section_data_.
8989 (Arm_dynobj::attributes_section_data): New method definition.
8990 (Arm_dynobj::attributes_section_data_): New data member declaration.
8991 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8992 initialization value of may_use_blx_ to false.
2e702c99 8993 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8994 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8995 object attributes to compute results instead of hard-coding.
8996 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8997 Target_arm::get_secondary_compatible_arch,
8998 Target_arm::set_secondary_compatible_arch
8999 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9000 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9001 New method declarations.
9002 (Target_arm::get_aeabi_object_attribute): New method definition.
9003 (Target_arm::attributes_section_data_): New data member declaration.
9004 (read_arm_attributes_section): New template definition.
9005 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9006 (Arm_dynobj::do_read_symbols): Ditto.
9007 (Target_arm::do_finalize_sections): Merge attributes sections from
9008 input. Check for BLX use after attributes section merging.
9009 Fix __exidx_start and __exidx_end visibility. Create an
9010 .ARM.attributes section if necessary.
9011 (Target_arm::get_secondary_compatible_arch,
9012 Target_arm::set_secondary_compatible_arch,
9013 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9014 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9015 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9016 New method definitions.
9017
b59befec
ILT
90182009-12-09 Ian Lance Taylor <iant@google.com>
9019
9020 * plugin.cc (Plugin::load): Don't cast from void* to a function
9021 pointer.
9022
1276bc89
ILT
90232009-12-09 Ian Lance Taylor <iant@google.com>
9024
9025 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9026 information fields.
9027
2f2de248
L
90282009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9029
9030 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9031 Replace two_file_shared_1.so with two_file_shared_2.so.
9032 * testsuite/Makefile.in: Regenerated.
9033
4f787271
DK
90342009-12-08 Doug Kwan <dougkwan@google.com>
9035
9036 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9037 (HFILES): Add attributes.h and int_encoding.h.
9038 * Makefile.in: Regenerate.
9039 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9040 function definitions to int_encoding.cc
9041 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9042 prototypes to int_encoding.h
9043 * reduced_debug_output.cc (int_encoding.h): New include.
9044 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9045 function definitions to int_encoding.cc
9046 (insert_into_vector, read_from_pointer): Move template definitions to
9047 int_encoding.h
9048 * attributes.cc: New file.
9049 * attributes.h: New file.
9050 * int_encoding.cc: New file.
9051 * int_encoding.h: New file.
9052
20b52f1a
RÁE
90532009-12-07 Rafael Avila de Espindola <espindola@google.com>
9054
9055 PR gold/11055
9056 * incremental-dump.cc (dump_incremental_inputs): New.
9057 (main): Use dump_incremental_inputs.
9058
53d7974c
L
90592009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9060
9061 PR gold/10893
9062 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9063 checking elfcpp::STT_FUNC.
9064 (Target_i386::Relocate::relocate): Likewise.
9065 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9066
9067 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9068 symbols from shared libraries into normal FUNC symbols.
9069
9070 * symtab.h (Symbol): Add is_func and use it.
9071
05a352e6
DK
90722009-12-05 Doug Kwan <dougkwan@google.com>
9073
9074 * arm.cc (Target_arm::arm_info): Initialize new fields
9075 attributes_section and attributes_vendor.
9076 * i386.cc (Target_i386::i386_info): Same.
9077 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9078 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9079 fields attributes_section and attributes_vendor.
53d7974c 9080 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9081 * target.h (Target::attributes_section, Target::attributes_vendor,
9082 Target::is_attributes_section, Target::attribute_arg_type,
9083 Target::attributes_order): New method definitions.
9084 (Target::Target_info::attributes_section,
9085 Target::Target_info::attributes_vendor): New fields.
9086 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9087 virtual method definitions.
9088 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9089 attributes_section and attributes_vendor.
9090 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9091
f4e5969c
DK
90922009-12-05 Doug Kwan <dougkwan@google.com>
9093
9094 * arm.cc: Update comments about interworking and stub generation.
9095 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9096 considered as non-PIC.
9097 (Arm_relocate_functions::base_abs): Fix formatting.
9098 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9099 of function to use GOT entry address instead of offset.
9100 (Target_arm::Scan::global): Issue an error if a symbol would need a
9101 PLT does not get one because it is untyped. Remove code to create
9102 dynamic symbols for relative branches.
9103 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9104 takes unsigned integer instead of boolean.
9105
1abce4a6
L
91062009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9107
9108 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9109 (two_file_test_LDADD): Likewise.
9110 (common_test_1_LDADD): Likewise.
9111 (exception_test_LDADD) Likewise.
9112 (weak_test_LDADD): Likewise.
9113 (many_sections_test_LDADD): Likewise.
9114 (initpri1_LDADD): Likewise.
9115 (script_test_1_LDADD): Likewise.
9116 (script_test_2_LDADD): Likewise.
9117 (justsyms_LDADD): Likewise.
9118 (binary_test_LDADD): Likewise.
9119 (large_LDADD): Likewise.
9120 * testsuite/Makefile.in: Regenerated.
9121
adcf2816 91222009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9123
adcf2816
L
9124 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9125 (Symbol_table::override_with_special): Likewise.
9126 (Symbol_table::add_from_object): Likewise.
9127
28e67f5d
RÁE
91282009-12-04 Rafael Avila de Espindola <espindola@google.com>
9129
9130 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9131 Don't set the data_offset twice.
9132
ae10a101
RÁE
91332009-12-04 Rafael Avila de Espindola <espindola@google.com>
9134
9135 * testsuite/Makefile.in: Regenerate.
9136
f59f41f3
DK
91372009-12-03 Doug Kwan <dougkwan@google.com>
9138
9139 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9140 (Target_arm::do_finalize_sections): Add parameter for symbol table
9141 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9142 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9143 parameter for symbol table pointer.
9144 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9145 an additional parameter for a pointer to symbol table.
9146 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9147 parameter for a symbol table pointer.
9148 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9149 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9150 Ditto.
9151 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9152 parameter for a symbol table pointer.
9153
ca55d848
RÁE
91542009-12-03 Rafael Avila de Espindola <espindola@google.com>
9155
9156 * incremental.cc (Incremental_inputs_header)
9157 (Incremental_inputs_header_write, Incremental_inputs_entry)
9158 (Incremental_inputs_entry_write): Move ...
9159 * incremental.h (Incremental_inputs_header)
9160 (Incremental_inputs_header_write, Incremental_inputs_entry)
9161 (Incremental_inputs_entry_write): here.
9162
3aec4f9c
RÁE
91632009-12-02 Rafael Avila de Espindola <espindola@google.com>
9164
9165 * incremental.cc (make_sized_incremental_binary): Set the target.
9166 Error if it is incompatible.
9167 * output.h (Output_file): Add filename method.
9168
9c0ae74d
RÁE
91692009-12-02 Rafael Avila de Espindola <espindola@google.com>
9170
9171 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9172 from the get_* methods.
9173
a45500ae
RÁE
91742009-12-02 Rafael Avila de Espindola <espindola@google.com>
9175
9176 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9177 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9178 Write 0 for the data_offset of scripts.
9179
325e6408
RÁE
91802009-12-02 Rafael Avila de Espindola <espindola@google.com>
9181
9182 * testsuite/Makefile.am: Add the incremental_test.sh test.
9183 * testsuite/incremental_test.sh: New.
9184 * testsuite/incremental_test_1.c: New.
9185 * testsuite/incremental_test_2.c: New.
9186
954c3e2e
RÁE
91872009-12-01 Rafael Avila de Espindola <espindola@google.com>
9188
703d02da 9189 * incremental-dump.cc (main): Fix typos.
954c3e2e 9190
f8086623
RÁE
91912009-11-27 Rafael Avila de Espindola <espindola@google.com>
9192
9193 PR gold/11025
9194 * incremental-dump.cc (main): Use llu to print 64 bit values.
9195
3b0dd6ac
L
91962009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9197 H.J. Lu <hongjiu.lu@intel.com>
9198
9199 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9200 $(LIBDL).
9201 (incremental_dump_LDADD): Likewise.
9202 * Makefile.in: Regenerated.
9203
a6d1ef57 92042009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9205
a6d1ef57
DK
9206 Revert:
9207
9208 2009-11-25 Doug Kwan <dougkwan@google.com>
9209
9210 * arm.cc (Target_arm::Target_arm): Move method definition
9211 outside of class definition. Add code to handle
9212 --target1-rel, --target1-abs and --target2= options.
9213 (Target_arm::get_reloc_reloc_type): Change method to be
9214 non-static and const.
9215 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9216 New data member declaration.
9217 (Target_arm::Scan::local, Target_arm::Scan::global,
9218 Target_arm::Relocate::relocate,
9219 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9220 Adjust call to Target_arm::get_real_reloc_type.
9221 (Target_arm::get_real_reloc_type): Use command line options
9222 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9223 * options.h (--target1-rel, --target1-abs, --target2): New
9224 ARM-only options.
9225
50aeb7d4
DK
92262009-11-25 Doug Kwan <dougkwan@google.com>
9227
9228 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9229 class definition. Add code to handle --target1-rel, --target1-abs
9230 and --target2= options.
9231 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9232 and const.
9233 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9234 member declaration.
9235 (Target_arm::Scan::local, Target_arm::Scan::global,
9236 Target_arm::Relocate::relocate,
9237 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9238 call to Target_arm::get_real_reloc_type.
9239 (Target_arm::get_real_reloc_type): Use command line options to
9240 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9241 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9242 options.
9243
51938283
DK
92442009-11-25 Doug Kwan <dougkwan@google.com>
9245
9246 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9247 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9248 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9249 formatting.
9250 (Arm_relocate_functions::thm_call): Replace body with a call to
9251 Arm_relocate_functions::thumb_branch_common.
9252 (Arm_relocate_functions::thm_jump24,
9253 Arm_relocate_functions::thm_xpc22): New method definitions.
9254 (Arm_relocate_functions::thumb_branch_common): New method definition.
9255 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9256 operator.
9257 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9258 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9259
e2b8f3c4
RÁE
92602009-11-24 Rafael Avila de Espindola <espindola@google.com>
9261
9262 * Makefile.am: Build incremental-dump
9263 * Makefile.in: Regenerate.
9264 * incremental-dump.cc: New.
9265 * incremental.cc (Incremental_inputs_header_data,
9266 Incremental_inputs_entry_data): Move to incremental.h
9267 * incremental.h: (Incremental_inputs_header_data,
9268 Incremental_inputs_entry_data): Move from incremental.cc
9269
bcba9aec
RÁE
92702009-11-24 Rafael Avila de Espindola <espindola@google.com>
9271
9272 * incremental.cc (Incremental_inputs_header,
9273 Incremental_inputs_header_write, Incremental_inputs_entry,
9274 Incremental_inputs_entry_write): Add a typedef with the data type.
9275
7c3afe08
RÁE
92762009-11-24 Rafael Avila de Espindola <espindola@google.com>
9277
9278 * incremental.cc (Incremental_inputs_header,
9279 Incremental_inputs_header_write, Incremental_inputs_entry,
9280 Incremental_inputs_entry_write): Update comment about which
9281 type has the filed descriptions.
9282
d204b6e9
DK
92832009-11-15 Doug Kwan <dougkwan@google.com>
9284
9285 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9286 (Arm_relocate_functions::arm_branch_common): Change method defintion
9287 in class definition to a method declaration and update list of formal
9288 parameters.
9289 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9290 Arm_relocation_functions::jump24): Adjust call to
9291 Arm_relocate_functions::arm_branch_common. Update list of formal
9292 parameters.
9293 (Arm_relocate_functions::xpc25): New method definition.
9294 (Arm_relocate_functions::arm_branch_common): Move method defintion
9295 out from class definition. Use stubs for mode-switching and extending
9296 branch ranges.
9297 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9298 specially. Change code to enable use of stubs in ARM branches.
9299
43d12afe
DK
93002009-11-10 Doug Kwan <dougkwan@google.com>
9301
9302 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9303 in method declaration.
9304 (Target_arm::relocate_stub): New method declaration.
9305 (Target_arm::default_target): Change to return a pointer instead of
9306 a const reference.
9307 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9308 Target_arm::default_target.
9309 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9310 method definition.
9311 (Target_arm::relocate_section): Adjust view.
9312 (Target_arm::relocate_stub): New method definition.
9313
ac33a407
DK
93142009-11-10 Doug Kwan <dougkwan@google.com>
9315
9316 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9317 a format warning.
9318 * incremental.cc (open_incremental_binary): Initialized local
9319 variables to avoid warnings.
9320 * object.cc (make_elf_object): Ditto.
9321 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9322 a format warning.
e1df38aa 9323
88ee28e9
L
9324009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9325
9326 PR gold/10930
9327 * testsuite/plugin_test.c: Include "config.h".
9328
2daedcd6
DK
93292009-11-09 Doug Kwan <dougkwan@google.com>
9330
9331 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9332 (arm_symbol_value): Remove.
9333 (Arm_relocate_functions::arm_branch_common,
9334 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9335 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9336 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9337 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9338 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9339 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9340 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9341 Arm_relocate_functions::thm_mobw_abs_nc,
9342 Arm_relocate_functions::thm_mov_abs,
9343 Arm_relocate_functions::movw_prel_nc,
9344 Arm_relocate_functions::thm_movt_abs,
9345 Arm_relocate_functions::movt_prel,
9346 Arm_relocate_functions::thm_movw_prel_nc,
9347 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9348 (Target_arm::Relocate::relocate): Only decompose address into two
9349 parts if relocation type uses the thumb-bit and pass the actual
9350 bit instead of a flag indicating that the thumb-bit is used. Adjust
9351 calls to methods in Arm_relocate_functions for this change.
9352
1276bc89 93532009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9354
9355 PR 10925
9356 * reloc.cc: Instantiate
9357 Sized_relobj::initialize_input_to_output_maps and
9358 Sized_relobj:free_input_to_output_maps.
9359
e53ad1b5
ILT
93602009-11-06 Ian Lance Taylor <iant@google.com>
9361
9362 PR 10876
9363 * defstd.cc (in_segment): Set only_if_ref true for "end".
9364
eb44217c
DK
93652009-11-06 Doug Kwan <dougkwan@google.com>
9366
9367 * arm.cc (class Reloc_stub): Correct a comment.
9368 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9369 (Target_arm::scan_section_for_stubs): New method declaration.
9370 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9371 Change methods from private to protected.
9372 (Target_arm::do_may_relax): New method definition.
9373 (Target_arm::do_relax, Target_arm::group_sections,
9374 Target_arm::scan_reloc_for_stub,
9375 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9376 (Target_arm::arm_input_section_map_): New data member declaration.
9377 (Target_arm::scan_reloc_for_stub,
9378 Target_arm::scan_reloc_section_for_stubs,
9379 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9380 Target_arm::do_relax): New method definitions.
9381
5d329b7d
ILT
93822009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9383
9384 * configure.ac: Check for (struct stat)::st_mtim
9385 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9386 * config.in: Regenerate.
9387 * configure: Regenerate.
9388
96a0d71b
ILT
93892009-11-05 Ian Lance Taylor <iant@google.com>
9390
9391 PR 10910
9392 * output.cc (Output_segment::add_output_section): Add missing
9393 return statement.
9394
594c8e5e
ILT
93952009-11-04 Ian Lance Taylor <iant@google.com>
9396
9397 PR 10880
9398 * object.h (class Object): Add is_needed and set_is_needed
9399 methods. Add is_needed_ field. Make bool fields into bitfields.
9400 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
9401 defined in a dynamic object and referenced by a regular object,
9402 set is_needed for the dynamic object.
9403 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
9404 if the file is marked with as_needed and it is not needed.
9405
22b127cc
ILT
94062009-11-04 Ian Lance Taylor <iant@google.com>
9407
9408 PR 10887
9409 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
9410 tags if data is discarded by linker script.
9411 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9412 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9413 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9414 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9415
f5c870d2
ILT
94162009-11-04 Ian Lance Taylor <iant@google.com>
9417
9418 * layout.cc (Layout::get_output_section): Add is_interp and
9419 is_dynamic_linker_section parameters. Change all callers.
9420 (Layout::choose_output_section): Likewise.
9421 (Layout::make_output_section): Likewise.
9422 (Layout::add_output_section_data): Add is_dynamic_linker_section
9423 parameter. Change all callers.
9424 * layout.h (class Layout): Update declarations.
9425 * output.h (class Output_section): Add is_interp, set_is_interp,
9426 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
9427 Add is_interp_, is_dynamic_linker_section_ fields. Change
9428 generate_code_fills_at_write_ to a bitfield.
9429 * output.cc (Output_section::Output_sections): Initialize new
9430 fields.
9431 (Output_segment::add_output_section): Add do_sort parameter.
9432 Change all callers.
9433
1ae4d23b
ILT
94342009-11-03 Ian Lance Taylor <iant@google.com>
9435
9436 PR 10860
9437 * options.h (class General_options): Add --warn-common.
9438 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
9439 merging two common symbols.
9440 (Symbol_table::should_override): Handle --warn-common when merging
9441 a common symbol with a defined symbol. Use report_resolve_problem
9442 for multiple definitions.
9443 (Symbol_table::report_resolve_problem): New function.
9444 * symtab.h (class Symbol_table): Declare report_resolve_problem.
9445
55da9579
DK
94462009-11-03 Doug Kwan <dougkwan@google.com>
9447
9448 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
9449 stub_factory_.
9450 (Target_arm::stub_factory): New method definition.
9451 (Target_arm::new_arm_input_section,
9452 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
9453 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 9454 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
9455 New type definitions.
9456 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
9457 member declarations.
9458 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
9459 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
9460 New method definitions.
9461
37a9ac43
ILT
94622009-11-03 Ian Lance Taylor <iant@google.com>
9463
9464 * options.h (class General_options): Add --warn_constructors.
9465
b3d6a3d4
ILT
94662009-11-03 Ian Lance Taylor <iant@google.com>
9467
9468 PR 10893
9469 * defstd.cc (in_section): Add entries for __rel_iplt_start,
9470 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
9471
934b01dd
ILT
94722009-11-03 Ian Lance Taylor <iant@google.com>
9473
9474 PR 10895
9475 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
9476 --msgid-bugs-address.
9477 (install-pdf): New target.
9478 (install-data_yes): Look up one directory to find mkinstalldirs.
9479
03c1939b
L
94802009-11-03 H.J. Lu <hongjiu.lu@intel.com>
9481
9482 * po/Make-in (.po.gmo): Don't generate .gmo files in source
9483 tree.
9484
ebd95253
DK
94852009-10-30 Doug Kwan <dougkwan@google.com>
9486
9487 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
9488
e9bbb538
DK
94892009-10-30 Doug Kwan <dougkwan@google.com>
9490
9491 * arm.cc (Stub_addend_reader): New struct template definition
9492 and partial specializations.
9493 (Stub_addend_reader::operator()): New method definition for a
9494 partially specialized template.
9495
d5b40221
DK
94962009-10-30 Doug Kwan <dougkwan@google.com>
9497
9498 * arm.cc (Arm_relobj::processor_specific_flags): New method
9499 definition.
9500 (Arm_relobj::do_read_symbols): New method declaration.
9501 (Arm_relobj::processor_specific_flags_): New data member declaration.
9502 (Arm_dynobj): New class definition.
9503 (Target_arm::do_finalize_sections): Add input_objects parameter.
9504 (Target_arm::do_adjust_elf_header): New method declaration.
9505 (Target_arm::are_eabi_versions_compatible,
9506 (Target_arm::merge_processor_specific_flags): New method declaration.
9507 (Target_arm::do_make_elf_object): New overloaded method definitions
9508 and declaration.
9509 (Arm_relobj::do_read_symbols): New method definition.
9510 (Arm_dynobj::do_read_symbols): Ditto.
9511 (Target_arm::do_finalize_sections): Add input_objects parameters.
9512 Merge processor-specific flags from all input objects.
9513 (Target_arm::are_eabi_versions_compatible,
9514 Target_arm::merge_processor_specific_flags,
9515 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
9516 New method definitions.
9517 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
9518 Input_objects pointer type parameter.
9519 * layout.cc (Layout::finalize): Pass input objects to target's.
9520 finalize_sections function.
9521 * output.cc (Output_file_header::do_sized_write): Set ELF file
9522 header's processor-specific flags.
9523 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
9524 Input_objects pointer type parameter.
9525 * sparc.cc (Target_sparc::do_finalize_sections): Same.
9526 * target.h (Input_objects): New forward class declaration.
9527 (Target::processor_specific_flags,
9528 Target::are_processor_specific_flags_sect): New method definitions.
9529 (Target::finalize_sections): Add input_objects parameter.
9530 (Target::Target): Initialize processor_specific_flags_ and
9531 are_processor_specific_flags_set_.
9532 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
9533 parameter.
9534 (Target::set_processor_specific_flags): New method definition.
9535 (Target::processor_specific_flags_,
9536 Target::are_processor_specific_flags_set_): New data member
9537 declarations.
9538 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
9539 Input_objects pointer type parameter.
9540
ebabffbd
DK
95412009-10-30 Doug Kwan <dougkwan@google.com>
9542
9543 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
9544
ad0f2072
ILT
95452009-10-28 Ian Lance Taylor <iant@google.com>
9546
9547 * object.h (class Relobj): Drop options parameter from
9548 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
9549 do_scan_relocs, do_relocate. Change all callers.
9550 (class Sized_relobj): Drop options parameters from
9551 do_gc_process_relocs, do_scan_relocs, do_relocate,
9552 do_relocate_sections, relocate_sections, emit_relocs_scan,
9553 emit_relocs_scan_reltype. Change all callers.
9554 (struct Relocate_info): Remove options field and all references to
9555 it.
9556 * reloc.h (class Read_relocs): Remove options constructor
9557 parameter and options_ field. Change all callers.
9558 (class Gc_process_relocs, class Scan_relocs): Likewise.
9559 (class Relocate_task): Likewise.
9560 * target-reloc.h (scan_relocs): Remove options parameter. Change
9561 all callers.
9562 (scan_relocatable_relocs): Likewise.
9563 * target.h (class Sized_target): Remove options parameter from
9564 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
9565 all callers.
9566 * gc.h (gc_process_relocs): Remove options parameter. Change all
9567 callers.
9568 * arm.cc: Update functions to remove options parameters.
9569 * i386.cc: Likewise.
9570 * powerpc.cc: Likewise.
9571 * sparc.cc: Likewise.
9572 * x86_64.cc: Likewise.
9573 * testsuite/testfile.cc: Likewise.
9574
8ffa3667
DK
95752009-10-28 Doug Kwan <dougkwan@google.com>
9576
9577 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9578 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9579 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9580 New method definitions.
9581
40f36857
CC
95822009-10-28 Cary Coutant <ccoutant@google.com>
9583
9584 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9585 (Plugin::cleanup_done_): New member.
9586 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9587 (Plugin_manager::cleanup_done_): Remove.
9588 (Plugin_manager::add_input_file): Edit error message.
9589 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9590 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9591
2c849493
ILT
95922009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9593
9594 * fileread.cc: (File_read::View::~View): Use the new
9595 data_ownership_ filed.
9596 (File_read::~File_read): Dispose the new whole_file_view_.
9597 (File_read::open): Mmap the whole file if needed.
9598 (File_read::open): Use whole_file_view_ instead of contents_.
9599 (File_read::find_view): Use whole_file_view_ if applicable.
9600 (File_read::do_read): Use whole_file_view_ instead of contents_.
9601 (File_read::make_view): Use whole_file_view_ instead of contents_,
9602 update File_read::View::View call.
9603 (File_read::find_or_make_view): Update File_read::View::View
9604 call.
9605 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9606 remove contents_
9607 (File_read::View::Data_ownership): New enum.
9608 (File_read::View::View): Replace bool mapped_ with Data_ownership
9609 argument.
9610 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9611 (File_read::View::data_ownership_): New field.
9612 (File_read::contents_): Remove (replaced by whole_file_view_).
9613 (File_read::whole_file_view_): New field.
9614 * options.h (class General_options): Add --keep-files-mapped.
9615
24998053
CC
96162009-10-27 Cary Coutant <ccoutant@google.com>
9617
9618 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9619 * testsuite/Makefile.am (plugin_test_5): New test case.
9620 * testsuite/Makefile.in: Regenerate.
9621
72adc4fa
DK
96222009-10-25 Doug Kwan <dougkwan@google.com>
9623
9624 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9625 from private to protected to allow access by child class.
9626 (Sized_relobj::do_relocate_sections): New method declaration.
9627 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9628 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9629 Sized_relobj::relocate_sections. Instantiate template explicitly
9630 for different target sizes and endianity.
9631
07f508a2
DK
96322009-10-24 Doug Kwan <dougkwan@google.com>
9633
9634 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9635 (Arm_input_section::as_arm_input_section): New method.
9636 (Arm_output_section): New class definition.
9637 (Arm_output_section::create_stub_group,
9638 Arm_output_section::group_sections): New method definitions.
9639
10ad9fe5
DK
96402009-10-22 Doug Kwan <dougkwan@google.com>
9641
9642 * arm.cc (Arm_input_section): New class definition.
9643 (Arm_input_section::init, Arm_input_section:do_write,
9644 Arm_input_section::set_final_data_size,
9645 Arm_input_section::do_reset_address_and_file_offset): New method
9646 definitions.
9647
56ee5e00
DK
96482009-10-21 Doug Kwan <dougkwan@google.com>
9649
9650 * arm.cc (Stub_table, Arm_input_section): New forward class
9651 declarations.
9652 (Stub_table): New class defintion.
9653 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9654 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9655 New method definition.
9656
b569affa
DK
96572009-10-21 Doug Kwan <dougkwan@google.com>
9658
9659 * arm.cc: Update copyright comments.
9660 (Target_arm): New forward class template declaration.
9661 (Arm_address): New type.
9662 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9663 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9664 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9665 constants.
9666 (Insn_template): Same.
9667 (DEF_STUBS): New macro.
9668 (Stub_type): New enum type.
9669 (Stub_template): New class definition.
9670 (Stub): Same.
9671 (Reloc_stub): Same.
9672 (Stub_factory): Same.
9673 (Target_arm::Target_arm): Initialize may_use_blx_ and
9674 should_force_pic_veneer_.
9675 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9676 Target_arm::should_force_pic_veneer,
9677 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9678 Target_arm::using_thumb_only, Target_arm:;default_target): New
9679 method defintions.
9680 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9681 New data member declarations.
9682 (Insn_template::size, Insn_template::alignment): New method defintions.
9683 (Stub_template::Stub_template): New method definition.
9684 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9685 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9686 (Stub_factory::Stub_factory): New method definition.
9687 * gold.h (string_hash): New template.
9688 * output.h (Input_section_specifier::hash_value): Use
9689 gold::string_hash.
9690 (Input_section_specifier::string_hash): Remove.
9691 * stringpool.cc (Stringpool_template::string_hash): Use
9692 gold::string_hash.
9693
6c172549
DK
96942009-10-20 Doug Kwan <dougkwan@google.com>
9695
9696 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9697 symbols of relaxed input sections.
9698 * output.h (Output_section::find_relaxed_input_section): Make
9699 method public.
9700
c5617f2f
DK
97012009-10-16 Doug Kwan <dougkwan@google.com>
9702
9703 * dynobj.cc (Versions::Versions): Initialize version_script_.
9704 Only insert base version symbol definition for a shared object
9705 if version script defines any version versions.
9706 (Versions::define_base_version): New method definition.
9707 (Versions::add_def): Check that base version is not needed.
9708 (Versions::add_need): Define base version lazily.
9709 * dynobj.h (Versions::define_base_version): New method declaration.
9710 (Versions::needs_base_version_): New data member declaration.
9711 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9712 (check_DATA): Add no_version_test.stdout.
9713 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9714 New make rules.
9715 * testsuite/Makefile.in: Regenerate.
9716 * testsuite/no_version_test.c: New file.
9717 * testsuite/no_version_test.sh: Ditto.
9718
3c12dcdb
DK
97192009-10-16 Doug Kwan <dougkwan@google.com>
9720
9721 * expression.cc (class Segment_start_expression): New class definition.
9722 (Segment_start_expression::value): New method definition.
9723 (script_exp_function_segment_start): Return a new
9724 Segment_start_expression.
9725 * gold/script-c.h (script_saw_segment_start_expression): New function
9726 prototype.
9727 * script-sections.cc (Script_sections::Script_sections): Initialize
9728 SAW_SEGMENT_START_EXPRESSION_ to false.
9729 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9730 and -Tbbs options to specify section addresses if given in
9731 command line and no SEGMENT_START expression is seen in a script.
9732 * script-sections.h (Script_sections::saw_segment_start_expression,
9733 Script_sections::set_saw_segment_start_expression): New method
9734 definition.
9735 (Script_sections::saw_segment_start_expression_): New data member
9736 declaration.
9737 * script.cc (script_saw_segment_start_expression): New function.
9738 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9739 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9740 script_test_7.sh and script_test_8.sh.
9741 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9742 script_test_8.stdout.
9743 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9744 (script_test_6, script_test_6.stdout, script_test_7,
9745 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9746 * Makefile.in: Regenerate.
9747 * testsuite/script_test_6.sh: New file.
9748 * testsuite/script_test_6.t: Same.
9749 * testsuite/script_test_7.sh: Same.
9750 * testsuite/script_test_7.t: Same.
9751 * testsuite/script_test_8.sh: Same.
9752
64b1ae37
DK
97532009-10-16 Doug Kwan <dougkwan@google.com>
9754
9755 * output.cc (Output_segment::set_section_list_address): Cast
9756 expressions to unsigned long long type to avoid format warnings.
9757
661be1e2
ILT
97582009-10-15 Ian Lance Taylor <iant@google.com>
9759
12edd763 9760 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9761 dot assignment to script_sections_.
12edd763
ILT
9762 * script-sections.cc (Script_sections::add_dot_assignment):
9763 Initialize if necessary.
9764
68b6574b
ILT
9765 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9766 program headers with no load segment if there is a linker script.
9767
661be1e2
ILT
9768 * layout.cc (Layout::set_segment_offsets): Align the file offset
9769 to the segment aligment for -N or -n with no load segment.
9770 * output.cc (Output_segment::add_output_section): Don't crash if
9771 the first section is a TLS section.
9772 (Output_segment::set_section_list_addresses): Print an error
9773 message if the address moves backward in a linker script.
9774 * script-sections.cc
9775 (Output_section_element_input::set_section_addresses): Don't
9776 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9777 (Orphan_output_section::set_section_addresses): Likewise.
9778
f15f61a7
DK
97792009-10-15 Doug Kwan <dougkwan@google.com>
9780
9781 * layout.cc (Layout::finish_dynamic_section): Generate tags
9782 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9783 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9784 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9785
82bb573a
ILT
97862009-10-14 Ian Lance Taylor <iant@google.com>
9787
9788 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9789 fields.
9790 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9791 data_shdr fields of relinfo.
9792 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9793 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9794 R_386_TLS_LDO_32, adjust based on section flags.
9795 (Target_i386::Relocate::fix_up_ldo): Remove.
9796
374ad285
ILT
97972009-10-13 Ian Lance Taylor <iant@google.com>
9798
9799 Add support for -pie.
9800 * options.h (class General_options): Add -pie and
9801 --pic-executable.
9802 (General_options::output_is_position_independent): Test -pie.
9803 (General_options::output_is_executable): Return true if not shared
9804 and not relocatable.
9805 (General_options::output_is_pie): Remove.
9806 * options.cc (General_options::finalize): Reject incompatible uses
9807 of -pie.
9808 * gold.cc (queue_middle_tasks): A -pie link is not static.
9809 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9810 * symtab.cc (Symbol::final_value_is_known): Return false if
9811 output_is_position_independent.
9812 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9813 output_is_position_independent.
9814 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9815 output_is_position_independent.
9816 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9817 output_is_position_independent.
9818 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9819 two_file_pie_test.
9820 (basic_pie_test.o, basic_pie_test): New targets.
9821 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9822 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9823 (two_file_pie_test): New target.
9824 * testsuite/Makefile.in: Rebuild.
9825 * README: Remove note saying that -pie is not supported.
9826
c6585162
ILT
98272009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9828
9829 * options.h (class General_options): Add -init and -fini.
9830 * layout.cc (Layout::finish_dynamic_section): Emit
9831 given init and fini functions.
9832
032ce4e9
ST
98332009-10-13 Sriraman Tallam <tmsriram@google.com>
9834
9835 * gc.h (gc_process_relocs): Check if icf is enabled using new
9836 function.
9837 * gold.cc (queue_initial_tasks): Likewise.
9838 (queue_middle_tasks): Likewise.
9839 * object.cc (do_layout): Likewise.
9840 * symtab.cc (is_section_folded): Likewise.
9841 * main.cc (main): Likewise.
9842 * reloc.cc (Read_relocs::run): Likewise.
9843 (Sized_relobj::do_scan_relocs): Likewise.
9844 * icf.cc (is_function_ctor_or_dtor): New function.
9845 (Icf::find_identical_sections): Check if function is ctor or dtor when
9846 safe icf is chosen.
9847 * options.h (General_options::icf): Change option to be an enum.
9848 (Icf_status): New enum.
9849 (icf_enabled): New method.
9850 (icf_safe_folding): New method.
9851 (set_icf_status): New method.
9852 (icf_status_): New variable.
9853 * (options.cc) (General_options::finalize): Set icf_status_.
9854 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9855 icf_test and icf_keep_unique_test to use the --icf enum flag.
9856 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9857 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9858
f345227a
ST
98592009-10-12 Sriraman Tallam <tmsriram@google.com>
9860
9861 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9862 includes to gc.h and icf.h.
9863 * arm.cc: Include gc.h.
9864 * gold.cc: Likewise.
9865 * i386.cc: Likewise.
9866 * powerpc.cc: Likewise.
9867 * sparc.cc: Likewise.
9868 * x86_64.cc: Likewise.
9869 * gc.h: Include icf.h.
9870
1c7814ed
ILT
98712009-10-11 Ian Lance Taylor <iant@google.com>
9872
9873 * plugin.cc: Include "gold.h" before other header files.
9874
ae3b5189
CD
98752009-10-10 Chris Demetriou <cgd@google.com>
9876
9877 * options.h (Input_file_argument::Input_file_type): New enum.
9878 (Input_file_argument::is_lib_): Replace with...
9879 (Input_file_argument::type_): New member.
9880 (Input_file_argument::Input_file_argument): Take Input_file_type
9881 'type' rather than boolean 'is_lib' as second argument.
9882 (Input_file_argument::is_lib): Use type_.
9883 (Input_file_argument::is_searched_file): New function.
9884 (Input_file_argument::may_need_search): Handle is_searched_file.
9885 * options.cc (General_options::parse_library): Support -l:filename.
9886 (General_options::parse_just_symbols): Update for Input_file_argument
9887 changes.
9888 (Command_line::process): Likewise.
9889 * archive.cc (Archive::get_file_and_offset): Likewise.
9890 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9891 * script.cc (read_script_file, script_add_file): Likewise.
9892 * fileread.cc (Input_file::Input_file): Likewise.
9893 (Input_file::will_search_for): Handle is_searched_file.
9894 (Input_file::open): Likewise.
9895 * readsyms.cc (Read_symbols::get_name): Likewise.
9896 * testsuite/Makefile.am (searched_file_test): New test.
9897 * testsuite/Makefile.in: Regenerate.
9898 * testsuite/searched_file_test.cc: New file.
9899 * testsuite/searched_file_test_lib.cc: New file.
9900
f3048a1d
ILT
99012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9902 Ian Lance Taylor <iant@google.com>
9903
9904 * descriptor.cc: Include <cstdio> and "binary-io.h".
9905 (Descriptors::open): Open the files in binary mode always.
9906 * script.cc (Lex::get_token): Treat \r as whitespace.
9907
d4780e57
ILT
99082009-10-09 Ian Lance Taylor <iant@google.com>
9909
9910 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9911
d9a893b8
ILT
99122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9913 Ian Lance Taylor <iant@google.com>
9914
9915 * configure.ac: Check for readv function also.
9916 * fileread.cc (readv): Define if not HAVE_READV.
9917 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9918 does not exist.
9919 * config.in: Regenerate.
9920 * configure: Regenerate.
9921
c0a62865
DK
99222009-10-09 Doug Kwan <dougkwan@google.com>
9923
9924 * layout.cc (Layout::make_output_section): Call target hook to make
9925 ordinary output section.
9926 (Layout::finalize): Adjust parameter list of call the
9927 Target::may_relax().
9928 * layout.h (class Layout::section_list): New method.
9929 * merge.h (Output_merge_base::entsize): Change visibility to public.
9930 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9931 New methods.
9932 (Output_merge_string::do_is_string): New method.
9933 * object.cc (Sized_relobj::do_setup): renamed from
9934 Sized_relobj::set_up.
9935 * object.h (Sized_relobj::adjust_shndx,
9936 Sized_relobj::initializ_input_to_output_maps,
9937 Sized_relobj::free_input_to_output_maps): Change visibilities to
9938 protected.
9939 (Sized_relobj::setup): Virtualize.
9940 (Sized_relobj::do_setup): New method declaration.
9941 (Sized_relobj::invalidate_section_offset,
9942 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9943 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9944 * options.cc (parse_int): New function.
9945 * options.h (parse_int): New declaration.
9946 (DEFINE_int): New macro.
9947 (stub_group_size): New option.
9948 * output.cc (Output_section::Output_section): Initialize memebers
9949 merge_section_map_, merge_section_by_properties_map_,
9950 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9951 (Output_section::add_input_section): Handled deferred code-fill
9952 generation and remove an old comment.
9953 (Output_section::add_relaxed_input_section): New method definition.
9954 (Output_section::add_merge_input_section): Use merge section by
9955 properties map to speed to search. Update merge section maps
9956 as appropriate.
9957 (Output_section::build_relaxation_map): New method definition.
9958 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9959 Same.
9960 (Output_section::relax_input_section): Renamed to
9961 Output_section::convert_input_sections_to_relaxed_sections and change
9962 interface to take a vector of pointers to relaxed sections.
9963 (Output_section::find_merge_section,
9964 Output_section::find_relaxed_input_section): New method definitions.
9965 (Output_section::is_input_address_mapped,
9966 Output_section::output_offset, Output_section::output_address):
9967 Use output section data maps to speed up searching.
9968 (Output_section::find_starting_output_address): Add comments.
9969 (Output_section::do_write,
9970 Output_section::write_to_postprocessing_buffer): Do code-fill
9971 generation as appropriate.
9972 (Output_section::get_input_sections): Invalidate relaxed input section
9973 map.
9974 (Output_section::restore_states): Adjust type of checkpoint .
9975 Invalidate relaxed input section map.
9976 * output.h (Output_merge_base): New class declaration.
9977 (Input_section_specifier): New class defintion.
9978 (class Output_relaxed_input_section) Change base class to
9979 Output_section_data_build.
9980 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9981 base class initializer.
9982 (Output_section::add_relaxed_input_section): New method declaration.
9983 (Output_section::Input_section): Change visibility to protected.
2e702c99 9984 (Output_section::Input_section::relobj,
c0a62865
DK
9985 Output_section::Input_section::shndx): Handle relaxed input sections.
9986 Output_section::input_sections) Change visibility to protected. Also
9987 define overload to return a non-const pointer.
9988 (Output_section::Merge_section_properties): New class defintion.
9989 (Output_section::Merge_section_by_properties_map,
9990 Output_section::Output_section_data_by_input_section_map,
9991 Output_section::Relaxation_map): New types.
9992 (Output_section::relax_input_section): Rename method to
9993 Output_section::convert_input_sections_to_relaxed_sections and change
9994 interface to take a vector of relaxed section pointers.
9995 (Output_section::find_merge_section,
9996 Output_section::find_relaxed_input_section,
9997 Output_section::build_relaxation_map,
9998 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9999 New method declarations.
10000 (Output_section::merge_section_map_
10001 Output_section::merge_section_by_properties_map_,
10002 Output_section::relaxed_input_section_map_,
10003 Output_section::is_relaxed_input_section_map_valid_,
10004 Output_section::generate_code_fills_at_write_): New data members.
10005 * script-sections.cc
10006 (Output_section_element_input::set_section_addresses): Call
10007 current_data_size and addralign methods of relaxed input sections.
10008 (Orphan_output_section::set_section_addresses): Call current_data_size
10009 and addralign methods of relaxed input sections.
10010 * symtab.cc (Symbol_table::compute_final_value): Extract template
10011 from the body of Symbol_table::sized_finalize_symbol.
10012 (Symbol_table::sized_finalized_symbol): Call
10013 Symbol_table::compute_final_value.
10014 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10015 (Symbol_table::compute_final_value): New templated method declaration.
10016 * target.cc (Target::do_make_output_section): New method defintion.
10017 * target.h (Target::make_output_section): New method declaration.
10018 (Target::relax): Add more parameters for input objects, symbol table
10019 and layout. Adjust call to do_relax.
10020 (Target::do_make_output_section): New method declaration.
10021 (Target::do_relax): Add parameters for input objects, symbol table
10022 and layout.
10023
d446d6c4
ILT
100242009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10025
10026 * pread.c: Include stdio.h.
10027
bc06c745
ILT
100282009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10029
10030 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10031 defined.
10032
75aea3d0
ILT
100332009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10034
10035 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10036 Change read_shndx type to unsigned int.
10037 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10038 int.
10039 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10040 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10041 Change read_shndx type to unsigned int.
10042 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10043 int.
10044 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10045 * layout.cc (Layout::create_symtab_sections): Cast the result of
10046 local_symcount * symsize to off_t in the gold_assert.
10047
be8fcb75
ILT
100482009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10049
10050 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10051 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10052 R_ARM_BASE_ABS.
10053 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10054 (Arm_relocate_functions::thm_abs5): New function.
10055 (Arm_relocate_functions::abs12): New function.
10056 (Arm_relocate_functions::abs16): New function.
10057 (Arm_relocate_functions::base_abs): New function.
10058 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10059 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10060 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10061 R_ARM_BASE_ABS.
10062 (Scan::global): Likewise.
10063 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10064 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10065 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10066 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10067 R_ARM_BASE_ABS.
10068
c2a122b6
ILT
100692009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10070
10071 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10072 (Arm_relocate_functions::movt_prel): New function.
10073 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10074 (Arm_relocate_functions::thm_movt_prel): New function.
10075 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10076 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10077 (Scan::global, Relocate::relocate): Likewise.
10078 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10079
c4aa1e2d
ILT
100802009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10081
10082 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10083 Incremental_checker.
10084 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10085 unsigned int.
10086 (class Incremental_inputs_header): New class.
10087 (Incremental_inputs_header_writer): Edit comment.
10088 (Incremental_inputs_entry): New class.
10089 (Incremental_inputs_entry_writer): Edit comment.
10090 (Sized_incremental_binary::do_find_incremental_inputs_section):
10091 Add *strtab_shndx parameter, fill it.
10092 (Sized_incremental_binary::do_check_inputs): New method.
10093 (Incremental_checker::can_incrementally_link_output_file): Use
10094 Sized_incremental_binary::check_inputs.
10095 (Incremental_inputs::report_command_line): Save command line in
10096 command_line_.
10097 * incremental.h:
10098 (Incremental_binary::find_incremental_inputs_section): New
10099 method.
10100 (Incremental_binary::do_find_incremental_inputs_section): Add
10101 strtab_shndx parameter.
10102 (Incremental_binary::do_check_inputs): New pure virtual method.
10103 (Sized_incremental_binary::do_check_inputs): Declare.
10104 (Incremental_checker::Incremental_checker): Add incremental_inputs
10105 parameter, use it to initialize incremental_inputs_.
10106 (Incremental_checker::incremental_inputs_): New field.
10107 (Incremental_checker::command_line): New method.
10108 (Incremental_checker::inputs): New method.
10109 (Incremental_checker::command_line_): New field.
10110
c549a694
ILT
101112009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10112
10113 * incremental.cc: Include <cstdarg> and "target-select.h".
10114 (vexplain_no_incremental): New function.
10115 (explain_no_incremental): New function.
10116 (Incremental_binary::error): New method.
10117 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10118 method.
10119 (make_sized_incremental_binary): New function.
10120 (open_incremental_binary): New function.
10121 (can_incrementally_link_file): Add checks if output is ELF and has
10122 inputs section.
10123 * incremental.h: Include "elfcpp_file.h" and "output.h".
10124 (Incremental_binary): New class.
10125 (Sized_incremental_binary): New class.
10126 (open_incremental_binary): Declare.
10127 * object.cc (is_elf_object): Use
10128 elfcpp::Elf_recognizer::is_elf_file.
10129 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10130 * output.h (Output_file::filesize): New method.
10131
fd3c5f0b
ILT
101322009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10133
10134 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10135 New function.
10136 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10137 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10138 function.
10139 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10140 function.
10141 (Arm_relocate_functions::movw_abs_nc): New function.
10142 (Arm_relocate_functions::movt_abs): New function.
10143 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10144 (Arm_relocate_functions::thm_movt_abs): New function.
10145 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10146 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10147 (Scan::global): Likewise.
10148 (Relocate::relocate): Likewise.
10149 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10150
7f5309a5
ILT
101512009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10152
10153 * arm.cc (Arm_relocate_functions::got_prel) New function.
10154 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10155 (Relocate::relocate): Likewise.
10156 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10157
364c7fa5
ILT
101582009-10-06 Ian Lance Taylor <iant@google.com>
10159
10160 * options.h (class General_options): Define
10161 split_stack_adjust_size parameter.
10162 * object.h (class Object): Add uses_split_stack_ and
10163 has_no_split_stack_ fields. Add uses_split_stack and
10164 has_no_split_stack accessor functions. Declare
10165 handle_split_stack_section.
10166 (class Reloc_symbol_changes): Define.
10167 (class Sized_relobj): Define Function_offsets. Declare
10168 split_stack_adjust, split_stack_adjust_reltype, and
10169 find_functions.
10170 * object.cc (Object::handle_split_stack_section): New function.
10171 (Sized_relobj::do_layout): Call handle_split_stack_section.
10172 * dynobj.cc (Sized_dynobj::do_layout): Call
10173 handle_split_stack_section.
10174 * reloc.cc (Sized_relobj::relocate_sections): Call
10175 split_stack_adjust for executable sections in split_stack
10176 objects. Pass reloc_map to relocate_section.
10177 (Sized_relobj::split_stack_adjust): New function.
10178 (Sized_relobj::split_stack_adjust_reltype): New function.
10179 (Sized_relobj::find_functions): New function.
10180 * target-reloc.h: Include "object.h".
10181 (relocate_section): Add reloc_symbol_changes parameter. Change
10182 all callers.
10183 * target.h (class Target): Add calls_non_split method. Declare
10184 do_calls_non_split virtual method. Declare match_view and
10185 set_view_to_nop.
10186 * target.cc: Include "elfcpp.h".
10187 (Target::do_calls_non_split): New function.
10188 (Target::match_view): New function.
10189 (Target::set_view_to_nop): New function.
10190 * gold.cc (queue_middle_tasks): Give an error if mixing
10191 split-stack and non-split-stack objects with -r.
10192 * i386.cc (Target_i386::relocate_section): Add
10193 reloc_symbol_changes parameter.
10194 (Target_i386::do_calls_non_split): New function.
10195 * x86_64.cc (Target_x86_64::relocate_section): Add
10196 reloc_symbol_changes parameter.
10197 (Target_x86_64::do_calls_non_split): New function.
10198 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10199 parameter.
10200 * powerpc.cc (Target_powerpc::relocate_section): Add
10201 reloc_symbol_changes parameter.
10202 * sparc.cc (Target_sparc::relocate_section): Add
10203 reloc_symbol_changes parameter.
10204 * configure.ac: Call AM_CONDITIONAL for the default target.
10205 * configure: Rebuild.
10206 * testsuite/Makefile.am (TEST_AS): New variable.
10207 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10208 (check_DATA): Add split_i386 and split_x86_64 files.
10209 (SPLIT_DEFSYMS): Define.
10210 (split_i386_[1234n].o): New targets.
10211 (split_i386_[124]): New targets.
10212 (split_i386_[1234r].stdout): New targets.
10213 (split_x86_64_[1234n].o): New targets.
10214 (split_x86_64_[124]): New targets.
10215 (split_x86_64_[1234r].stdout): New targets.
10216 (MOSTLYCLEANFILES): Add new executables.
10217 * testsuite/split_i386.sh: New file.
10218 * testsuite/split_x86_64.sh: New file.
10219 * testsuite/split_i386_1.s: New file.
10220 * testsuite/split_i386_2.s: New file.
10221 * testsuite/split_i386_3.s: New file.
10222 * testsuite/split_i386_4.s: New file.
10223 * testsuite/split_i386_n.s: New file.
10224 * testsuite/split_x86_64_1.s: New file.
10225 * testsuite/split_x86_64_2.s: New file.
10226 * testsuite/split_x86_64_3.s: New file.
10227 * testsuite/split_x86_64_4.s: New file.
10228 * testsuite/split_x86_64_n.s: New file.
10229 * testsuite/testfile.cc (Target_test): Update relocation_section
10230 function.
10231 * testsuite/Makefile.in: Rebuild.
10232
e8a9fcda
ILT
102332009-10-06 Ian Lance Taylor <iant@google.com>
10234
10235 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10236 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10237 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10238 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10239 the address on ldo_addrs_.
10240 (Target_i386::Relocate::fix_up_ldo): New function.
10241
e99daf92
ILT
102422009-10-06 Rafael Espindola <espindola@google.com>
10243
10244 * plugin.cc (add_input_library): New.
10245 (Plugin::load): Add add_input_library to tv.
10246 (Plugin_manager::add_input_file): Add the is_lib argument.
10247 (add_input_file): Update call to Plugin_manager::add_input_file.
10248 (add_input_library): New.
10249 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10250
966d4097
DK
102512009-09-30 Doug Kwan <dougkwan@google.com>
10252
10253 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10254 symbol and call Symbol::may_need_copy_reloc to determine if
10255 a copy reloc is needed.
10256 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10257 nocopyreloc is given in command line.
10258 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10259 given in command line.
10260 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10261 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10262 of the removed Target_i386::may_need_copy_reloc.
10263 * options.h (copyreloc): New option with default value false.
10264 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10265 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10266 instead of the removed Target_powerpc::may_need_copy_reloc.
10267 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10268 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10269 instead of the removed Target_sparc::may_need_copy_reloc.
10270 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10271 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10272 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10273 instead of the removed Target_x86_64::may_need_copy_reloc.
10274
029ba973
ILT
102752009-09-30 Ian Lance Taylor <iant@google.com>
10276
10277 * object.h (class Object): Remove target_ field, and target,
10278 sized_target, and set_target methods.
10279 (Object::sized_target): Remove.
10280 (class Sized_relobj): Update declarations. Remove sized_target.
10281 * object.cc (Sized_relobj::setup): Remove target parameter.
10282 Change all callers.
10283 (Input_objects::add_object): Don't do anything with the target.
10284 (make_elf_sized_object): Add punconfigured parameter. Change all
10285 callers. Set or test parameter target.
10286 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10287 Change all callers.
10288 * parameters.cc (Parameters::set_target): Change parameter type to
10289 be non-const.
10290 (Parameters::default_target): Remove.
10291 (set_parameters_target): Change parameter type to be non-const.
10292 (parameters_force_valid_target): New function.
10293 (parameters_clear_target): New function.
10294 * parameters.h (class Parameters): Update declarations. Remove
10295 default_target method. Add sized_target and clear_target
10296 methods. Change target_ to be non-const.
10297 (set_parameters_target): Update declaration.
10298 (parameters_force_valid_target): Declare.
10299 (parameters_clear_target): Declare.
10300 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10301 as NULL if we aren't searching.
10302 (Add_symbols::run): Don't check for compatible target.
10303 * fileread.cc (Input_file::open_binary): Call
10304 parameters_force_valid_target.
10305 * gold.cc (queue_middle_tasks): Likewise.
10306 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10307 set_target on object.
10308 * dynobj.h (class Sized_dynobj): Update declarations.
10309 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10310 make_elf_object returns NULL.
10311 (Archive::include_member): Don't check whether object target is
10312 compatible.
10313 * output.cc (Output_section::add_input_section): Get target from
10314 parameters.
10315 (Output_section::relax_input_section): Likewise.
10316 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10317 parameters.
10318 (Sized_relobj::do_scan_relocs): Likewise.
10319 (Sized_relobj::relocate_sections): Likewise.
10320 * resolve.cc (Symbol_table::resolve): Likewise.
10321 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10322 parameter. Change all callers.
10323 (Symbol_table::add_from_object): Get target from parameters.
10324 (Symbol_table::add_from_relobj): Don't check object target.
10325 (Symbol_table::add_from_dynobj): Likewise.
10326 (Symbol_table::define_special_symbol): Get target from
10327 parameters.
10328 * symtab.h (class Symbol_table): Update declaration.
10329 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10330 parameter. Change all callers. Clear parameter target.
10331 (Binary_test): Test target here.
10332 * testsuite/object_unittest.cc (gold_testsuite): Remove
10333 target_test_pointer parameter. Change all callers.
10334 (Object_test): Test target here.
10335
a6a22b83
ILT
103362009-09-26 Ian Lance Taylor <iant@google.com>
10337
10338 * testsuite/initpri1.c: Don't try to use constructor priorities if
10339 compiling with gcc before 4.3.
10340
6a8f49fe
ILT
103412009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10342
10343 * testsuite/retain_symbols_file_test.sh (check_present): Change
10344 output file name to retain_symbols_file_test.stdout.
10345 (check_absent): Likewise.
10346
8c604651
CS
103472009-09-18 Craig Silverstein <csilvers@google.com>
10348
10349 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10350 * options.cc: Include <cerrno> and <fstream>.
10351 (General_options::finalize): Parse -retain-symbols-file tag.
10352 * options.h: New flag.
10353 (General_options): New method should_retain_symbol, new
10354 variable symbols_to_retain.
10355 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10356 should_retain_symbol map.
10357 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10358 * testsuite/Makefile.in: Regenerate.
10359 * testsuite/retain_symbols_file_test.sh: New file.
10360
ca58b19f
NC
103612009-09-18 Nick Clifton <nickc@redhat.com>
10362
10363 * po/es.po: Updated Spanish translation.
10364
20e6d0d6
DK
103652009-09-17 Doug Kwan <dougkwan@google.com>
10366
10367 * debug.h (DEBUG_RELAXATION): New constant.
10368 (DEBUG_ALL): Add DEBUG_RELAXATION.
10369 (debug_string_to_enum): Add relaxation debug option.
10370 * layout.cc
10371 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10372 Layout::Relaxation_debug_check::read_sections,
10373 Layout::Relaxation_debug_check::read_sections): New method definitions.
10374 (Layout::Layout): Initialize data members
10375 record_output_section_data_from_scrips_,
10376 script_output_section_data_list_ and relaxation_debug_check_.
10377 (Layout::save_segments, Layout::restore_segments,
10378 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10379 Layout::relaxation_loop_body): New method definitions.
10380 (Layout::finalize): Support relaxation. Move section layout code to
10381 Layout::relaxation_loop_body.
10382 (Layout::set_asection_address_from_script): Move code for orphan
10383 section placement out.
10384 (Layout::place_orphan_sections_in_script): New method definition.
10385 * layout.h (Output_segment_headers, Output_file_header):
10386 New forward class declarations.
10387 (Layout::~Layout): Define.
10388 (Layout::new_output_section_data_from_script): New method definition.
10389 (Layout::place_orphan_sections_in_script): New method declaration.
10390 (Layout::Segment_states): New type declaration.
10391 (Layout::save_segments, Layout::restore_segments,
10392 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10393 Layout::relaxation_loop_body): New method declarations.
10394 (Layout::Output_section_data_list): New type declaration.
10395 (Layout::Relaxation_debug_check): New class definition.
10396 (Layout::record_output_section_data_from_script_,
10397 Layout::script_output_section_data_list_, Layout::segment_states_,
10398 Layout::relaxation_debug_check_): New data members.
10399 * output.cc: (Output_section_headers::do_size): New method definition.
10400 (Output_section_headers::Output_section_headers): Move size
10401 computation to Output_section_headers::do_size.
10402 (Output_segment_headers::do_size): New method definition.
e1df38aa 10403 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
10404 Output_file_header::do_size and call it.
10405 (Output_file_header::do_size): New method definition.
10406 (Output_data_group::Output_data_group): Adjust call to
10407 Output_section_data.
10408 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
10409 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 10410 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
10411 RELAXED_INPUT_SECTION_CODE.
10412 (Output_section::Output_section): Initialize data member checkpoint_.
10413 (Output_section::~Output_section): Delete checkpoint object pointed
10414 by checkpoint_.
10415 (Output_section::add_input_section): Always add an Input_section if
10416 relaxing.
10417 (Output_section::add_merge_input_section): Add assert.
10418 (Output_section::relax_input_section): New method definition.
10419 (Output_section::set_final_data_size): Set load address to zero for
10420 an unallocated section.
10421 (Output_section::do_address_and_file_offset_have_reset_values):
10422 New method definition.
10423 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
10424 Handle relaxed input section.
10425 (Output_section::sort_attached_input_sections): Checkpoint input
10426 section list lazily.
10427 (Output_section::get_input_sections): Change type of input_sections to
10428 list of Simple_input_section pointers. Checkpoint input section list
10429 lazily. Also handle relaxed input sections.
10430 (Output_section::add_input_section_for_script): Take a reference to
10431 a Simple_input_section object instead of Relobj pointer and section
10432 index as parameter. Handle relaxed input sections.
10433 (Output_section::save_states, Output_section::restore_states): New
10434 method definitions.
10435 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
10436 (Output_data::is_data_size_fixed): New method definition.
10437 (Output_data::reset_addresss_and_file_offset): Do not reset data size
10438 if it is fixed.
10439 (Output_data::address_and_file_offset_have_reset_values): New method
10440 definition.
10441 (Output_data::do_address_and_file_offset_have_reset_values): New method
10442 definition.
10443 (Output_data::set_data_size): Check that data size is not fixed.
10444 (Output_data::fix_data_size): New method definition.
10445 (Output_data::is_data_size_fixed_): New data member.
10446 (Output_section_headers::set_final_data_size): New method definition.
10447 (Output_section_headers::do_size): New method declaration.
10448 (Output_segment_headers::set_final_data_size): New method definition.
10449 (Output_segment_headers::do_size): New method declaration.
10450 (Output_file_header::set_final_data_size)::New method definition.
10451 (Output_file_header::do_size)::New method declaration.
10452 (Output_section_data::Output_section_data): Add new parameter
10453 is_data_size_fixed and use it to fix data size.
10454 (Output_data_const::Output_data_const): Adjust call to base class
10455 constructor and fix data size.
10456 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
10457 base class constructor and fix data size.
10458 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
10459 base class constructor and fix data size.
10460 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
10461 class constructor and fix data size.
10462 (Output_data_group::set_final_data_size): New method definition.
10463 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
10464 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
10465 class constructor and fix data size.
10466 (Output_relaxed_input_section): New class definition.
10467 (Output_section::Simple_input_section): New class definition.
10468 (Output_section::get_input_sections): Adjust parameter list.
10469 (Output_section::add_input_section_for_script): Same.
10470 (Output_section::save_states, Output_section::restore_states,
10471 Output_section::do_address_and_file_offset_have_reset_values,
10472 (Output_section::Input_section::Input_section): Handle
10473 RELAXED_INPUT_SECTION_CODE. Add new overload for
10474 Output_relaxed_input_section.
10475 (Output_section::Input_section::is_input_section,
10476 Output_section::Input_section::set_output_section): Handle relaxed
10477 input section.
10478 (Output_section::Input_section::is_relaxed_input_section,
10479 Output_section::Input_section::output_section_data,
10480 Output_section::Input_section::relaxed_input_section): New method
10481 definitions.
10482 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
10483 value.
10484 (Output_section::Input_section::u1_): Update comments.
10485 (Output_section::Input_section::u2_): Add new union member poris.
10486 (Output_section::Checkpoint_output_section): New classs definition.
10487 (Output_section::relax_input_section): New method declaration.
10488 (Output_section::checkpoint_): New data member.
10489 (Output_segment): Update comments.
10490 (Output_segment::Output_segment): Un-privatize copy constructor.
10491 (Output_segment::operator=): Un-privatize.
10492 * script-sections.cc (Output_section_element::Input_section_list):
10493 Change element type to Output_section::Simple_input_section.
10494 (Output_section_element_dot_assignment::set_section_addresses):
10495 Register output section data for relaxation clean up.
10496 (Output_data_exression::Output_data_expression): Adjust call to base
10497 constructor to fix data size.
10498 (Output_section_element_data::set_section_addresses): Register
10499 Output_data_expression object for relaxation clean up.
10500 (struct Input_section_info): Replace Relobj pointer and section index
10501 pair with Output_section::Simple_input_section and Convert struct to a
10502 class.
10503 (Input_section_sorter::operator()): Adjust access to
e1df38aa 10504 Input_section_info data member to use accessors.
20e6d0d6
DK
10505 (Output_section_element_input::set_section_addresses): Use layout
10506 parameter. Adjust code to use Output_section::Simple_input_section
10507 and Input_secction_info classes. Register filler for relaxation
10508 clean up.
10509 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
10510 and section index pair with Output_section::Simple_input_section
10511 class. Adjust code accordingly.
10512 (Phdrs_element::release_segment): New method definition.
10513 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
10514 segment list.
10515 (Script_sections::release_segments): New method definition.
10516 * gold/script-sections.h (Script_sections::release_segments): New
10517 method declaration.
10518 * gold/target.h (Target::may_relax, Target::relax,
10519 Target::do_may_relax, Target::do_relax): New method definitions.
10520
5e445df6
ILT
105212009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10522
10523 * arm.cc (has_signed_unsigned_overflow): New function.
10524 (Arm_relocate_functions::abs8): New function.
10525 (Target_arm::Scan::local): Handle R_ARM_ABS8.
10526 (Target_arm::Scan::global): Likewise.
10527 (Target_arm::relocate::relocate): Likewise.
10528 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10529 Likewise.
10530
8c604651 105312009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
10532
10533 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
10534 * testsuite/Makefile.in: Regenerate.
10535
1e9cc1c2
NC
105362009-09-11 Nick Clifton <nickc@redhat.com>
10537
10538 * po/gold.pot: Updated by the Translation project.
10539
6a89f575
CC
105402009-09-08 Cary Coutant <ccoutant@google.com>
10541
10542 * output.cc (Output_file::open): Add execute permission to empty file.
10543 * testsuite/Makefile.am (permission_test): New test.
10544 * testsuite/Makefile.in: Regenerate.
10545
fdcac5af
ILT
105462009-09-02 Ian Lance Taylor <iant@google.com>
10547
10548 * output.cc (Output_file::resize): Call map_no_anonymous rather
10549 than map.
10550
44453f85
ILT
105512009-09-01 Mikolaj Zalewski <mikolajz@google.com>
10552
10553 * gold.cc: Include "incremental.h".
10554 (queue_initial_tasks): Call Incremental_checker methods.
10555 * incremental.cc: Include "output.h".
10556 (Incremental_checker::can_incrementally_link_output_file): New
10557 method.
10558 * incremental.h (Incremental_checker): New class.
10559
10560 * output.cc (Output_file::open_for_modification): New method.
10561 (Output_file::map_anonymous): Changed return type to bool. Record
10562 map in base_ field.
10563 (Output_file::map_no_anonymous): New method, broken out of map.
10564 (Output_file::map): Use map_no_anonymous and map_anonymous.
10565 * output.h (class Output_file): Update declarations.
10566
293c1386
CC
105672009-08-24 Cary Coutant <ccoutant@google.com>
10568
10569 * options.h (Command_line::Pre_options): New class.
10570 (Command_line::pre_options): New member.
10571 * options.cc (gold::options::ready_to_register): New variable.
10572 (One_option::register_option): Do nothing if not registering options.
10573 Assert if same short option registered twice.
10574 (General_options::General_options): Turn off option registration when
10575 done constructing.
10576 (Command_line::Pre_options::Pre_options): New constructor.
10577
f773f3d2
CC
105782009-08-24 Cary Coutant <ccoutant@google.com>
10579
06a73cfe
CC
10580 * options.h (General_options::no_keep_memory): Remove incorrect
10581 short option.
f773f3d2 10582
a15af8e2
RW
105832009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10584
10585 * Makefile.am (am__skiplex, am__skipyacc): New.
10586 * Makefile.in: Regenerate.
10587
c462b41b
RW
105882009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10589
14ec8efd
RW
10590 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10591 (INCLUDES): ... this.
10592 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10593 (AM_CPPFLAGS): Renamed from ...
10594 (INCLUDE): ... this.
10595 * Makefile.in, testsuite/Makefile.in: Regenerate.
10596
81ecdfbb
RW
10597 * Makefile.in: Regenerate.
10598 * aclocal.m4: Likewise.
10599 * config.in: Likewise.
10600 * configure: Likewise.
10601 * testsuite/Makefile.in: Likewise.
10602
c462b41b
RW
10603 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10604 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10605 * Makefile.in: Regenerate.
10606 * testsuite/Makefile.in: Regenerate.
10607
2da73f13
CC
106082009-08-19 Cary Coutant <ccoutant@google.com>
10609
10610 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10611 symbols in shared libraries overridden by hidden or internal symbols
10612 in the main program.
10613
2db70501
CD
106142009-08-19 Chris Demetriou <cgd@google.com>
10615
10616 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10617 checking source file names in error messages.
10618
f733487b
DK
106192009-08-18 Doug Kwan <dougkwan@google.com>
10620
10621 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10622 an elcpp::Ehdr as parameter. Adjust call to set_target.
10623 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10624 an elfcpp::Ehdr as parameter.
10625 * object.cc (Object::set_target): Remove the version that looks up
10626 a target and sets it.
10627 (Sized_relobj::setup): Take a Target object instead of
10628 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10629 (make_elf_sized_object): Find target and ask target to
10630 make an ELF object.
10631 * object.h: (Object::set_target): Remove the version that looks up
10632 a target and sets it.
10633 (Sized_relobj::setup): Take a Target object instead of
10634 an elfcpp:Ehdr as parameter.
10635 * target.cc: Include dynobj.h.
10636 (Target::do_make_elf_object_implementation): New.
2e702c99 10637 (Target::do_make_elf_object): New.
f733487b
DK
10638 * target.h (Target::make_elf_object): New template declaration.
10639 (Target::do_make_elf_object): New method declarations.
10640 (Target::do_make_elf_object_implementation): New template declaration.
10641
cc70f101
ILT
106422009-08-14 Ian Lance Taylor <iant@google.com>
10643
10644 * gold.h (FUNCTION_NAME): Define.
10645 (gold_unreachable): Use FUNCTION_NAME.
10646
ef5e0cb1
ST
106472009-08-12 Sriraman Tallam <tmsriram@google.com>
10648
10649 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10650 symbol in the --keep-unique list is not found.
10651
48c187ce
ST
106522009-08-12 Sriraman Tallam <tmsriram@google.com>
10653
10654 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10655 been maked as --keep-unique.
10656 (Icf::unfold_section): New function.
10657 * icf.h (Icf::unfold_section): New function.
10658 * options.h (General_options::keep_unique): New option.
10659 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10660 * testsuite/Makefile.in: Regenerate.
10661 * testsuite/icf_keep_unique_test.sh: New file.
10662 * testsuite/icf_keep_unique_test.cc: New file.
10663
645afe0c
CC
106642009-08-12 Cary Coutant <ccoutant@google.com>
10665
10666 PR 10471
10667 * resolve.cc (Symbol_table::resolve): Check for references from
10668 dynamic objects to hidden and internal symbols.
10669 * testsuite/Makefile.am (hidden_test.sh): New test.
10670 * testsuite/Makefile.in: Regenerate.
10671 * testsuite/hidden_test.sh: New script.
10672 * testsuite/hidden_test_1.c: New test source.
10673 * testsuite/hidden_test_main.c: New test source.
10674
11af873f
DK
106752009-08-11 Doug Kwan <dougkwan@google.com>
10676
10677 * arm.cc: Update comments.
10678 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10679 segment to locate the .ARM.exidx section if present.
10680
b9f7d72d
DK
106812009-08-09 Doug Kwan <dougkwan@google.com>
10682
10683 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10684 patch.
10685
ddd3c53c
ST
106862009-08-07 Sriraman Tallam <tmsriram@google.com>
10687 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10688 compiler warnings.
10689
27721062
ST
106902009-08-06 Sriraman Tallam <tmsriram@google.com>
10691
10692 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10693 valid tls_segment only for non-debug-section relocations.
10694 * testsuite/Makefile.am: Add gc_tls_test.
10695 * testsuite/Makefile.in: Regenerate.
10696 * testsuite/gc_tls_test.cc: New file.
10697 * testsuite/gc_tls_test.sh: New file.
10698
ef15dade 106992009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10700
ef15dade
ST
10701 * icf.cc: New file.
10702 * icf.h: New file.
10703 * Makefile.am (CCFILES): Add icf.cc.
10704 (HFILES): Add icf.h
10705 * Makefile.in: Regenerate.
10706 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10707 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10708 section, symbol and addend information for the relocs.
10709 * gold.cc (queue_middle_tasks): Call identical code folding.
10710 * gold.h: Add defines for multimap.
10711 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10712 to the call of finalize_local_symbols.
10713 * main.cc (main): Create object of class Icf.
10714 * object.cc (Sized_relobj::do_layout): Allow this function to be
10715 called twice during icf.
10716 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10717 to sections marked as identical by icf.
10718 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10719 when available.
10720 (Sized_relobj::do_section_entsize): New function.
10721 * object.h (Object::section_entsize): New function.
10722 (Object::do_section_entsize): New pure virtual function.
10723 (Relobj::finalize_local_symbols): Add new parameter.
10724 (Relobj::do_section_entsize): New function.
10725 * options.h (General_options::icf): New option.
10726 (General_options::icf_iterations): New option.
10727 (General_options::print_icf_sections): New option.
10728 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10729 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10730 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10731 icf.
10732 * symtab.cc (Symbol_table::is_section_folded): New function.
10733 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10734 to sections marked as identical by icf.
10735 * symtab.h (Symbol_table::set_icf): New function.
10736 (Symbol_table::icf): New function.
10737 (Symbol_table::is_section_folded): New function.
10738 (Symbol_table::icf_): New data member.
10739 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10740 * testsuite/Makefile.am: Add commands to build icf_test.
10741 * testsuite/Makefile.in: Regenerate.
10742 * testsuite/icf_test.sh: New file.
10743 * testsuite/icf_test.cc: New file.
10744
c3b65ac4
CD
107452009-07-24 Chris Demetriou <cgd@google.com>
10746
10747 * layout.cc (is_compressible_debug_section): Fix incorrect
10748 comment about compressed section names.
10749
1caf2c51
ILT
107502009-07-20 Ian Lance Taylor <ian@airs.com>
10751
10752 PR 10419
10753 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10754
1ef4d87f
ILT
107552009-07-16 Ian Lance Taylor <iant@google.com>
10756
10757 PR 10400
10758 * layout.h: #include <map>.
10759 (class Kept_section): Change from struct to class. Add accessors
10760 and setters. Add section size to Comdat_group mapping. Change
10761 Comdat_group to std::map. Add is_comdat_ field. Add
10762 linkonce_size field in union.
10763 (class Layout): Update declaration of find_or_add_kept_section.
10764 Don't declare find_kept_object.
10765 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10766 parameter. Add object, shndx, is_comdat, and is_group_name
10767 parameters. Change all callers. Adjust for new Kept_section.
10768 (Layout::find_kept_object): Remove.
10769 * object.cc (Sized_relobj::include_section_group): Update use of
10770 Kept_section. Rename secnum to shndx. Only record
10771 Kept_comdat_section if sections are the same size.
10772 (Sized_relobj::include_linkonce_section): Update use of
10773 Kept_section. Only record Kept_comdat_section if sections are the
10774 same size. Set size of linkonce section.
10775 (Sized_relobj::map_to_kept_section): Update call to
10776 get_kept_comdat_section.
10777 * object.h (class Sized_relobj): Rename fields in
10778 Kept_comdat_section to drop trailing underscores; change object
10779 field to Relobj*. Change Kept_comdat_section_table to store
10780 struct rather than pointer.
10781 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10782 Add kept_object and kept_shndx parameters. Change all callers.
10783 (Sized_relobj::get_kept_comdat_section): Change return type to
10784 bool. Add kept_object and kept_shndx parameters. Change all
10785 callers.
10786 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10787 Layout::find_or_add_kept_section.
10788
37c3b7b0
ILT
107892009-07-09 Ian Lance Taylor <iant@google.com>
10790
10791 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10792 Reserve space in the hash table.
10793
98fa85cb
ILT
107942009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10795
10796 * fileread.cc (File_read::get_mtime): New method.
10797 * fileread.h (Timespec): New structure.
10798 (File_read::get_mtime): New method.
10799 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10800 Renamed from timestamp_nsec.
10801 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10802 Elf_Xword.
e1df38aa 10803 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10804 timestamp_nsec.
e1df38aa 10805 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10806 (Incremental_inputs::report_obejct): Save mtime; style fix.
10807 (Incremental_inputs::report_script): Save mtime; style fix.
10808 (Incremental_inputs::finalize_inputs): Style fix.
10809 (Incremental_inputs::finalize): Style fix.
10810 (Incremental_inputs::create_input_section_data): Store inputs
10811 mtime.
10812 * incremental.h (Incremental_inputs::report_script): Add mtime
10813 argument.
10814 (Incremental_inputs::Input_info::Input_info): Intialize only one
10815 union member.
10816 (Incremental_inputs::Input_info::archive): Move to nameless
10817 union.
10818 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10819 (Incremental_inputs::Input_info::script): Move to nameless union.
10820 (Incremental_inputs::mtime): New field.
10821 * script.cc (read_input_script): Pass file mtime to
10822 Incremental_input.
10823 * script.h (Script_info::inputs): Style fix.
10824
c9d70757
ILT
108252009-07-01 Ian Lance Taylor <ian@airs.com>
10826
10827 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10828 instead of 32.
10829
9c547ec3
ILT
108302009-06-24 Ian Lance Taylor <iant@google.com>
10831
10832 PR 10156
10833 * layout.cc (Layout::choose_output_section): If we find an
10834 existing section, update the flags.
10835 (Layout::create_notes): New function, broken out of
10836 Layout::finalize.
10837 (Layout::finalize): Don't create note sections.
10838 (Layout::create_note): Don't crash if linker script discards
10839 section.
10840 (Layout::create_gold_note): Likewise.
10841 (Layout::create_build_id): Likewise. Don't set
10842 after_input_sections on the section.
10843 (Layout::create_executable_stack_info): Remove target parameter.
10844 Change caller.
10845 * layout.h (class Layout): Declare create_notes. Update
10846 declaration of create_executable_stack_info.
10847 * gold.cc (queue_middle_tasks): Call create_notes.
10848 * output.cc (Output_section::update_flags_for_input_section): Move
10849 here from output.h. If SHF_ALLOC flag is newly set, mark address
10850 invalid.
10851 * output.h (Output_data::mark_address_invalid): New function.
10852 (class Output_section): Only declare, not define,
10853 update_flags_for_input_section. Remove set_flags.
10854
55458500
ILT
108552009-06-24 Ian Lance Taylor <iant@google.com>
10856
10857 * script-sections.cc (Output_section_definition::
10858 set_section_addresses): Rename shadowing local load_address to
10859 laddr.
10860
1307d6cd
ILT
108612009-06-24 Ian Lance Taylor <iant@google.com>
10862
10863 PR 10244
10864 * reloc.cc (relocate_sections): Skip empty relocation sections.
10865
ec3f783e
ILT
108662009-06-23 Ian Lance Taylor <iant@google.com>
10867
10868 PR 10156
10869 * layout.cc (Layout::create_note): Use choose_output_section
10870 rather than make_output_section.
10871
459c9f1c
ILT
108722009-06-23 Ian Lance Taylor <iant@google.com>
10873
10874 PR 10237
10875 * options.cc (General_options::parse_V): Set printed_version_.
10876 (General_options::General_options): Initialize printed_version_.
10877 * options.h (class General_options): Add printed_version_ field.
10878 * gold.cc (queue_initial_tasks): If there are no input files,
10879 don't give a fatal error if we printed the version information.
10880 (queue_middle_tasks): If using -r with a shared object, give a
10881 fatal error rather than an ordinary error.
10882
1518dc8f
ILT
108832009-06-23 Ian Lance Taylor <iant@google.com>
10884
10885 PR 10219
10886 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10887 (Layout::make_output_section): Set have_stabstr_section_ if we see
10888 a .stab*str section.
10889 (Layout::finalize): Call link_stabs_sections.
10890 (Layout::link_stabs_sections): New file.
10891 * layout.h (class Layout): Add have_stabstr_section_ field.
10892 Declare link_stabs_sections.
10893
3d857b98
DK
108942009-06-23 Doug Kwan <dougkwan@google.com>
10895
10896 * Makefile.am (libgold_a_LIBADD): New.
10897 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10898 * Makefile.in: Regenerate.
3d857b98
DK
10899 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10900 * configure: Regenerate.
10901 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10902 * fileread.cc: Include sys/state.h
10903 * gold.h: Declare memmem and strndup if found missing.
10904 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10905
0639a6f6
ILT
109062009-06-23 Ian Lance Taylor <iant@google.com>
10907
10908 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10909 * configure: Rebuild.
10910
8d63875c
ILT
109112009-06-23 Ian Lance Taylor <iant@google.com>
10912
10913 PR 10147
10914 * object.cc (Object::section_contents): Don't try to get a view if
10915 the section has length zero.
10916 (Object::handle_gnu_warning_section): If the section is empty, use
10917 the name of the section as the warning.
10918
f7c8a183
ILT
109192009-06-23 Ian Lance Taylor <iant@google.com>
10920
10921 PR 10133
10922 * stringpool.h (class Stringpool_template): Add optimize_ field.
10923 (Stringpool_template::set_optimize): New function.
10924 * stringpool.cc (Stringpool_template::Stringpool_template):
10925 Initialize optimize_ field.
10926 (Stringpool_template::set_string_offsets): Test local optimize
10927 fild rather than parameter.
10928 * layout.cc (Layout::Layout): Call set_optimize on the section
10929 name stringpool.
10930
e6a307ba
ILT
109312009-06-22 Ian Lance Taylor <iant@google.com>
10932
10933 PR 10030
10934 * yyscript.y: Parse TARGET.
10935 * script.cc (script_set_target): New function.
10936 * script-c.h (script_set_target): Declare.
10937 * options.cc (General_options::string_to_object_format): Rename
10938 from string_to_object_format in anonymous namespace. Change
10939 callers.
10940 * options.h (class General_options): Declare
10941 string_to_object_format.
10942
3ee173de
ILT
109432009-06-22 Ian Lance Taylor <iant@google.com>
10944
10945 * script-sections.cc (Script_sections::create_segments): Don't put
10946 program headers in a PT_LOAD segment if -n or -N.
10947
109482009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10949
10950 PR 10141
10951 * options.h (class General_options): Add -z lazy and -z now. Sort
10952 -z options into alphabetical order.
10953 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10954
cd6739a1 109552009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10956
10957 * layout.cc (Layout::make_output_section): Call
10958 Target::new_output_section.
10959 (Layout::attach_allocated_section_to_segment): Put large section
10960 sections in a separate load segment with the large segment flag
10961 set.
10962 (Layout::segment_precedes): Sort large data segments after other
10963 load segments.
10964 (align_file_offset): New static function.
10965 (Layout::set_segment_offsets): Use align_file_offset.
10966 * output.h (class Output_section): Add is_small_section_ and
10967 is_large_section_ fields.
10968 (Output_section::is_small_section): New function.
10969 (Output_section::set_is_small_section): New function.
10970 (Output_section::is_large_section): New function.
10971 (Output_section::set_is_large_section): New function.
10972 (Output_section::is_large_data_section): New function.
10973 (class Output_segment): Add is_large_data_segment_ field.
10974 (Output_segment::is_large_data_segment): New function.
10975 (Output_segment::set_is_large_data_segment): New function.
10976 * output.cc (Output_section::Output_section): Initialize new
10977 fields.
10978 (Output_segment::Output_segment): Likewise.
10979 (Output_segment::add_output_section): Add assertion that large
10980 data sections always go in large data segments. Force small data
10981 sections to the end of the list of data sections. Force small BSS
10982 sections to the start of the list of BSS sections. For large BSS
10983 sections to the end of the list of BSS sections.
10984 * symtab.h (class Symbol): Declare is_common_shndx.
10985 (Symbol::is_defined): Check Symbol::is_common_shndx.
10986 (Symbol::is_common): Likewise.
10987 (class Symbol_table): Define enum Commons_section_type. Update
10988 declarations. Add small_commons_ and large_commons_ fields.
10989 * symtab.cc (Symbol::is_common_shndx): New function.
10990 (Symbol_table::Symbol_table): Initialize new fields.
10991 (Symbol_table::add_from_object): Put small and large common
10992 symbols in the right list.
10993 (Symbol_table::sized_finalized_symbol): Check
10994 Symbol::is_common_shndx.
10995 (Symbol_table::sized_write_globals): Likewise.
10996 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10997 common symbol lists. Don't call do_allocate_commons_list if the
10998 list is empty.
10999 (Symbol_table::do_allocate_commons_list): Remove is_tls
11000 parameter. Add comons_section_type parameter. Change all
11001 callers. Handle small and large common symbols.
11002 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11003 Symbol::is_common_shndx.
11004 * resolve.cc (symbol_to_bits): Likewise.
11005 * target.h (Target::small_common_shndx): New function.
11006 (Target::small_common_section_flags): New function.
11007 (Target::large_common_shndx): New function.
11008 (Target::large_common_section_flags): New function.
11009 (Target::new_output_section): New function.
11010 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11011 small_common_section_flags, and large_common_section_flags
11012 fields.
11013 (Target::do_new_output_section): New virtual function.
11014 * arm.cc (Target_arm::arm_info): Initialize new fields.
11015 * i386.cc (Target_i386::i386_info): Likewise.
11016 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11017 Likewise.
11018 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11019 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11020 (Target_x86_64::do_new_output_section): New function.
11021 * configure.ac: Define conditional MCMODEL_MEDIUM.
11022 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11023 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11024 (large_LDFLAGS): Define.
11025 * testsuite/large.c: New file.
11026 * testsuite/testfile.cc (Target_test::test_target_info):
11027 Initialize new fields.
11028 * configure, testsuite/Makefile.in: Rebuild.
11029
bb04269c
DK
110302009-06-05 Doug Kwan <dougkwan@google.com>
11031
11032 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11033 * Makefile.in: Regenerate.
bb04269c
DK
11034 * i386.cc (class Target_i386): Define new virtual method to
11035 override do_is_local_label_name in parent.
11036 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11037 local symbols if --discard-locals or -X is given.
11038 * options.h (class General_options): Declare new options
11039 '--discard-locals' and '-X' for discarding locals.
11040 * target.h (class Target): Define new methods is_local_label_name.
11041 Declare new virtual method do_is_local_label_name.
11042 * target.cc: New file.
11043 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11044 (check_SCRIPTS): Add discard_locals_test.sh.
11045 (check_DATA): Add discard_local_tests.syms.
11046 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11047 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11048 * testsuite/Makefile.in: Regenerate.
11049 * testsuite/discard_locals_test.c: New file.
11050 * testsuite/discard_locals_test.sh: Same.
11051
805bb01c
DK
110522009-06-05 Doug Kwan <dougkwan@google.com>
11053
11054 * object.cc (Sized_relobj::Sized_relobj): Initialize
11055 discarded_eh_frame_shndx_ to -1U.
11056 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11057 section.
11058 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11059 a discarded .eh_frame section.
11060 (Sized_relobj::do_finalize_local_symbols): Ditto.
11061 * object.h (class Sized_relobj): Declare new member
11062 discarded_eh_frame_shndx_.
11063 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11064 (local_labels_test.o, local_labels_test): New rules.
11065 * testsuite/Makefile.in: Regenerate.
11066
1dcd334d
DK
110672009-06-04 Doug Kwan <dougkwan@google.com>
11068
11069 * layout.cc (Layout::section_name_mapping): Add mapping for
11070 special ARM sections.
11071
96d49306
DK
110722009-06-03 Doug Kwan <dougkwan@google.com>
11073
11074 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11075 (utils::has_overflow): Same.
11076
dff16297
ILT
110772009-06-03 Ian Lance Taylor <iant@google.com>
11078
11079 * layout.cc (Layout::section_name_mapping): New array, replacing
11080 Layout::linkonce_mapping.
11081 (Layout::section_name_mapping_count): New variable, replacing
11082 Layout::linkonce_mapping_count.
11083 (Layout::linkonce_output_name): Remove.
11084 (Layout::output_section_name): Rewrite.
11085 * layout.h (class Layout): Rename Linkonce_mapping to
11086 Section_name_mapping, linkonce_mapping to section_name_mapping,
11087 linkonce_mapping_count to section_name_mapping_count. Don't
11088 declare linkonce_output_name.
11089
c121c671
DK
110902009-06-03 Doug Kwan <dougkwan@google.com>
11091
11092 * gold/arm.cc (namespace utils): New.
11093 (Target_arm::reloc_is_non_pic): Define new method.
11094 (class Arm_relocate_functions): New.
11095 (Target_arm::Relocate::relocate): Handle relocation types used by
11096 Android.
11097
07800fab
ILT
110982009-06-03 Ian Lance Taylor <iant@google.com>
11099
11100 * arm.cc (Target_arm::scan::global): Use || instead of |.
11101
c121c671
DK
111022009-06-02 Doug Kwan <dougkwan@google.com>
11103
11104 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11105 issued_non_pic_error_.
11106 (class Target_arm::Scan): Declare new method check_non_pic.
11107 Define new method symbol_needs_plt_entry.
11108 Declare new data member issued_non_pic_error_.
11109 (class Target_arm::Relocate): Declare new method
11110 should_apply_static_reloc.
11111 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11112 (Target_arm::Scan::check_non_pic): Define new method.
11113 (Target_arm::Scan::local): Handle a small subset of reloc types used
11114 by Android.
11115 (Target_arm::Scan::local): Same.
11116 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11117
b19b0c6d
ILT
111182009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11119
11120 * incremental.cc (Incremental_inputs::report_command_line): Filter
11121 out --incremental-* options.
11122
94cdfcff
DK
111232009-05-29 Doug Kwan <dougkwan@google.com>
11124
11125 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11126 template class.
11127 (class Target_arm): Update comment.
11128 (Target_arm::Target_arm): Initialize new data members GOT_,
11129 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11130 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11131 and Target_arm::rel_dyn_section.
11132 Declare new_enum Target_arm::Got_type.
11133 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11134 and DYNBSS_.
11135 Update commments for member do_dynsym_value.
11136 (Target_arm::got_size, Target_arm::plt_section,
11137 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11138 new methods inside class defintion.
11139 (Target_arm::got_section): Define new method.
11140 (Target_arm::rel_dyn_section): Same.
11141 (Output_data_plt_arm): New template class.
11142 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11143 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11144 (Output_data_plt_arm::add_entry): Same.
11145 (Output_data_plt_arm::first_plt_entry): Define new
11146 static data member for PLT instruction template.
11147 (Output_data_plt_arm::plt_entry): Same.
11148 (Output_data_plt_arm::do_write): Define new method.
11149 (Target_arm::make_plt_entry): Same.
11150 (Target_arm::do_finalize_sections): Same.
11151 (Target_arm::do_dynsym_value): Same.
11152
4a657b0d
DK
111532009-05-28 Doug Kwan <dougkwan@google.com>
11154
11155 * Makefile.am (TARGETSOURCES): Add arm.cc.
11156 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11157 * Makefile.in: Regenerate.
11158 * arm.cc: New file.
11159 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11160
e7ae8c36
DK
111612009-05-26 Doug Kwan <dougkwan@google.com>
11162
11163 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11164 (General_options::check_excluded_libs): Strip off directories in
11165 archive name before matching like GNU ld does.
11166 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11167 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11168 (exclude_libs_test_LDFLAGS): Add linker option
11169 -Wl,--exclude-libs,libexclude_libs_test_3
11170 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11171 an explicit archive without using -l.
11172 (alt/libexclude_libs_test_3.a): New make rule.
11173 * testsuite/Makefile.in: Regenerate.
11174 * testsuite/exclude_libs_test.c : Declare lib3_default().
11175 (main): Call it.
11176 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11177 * exclude_libs_test_3.c: New file.
11178
f12e7348
NC
111792009-05-26 Nick Clifton <nickc@redhat.com>
11180
11181 * po/id.po: New Indonesian translation.
11182 * po/gold.pot: Updated template file.
11183
4daadc0d
ST
111842009-05-22 Sriraman Tallam <tmsriram@google.com>
11185
e1df38aa 11186 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11187 gc_comdat_test files. Add -Wl,--gc-sections to build
11188 gc_comdat_test.
11189 * testsuite/Makefile.in: Regenerate.
11190 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11191
531813ad
ST
111922009-05-21 Sriraman Tallam <tmsriram@google.com>
11193
11194 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11195 kept comdat section was garbage collected.
11196 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11197 * testsuite/Makefile.in: Regenerate.
11198 * testsuite/gc_comdat_test.sh: New file.
11199 * testsuite/gc_comdat_test_1.cc: New file.
11200 * testsuite/gc_comdat_test_2.cc: New file.
11201
65514900
CC
112022009-05-19 Doug Kwan <dougkwan@google.com>
11203
11204 * archive.cc (Archive::Archive): Move constructor from archive.h
11205 to here. Initialize no_export_.
11206 (Archive::get_elf_object_for_member): Set no_export flag of object.
11207 * archive.h (Archive::Archive): Move constructor body to
11208 archive.cc.
11209 (Archive::no_export): New method.
11210 (Archive::no_export_): New field.
11211 * object.h (Object::Object): Initialize no_export_ to false.
11212 (Object::no_export, Object::set_no_export): New methods.
11213 (Object::no_export_): New field.
11214 * options.cc (General_options::parse_exclude_libs): New method.
11215 (General_options::check_excluded_libs) Same.
11216 * options.h (exclude_libs): New option.
11217 (General_options::check_excluded_libs): New method declaration.
11218 (General_options::excluded_libs_): New field.
11219 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11220 default or protected visibility if an object has no-export flag set.
11221 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11222 (check_SCRIPTS): Add exclude_libs_test.sh.
11223 (check_DATA): Add exclude_libs_test.syms.
11224 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11225 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11226 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11227 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11228 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11229 libexclude_libs_test_2.a): New rules.
11230 * testsuite/Makefile.in: Regenerate.
11231 * testsuite/exclude_libs_test.c: New file.
11232 * testsuite/exclude_libs_test.sh: Ditto.
11233 * testsuite/exclude_libs_test_1.c: Ditto.
11234 * testsuite/exclude_libs_test_2.c: Ditto.
11235
1b77ea50
ILT
112362009-05-15 Ian Lance Taylor <iant@google.com>
11237
11238 * configure.ac: Check for declarations for cases where libiberty.h
11239 checks HAVE_DECL_xxx.
11240 * configure, config.in: Rebuild.
11241
072fe7ce
ILT
112422009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11243
11244 * gold.h (Incremental_argument_list): Remove (invalid) forward
11245 declaration.
11246 * incremental.cc (Incremental_inputs::report_achive): New method.
11247 (Incremental_inputs::report_object): New method.
11248 (Incremental_inputs::report_script): New method.
11249 (Incremental_inputs::finalize_inputs): New method.
11250 (Incremental_inputs::finalize): Call finalize_inputs().
11251 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11252 Create inputs entries.
11253 * incremental.h (Incremental_input_type): New enum.
11254 (Incremental_inputs::Incremental_input): Initialize new fields.
11255 (Incremental_inputs::report_inputs): New method.
11256 (Incremental_inputs::report_achive): New method.
11257 (Incremental_inputs::report_object): New method.
11258 (Incremental_inputs::report_script): New method.
11259 (Incremental_inputs::finalize_inputs): New method.
11260 (Incremental_inputs::Input_info): New struct.
11261 (Incremental_inputs::Input_info_map): New typedef.
11262 (Incremental_inputs::lock_): New field.
11263 (Incremental_inputs::Inputs_): New field.
11264 (Incremental_inputs::Inputs_map): New field.
11265 * main.cc (main): Call Incremental_input::report_inputs.
11266 * options.h (Input_argument_list): Typedef moved from
11267 Input_arguments.
11268 (Input_file_group::Files): Remove, use ::Input_argument_list.
11269 (Input_file_group::Input_argument_list): Remove, use
11270 ::Input_argument_list.
11271 * plugin.cc (Plugin_manager::add_input_file): Add error in
11272 incremental build.
11273 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11274 functions.
11275 * script.cc (read_input_script): Call
11276 Incremental_input::report_script.
11277 * script.h (Script_info): New class.
11278
b0481b0b
ILT
112792009-04-27 Ian Lance Taylor <iant@google.com>
11280
11281 * x86_64.cc (do_adjust_output_section): Set entsize to
11282 plt_entry_size.
11283
b22a5a41 112842009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11285
11286 * output.cc (Output_file::close): After short writes, continue
11287 writing from the correct offset in the buffer being written.
11288
40fde488
CD
112892009-04-23 Chris Demetriou <cgd@google.com>
11290
11291 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11292 * configure: Regenerate.
11293 * config.in: Regenerate.
11294 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11295 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11296
3ce2c28e
ILT
112972009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11298
11299 * incremental.cc (Incremental_inputs_header_data): Renamed from
11300 Incremental_input_header_data.
11301 (Incremental_inputs_header_data::data_size): New field.
11302 (Incremental_inputs_header_data::put_input_file_count): Renamed
11303 from input_file_count.
11304 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11305 from command_line_offset.
11306 (Incremental_inputs_header_data::put_reserved): Renamed from
11307 put_reserved.
11308 (Incremental_inputs_entry_data): Renamed from
11309 Incremental_input_entry_data.
11310 (Incremental_inputs_entry_data::data_size): New field.
11311 (Incremental_inputs::report_command_line): New method.
11312 (Incremental_inputs::finalize): New method.
11313 (Incremental_inputs::create_incremental_inputs_data): New method.
11314 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11315 * incremental.h: New file.
11316 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11317 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11318 incremental builds.
703d02da 11319 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11320 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11321 (Layout::create_incremental_info_sections): New method.
11322 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11323 * main.cc (main): Notify Incremental_input of the command line.
11324
e55bde5e
ILT
113252009-04-01 Ian Lance Taylor <iant@google.com>
11326 Mikolaj Zalewski <mikolajz@google.com>
11327
11328 * gold.h (reserve_unordered_map): Define, three versions, one for
11329 each version of Unordered_map.
11330 * layout.cc (Layout::Layout): Remove options parameter. Add
11331 number_of_input_files parameter. Don't initialize options_.
11332 Initialize number_of_input_files_ and resized_signatures_. Move
11333 sections_are_attached_.
11334 (Layout::layout_group): Reserve space for group_signatures_.
11335 (Layout::find_or_add_kept_section): Change name parameter to be a
11336 reference. Resize signatures_ map when it gets large enough.
11337 (Layout::layout_eh_frame): Use parameters->options() instead of
11338 this->options_.
11339 (Layout::make_output_section): Likewise.
11340 (Layout::attach_allocated_section_to_segment): Likewise.
11341 (Layout::finalize, Layout::create_executable_stack): Likewise.
11342 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11343 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11344 * layout.h (class Layout): Update declarations. Remove options_
11345 field. Add number_of_input_files_ and resized_signatures_
11346 fields. Move sections_are_attached_ field.
11347 * main.cc (main): Pass number of input files to Layout
11348 constructor. Don't pass options.
11349
154b857c
ILT
113502009-03-30 Ian Lance Taylor <iant@google.com>
11351
11352 * ffsll.c (ffsll): Correct implementation.
11353
2f35ab9b
ILT
113542009-03-27 Ian Lance Taylor <iant@google.com>
11355
fd03461a
ILT
11356 * ffsll.c: New file.
11357 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11358 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11359 * ftruncate.c (ftruncate): Declare before definition.
11360 * mremap.c (mremap): Likewise.
11361 * pread.c (pread): Likewise.
11362 * configure, Makefile.in, config.in: Rebuild.
11363
2f35ab9b
ILT
11364 * mremap.c: New file.
11365 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11366 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11367 (mremap): Declare if HAVE_MREMAP is not defined.
11368 * configure, Makefile.in, config.in: Rebuild.
11369
33aea2fd
CC
113702009-03-27 Cary Coutant <ccoutant@google.com>
11371
11372 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11373 position independent.
11374 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11375 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11376
6d479619
CC
113772009-03-24 Cary Coutant <ccoutant@google.com>
11378
11379 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11380 an executable.
11381 (needs_dynamic_reloc): Likewise.
11382
afc06bb8
ILT
113832009-03-24 Ian Lance Taylor <iant@google.com>
11384
11385 * yyscript.y (file_cmd): Recognize EXTERN.
11386 (extern_name_list, extern_name_list_body): New nonterminals.
11387 * script.cc (script_add_extern): Define.
11388 * script-c.h (script_add_extern): Declare.
11389
f6060a4d
ILT
113902009-03-24 Rafael Avila de Espindola <espindola@google.com>
11391
11392 * object.cc (is_elf_object): Define.
11393 * object.h (is_elf_object): Declare.
11394 * archive.cc (Archive::get_elf_object_for_member): Call
11395 is_elf_object.
33aea2fd 11396 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 11397
26736d8e
ILT
113982009-03-24 Elliott Hughes <enh@google.com>
11399
11400 * output.cc (Output_file::map_anonymous): Define.
11401 (Output_file::map): Use map_anonymous. If the regular mmap fails,
11402 try an anonymous one. Report the size if the mmap fails.
11403 * output.h (class Output_file): Declare map_anonymous.
11404
22fd9730
ILT
114052009-03-24 Ian Lance Taylor <iant@google.com>
11406
11407 * target-select.cc (instantiate_target): Don't acquire the lock if
11408 the instantiated_target_ field has already been set.
11409
cb010894
ILT
114102009-03-23 Ian Lance Taylor <iant@google.com>
11411
7f055c20
ILT
11412 * gold-threads.h (class Initialize_lock): Define.
11413 * gold-threads.cc (class Initialize_lock_once): Define.
11414 (initialize_lock_control): New static variable.
11415 (initialize_lock_pointer): New static variable.
11416 (initialize_lock_once): New static function.
11417 (Initialize_lock::Initialize_lock): Define.
11418 (Initialize_lock::initialize): Define.
11419 * target-select.h: Include "gold-threads.h".
11420 (class Target_selector): Add lock_ and initialize_lock_ fields.
11421 Don't define instantiate_target, just declare it.
11422 * target-select.cc (Target_selector::Target_selector): Initialize
11423 new fields.
11424 (Target_selector::instantiate_target): Define.
11425 * descriptors.h: Include "gold-threads.h".
11426 (class Descriptors): Add initialize_lock_ field.
11427 * descriptors.cc (Descriptors::Descriptors): Initialize new
11428 field.
11429 (Descriptors::open): Use initialize_lock_ field
11430 * errors.h (class Errors): Add initialize_lock_ field.
11431 * errors.cc (Errors::Errors): Initialize new field.
11432 (Errors::initialize_lock): Use initialize_lock_ field.
11433 * powerpc.cc (class Target_selector_powerpc): Remove
11434 instantiated_target_ field. In do_recognize call
11435 instantiate_target rather than do_instantiate_target. In
11436 do_instantiate_target just allocate a new target.
11437 * sparc.cc (class Target_selector_sparc): Likewise.
11438
36959681
ILT
11439 * freebsd.h: New file.
11440 * i386.cc: Include "freebsd.h".
11441 (Target_i386): Derive from Target_freebsd rather than
11442 Sized_target.
11443 (Target_selector_i386): Derive from Target_selector_freebsd rather
11444 than Target_selector.
11445 * x86_64.cc: Include "freebsd.h".
11446 (Target_x86_64): Derive from Target_freebsd rather than
11447 Sized_target.
11448 (Target_selector_x86_64): Derive from Target_selector_freebsd
11449 rather than Target_selector.
11450 * target.h (class Target): Add adjust_elf_header and
11451 do_adjust_elf_header.
11452 * output.cc (Output_file_header:: do_sized_write): Call target
11453 adjust_elf_header routine.
11454 * configure.tgt: Set targ_osabi.
11455 * configure.ac: Define GOLD_DEFAULT_OSABI.
11456 * parameters.cc (Parameters::default_target): Pass
11457 GOLD_DEFAULT_OSABI to select_target.
11458 * target-select.h (class Target_selector): Make instantiate_target
11459 protected rather than private.
11460 * Makefile.am (HFILES): Add freebsd.h.
11461 * configure, Makefile.in, config.in: Rebuild.
11462
cb010894
ILT
11463 * merge.cc (do_add_input_section): Correct pend value. Change
11464 message about last entry not being null terminated from error to
11465 warning.
11466
0e879927
ILT
114672009-03-20 Mikolaj Zalewski <mikolajz@google.com>
11468
11469 * incremental.cc: New file.
11470 * Makefile.am (CCFILES): Add incremental.cc.
11471 * Makefile.in: Rebuild.
11472
41105937
PP
114732009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
11474
11475 * layout.cc (Layout::output_section_name): Preserve names
11476 of '.note.' sections.
e1df38aa 11477
60439920
ILT
114782009-03-19 Ian Lance Taylor <iant@google.com>
11479
11480 * descriptors.cc (Descriptors::open): Check that the options are
11481 valid before using them.
11482
0d371ad3
ILT
114832009-03-18 Ian Lance Taylor <iant@google.com>
11484
11485 * script-sections.h: Include <list>.
11486 (class Script_sections): Change Sections_elements from std::vector
11487 to std::list. Typedef public Elements_iterator. Add
11488 orphan_section_placement_, data_segment_align_start_, and
11489 saw_data_segment_align_ fields. Remove data_segment_align_index_
11490 field.
11491 * script-sections.cc (class Orphan_section_placement): New class.
11492 (class Sections_element): Add virtual functions is_relro and
11493 orphan_section_init. Remove virtual function place_orphan_here.
11494 (class Output_section_definition): Add is_relro and
11495 orphan_section_init. Remove place_orphan_here.
11496 (class Orphan_output_section): Likewise.
11497 (Script_sections::Script_sections): Update for field changes.
11498 (Script_sections::data_segment_align): Set saw_data_segment_align_
11499 and data_segment_align_start_, not data_segment_align_index.
11500 (Script_sections::data_segment_relro_end): Check
11501 saw_data_segment_align_. Use data_segment_align_start_ rather
11502 than data_segment_align_index_.
11503 (Script_sections::place_orphan): Rewrite to use
11504 Orphan_section_placement.
11505
9201d894
ILT
115062009-03-17 Ian Lance Taylor <iant@google.com>
11507
9c5b8369
ILT
11508 * archive.cc (Archive::add_symbols): Check for a version attached
11509 to the symbol name in the archive map.
11510 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
11511 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
11512 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
11513 (ver_test_11.a): New target.
11514 * testsuite/Makefile.in: Rebuild.
11515
9201d894
ILT
11516 * configure.ac: Check for chsize and posix_fallocate. Replace
11517 ftruncate.
11518 * ftruncate.c: New file, from gnulib.
11519 * output.cc (posix_fallocate): Define dummy version if not
11520 HAVE_POSIX_FALLOCATE.
11521 (Output_file::map): Call posix_fallocate rather than lseek and
11522 write.
11523 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
11524 * configure, Makefile.in, config.in: Rebuild.
11525
ef4ab7a8 115262009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 11527
ef4ab7a8
PP
11528 * layout.h (Layout::create_note): Add section_name parameter.
11529 * layout.cc (Layout::create_note): Likewise.
11530 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 11531
8c500701
ILT
115322009-03-17 Ian Lance Taylor <iant@google.com>
11533
e85b18e1
ILT
11534 * descriptors.cc: Include "options.h".
11535 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
11536 (Descriptors::open): Always use O_CLOEXEC when opening a new
11537 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
11538 then set FD_CLOEXEC.
11539
9efe6174
ILT
11540 * sparc.cc (class Target_sparc): Add has_got_section.
11541 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
11542 make sure we have a GOT section.
11543
11544 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
11545 (Target_sparc::Scan::local): Likewise.
11546 (Target_sparc::Scan::global): Likewise.
11547 (Target_sparc::Relocate::relocate): Likewise.
11548 (Target_sparc::Relocate::relocate_tls): Likewise.
11549
8c500701
ILT
11550 * symtab.cc (Symbol_table::define_default_version): New function,
11551 broken out of add_from_object.
11552 (Symbol_table::add_from_object): Call define_default_version.
11553 (Symbol_table::define_special_symbol): Add resolve_oldsym
11554 parameter. Change all callers. If the version for a symbol comes
11555 from a version script, resolve it with the symbol with the same
11556 name with no version. Also add the symbol without a version if
11557 appropriate.
11558 (do_define_in_output_data): If resolving with oldsym, don't delete
11559 sym.
11560 (do_define_in_output_segment): Likewise.
11561 (do_define_as_constant): Likewise.
11562 * symtab.h (class Symbol_table): Update declarations.
11563
f1ed28fb
ILT
115642009-03-13 Ian Lance Taylor <iant@google.com>
11565
15f8229b
ILT
11566 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11567 (Read_symbols::requeue): New function.
11568 (Read_symbols::do_read_symbols): If make_elf_object fails because
11569 the target type is not configured, and the file was searched for,
11570 issue a warning and retry with the next directory.
11571 (Add_symbols::run): If the file has an incompatible format, and
11572 it was searched for, requeue the Read_symbols task. On error,
11573 release the object.
11574 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11575 dirindex parameter to constructor. Change all callers. Declare
11576 incompatible_warning and requeue.
11577 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11578 input_argument_ and input_group_ fields. Add them to
11579 constructor. Change all callers.
11580 (class Read_script): Add dirindex_ field. Add it to constructor.
11581 Change all callers.
11582 * archive.cc (Archive::setup): Remove input_objects parameter.
11583 Change all callers.
11584 (Archive::get_file_and_offset): Likewise.
11585 (Archive::read_all_symbols): Likewise.
11586 (Archive::read_symbols): Likewise.
11587 (Archive::get_elf_object_for_member): Remove input_objects
11588 parameter. Add punconfigured parameter. Change all callers.
11589 (Archive::add_symbols): Change return type to bool. Check return
11590 value of include_member.
11591 (Archive::include_all_members): Likewise.
11592 (Archive::include_member): Change return type to bool. Return
11593 false if first included object has incompatible target. Set
11594 included_member_ field.
11595 (Add_archive_symbols::run): If add_symbols returns false, requeue
11596 Read_symbols task.
11597 * archive.h (class Archive): Add included_member_ field.
11598 Initialize it in constructor. Add input_file and searched_for
11599 methods. Update declarations.
11600 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11601 input_argument_ fields. Add them to constructor. Change all
11602 callers.
11603 * script.cc: Include "target-select.h".
11604 (class Parser_closure): Add skip_on_incompatible_target_ and
11605 found_incompatible_target_ fields. Add
11606 skip_on_incompatible_target parameter to constructor. Change all
11607 callers. Add methods skip_on_incompatible_target,
11608 clear_skip_on_incompatible_target, found_incompatible_target, and
11609 set_found_incompatible_target.
11610 (read_input_script): Add dirindex parameter. Change all callers.
11611 If parser finds an incompatible target, requeue Read_symbols
11612 task.
11613 (script_set_symbol): Clear skip_on_incompatible_target in
11614 closure.
11615 (script_add_assertion, script_parse_option): Likewise.
11616 (script_start_sections, script_add_phdr): Likewise.
11617 (script_check_output_format): New function.
11618 * script.h (read_input_script): Update declaration.
11619 * script-c.h (script_check_output_format): Declare.
11620 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11621 (ignore_cmd): Remove OUTPUT_FORMAT.
11622 * fileread.cc (Input_file::Input_file): Add explicit this.
11623 (Input_file::will_search_for): New function.
11624 (Input_file::open): Add pindex parameter. Change all callers.
11625 * fileread.h (class Input_file): Add input_file_argument method.
11626 Declare will_search_for. Update declarations.
11627 * object.cc (make_elf_object): Add punconfigured parameter.
11628 Change all callers.
11629 * object.h (class Object): Make input_file public. Add
11630 searched_for method.
11631 (make_elf_object): Update declaration.
11632 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11633 restart search.
11634 * dirsearch.h (class Dirsearch): Update declaration.
11635 * options.h (class General_options): Add --warn-search-mismatch.
11636 * parameters.cc (Parameters::is_compatible_target): New function.
11637 * parameters.h (class Parameters): Declare is_compatible_target.
11638 * workqueue.cc (Workqueue::add_blocker): New function.
11639 * workqueue.h (class Workqueue): Declare add_blocker.
11640
f1ed28fb
ILT
11641 * fileread.cc (Input_file::open): Remove options parameter.
11642 Change all callers.
11643 (Input_file::open_binary): Likewise.
11644 * script.cc (read_input_script): Likewise.
11645 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11646 options parameter from constructor. Change all callers.
11647 (class Read_script): Likewise.
11648 * fileread.h (class Input_file): Update declarations.
11649 * script.h (read_input_script): Update declaration.
11650
34dd024a
NC
116512009-03-10 Nick Clifton <nickc@redhat.com>
11652
11653 * po/es.po: New Spanish translation.
11654
6d71b17c
CC
116552009-03-06 Cary Coutant <ccoutant@google.com>
11656
11657 * options.cc (parse_short_option): Keep dash_z from registering itself.
11658
031cdbed
ILT
116592009-03-03 Ian Lance Taylor <iant@google.com>
11660
11661 PR 9918
11662 * target-reloc.h (relocate_section): Pass output_section to
11663 relocate.
11664 * i386.cc (Target_i386::should_apply_static_reloc): Add
11665 output_section parameter. Change all callers.
11666 (Target_i386::Relocate::relocate): Add output_section parameter.
11667 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11668 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11669 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11670 * testsuite/two_file_shared.sh: New script.
11671 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11672 (check_DATA): Add two_file_shared.dbg.
11673 (two_file_shared.dbg): New target.
11674 * testsuite/Makefile.in: Rebuild.
11675
15d5fa16
ILT
116762009-03-01 Ian Lance Taylor <iant@google.com>
11677
11678 * configure.ac: Check for byteswap.h.
11679 * configure: Rebuild.
11680 * config.in: Rebuild.
11681
8a4c0b0d
ILT
116822009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11683
11684 * layout.cc (Layout::find_or_add_kept_section): New function.
11685 (Layout::add_comdat): Removed.
11686 * layout.h (struct Kept_section): Move out of class Layout.
11687 Remove trailing underscores from field names. Add group_sections
11688 field. Rename group_ field to is_group. Change all uses.
11689 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11690 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11691 comdat_groups_ field.
11692 (Sized_relobj::include_section_group): Use
11693 find_or_add_kept_section and Kept_section::group_sections.
11694 (Sized_relobj::include_linkonce_section): Likewise.
11695 * object.cc (class Sized_relobj): Don't define Comdat_group or
11696 Comdat_group_table. Remove find_comdat_group and
11697 add_comdat_group. Remove comdat_groups_ field.
11698 * plugin.cc (include_comdat_group): Use
11699 Layout::find_or_add_kept_section.
11700
b4ecf66b
ILT
117012009-02-28 Ian Lance Taylor <iant@google.com>
11702
14359ca0
ILT
11703 * README: --gc-sections and map files are now supported. Document
11704 some build requirements.
11705
b4ecf66b
ILT
11706 PR 6992
11707 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11708 relocatable link set the value of the section symbol to zero.
11709 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11710 relocatable link don't include the section address in the local
11711 symbol value.
11712
0602e05a
ILT
117132009-02-27 Ian Lance Taylor <iant@google.com>
11714
fd9d194f
ILT
11715 PR 6811
11716 * options.h (class Search_directory): Add is_system_directory.
11717 (class General_options): Declare is_in_system_directory.
11718 * options.cc (get_relative_sysroot): Make static.
11719 (get_default_sysroot): Make static.
11720 (General_optoins::is_in_system_directory): New function.
11721 * fileread.cc (Input_file::is_in_system_directory): New function.
11722 * fileread.h (class Input_file): Declare is_in_system_directory.
11723 * object.h (class Object): Add is_in_system_directory.
11724 (class Input_objects): Remove system_library_directory_ field.
11725 * object.cc (Input_objects::add_object): Don't set
11726 system_library_directory_.
11727 (input_objects::found_in_system_library_directory): Remove.
11728 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11729 parameter. Change all callers.
11730 (Symbol_table::sized_write_globals): Likewise.
11731 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11732 Call Object::is_in_system_directory.
11733 * symtab.h (class Symbol_table): Update declarations.
11734
61edd21f
ILT
11735 PR 5990
11736 * descriptors.h (Open_descriptor): Add is_on_stack field.
11737 * descriptors.cc (Descriptors::open): If the descriptor is on the
11738 top of the stack, remove it. Initialize is_on_stack field.
11739 (Descriptors::release): Only add pod to stack if it is not on the
11740 stack already.
11741 (Descriptors::close_some_descriptor): Clear stack_next and
11742 is_on_stack fields.
11743
e29e076a
ILT
11744 PR 7091
11745 * output.cc (Output_section::find_starting_output_address): Rename
11746 from starting_output_address; add PADDR parameter; change return
11747 type.
11748 * output.h (class Output_section): Declare
11749 find_starting_output_address instead of starting_output_address.
11750 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11751 section symbol for which we can't find a merge section.
11752
0602e05a
ILT
11753 PR 9836
11754 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11755 hidden or internal, force the symbol to be local.
11756 * resolve.cc (Symbol::override_visibility): Define.
11757 (Symbol::override_base): Use override_visibility.
11758 (Symbol_table::resolve): Likewise.
11759 (Symbol::override_base_with_special): Likewise.
11760 (Symbol_table::override_with_special): If the visibility is hidden
11761 or internal, force the symbol to be local.
11762 * symtab.h (class Symbol): Add set_visibility and
11763 override_visibility.
11764 * testsuite/ver_test_1.sh: New file.
11765 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11766 (check_DATA): Add ver_test_1.syms.
11767 (ver_test_1.syms): New target.
11768 * testsuite/Makefile.in: Rebuild.
11769
401a9a73
CC
117702009-02-25 Cary Coutant <ccoutant@google.com>
11771
11772 * layout.cc (Layout::choose_output_section): Don't rename sections
11773 when using a linker script that has a SECTIONS clause.
11774 * Makefile.in: Regenerate.
11775
11776 * testsuite/Makefile.am (script_test_5.sh): New test case.
11777 * testsuite/Makefile.in: Regenerate.
11778 * testsuite/script_test_5.cc: New file.
11779 * testsuite/script_test_5.sh: New file.
11780 * testsuite/script_test_5.t: New file.
11781
f488e4b0
CC
117822009-02-13 Rafael Avila de Espindola <espindola@google.com>
11783
11784 * archive.cc (Archive::include_member): Update calls to add_symbols.
11785 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11786 the Layout argument.
11787 * dynobj.h (do_add_symbols): Add the Layout argument.
11788 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11789 Layout argument.
11790 * object.h (Object::add_symbols): Add the Layout argument.
11791 (Object::do_add_symbols): Add the Layout argument.
11792 (Sized_relobj::do_add_symbols): Add the Layout argument.
11793 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11794 Unify the two versions.
11795 (Add_plugin_symbols): Remove.
11796 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11797 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11798 (Add_plugin_symbols): Remove.
11799 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11800 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11801 (Add_symbols::run): Make it work with Pulginobj.
11802
89dd1680
ILT
118032009-02-06 Ian Lance Taylor <iant@google.com>
11804
11805 * object.cc (Sized_relobj::do_layout): Make info message start
11806 with lower case letter.
11807
266d0a74
ILT
118082009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11809
602b464e
ILT
11810 * binary.cc: Fix file comment.
11811
266d0a74
ILT
11812 * options.h (enum Incremental_disposition): Define.
11813 (class General_options): Add new options: --incremental,
11814 --incremental_changed, --incremental_unchanged,
11815 --incremental_unknown. Add incremental_disposition_ and
11816 implicit_incremental_ fields.
11817 (General_options::incremental_disposition): New function.
11818 (class Position_dependent_options): Add incremental_disposition
11819 option.
11820 (Position_dependent_options::copy_from_options): Set incremental
11821 dispositions.
11822 * options.cc (General_options::parse_incremental_changed): New
11823 function.
2e702c99
RM
11824 (General_options::parse_incremental_unchanged): New function.
11825 (General_options::parse_incremental_unknown): New function.
11826 (General_options::General_options): Initialize new fields
266d0a74 11827 incremental_disposition_ and implicit_incremental_.
2e702c99 11828 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11829 without --incremental.
11830
f073bbf7
CD
118312009-02-06 Chris Demetriou <cgd@google.com>
11832
11833 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11834 pointer and to report location as the file name associated with
11835 the symbol.
11836 (gold_undefined_symbol_at_location): New function to replace the
11837 old gold_undefined_symbol functionality.
11838 * target-reloc.h (relocate_section): Update to use
11839 gold_undefined_symbol_at_location.
11840 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11841 Call gold_undefined_symbol function rather than gold_error.
11842 * errors.h (Errors::undefined_symbol): Take location as a
11843 string, rather than calculating it from a relocation.
11844 * errors.cc (Errors::fatal): Print "fatal error:" before the
11845 formatted message.
11846 (Errors::error, Errors::error_at_location): Print "error: "
11847 before the formatted message.
11848 (Errors::undefined_symbol): Take location as a string, rather
11849 than calculating it from a relocation.
11850 (gold_undefined_symbol_at_location): New function akin to
11851 old gold_undefined_symbol, calculates location from relocation.
11852 (gold_undefined_symbol): Change to take only a Symbol pointer
11853 and to report location as the file name associated with the symbol.
11854 * testsuite/debug_msg.sh: Update for changed error messages.
11855 * testsuite/undef_symbol.sh: Likewise.
11856
8e94a90c
ILT
118572009-02-04 Duncan Sands <baldrick@free.fr>
11858
11859 PR 9812
11860 * reduced_debug_output.h
11861 (Output_reduced_debug_abbrev_section::failed): Use format for
11862 gold_warning.
11863 (Output_reduced_debug_info_section::faild): Likewise.
11864
88a0e15b
ILT
118652009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11866
11867 * script.cc (Lazy_demangler): New class.
2e702c99 11868 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11869 symbol only once.
11870
5efc7cd2
CC
118712009-01-29 Cary Coutant <ccoutant@google.com>
11872
11873 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11874 to __tls_get_addr.
11875 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11876
e0ebcf42
ILT
118772009-01-28 Ian Lance Taylor <iant@google.com>
11878
5efc7cd2 11879 * version.cc (version_string): Bump to 1.9.
75fe7426 11880
e0ebcf42
ILT
11881 * gold.h: Include <cstring> and <stdint.h>.
11882 * version.cc: Include <cstdio>.
11883 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11884 warning.
11885 * reduced_debug_output.cc (insert_into_vector): Rename from
11886 Insert_into_vector; change all callers. Use Swap_unaligned to
11887 avoid aliasing issue; remove union since it is unnecessary.
11888
8e2813be 118892009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11890
11891 * Makefile.am (CCFILES): Add gc.cc.
11892 (HFILES): Add gc.h.
11893 * Makefile.in: Regenerate.
11894 * gold.cc (Gc_runner): New class.
11895 (queue_initial_tasks): Call garbage collection related tasks
11896 when corresponding options are invoked.
11897 (queue_middle_gc_tasks): New function.
11898 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11899 processed early before laying out sections during garbage collection.
11900 * gold.h (queue_middle_gc_tasks): New function.
11901 (is_prefix_of): Move from "layout.cc".
11902 * i386.cc (Target_i386::gc_process_relocs): New function.
11903 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11904 * main.cc (main): Create object of class "Garbage_collection".
11905 * object.cc (Relobj::copy_symbols_data): New function.
11906 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11907 (Sized_relobj::do_layout): Allow this function to be called twice
11908 during garbage collection and defer layout of section during the
6d03d481
ST
11909 first call.
11910 * object.h (Relobj::get_symbols_data): New function.
11911 (Relobj::is_section_name_included): New function.
11912 (Relobj::copy_symbols_data): New function.
11913 (Relobj::set_symbols_data): New function.
11914 (Relobj::get_relocs_data): New function.
11915 (Relobj::set_relocs_data): New function.
11916 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11917 (Relobj::gc_process_relocs): New function.
11918 (Relobj::do_gc_process_relocs): New pure virtual function.
11919 (Relobj::sd_): New data member.
11920 (Sized_relobj::is_output_section_offset_invalid): New function.
11921 (Sized_relobj::do_gc_process_relocs): New function.
11922 * options.h (General_options::gc_sections): Modify to not be a no-op.
11923 (General_options::print_gc_sections): New option.
11924 * plugin.cc (Plugin_finish::run): Remove function call to
11925 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11926 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11927 * reloc.cc (Read_relocs::run): Add task to process relocs and
11928 determine unreferenced sections when doing garbage collection.
11929 (Gc_process_relocs): New class.
11930 (Sized_relobj::do_gc_process_relocs): New function.
11931 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11932 sections that are garbage collected.
11933 * reloc.h (Gc_process_relocs): New class.
11934 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11935 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11936 symbols whose corresponding sections are garbage collected.
11937 (Symbol_table::Symbol_table): Add new parameter for the garbage
11938 collection object.
11939 (Symbol_table::gc_mark_undef_symbols): New function.
11940 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11941 (Symbol_table::gc_mark_dyn_syms): New function.
11942 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11943 as garbage.
11944 (Symbol_table::add_from_object): Likewise.
11945 (Symbol_table::add_from_relobj): When building shared objects, do not
11946 treat externally visible symbols as garbage.
11947 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11948 table information for static and relocatable links.
11949 * symtab.h (Symbol_table::set_gc): New function.
11950 (Symbol_table::gc): New function.
11951 (Symbol_table::gc_mark_undef_symbols): New function.
11952 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11953 (Symbol_table::gc_mark_dyn_syms): New function.
11954 (Symbol_table::gc_): New data member.
e1df38aa 11955 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11956 function.
11957 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11958 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11959
3b293544
CF
119602009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11961
11962 * options.h (General_options::gc_sections): Define as a no-op for now.
11963 (General_options::no_keep_memory): Ditto.
11964 (General_options::Bshareable): Define.
11965 * options.cc (General_options::finalize): Honor -Bshareable.
11966
83d22aa8
AS
119672009-01-20 Andreas Schwab <schwab@suse.de>
11968
11969 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11970 read the value in the contents, since we don't use it. Use the
11971 template endianness when writing.
11972 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11973
cd536b21
AS
119742009-01-19 Andreas Schwab <schwab@suse.de>
11975
11976 * configure.tgt (powerpc64-*): Fix targ_obj.
11977
99e9a495
ILT
119782009-01-15 Ian Lance Taylor <iant@google.com>
11979
11980 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11981 local symbols when stripping all symbols.
11982
bbbfea06
CC
119832009-01-14 Cary Coutant <ccoutant@google.com>
11984
99e9a495 11985 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11986
0f7c0701
CC
119872009-01-14 Cary Coutant <ccoutant@google.com>
11988
11989 * archive.cc (Archive::get_elf_object_for_member): Remove call
11990 to File_read::claim_for_plugin.
11991 * descriptors.cc (Descriptors::open): Remove reference to
11992 is_claimed.
11993 (Descriptors::claim_for_plugin): Remove.
11994 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11995 (Descriptors::is_claimed): Remove.
11996 (claim_descriptor_for_plugin): Remove.
11997 * fileread.cc (File_read::claim_for_plugin): Remove.
11998 * fileread.h (File_read::claim_for_plugin): Remove.
11999 (File_read::descriptor): Reopen descriptor if necessary.
12000 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12001 (Plugin_manager::all_symbols_read): Add task parameter. Change
12002 all callers.
12003 (Plugin_manager::get_input_file): New function.
12004 (Plugin_manager::release_input_file): New function.
12005 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12006 corresponding data member.
12007 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12008 and pass to base constructor. Change all callers.
12009 (get_input_file, release_input_file): New functions.
12010 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12011 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12012 (Plugin_manager::all_symbols_read): Add task parameter.
12013 (Plugin_manager::get_input_file): New function.
12014 (Plugin_manager::release_input_file): New function.
12015 (Plugin_manager::task_): New data member.
12016 (Pluginobj::Pluginobj): Add filesize parameter.
12017 (Pluginobj::filename): New function.
12018 (Pluginobj::descriptor): New function.
12019 (Pluginobj::filesize): New function.
12020 (Pluginobj::filesize_): New data member.
12021 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12022 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12023 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12024
12025 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12026 with archive libraries.
12027 * testsuite/Makefile.in: Regenerate.
12028 * testsuite/plugin_test.c (struct sym_info): New type.
12029 (get_input_file, release_input_file): New static variables.
12030 (onload): Capture new transfer vector entries.
12031 (claim_file_hook): Stop reading at end of file according to filesize.
12032 Factor out parsing of readelf output into separate function.
12033 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12034 APIs and get the source file name from the symbol table. Convert
12035 source file name to corresponding object file name. Print info
12036 message when adding new input files.
12037 (parse_readelf_line): New function.
12038 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12039 * testsuite/plugin_test_2.sh: Likewise.
12040 * testsuite/plugin_test_3.sh: Likewise.
12041 * testsuite/plugin_test_4.sh: New test case.
12042
62a6d109
ILT
120432009-01-07 Ian Lance Taylor <iant@google.com>
12044
12045 * version.cc (version_string): Bump to 1.8.
12046
483620e8
CC
120472008-12-23 Cary Coutant <ccoutant@google.com>
12048
12049 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12050 * plugin.cc (Plugin_manager::finish): Rename as
12051 layout_deferred_objects. Move cleanup to separate function.
12052 (Plugin_manager::cleanup): New function.
12053 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12054 separately.
12055 * plugin.h (Plugin_manager::finish): Rename as
12056 layout_deferred_objects.
12057 (Plugin_manager::cleanup): New function.
12058 (Plugin_manager::cleanup_done): New field.
12059
d66a9eb3
CC
120602008-12-23 Cary Coutant <ccoutant@google.com>
12061
12062 * plugin.cc (is_visible_from_outside): New function.
12063 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12064 so we don't return "IR only" status for exported symbols or -r links.
12065
12066 * testsuite/Makefile.am (plugin_test_3): New test case.
12067 * testsuite/Makefile.in: Regenerate.
12068 * testsuite/plugin_test_3.sh: New file.
12069
5995b570
CC
120702008-12-22 Cary Coutant <ccoutant@google.com>
12071
12072 * object.cc (Sized_relobj::layout_section): New function.
12073 (Sized_relobj::do_layout): Defer layout of input sections until after
12074 plugin has provided replacement files.
12075 (Sized_relobj::do_layout_deferred_sections): New function.
12076 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12077 (Relobj::layout_deferred_sections): New function.
12078 (Relobj::do_layout_deferred_sections): New function.
12079 (Sized_relobj::do_layout_deferred_sections): New function.
12080 (Sized_relobj::layout_section): New function.
12081 (Sized_relobj::Deferred_layout): New structure.
12082 (Sized_relobj::deferred_layout_): New field.
12083 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12084 Change all callers. Layout deferred sections.
12085 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12086 references.
12087 (Plugin_hook::run): Move code from do_plugin_hook inline.
12088 (Plugin_hook::do_plugin_hook): Remove.
12089 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12090 (Plugin_manager::finish): Renamed, was cleanup.
12091 (Plugin_manager::should_defer_layout): New function.
12092 (Plugin_manager::add_deferred_layout_object): New function.
12093 (Plugin_manager::Deferred_layout_list): New type.
12094 (Plugin_manager::deferred_layout_objects_): New field.
12095 (Plugin_hook::do_plugin_hook): Remove.
12096
ee769c88
ILT
120972008-12-17 Ian Lance Taylor <iant@google.com>
12098
12099 * options.h (class General_options): Add --no case for
12100 --export-dynamic.
12101
abc8dcba
CC
121022008-12-16 Cary Coutant <ccoutant@google.com>
12103
12104 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12105 vector.
12106 (Plugin_manager::claim_file): Create plugin object even if
12107 plugin did not call the add_symbols callback.
12108 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12109 asking for more symbols than were added.
12110 * testsuite/Makefile.am (plugin_test_1): Add test case with
12111 no global symbols.
12112 (empty.syms): New target.
12113 * testsuite/Makefile.in: Regenerate.
12114 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12115 message. Don't call add_symbols if no globals.
12116 (all_symbols_read_hook): Don't provide replacement for empty
12117 claimed file.
12118
b0074644
ILT
121192008-12-12 Ian Lance Taylor <iant@google.com>
12120
68943102
ILT
12121 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12122 r_type == 0 for a local symbol with r_sym == 0.
12123 (scan_relocatable_relocs): Pass r_sym to
12124 local_non_section_strategy.
12125 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12126 r_sym parameter.
12127
b0074644
ILT
12128 * configure.ac: Update test for TLS descriptors: they are
12129 supported as of glibc 2.9.
12130 * configure: Rebuild.
12131
c2508178
ILT
121322008-12-11 Ian Lance Taylor <iant@google.com>
12133
12134 PR 7091
12135 * target-reloc.h (Default_scan_relocatable_relocs): For each
12136 function, map r_type == 0 to RELOC_DISCARD.
12137
2756a258
CC
121382008-12-10 Cary Coutant <ccoutant@google.com>
12139
12140 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12141 object to override a kept COMDAT group from a plugin object.
12142
bb6f53d3
ILT
121432008-12-09 Ian Lance Taylor <iant@google.com>
12144
fbc558e1
ILT
12145 PR 7088
12146 * yyscript.y (file_cmd): Handle INPUT.
12147
bb6f53d3
ILT
12148 * testsuite/initpri1.c: Change all declarations to be full
12149 prototypes by adding void, to avoid compiler warnings.
12150
4674ecfc
CC
121512008-12-05 Rafael Avila de Espindola <espindola@google.com>
12152
12153 * options.cc (General_options::parse_plugin_opt): New.
12154 (General_options::add_plugin): The argument now is just the filename.
12155 (General_options::add_plugin_option): New.
12156 * options.h (plugin_opt): New.
12157 (add_plugin): Change argument name.
12158 (add_plugin_option): New.
12159 * plugin.cc (Plugin::load): Don't parse the plugin option.
12160 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12161 (Plugin::add_option): New.
12162 (Plugin::args_): Change type.
12163 (Plugin::filename_): New.
12164 (Plugin_manager::add_plugin_option): New.
12165 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12166 * testsuite/Makefile.in: Regenerate.
12167
fd06b4aa
CC
121682008-12-05 Cary Coutant <ccoutant@google.com>
12169
12170 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12171 Handle --strip-lto-sections option.
12172 * options.h (strip_lto_sections): New option.
12173
6c52134c
CC
121742008-12-01 Cary Coutant <ccoutant@google.com>
12175
12176 * plugin.cc (ld_plugin_message): Change format parameter to const.
12177 Fix mismatch between new[] and delete.
12178
a45248e0
CC
121792008-11-14 Cary Coutant <ccoutant@google.com>
12180
12181 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12182 instead of -1U.
12183
c82fbeee
CS
121842008-11-05 Craig Silverstein <csilvers@google.com>
12185
12186 * options.cc (General_options::parse_dynamic_list): New function.
12187 * options.h (General_options): New flags dynamic_list,
12188 dynamic_list_data, dynamic_list_cpp_new, and
12189 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12190 (General_options::in_dynamic_list): New function.
12191 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12192 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12193 (Lex::can_continue_name): Likewise.
12194 (yylex): Likewise.
12195 (read_script_file): New parameter script_options.
12196 (read_dynamic_list): New function.
12197 (Script_options::define_dynamic_list): New function.
12198 (dynamic_list_keyword_parsecodes): New variable.
12199 (dynamic_list_keywords): New variable.
12200 * script.h (Script_options::define_dynamic_list): New function
12201 prototype.
12202 (read_dynamic_list): New function prototype.
12203 * symtab.cc (strprefix): New macro.
12204 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12205 dynamic_list_data, dynamic_list_cpp_new, and
12206 dynamic_list_cpp_typeinfo.
12207 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12208 (dynamic_list_expr): New rule.
12209 (dynamic_list_nodes): Likewise.
12210 (dynamic_list_node): Likewise.
12211 * testsuite/Makefile.am (dynamic_list): New test.
12212 * testsuite/Makefile.in: Regenerated.
12213 * testsuite/dynamic_list.t: New file.
12214 * testsuite/dynamic_list.sh: New file.
12215
e0bb29a5
CS
122162008-11-05 Craig Silverstein <csilvers@google.com>
12217
12218 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12219 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12220 (t11_last): Likewise.
12221 * testsuite/ver_test_6.c (main): Likewise.
12222
4e1e25e0
CC
122232008-10-07 Cary Coutant <ccoutant@google.com>
12224
12225 * options.c (General_options::finalize): Add check for -static and
12226 -shared.
12227 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12228 is not empty.
12229
92f03fcb
CC
122302008-10-02 Cary Coutant <ccoutant@google.com>
12231
12232 * plugin.cc (make_sized_plugin_object): Fix conditional
12233 compilation to work when not all targets are enabled.
12234
fbd8a257
CC
122352008-09-29 Cary Coutant <ccoutant@google.com>
12236
12237 * archive.cc (Archive::get_file_and_offset): Use filename instead
12238 of name to get library path.
12239 (Archive::include_member): Unlock external member of a thin archive.
12240
12241 * testsuite/Makefile.am (TEST_AR): New variable.
12242 (thin_archive_test_1): New test.
12243 (thin_archive_test_2): New test.
81636b3f
CC
12244 * testsuite/Makefile.in: Regenerate.
12245 * testsuite/thin_archive_main.cc: New file.
12246 * testsuite/thin_archive_test_1.cc: New file.
12247 * testsuite/thin_archive_test_2.cc: New file.
12248 * testsuite/thin_archive_test_3.cc: New file.
12249 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12250
eff45813
CC
122512008-09-29 Cary Coutant <ccoutant@google.com>
12252
12253 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12254 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12255 instead of -1U.
12256 (Sized_relobj::do_finalize_local_symbols): Likewise.
12257 (Sized_relobj::map_to_kept_section): Likewise.
12258 * object.h (Sized_relobj::invalid_address): New constant.
12259 (Sized_relobj::do_output_section_offset): Check for invalid_address
12260 and return -1ULL.
12261 * output.cc (Output_reloc::local_section_offset): Use constant
12262 invalid_address instead of -1U.
12263 (Output_reloc::get_address): Likewise.
12264 (Output_section::output_address): Change -1U to -1ULL.
12265 * output.h (Output_reloc::invalid_address): New constant.
12266 * reloc.cc (Sized_relobj::write_sections): Use constant
12267 invalid_address instead of -1U.
12268 (Sized_relobj::relocate_sections): Likewise.
12269 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12270 values for merge sections.
12271 * target-reloc.h (relocate_for_relocatable): Use constant
12272 invalid_address instead of -1U.
12273
89fc3421
CC
122742008-09-19 Cary Coutant <ccoutant@google.com>
12275
12276 Add plugin functionality for link-time optimization (LTO).
12277 * configure.ac (plugins): Add --enable-plugins option.
12278 * configure: Regenerate.
12279 * config.in: Regenerate.
12280 * Makefile.am (LIBDL): New variable.
12281 (CCFILES): Add plugin.cc.
12282 (HFILES): Add plugin.h.
12283 (ldadd_var): Add LIBDL.
12284 * Makefile.in: Regenerate.
12285
12286 * archive.cc: Include "plugin.h".
12287 (Archive::setup): Don't preread archive symbols when using a plugin.
12288 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12289 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12290 files.
12291 (Archive::include_member): Add symbols from plugin objects.
12292 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12293 * descriptors.cc (Descriptors::open): Check for file descriptors
12294 abandoned by plugins.
12295 (Descriptors::claim_for_plugin): New function.
12296 * descriptors.h (Descriptors::claim_for_plugin): New function.
12297 (Open_descriptor::is_claimed): New field.
12298 (claim_descriptor_for_plugin): New function.
12299 * fileread.cc (File_read::claim_for_plugin): New function.
12300 * fileread.h (File_read::claim_for_plugin): New function.
12301 (File_read::descriptor): New function.
12302 * gold.cc: Include "plugin.h".
12303 (queue_initial_tasks): Add task to call plugin hooks for generating
12304 new object files.
12305 * main.cc: Include "plugin.h".
12306 (main): Load plugin libraries.
12307 * object.h (Pluginobj): Declare.
12308 (Object::pluginobj): New function.
12309 (Object::do_pluginobj): New function.
12310 (Object::set_target): New function.
12311 * options.cc: Include "plugin.h".
12312 (General_options::parse_plugin): New function.
12313 (General_options::General_options): Initialize plugins_ field.
12314 (General_options::add_plugin): New function.
12315 * options.h (Plugin_manager): Declare.
12316 (General_options): Add --plugin option.
12317 (General_options::has_plugins): New function.
12318 (General_options::plugins): New function.
12319 (General_options::add_plugin): New function.
12320 (General_options::plugins_): New field.
12321 * plugin.cc: New file.
12322 * plugin.h: New file.
12323 * readsyms.cc: Include "plugin.h".
12324 (Read_symbols::do_read_symbols): Check for archive before checking
12325 for ELF file. Call plugin hooks to claim files.
12326 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12327 from a real object file; force override when processing replacement
12328 files.
12329 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12330 (Symbol::init_base_object): Likewise.
12331 (Symbol::init_base_output_data): Likewise.
12332 (Symbol::init_base_output_segment): Likewise.
12333 (Symbol::init_base_constant): Likewise.
12334 (Symbol::init_base_undefined): Likewise.
12335 (Symbol::output_section): Assert that object is not a plugin.
12336 (Symbol_table::add_from_pluginobj): New function.
12337 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12338 undefined.
12339 (Symbol_table::sized_write_globals): Likewise.
12340 (Symbol_table::add_from_pluginobj): Instantiate template.
12341 * symtab.h (Sized_pluginobj): Declare.
12342 (Symbol::in_real_elf): New function.
12343 (Symbol::set_in_real_elf): New function.
12344 (Symbol::in_real_elf_): New field.
12345 (Symbol_table::add_from_pluginobj): New function.
12346
12347 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12348 (LIBDL): New variable.
12349 (LDADD): Add LIBDL.
12350 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12351 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12352 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12353 (MOSTLYCLEANFILES): Likewise.
12354 * testsuite/Makefile.in: Regenerate.
12355 * testsuite/plugin_test.c: New file.
12356 * testsuite/plugin_test_1.sh: New file.
12357 * testsuite/plugin_test_2.sh: New file.
12358
de31bda5
ILT
123592008-09-16 Ian Lance Taylor <iant@google.com>
12360
9c2d0ef9
ILT
12361 * target-reloc.h (relocate_section): Check whether a symbol is
12362 defined by the ABI before reporting an undefined symbol error.
12363 * target.h (Target::is_defined_by_abi): Make parameter const.
12364 (Target::do_is_defined_by_abi): Likewise.
12365 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12366 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12367 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12368 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12369 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12370 * testsuite/Makefile.in: Rebuild.
12371
de31bda5
ILT
12372 * fileread.cc (make_view): Add casts to avoid warning.
12373
9fa33bee
AO
123742008-09-16 Alexandre Oliva <aoliva@redhat.com>
12375
12376 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12377 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12378
183fd0e3
AO
123792008-09-16 Alexandre Oliva <aoliva@redhat.com>
12380
12381 * options.h (General_options::output_is_executable): New.
12382 (General_options::output_is_pie): New.
12383 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12384 for shared libraries.
12385 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12386
7be8330a
CD
123872008-09-11 Chris Demetriou <cgd@google.com>
12388
12389 * options.h (origin): New -z option.
12390 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12391 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12392 in DT_FLAGS_1.
12393
a9caad02
CC
123942008-09-05 Cary Coutant <ccoutant@google.com>
12395
12396 * fileread.cc (File_read::make_view): Add check for attempt to map
12397 beyond end of file.
12398
ae6dce4d
CC
123992008-09-05 Cary Coutant <ccoutant@google.com>
12400
12401 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
12402 explicit instantiations.
12403
d7ab2a47
KVH
124042008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
12405
12406 PR gold/6858
12407 * options.cc (General_options::finalize): Allow undefined symbols
12408 in shlibs if linking -shared.
12409
12410 PR gold/6859
12411 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
12412 symbols as not needing a dynsym entry.
12413
1e52a9c1
CS
124142008-08-20 Craig Silverstein <csilvers@google.com>
12415
12416 * fileread.cc (File_read::open): Do not lock the file unless it
12417 was successfully opened.
12418
d85c80a3
CC
124192008-08-14 Cary Coutant <ccoutant@google.com>
12420
12421 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
12422 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
12423 * testsuite/tls_test.cc (struct int128): 128-bit struct
12424 for testing TLS relocs with non-zero addend.
12425 (v12): New TLS variable.
12426 (t12): New test.
12427 (t_last): Add check for v12.
12428 * testsuite/tls_test.h (t12): New function.
12429 * testsuite/tls_test_main.cc (thread_routine): Call new test.
12430
2d924fd9
ILT
124312008-08-13 Ian Lance Taylor <iant@google.com>
12432
12433 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
12434 set tls_segment_ or relro_segment_.
12435 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
12436 when appropriate.
12437 * output.h (Output_section::clear_is_relro): New function.
12438 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
12439 sections specially even when output_data_ is empty.
12440 (Output_segment::maximum_alignment): When first section is relro,
12441 only force alignment for PT_LOAD segments.
12442 * script.cc (script_data_segment_align): New function.
12443 (script_data_segment_relro_end): New function.
12444 * script-c.h (script_data_segment_align): Declare.
12445 (script_data_segment_relro_end): Declare.
12446 * script-sections.h (class Script_sections): Declare
12447 data_segment_align and data_segment_relro_end. Add fields
12448 segment_align_index_ and saw_relro_end_.
12449 * script-sections.cc (class Sections_element): Add set_is_relro
12450 virtual function. Add new bool* parameter to place_orphan_here.
12451 Add get_output_section virtual function.
12452 (class Output_section_definition): Add set_is_relro. Add new
12453 bool* parameter to place_orphan_here. Add get_output_section.
12454 Add is_relro_ field.
12455 (Output_section_definition::Output_section_definition): Initialize
12456 evaluated_address_, evaluated_load_address, evaluated_addralign_,
12457 and is_relro_ fields.
12458 (Output_section_definition::place_orphan_here): Add is_relro
12459 parameter.
12460 (Output_section_definition::set_section_addresses): Set relro for
12461 output section.
12462 (Output_section_definition::alternate_constraint): Likewise.
12463 (class Orphan_output_section): Add new bool* parameter to
12464 place_orphan_here. Add get_output_section.
12465 (Orphan_output_section::place_orphan_here): Add is_relro
12466 parameter.
12467 (Script_sections::Script_sections): Initialize
12468 data_segment_align_index_ and saw_relro_end_.
12469 (Script_sections::data_segment_align): New function.
12470 (Script_sections::data_segment_relro_end): New function.
12471 (Script_sections::place_orphan): Set or clear is_relro.
12472 (Script_sections::set_section_addresses): Force alignment of first
12473 TLS section.
12474 * yyscript.y (exp): Call script_data_segment_align and
12475 script_data_segment_relro_end.
12476 * testsuite/relro_script_test.t: New file.
12477 * testsuite/relro_test.cc (using_script): Declare.
12478 (t1, t2): Test using_script.
12479 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
12480 (relro_script_test_SOURCES): Define.
12481 (relro_script_test_DEPENDENCIES): Define.
12482 (relro_script_test_LDFLAGS): Define.
12483 (relro_script_test_LDADD): Define.
12484 (relro_script_test.so): New target.
12485 * testsuite/Makefile.in: Rebuild.
12486
f827c9a9
CC
124872008-08-06 Cary Coutant <ccoutant@google.com>
12488
12489 * archive.cc (Archive::total_archives, Archive::total_members)
12490 (Archive::total_members_loaded): New variables.
12491 (Archive::setup): Add parameter. Add option to preread
12492 archive symbols.
12493 (Archive::read_armap): Add counter.
12494 (Archive::get_file_and_offset): New function.
12495 (Archive::get_elf_object_for_member): New function.
12496 (Archive::read_all_symbols): New function.
12497 (Archive::read_symbols): New function.
12498 (Archive::add_symbols): Add counters.
12499 (Archive::include_all_members): Use armap to find members if it's
12500 already built.
12501 (Archive::include_member): Skip reading symbols if already read.
12502 Factored code into Archive::get_file_and_offset and
12503 Archive::get_elf_object_for_member. Changed call to
12504 Mapfile::report_include_archive_member.
12505 (Archive::print_stats): New function.
12506 * archive.h: Declare Object and Read_symbols_data classes.
12507 (Archive::Archive): Add initializers for new members.
12508 (Archive::setup): Add parameter.
12509 (Archive::print_stats): New function.
12510 (Archive::total_archives, Archive::total_members)
12511 (Archive::total_members_loaded): New variables.
12512 (Archive::get_file_and_offset): New function.
12513 (Archive::get_elf_object_for_member): New function.
12514 (Archive::read_all_symbols): New function.
12515 (Archive::read_symbols): New function.
12516 (Archive::Archive_member): New class.
12517 (Archive::members_): New member.
12518 (Archive::num_members_): New member.
12519 * main.cc: Include archive.h.
12520 (main): Call Archive::print_stats.
12521 * mapfile.cc (Mapfile::report_include_archive_member): Delete
12522 archive parameter; member_name is now the fully-decorated name.
12523 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
12524 * options.h: (General_options): Add --preread-archive-symbols option.
12525 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
12526 Archive::setup.
12527
de4c45bd
ILT
125282008-08-04 Ian Lance Taylor <iant@google.com>
12529
12530 * symtab.h (Symbol::use_plt_offset): New function.
12531 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
12532 * powerpc.cc (Relocate::relocate): Likewise.
12533 * sparc.cc (Relocate::relocate): Likewise.
12534 * x86_64.cc (Relocate::relocate): Likewise.
12535 * testsuite/weak_plt.sh: New test.
12536 * testsuite/weak_plt_main.cc: New test.
12537 * testsuite/weak_plt_shared.cc: New test.
12538 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
12539 (check_PROGRAMS): Add weak_plt.
12540 (check_DATA): Add weak_plt_shared.so.
12541 (weak_plt_main_pic.o, weak_plt): New targets.
12542 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
12543 * testsuite/Makefile.in: Rebuild.
12544
12545 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
12546 gcctestdir/ld.
12547 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
12548 * testsuite/Makefile.in: Rebuild.
12549
323ee3f4
AM
125502008-08-04 Alan Modra <amodra@bigpond.net.au>
12551
12552 * Makefile.am (POTFILES.in): Set LC_ALL=C.
12553 * Makefile.in: Regenerate.
12554 * po/POTFILES.in: Regenerate.
12555
7c07ecec
ILT
125562008-07-29 Ian Lance Taylor <iant@google.com>
12557
12558 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
12559 symbols before other symbols.
12560 * testsuite/script_test_2.cc (test_addr): Declare.
12561 (test_addr_alias): Declare.
12562 (main): Check that test_addr and test_addr_alias have the right
cd536b21 12563 values.
7c07ecec
ILT
12564 * testsuite/script_test_2.t: Define test_addr_alias and
12565 test_addr.
12566
5778530e
ILT
125672008-07-24 Ian Lance Taylor <iant@google.com>
12568
2a00e4fb
ILT
12569 PR 5990
12570 * descriptors.cc: New file.
12571 * descriptors.h: New file.
12572 * gold-threads.h (class Hold_optional_lock): New class.
12573 * fileread.cc: Include "descriptors.h".
12574 (File_read::~File_read): Release descriptor rather than closing
12575 it.
12576 (File_read::open) [file]: Call open_descriptor rather than open.
12577 Set is_descriptor_opened_.
12578 (File_read::open) [memory]: Assert that descriptor is not open.
12579 (File_read::reopen_descriptor): New function.
12580 (File_read::release): Release descriptor.
12581 (File_read::do_read): Make non-const. Reopen descriptor.
12582 (File_read::read): Make non-const.
12583 (File_read::make_view): Reopen descriptor.
12584 (File_read::do_readv): Likewise.
12585 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12586 Update declarations.
12587 * layout.cc: Include "descriptors.h".
12588 (Layout::create_build_id): Use open_descriptor rather than open.
12589 * output.cc: Include "descriptors.h".
12590 (Output_file::open): Use open_descriptor rather than open.
12591 * archive.cc (Archive::const_iterator): Change Archive to be
12592 non-const.
12593 (Archive::begin, Archive::end): Make non-const.
12594 (Archive::count_members): Likewise.
12595 * archive.h (class Archive): Update declarations.
12596 * object.h (Object::read): Make non-const.
12597 * Makefile.am (CCFILES): Add descriptors.cc.
12598 (HFILES): Add descriptors.h.
12599 * Makefile.in: Rebuild.
12600
801647d1
ILT
12601 PR 6716
12602 * gold.h: Always include <clocale>. Add Solaris workarounds
12603 following code in binutils/sysdep.h.
12604
5edd166e
ILT
12605 PR 6048
12606 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12607 this->eh_frame_hdr_ is NULL before using it.
12608
c89ad728
ILT
12609 * dynobj.cc (Versions::Versions): Update comment.
12610
aa86f06b
ILT
12611 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12612 the base version name.
12613
5778530e
ILT
12614 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12615 array size plus one.
12616 (Stringpool_template::set_string_offsets): Subtract one from key
12617 before using it as an array index.
12618 (Stringpool_template::get_offset_with_length): Likewise.
12619 (Stringpool_template::write_to_buffer): Likewise.
12620 * stringpool.h (Stringpool_template::get_offset_from_key):
12621 Likewise.
12622
057ead22
ILT
126232008-07-23 Ian Lance Taylor <iant@google.com>
12624
7f649c59
ILT
12625 PR 6658
12626 * object.h (Merged_symbol_value::value): Do our best to handle a
12627 negative addend.
12628
057ead22
ILT
12629 PR 6647
12630 * script.cc (Version_script_info::get_versions): Don't add empty
12631 version tag to return value.
12632 (Version_script_info::get_symbol_version_helper): Change return
12633 type to bool. Add pversion parameter. Change all callers.
12634 (script_register_vers_node): Don't require a non-NULL tag.
12635 * script.h (class Version_script_info): Update declarations.
12636 (Version_script_info::get_symbol_version): Change return type to
12637 bool. Add version parameter. Change all callers.
12638 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12639 handling. Handle an empty version from a version script.
12640 (Symbol_table::define_special_symbol): Likewise.
12641 * testsuite/ver_test_10.script: New file.
12642 * testsuite/ver_test_10.sh: New file.
12643 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12644 (check_DATA): Add ver_test_10.syms.
12645 (ver_test_10.syms, ver_test_10.so): New target.
12646 * testsuite/Makefile.in: Rebuild.
12647
58e54ac2
CD
126482008-07-23 Simon Baldwin <simonb@google.com>
12649
12650 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12651 to zero for undefined symbols from dynamic libraries.
12652
95d14cd3
ILT
126532008-07-23 Ian Lance Taylor <iant@google.com>
12654
12655 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12656 Change all callers.
12657 * symtab.h (class Symbol_table): Update declaration.
12658 * testsuite/ver_test_9.cc: New file.
12659 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12660 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12661 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12662 (ver_test_9.so, ver_test_9.o): New targets.
12663 * testsuite/Makefile.in: Rebuild.
12664
92de84a6
ILT
126652008-07-22 Ian Lance Taylor <iant@google.com>
12666
34810851
ILT
12667 * options.h (class General_options): Define --check-sections.
12668 * layout.cc (Layout::set_segment_offsets): Handle
12669 --check-sections.
12670
af6156ef
ILT
12671 * options.h (class General_options): Define -n/--nmagic and
12672 -N/--omagic.
12673 * options.cc (General_options::finalize): For -n/--nmagic or
12674 -N/--omagic, set -static.
12675 * layout.cc (Layout::attach_allocated_section_to_segment): If
12676 -N/--omagic, don't put read-only and read-write sections in
12677 different segments.
12678 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12679 finding a read-only segment.
12680 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12681 don't set the minimum segment alignment to the common page size,
12682 and don't set the file offset to the address modulo the page size.
12683 * script-sections.cc (Script_sections::create_segments): If
12684 -n/--omagic, don't put read-only and read-write sections in
12685 different segments.
12686
92de84a6
ILT
12687 * cref.cc: New file.
12688 * cref.h: New file.
12689 * options.h (class General_options): Add --print-symbol-counts.
12690 * main.cc (main): Issue defined symbol report if requested.
12691 * archive.cc (Archive::interpret_header): Make into a const member
12692 function.
12693 (Archive::add_symbols): Call Input_objects::archive_start and
12694 archive_stop.
12695 (Archive::const_iterator): Define new class.
12696 (Archive::begin, Archive::end): New functions.
12697 (Archive::include_all_members): Rewrite to use iterator.
12698 (Archive::count_members): New function.
12699 * archive.h (class Archive): Update declarations.
12700 (Archive::filename): New function.
12701 * object.cc: Include "cref.h".
12702 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12703 (Sized_relobj::do_get_global_symbol_counts): New function.
12704 (Input_objects::add_object): Add object to cross-referencer.
12705 (Input_objects::archive_start): New function.
12706 (Input_objects::archive_stop): New function.
12707 (Input_objects::print_symbol_counts): New function.
12708 * object.h: Declare Cref and Archive.
12709 (Object::get_global_symbol_counts): New function.
12710 (Object::do_get_global_symbol_counts): New pure virtual function.
12711 (class Sized_relobj): Add defined_count_ field. Update
12712 declarations.
12713 (class Input_objects): Add cref_ field. Update constructor.
12714 Update declarations.
12715 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12716 defined_count_.
12717 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12718 symbol counts.
12719 (Sized_dynobj::do_get_global_symbol_counts): New function.
12720 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12721 defined_count_. Update declarations. Define Symbols typedef.
12722 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12723 parameter. Change all callers.
12724 (Symbol_table::add_from_dynobj): Add sympointers and defined
12725 parameters. Change all callers.
12726 * symtab.h (class Symbol_table): Update declarations.
12727 * Makefile.am (CCFILES): Add cref.cc.
12728 (HFILES): Add cref.h.
12729 * Makefile.in: Rebuild.
12730
3f7c5e1d
CD
127312008-07-22 Simon Baldwin <simonb@google.com>
12732
12733 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12734 to zero when writing undefined symbols.
12735
e0b64032
ILT
127362008-07-22 Ian Lance Taylor <iant@google.com>
12737
12738 * output.cc (Output_section::add_input_section): Don't try to
12739 merge empty merge sections.
12740
096b02cf
CS
127412008-07-21 Craig Silverstein <csilvers@google.com>
12742
12743 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12744 Include symbol version in error message.
cd536b21 12745
1d1f116d
CD
127462008-07-20 Chris Demetriou <cgd@google.com>
12747
cd536b21 12748 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12749 (RANDOM_SEED_CFLAGS): New substituted variable.
12750 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12751 * configure: Rebuild.
12752 * Makefile.in: Likewise.
12753 * testsuite/Makefile.in: Likewise.
12754
a18f591e
ILT
127552008-07-18 Ian Lance Taylor <iant@google.com>
12756
12757 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12758 where we see NAME/NULL and NAME/VERSION as separate symbols.
12759 * testsuite/ver_test_main.cc (main): Call t4.
12760 (t4, t4_2a): Define.
12761 * testsuite/ver_test_2.cc (t4_2): Define.
12762 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12763 * testsuite/ver_test_4.cc (t4_2a): Define.
12764 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12765 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12766
c6e3f6ed
ILT
127672008-07-17 Ian Lance Taylor <iant@google.com>
12768
12769 * dynobj.cc (Versions::add_def): If we give an error about a
12770 missing version, go ahead and create the version anyhow.
12771
ef9beddf
ILT
127722008-07-10 Ian Lance Taylor <iant@google.com>
12773
12774 Handle output sections with more than 0x7fffffff bytes.
12775 * object.h (class Relobj): Change map_to_output_ to
12776 output_sections_, and just keep a section pointer. Change all
12777 uses. Move comdat group support to Sized_relobj.
12778 (Relobj::is_section_specially_mapped): Remove.
12779 (Relobj::output_section): Remove poff parameter. Change all
12780 callers.
12781 (Relobj::output_section_offset): New function.
12782 (Relobj::set_section_offset): Rewrite.
12783 (Relobj::map_to_output): Remove.
12784 (Relobj::output_sections): New function.
12785 (Relobj::do_output_section_offset): New pure virtual function.
12786 (Relobj::do_set_section_offset): Likewise.
12787 (class Sized_relobj): Add section_offsets_ field. Add comdat
12788 group support from Relobj. Update declarations.
12789 (Sized_relobj::get_output_section_offset): New function.
12790 (Sized_relobj::do_output_section_offset): New function.
12791 (Sized_relobj::do_set_section_offset): New function.
12792 * object.cc (Relobj::output_section_address): Remove.
12793 (Sized_relobj::Sized_relobj): Initialize new fields.
12794 (Sized_relobj::include_section_group): Cast find_kept_object to
12795 Sized_relobj.
12796 (Sized_relobj::include_linkonce_section): Likewise.
12797 (Sized_relobj::do_layout): Use separate arrays for output section
12798 and output offset.
12799 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12800 output_sections.
12801 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12802 output_sections and section_offsets.
12803 (Sized_relobj::write_local_symbols): Likewise.
12804 (map_to_kept_section): Compute output address directly.
12805 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12806 output_sections and section_offsets.
12807 (Sized_relobj::write_sections): Likewise.
12808 (Sized_relobj::relocate_sections): Likewise.
12809 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12810 * output.h (class Output_reloc): Update declarations. Change
12811 u2_.relobj to Sized_relobj*.
12812 (class Output_data_reloc): Change add functions to use
12813 Sized_relobj*.
12814 * output.cc (Output_reloc::Output_reloc): Change relobj to
12815 Sized_relobj*.
12816 (Output_reloc::local_section_offset): Change return type to
12817 Elf_Addr. Use get_output_section_offset.
12818 (Output_reloc::get_address): Likewise.
12819 (Output_section::is_input_address_mapped): Don't call
12820 is_section_specially_mapped.
12821 (Output_section::output_offset): Likewise.
12822 (Output_section::output_address): Likewise.
12823 (Output_section::starting_output_address): Likewise.
12824 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12825 parameter to Sized_relobj*.
12826 (Copy_relocs::need_copy_reloc): Likewise.
12827 (Copy_relocs::save): Likewise.
12828 * copy-relocs.h (class Copy_relocs): Update declarations.
12829 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12830 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12831 * target-reloc.h (relocate_for_relocatable): Change
12832 offset_in_output_section type to Elf_Addr. Change code that uses
12833 it as well.
12834 * layout.cc (Layout::layout): Always set *off.
12835 * mapfile.cc (Mapfile::print_input_section): Use
12836 output_section_offset.
12837 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12838 Sized_relobj*.
12839 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12840 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12841 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12842
5cb66f97
ILT
128432008-07-03 Ian Lance Taylor <iant@google.com>
12844
12845 * layout.cc (Layout::include_section): Do not discard unrecognized
12846 SHT_STRTAB sections.
12847
afe47622
CS
128482008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12849
12850 * script.cc (Lex::can_continue_name): Make '?' allowable in
12851 version-script names.
12852 * testsuite/version_script.map: Change glob pattern to use '?'
12853
5adf9721
ILT
128542008-06-30 Manish Singh <yosh@gimp.org>
12855
12856 PR 6585
12857 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12858 Correct typo.
12859
e6fde208
ILT
128602008-06-30 Ian Lance Taylor <iant@google.com>
12861
12862 PR 6660
12863 PR 6682
12864 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12865 versions]: Don't try to read the value in the contents, since we
12866 don't use it. Use the template endianness when writing.
12867
3f2e6a2d
CC
128682008-06-25 Cary Coutant <ccoutant@google.com>
12869
12870 * fileread.cc (File_read::make_view): Assert on zero-length view.
12871 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12872 symbol table when there are no symbols to read.
12873
c43d3a48
CS
128742008-06-23 Craig Silverstein <csilvers@google.com>
12875
12876 * version.cc (version_string): Bump to 1.7
12877
5f494ea0
CS
128782008-06-18 Craig Silverstein <csilvers@google.com>
12879
12880 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12881 constant 0xFFFF to type Valtype.
12882 (Powerpc_relocate_functions::rel16_ha): Likewise.
12883
c42e122e
ILT
128842008-06-17 Ian Lance Taylor <iant@google.com>
12885
f34787f8
ILT
12886 * output.h (Output_section::Input_section): Initialize p2align_ to
12887 zero for Output_section_data constructors.
12888 (Output_section::Input_section::addralign): If not an input
12889 section, return the alignment of the Output_section_data.
12890 * testsuite/copy_test.cc: New file.
12891 * testsuite/copy_test_1.cc: New file.
12892 * testsuite/copy_test_2.cc: New file.
12893 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12894 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12895 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12896 (copy_test_1_pic.o, copy_test_1.so): New targets.
12897 (copy_test_2_pic.o, copy_test_2.so): New targets.
12898 * testsuite/Makefile.in: Rebuild.
12899
c42e122e
ILT
12900 * script-sections.cc (Script_sections::place_orphan): Initialize
12901 local variable exact.
12902
ce3ac18a
DE
129032008-06-13 David Edelsohn <edelsohn@gnu.org>
12904
12905 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12906
42cacb20
DE
129072008-06-12 David Edelsohn <edelsohn@gnu.org>
12908 David S. Miller <davem@davemloft.net>
12909
12910 * powerpc.cc: New file.
12911 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12912 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12913 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12914 * Makefile.in: Rebuild.
12915
7b308235
ILT
129162008-06-09 Ian Lance Taylor <iant@google.com>
12917
12918 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12919 <exception>.
12920 (throwing, orig_terminate): New static variables.
12921 (terminate_handler): New static function.
12922 (t2): Set terminate handler.
12923
f0b886e3
ILT
129242008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12925
12926 PR 6584
cd536b21 12927 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12928 alignment.
12929
3e90f135
CC
129302008-05-30 Cary Coutant <ccoutant@google.com>
12931
12932 * archive.cc (Archive::include_all_members) Correct to step
12933 over symbol table and extended name table in thin archives.
12934
e09ad04a
ILT
129352008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12936
12937 PR 6407
12938 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12939 calculation.
12940
62b01cb5
ILT
129412008-05-28 Caleb Howe <cshowe@google.com>
12942
12943 * reduced_debug_output.cc: New file.
12944 * reduced_debug_output.h: New file.
92de84a6 12945 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12946 * options.cc (General_options::finalize): Add strip_debug_non_line
12947 to the strip heirarchy.
12948 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12949 fields.
12950 * layout.cc: Include "reduced_debug_output.h".
12951 (Layout::Layout): Initialize new fields.
12952 (line_only_debug_sections): New static array.
12953 (is_lines_only_debug_sections): New static inline function.
12954 (Layout::include_section): Handle --strip-debug-non-line.
12955 (Layout::make_output_section): If --strip-debug-non-line, build
12956 new output sections for .debug_abbrev and .debug_info.
12957 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12958 gold. Warn about possible overflow.
12959 (read_signed_LEB_128): Likewise.
12960 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12961 (read_signed_LEB_128): Declare.
12962 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12963 (HFILES): Add reduced_debug_output.h.
12964 * Makefile.in: Rebuild.
12965
7d9e3d98
ILT
129662008-05-21 Ian Lance Taylor <iant@google.com>
12967
12968 * mapfile.cc: New file.
12969 * mapfile.h: New file.
12970 * options.h (class General_options): Add -M/--print-map and -Map.
12971 * options.cc (General_options::finalize): Make -M equivalent to
12972 -Map -.
12973 * main.cc: Include <cstdio> and "mapfile.h".
12974 (main): Open mapfile if requested.
12975 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12976 constructor. Change caller.
12977 (queue_initial_tasks): Add mapfile parameter. Change caller.
12978 (queue_middle_tasks): Likewise.
12979 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12980 declarations.
12981 * archive.cc: Include "mapfile.h".
12982 (Archive::add_symbols): Add mapfile parameter. Change all
12983 callers. Pass mapfile, symbol, and reason to include_member.
12984 (Archive::include_all_members): Add mapfile parameter. Change all
12985 callers.
12986 (Archive::include_member): Add mapfile, sym, and why parameters.
12987 Change all callers. Report inclusion to map file.
12988 * archive.h: Include "fileread.h".
12989 (class Archive): Update declarations.
12990 (Archive::file): New const method.
12991 (class Add_archive_symbols): Add mapfile_ field. Update
12992 constructor. Change all callers.
12993 * readsyms.h (class Read_symbols): Likewise.
12994 (class Finish_group): Likewise.
12995 (class Read_script): Likewise.
12996 * common.cc: Include "mapfile.h".
12997 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12998 all callers.
12999 (Symbol_table::do_allocate_commons): Likewise.
13000 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13001 symbol allocation to mapfile.
13002 * common.h (class Allocate_commons_task): Add mapfile_ field.
13003 Update constructor. Change all callers.
13004 * symtab.h (class Symbol_table): Update declarations.
13005 * layout.cc: Include "mapfile.h".
13006 (Layout_task_runner::run): Print information to mapfile.
13007 (Layout::create_gold_note): Change Output_data_fixed_space to
13008 Output_data_zero_fill.
13009 (Layout::create_build_id): Likewise.
13010 (Layout::print_to_mapfile): New function.
13011 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13012 constructor. Change caller.
13013 (class Layout): Declare print_to_mapfile.
13014 * output.cc (Output_section::Input_section::print_to_mapfile): New
13015 function.
13016 (Output_section::add_input_section): If producing a map, always
13017 add to input_sections_ list.
13018 (Output_section::do_print_to_mapfile): New function.
13019 (Output_segment::print_sections_to_mapfile): New function.
13020 (Output_segment::print_section_list_to_mapfile): New function.
13021 * output.h: Include "mapfile.h".
13022 (Output_data::print_to_mapfile): New function.
13023 (Output_data::do_print_to_mapfile): New virtual function.
13024 (Output_segment_headers::do_print_to_mapfile): New function.
13025 (Output_file_header::do_print_to_mapfile): New function.
13026 (Output_data_const::do_print_to_mapfile): New function.
13027 (class Output_data_const_buffer): Add map_name_ field. Update
13028 constructor. Change all callers. Add do_print_to_mapfile
13029 function.
13030 (class Output_data_fixed_space): Likewise.
13031 (class Output_data_space): Likewise.
13032 (class Output_data_zero_fill): New class.
13033 (Output_data_strtab::do_print_to_mapfile): New function.
13034 (Output_data_reloc_base::do_print_to_mapfile): New function.
13035 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13036 (Output_data_group::do_print_to_mapfile): New function.
13037 (Output_data_got::do_print_to_mapfile): New function.
13038 (Output_data_dynamic::do_print_to_mapfile): New function.
13039 (Output_symtab_xindex::do_print_to_mapfile): New function.
13040 (class Output_section): Declare do_print_to_mapflie. Declare
13041 print_to_mapfile in Input_section.
13042 (class Output_segment): Declare new functions.
13043 * object.h (Sized_relobj::symbol_count): New function.
13044 * script-sections.cc
13045 (Output_section_element_dot_assignment::set_section_addresses):
13046 Change Output_data_fixed_space to Output_data_zero_fill.
13047 (Output_data_expression::do_print_to_mapfile): New function.
13048 * script.cc (read_input_script): Add mapfile parameter. Change
13049 all callers.
13050 * script.h (read_input_script): Update declaration.
13051 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13052 (Eh_frame::do_print_to_mapfile): New function.
13053 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13054 (Output_merge_string::do_print_to_mapfile): New function.
13055 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13056 function.
13057 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13058 function.
13059 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13060 function.
13061 * Makefile.am (CCFILES): Add mapfile.cc.
13062 (HFILES): Add mapfile.h.
13063 * Makefile.in: Rebuild.
13064
9f1d377b
ILT
130652008-05-19 Ian Lance Taylor <iant@google.com>
13066
13067 * options.h (class General_options): Add -z relro.
13068 * layout.cc (Layout::Layout): Initialize relro_segment_.
13069 (Layout::add_output_section_data): Return the output section.
13070 (Layout::make_output_section): Rcognize relro sections and mark
13071 them appropriately.
13072 (Layout::attach_allocated_section_to_segment): Put relro sections
13073 in a PT_GNU_RELRO segment.
13074 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13075 section as relro.
13076 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13077 PT_TLS segments.
13078 (Layout::linkonce_mapping): Map d.rel.ro.local to
13079 .data.rel.ro.local.
13080 (Layout::output_section_name): Us .data.rel.ro.local for any
13081 section which begins with that.
13082 * layout.h (class Layout): Update add_output_section_data
13083 declaration. Add relro_segment_ field.
13084 * output.cc (Output_section::Output_section): Initialize is_relro_
13085 and is_relro_local_ fields.
13086 (Output_segment::add_output_section): Group relro sections.
13087 (Output_segment::is_first_section_relro): New function.
13088 (Output_segment::maximum_alignment): If there is a relro section,
13089 align the segment to the common page size.
13090 (Output_segment::set_section_addresses): Track whether we are
13091 looking at relro sections. If the last section is a relro
13092 section, align to the common page size.
13093 (Output_segment::set_section_list_addresses): Add in_relro
13094 parameter. Change all callers. Align to the page size when
13095 moving from relro to non-relro section.
13096 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13097 segment.
13098 * output.h (class Output_section): Add is_relro_ and
13099 is_relro_local_ fields.
13100 (Output_section::is_relro): New function.
13101 (Output_section::set_is_relro): New function.
13102 (Output_section::is_relro_local): New function.
13103 (Output_section::set_is_relro_local): New function.
13104 (class Output_segment): Update declarations.
13105 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13106 * sparc.cc (Target_sparc::got_section): Likewise.
13107 * x86_64.cc (Target_x86_64::got_section): Likewise.
13108 * testsuite/relro_test_main.cc: New file.
13109 * testsuite/relro_test.cc: New file.
13110 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13111 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13112 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13113 (relro_test.so, relro_test_pic.o): New targets.
13114 * testsuite/Makefile.in: Rebuild.
13115
a984ee1d
ILT
131162008-05-16 Ian Lance Taylor <iant@google.com>
13117
01676dcd
ILT
13118 * output.cc (Output_segment::add_output_section): Remove front
13119 parameter.
13120 * output.h (class Output_segment): Remove
13121 add_initial_output_section and overloaded add_output_section.
13122 Update declaration of remaining add_output_section.
13123 * layout.cc (Layout::create_interp): Call add_output_section
13124 rather than add_initial_output_section.
13125 (Layout::finish_dynamic_section): Likewise.
13126
497897f9
ILT
13127 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13128 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13129 know the dynamic type.
13130 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13131 field. Initialize it in constructor.
13132 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13133 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13134 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13135 reloc.
13136
a984ee1d
ILT
13137 * output.cc (Output_reloc::get_address): Change return type to
13138 Elf_Addr.
13139 * output.h (class Output_reloc): Update get_address declaration.
13140 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13141 for section addresses.
13142
55ba0940
ILT
131432008-05-09 Ian Lance Taylor <iant@google.com>
13144
13145 PR 6493
13146 * gold.cc (gold_nomem): Use return value of write.
13147
75517b77
ILT
131482008-05-08 Ian Lance Taylor <iant@google.com>
13149
13150 * symtab.c (Symbol::init_base_output_data): Add version
13151 parameter. Change all callers.
13152 (Symbol::init_base_output_segment): Likewise.
13153 (Symbol::init_base_constant): Likewise.
13154 (Symbol::init_base_undefined): Likewise.
13155 (Sized_symbol::init_output_data): Likewise.
13156 (Sized_symbol::init_output_segment): Likewise.
13157 (Sized_symbol::init_constant): Likewise.
13158 (Sized_symbol::init_undefined): Likewise.
13159 (Symbol_table::do_define_in_output_data): If the new symbol has a
13160 version, mark it as the default.
13161 (Symbol_table::do_define_in_output_segment): Likewise.
13162 (Symbol_table::do_define_as_constant): Likewise.
13163 * symtab.h (class Symbol): Update declarations.
13164 (class Sized_symbol): Likewise.
13165 * resolve.cc (Symbol::override_version): New function.
c42e122e 13166 (Symbol::override_base): Call override_version.
75517b77
ILT
13167 (Symbol::override_base_with_special): Likewise.
13168 * testsuite/ver_script_8.script: New file.
13169 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13170 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13171 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13172 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13173
f1f70eae
ILT
131742008-05-06 Ian Lance Taylor <iant@google.com>
13175
f3e9c5c5
ILT
13176 PR 6049
13177 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13178 functions.
13179 (class General_options): Remove existing --undefined, and add
13180 --no-undefined instead. Add new --undefined as synonym for -u.
13181 * archive.cc (Archive::add_symbols): Check whether symbol was
13182 named with -u.
13183 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13184 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13185 all uses. Add IS_UNDEFINED. Update declarations to split
13186 different versions of init_base. Declare init_base_undefined.
13187 (Symbol::is_defined): Handle IS_UNDEFINED.
13188 (Symbol::is_undefined): Likewise.
13189 (Symbol::is_weak_undefined): Call is_undefined.
13190 (Symbol::is_absolute): Handle IS_CONSTANT.
13191 (class Sized_symbol): Update declarations to split different
13192 versions of init. Declare init_undefined.
13193 (class Symbol_table): Declare new functions.
13194 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13195 Change all callers.
13196 (Symbol::init_base_output_data): Likewise.
13197 (Symbol::init_base_output_segment): Likewise.
13198 (Symbol::init_base_constant): Likewise.
13199 (Symbol::init_base_undefined): New function.
13200 (Sized_symbol::init_object): Rename from init. Change all
13201 callers.
13202 (Sized_symbol::init_output_data): Likewise.
13203 (Sized_symbol::init_output_segment): Likewise.
13204 (Sized_symbol::init_constant): Likewise.
13205 (Sized_symbol::init_undefined): New function.
13206 (Symbol_table::add_undefined_symbols_from_command_line): New
13207 function.
13208 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13209 function.
13210 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13211 (Symbol::output_section): Likewise.
13212 (Symbol::set_output_section): Likewise.
13213 (Symbol_table::sized_finalize_symbol): Likewise.
13214 (Symbol_table::sized_write_globals): Likewise.
13215 * resolve.cc (Symbol_table::should_override): Likewise.
13216 (Symbol::override_base_with_special): Likewise.
13217
8bdcdf2c
ILT
13218 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13219 symbol, change it to have default visibility.
13220 * testsuite/protected_1.cc: New file.
13221 * testsuite/protected_2.cc: New file.
13222 * testsuite/protected_3.cc: New file.
13223 * testsuite/protected_main_1.cc: New file.
13224 * testsuite/protected_main_2.cc: New file.
13225 * testsuite/protected_main_3.cc: New file.
13226 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13227 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13228 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13229 (protected_1.so): New target.
13230 (protected_1_pic.o, protected_2_pic.o): New targets.
13231 (protected_3_pic.o): New target.
13232 (check_PROGRAMS): Add protected_2.
13233 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13234 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13235 * testsuite/Makefile.in: Rebuild.
13236
2b706932
ILT
13237 * options.h (DEFINE_var): Add set_user_set_##varname__.
13238 (DEFINE_bool_alias): New macro.
13239 (class General_options): Define -Bstatic using DEFINE_bool_alias
13240 rather than DEFINE_special. Add --undefined as an alias for -z
13241 defs.
13242 * options.cc (General_options::parse_Bstatic): Remove.
13243
d82a5bcc
ILT
13244 * options.h (class General_options): Add --fatal-warnings.
13245 * main.cc (main): Implement --fatal-warnings.
13246 * errors.h (Errors::warning_count): New function.
13247
f1f70eae
ILT
13248 * options.h (class General_options): Add -Bsymbolic-functions.
13249 * symtab.h (Symbol::is_preemptible): Check for
13250 -Bsymbolic-functions.
13251
8825ac63
ILT
132522008-05-05 Ian Lance Taylor <iant@google.com>
13253
d98bc257
ILT
13254 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13255 as noVARNAME rather than no-VARNAME.
13256 (class General_options): Add option -z combreloc.
13257 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13258 get_address.
13259 (Output_reloc::sort_before) [SHT_REL]: New function.
13260 (Output_reloc::sort_before) [SHT_RELA]: New function.
13261 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13262 Sort_relocs_comparison.
13263 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13264 parameter. Change all callers.
13265 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13266 sort_relocs parameter. Change all callers.
13267 * output.cc (Output_reloc::get_address): New function, broken out
13268 of write_rel.
13269 (Output_reloc::write_rel): Call it.
13270 (Output_reloc::compare): New function.
13271 (Output_data_reloc_base::do_write): Optionally sort relocs.
13272
60b2b4e7
ILT
13273 * configure.ac: If targ_extra_obj is set, link it in.
13274 * configure.tgt: Initialize all variables.
13275 (x86_64*): Set targ_extra_obj and targ_extra_size.
13276 * configure: Rebuild.
13277
8825ac63
ILT
13278 * object.cc (Sized_relobj::include_section_group): Adjust section
13279 indexes read from group data. Build vector to pass to
13280 layout_group.
13281 * layout.cc (Layout::layout_group): Add flags and shndxes
13282 parameters. Remove contents parameter. Change caller. Update
13283 explicit instantiations.
13284 * layout.h (class Layout): Update layout_group declaration.
13285 * output.cc (Output_data_group::Output_data_group): Add flags and
13286 input_shndxes parameters. Remove contents parameter. Change
13287 caller.
13288 (Output_data_group::do_write): Change input_sections_ to
13289 input_shndxes_.
13290 * output.h (class Output_data_group): Update constructor
13291 declaration. Rename input_sections_ to input_shndxes_.
13292 * testsuite/many_sections_test.cc: Add template.
13293
e94cf127
CC
132942008-04-30 Cary Coutant <ccoutant@google.com>
13295
4418b2d5
CC
13296 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13297
e94cf127
CC
13298 * layout.cc (Layout::include_section): Refactored check for debug
13299 info section.
13300 (Layout::add_comdat): Add new parameters. Change type
13301 of signature parameter. Add object and shndx to signatures table.
13302 (Layout::find_kept_object): New function.
13303 * layout.h: Include <cstring>.
13304 (Layout::is_debug_info_section): New function.
13305 (Layout::add_comdat): Add new parameters.
13306 (Layout::find_kept_object): New function.
13307 (Layout::Kept_section): New struct.
13308 (Layout::Signatures): Change type of map range.
13309 * object.cc (Relobj::output_section_address): New function.
13310 (Sized_relobj::include_section_group): Add new parameters. Change
13311 calls to Layout::add_comdat. Change to build table of kept comdat
13312 groups and table mapping discarded sections to kept sections.
13313 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13314 (Sized_relobj::do_layout): Change calls to include_section_group and
13315 include_linkonce_section.
13316 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13317 value to zero when section is discarded.
13318 (Sized_relobj::map_to_kept_section): New function.
13319 * object.h (Relobj::output_section_address): New function.
13320 (Relobj::Comdat_group): New type.
13321 (Relobj::find_comdat_group): New function.
13322 (Relobj::Comdat_group_table): New type.
13323 (Relobj::Kept_comdat_section): New type.
13324 (Relobj::Kept_comdat_section_table): New type.
13325 (Relobj::add_comdat_group): New function.
13326 (Relobj::set_kept_comdat_section): New function.
13327 (Relobj::get_kept_comdat_section): New function.
13328 (Relobj::comdat_groups_): New field.
13329 (Relobj::kept_comdat_sections_): New field.
13330 (Symbol_value::input_value): Update comment.
13331 (Sized_relobj::map_to_kept_section) New function.
13332 (Sized_relobj::include_linkonce_section): Add new parameter.
13333 * target-reloc.h (Comdat_behavior): New type.
13334 (get_comdat_behavior): New function.
13335 (relocate_section): Add code to map a discarded section to the
13336 corresponding kept section when applying a relocation.
13337
e4e5049b
CS
133382008-04-30 Craig Silverstein <csilvers@google.com>
13339
13340 * dwarf_reader.cc (next_generation_count): New static var.
13341 (Addr2line_cache_entry): New struct.
13342 (addr2line_cache): New static var.
13343 (Dwarf_line_info::one_addr2line): Added caching.
13344 (Dwarf_line_info::clear_addr2line_cache): New function.
13345 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13346 cache-size parameter.
13347 (Dwarf_line_info::one_addr2line_cache): New function.
13348 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13349 new cache-size argument to one_addr2line(), and clear cache.
13350
d09e9154
CC
133512008-04-28 Cary Coutant <ccoutant@google.com>
13352
13353 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13354 R_386_PC8 relocations.
13355
7ef73768
ILT
133562008-04-23 Ian Lance Taylor <iant@google.com>
13357
55438702
ILT
13358 * object.cc (Sized_relobj::include_section_group): Check for
13359 invalid section group.
13360
c165fb93
ILT
13361 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13362 header size.
13363
7ef73768
ILT
13364 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13365 than read for file header.
13366 * archive.cc (Archive::include_member): Likewise.
13367
6194aaab
L
133682008-04-23 Paolo Bonzini <bonzini@gnu.org>
13369
13370 * aclocal.m4: Regenerate.
13371 * configure: Regenerate.
13372
d491d34e
ILT
133732008-04-19 Ian Lance Taylor <iant@google.com>
13374
5ea2bac6
ILT
13375 * version.cc (version_string): Bump to 1.6.
13376
7bc3e21a
ILT
13377 * testsuite/Makefile.am (many_sections_r_test): New target.
13378 (many_sections_r_test_SOURCES): Remove.
13379 (many_sections_r_test_DEPENDENCIES): Remove.
13380 (many_sections_r_test_LDFLAGS): Remove.
13381 (many_sections_r_test_LDADD): Remove.
13382
7fcd3aa9
ILT
13383 * object.cc (Sized_relobj::do_add_symbols): Always pass
13384 local_symbol_count_ to add_from_relobj.
13385
4c94d6ae
ILT
13386 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13387 every thousand variables.
13388 * testsuite/Makefile.in: Rebuild.
13389
d491d34e
ILT
13390 * object.cc (Xindex::initialize_symtab_xindex): New function.
13391 (Xindex::read_symtab_xindex): New function.
13392 (Xindex::sym_xindex_to_shndx): New function.
13393 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
13394 available.
13395 (Sized_relobj::do_initialize_xindex): New function.
13396 (Sized_relobj::do_read_symbols): Adjust section links.
13397 (Sized_relobj::symbol_section_and_value): Add is_ordinary
13398 parameter. Change all callers.
13399 (Sized_relobj::include_section_group): Adjust section links and
13400 symbol section indexes.
13401 (Sized_relobj::do_layout): Adjust section links.
13402 (Sized_relobj::do_count_local_symbols): Adjust section links and
13403 symbol section indexes.
13404 (Sized_relobj::do_finalize_local_symbols): Distinguish between
13405 ordinary and special symbols.
13406 (Sized_relobj::write_local_symbols): Add symtab_xindex and
13407 dynsym_xindex parameters. Change all callers. Adjust section
13408 links. Use SHN_XINDEX when needed.
13409 (Sized_relobj::get_symbol_location_info): Adjust section links.
13410 Don't get fooled by special symbols.
13411 * object.h (class Xindex): Define.
13412 (class Object): Add xindex_ parameter. Declare virtual functoin
13413 do_initialize_xindex.
13414 (Object::adjust_sym_shndx): New function.
13415 (Object::set_xindex): New protected function.
13416 (class Symbol_value): Add is_ordinary_shndx_ field.
13417 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
13418 (Symbol_value::value): Assert ordinary section.
13419 (Symbol_value::initialize_input_to_output_map): Likewise.
13420 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
13421 Change all callers.
13422 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
13423 all callers.
13424 (class Sized_relobj): Update declarations.
13425 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
13426 parameter. Change all callers.
13427 (Sized_relobj::adjust_shndx): New function.
13428 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
13429 field.
13430 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
13431 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
13432 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
13433 (Sized_dynobj::read_dynsym_section): Adjust section links.
13434 (Sized_dynobj::read_dynamic): Likewise.
13435 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
13436 section links.
13437 (Sized_dynobj::do_initialize_xindex): New function.
13438 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
13439 do_initialize_xindex.
13440 (Sized_dynobj::adjust_shndx): New function.
13441 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
13442 dynsym_xindex_ fields.
13443 (Layout::finalize): Add a call to set_section_indexes before
13444 creating the symtab sections.
13445 (Layout::set_section_indexes): Don't do anything if the section
13446 already has a section index.
13447 (Layout::create_symtab_sections): Add shnum parameter. Change
13448 caller. Create .symtab_shndx section if needed.
13449 (Layout::create_shdrs): Add shstrtab_section parameter. Change
13450 caller.
13451 (Layout::allocated_output_section_count): New function.
13452 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
13453 needed.
13454 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
13455 fields. Update declarations.
13456 (Layout::symtab_xindex): New function.
13457 (Layout::dynsym_xindex): New function.
13458 (class Write_symbols_task): Add layout_ field.
13459 (Write_symbols_task::Write_symbols_task): Add layout parameter.
13460 Change caller.
13461 * output.cc (Output_section_headers::Output_section_headers): Add
13462 shstrtab_section parameter. Change all callers.
13463 (Output_section_headers::do_sized_write): Store overflow values
13464 for section count and section string table section index in
13465 section header zero.
13466 (Output_file_header::do_sized_write): Check for overflow of
13467 section count and section string table section index.
13468 (Output_symtab_xindex::do_write): New function.
13469 (Output_symtab_xindex::endian_do_write): New function.
13470 * output.h (class Output_section_headers): Add shstrtab_section_.
13471 Update declarations.
13472 (class Output_symtab_xindex): Define.
13473 (Output_section::has_out_shndx): New function.
13474 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
13475 field.
13476 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
13477 Change all callers.
13478 (Sized_symbol::init): Likewise.
13479 (Symbol::output_section): Check for ordinary symbol.
13480 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
13481 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
13482 callers.
13483 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
13484 Change all callers. Simplify handling of symbols from sections
13485 not included in the link.
13486 (Symbol_table::add_from_dynobj): Handle ordinary symbol
13487 distinction.
13488 (Weak_alias_sorter::operator()): Assert that symbols are
13489 ordinary.
13490 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
13491 distinction.
13492 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
13493 parameters. Change all callers.
13494 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
13495 symbol distinction. Use SHN_XINDEX when needed.
13496 (Symbol_table::write_section_symbol): Add symtab_xindex
13497 parameter. Change all callers.
13498 (Symbol_table::sized_write_section_symbol): Likewise. Use
13499 SHN_XINDEX when needed.
13500 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
13501 declarations.
13502 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
13503 (Symbol::is_defined): Check is_ordinary.
13504 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
13505 (Symbol::is_absolute, Symbol::is_common): Likewise.
13506 (class Sized_symbol): Update declarations.
13507 (class Symbol_table): Update declarations.
13508 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
13509 parameters. Change all callers.
13510 (Sized_symbol::override): Likewise.
13511 (Symbol_table::override): Likewise.
13512 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
13513 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
13514 is_ordinary, and orig_st_shndx parameters. Change all callers.
13515 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
13516 to be in an ordinary section.
13517 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
13518 object and is_ordinary parameters. Change all callers.
13519 (Sized_dwarf_line_info::read_relocs): Add object parameter.
13520 Change all callers. Don't add undefined or non-ordinary symbols
13521 to reloc_map_.
13522 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
13523 Change all callers.
13524 * dwarf_reader.h (class Sized_dwarf_line_info): Update
13525 declarations.
13526 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
13527 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
13528 (Sized_relobj::relocate_sections): Likewise.
13529 * target-reloc.h (scan_relocs): Adjust section symbol index.
13530 (scan_relocatable_relocs): Likewise.
13531 * i386.cc (Scan::local): Check for ordinary symbols.
13532 * sparc.cc (Scan::local): Likewise.
13533 * x86_64.cc (Scan::local): Likewise.
13534 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
13535 to symbol_section_and_value.
13536 * testsuite/many_sections_test.cc: New file.
13537 * testsuite/Makefile.am (BUILT_SOURCES): Define.
13538 (check_PROGRAMS): Add many_sections_test.
13539 (many_sections_test_SOURCES): Define.
13540 (many_sections_test_DEPENDENCIES): Define.
13541 (many_sections_test_LDFLAGS): Define.
13542 (BUILT_SOURCES): Add many_sections_define.h.
13543 (many_sections_define.h): New target.
13544 (BUILT_SOURCES): Add many_sections_check.h.
13545 (many_sections_check.h): New target.
13546 (check_PROGRAMS): Add many_sections_r_test.
13547 (many_sections_r_test_SOURCES): Define.
13548 (many_sections_r_test_DEPENDENCIES): Define.
13549 (many_sections_r_test_LDFLAGS): Define.
13550 (many_sections_r_test_LDADD): Define.
13551 (many_sections_r_test.o): New target.
13552 * testsuite/Makefile.in: Rebuild.
13553
c5818ff1
CC
135542008-04-17 Cary Coutant <ccoutant@google.com>
13555
13556 * errors.cc (Errors::info): New function.
13557 (gold_info): New function.
13558 * errors.h (Errors::info): New function.
13559 * gold.h (gold_info): New function.
13560 * object.cc (Input_objects::add_object): Print trace output.
13561 * options.cc (options::parse_set): New function.
13562 (General_options::parse_wrap): Deleted.
13563 (General_options::General_options): Deleted initializer.
13564 * options.h (options::String_set): New typedef.
13565 (options::parse_set): New function.
13566 (DEFINE_set): New macro.
13567 (General_options::wrap): Changed to use DEFINE_set. Changed
13568 callers of any_wrap_symbols and is_wrap_symbol.
13569 (General_options::trace, General_options::trace_symbol):
13570 New options.
13571 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13572 (General_options::wrap_symbols_): Deleted.
13573 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13574
b5be4a7c
DM
135752008-04-17 David S. Miller <davem@davemloft.net>
13576
13577 * options.cc (General_options::parse_V): New function.
13578 * options.h: Add entries for -V and -Qy.
13579
155a0dd7
ILT
135802008-04-17 Ian Lance Taylor <iant@google.com>
13581
13582 * common.cc (Symbol_table::allocate_commons): Remove options
13583 parameter. Change caller.
13584 (Symbol_table::do_allocate_commons): Remove options parameter.
13585 Change caller. Just call do_allocate_commons_list twice.
13586 (Symbol_table::do_allocate_commons_list): New function, broken out
13587 of do_allocate_commons.
13588 * common.h (class Allocate_commons_task): Remove options_ field.
13589 Update constructor.
13590 * symtab.cc (Symbol_table::Symbol_table): Initialize
13591 tls_commons_.
13592 (Symbol_table::add_from_object): Put TLS common symbols on
13593 tls_commons_ list.
13594 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13595 which are IN_OUTPUT_DATA.
13596 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13597 allocate_commons and do_allocate_commons declarations. Declare
13598 do_allocate_commons_list.
13599 * gold.cc (queue_middle_tasks): Update creation of
13600 Allocate_commons_task to not pass options.
13601 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13602 (TLS_TEST_C_FLAGS): New variable.
13603 (tls_test_c_pic.o): New target.
13604 (tls_test_shared.so): Link in tls_test_c_pic.o.
13605 (tls_test_c_pic_ie.o): New target.
13606 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13607 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13608 (tls_test_c.o): New target.
13609 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13610 (tls_pic_test_LDADD): Likewise.
13611 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13612 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13613 (tls_test_c_gnu2.o): New target.
13614 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13615 tls_test_c_gnu2.o.
13616 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13617 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13618 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13619 * testsuite/tls_test.cc: Include "config.h".
13620 (t_last): Call t11_last.
13621 * testsuite/tls_test.h (t11, t11_last): Declare.
13622 * testsuite/tls_test_c.c: New file.
13623 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13624 * configure.ac: Check for OpenMP support.
13625 * configure, config.in, Makefile.in: Rebuild.
13626 * testsuite/Makefile.in: Rebuild.
13627
edfbb029
CC
136282008-04-16 Cary Coutant <ccoutant@google.com>
13629
13630 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13631 (Target_i386::tls_base_symbol_defined_): New field.
13632 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13633 (Target_i386::Scan::global): Likewise.
13634 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13635 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13636 (Target_x86_64::tls_base_symbol_defined_): New field.
13637 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13638 (Target_x86_64::Scan::global): Likewise.
13639
f3c69fca
CC
136402008-04-16 Cary Coutant <ccoutant@google.com>
13641
13642 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13643 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13644 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13645 building shared libraries.
13646 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13647 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13648 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13649 * testsuite/Makefile.in: Rebuild.
13650 * testsuite/weak_undef.h: New file.
13651 * testsuite/weak_undef_file1.cc: Add extra test cases.
13652 * testsuite/weak_undef_file2.cc: Likewise.
13653 * testsuite/weak_undef_test.cc: Likewise.
13654
7c414435
DM
136552008-04-16 David S. Miller <davem@davemloft.net>
13656
32b769e1
DM
13657 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13658 Add issued_non_pic_error_ field. Declare check_non_pic.
13659 (Target_sparc::Scan::check_non_pic): New function.
13660 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13661 (Target_sparc::Scan::global): Likewise.
13662
11936fb1
DM
13663 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13664 * configure: Rebuild.
13665
7c414435
DM
13666 * options.h (DEFINE_enable): New macro.
13667 (new_dtags): New enable option.
13668 (initfirst, interpose, loadfltr, nodefaultlib,
13669 nodelete, nodlopen, nodump): New -z options.
13670 * layout.cc (Layout:finish_dynamic_section): If new
13671 dtags enabled, emit DT_RUNPATH. Also, emit a
13672 DT_FLAGS_1 containing any specified -z flags.
13673
85c7bf8b
ILT
136742008-04-16 Ian Lance Taylor <iant@google.com>
13675
12c0daef
ILT
13676 * copy-relocs.cc: New file.
13677 * copy-relocs.h: New file.
13678 * reloc.cc: Remove Copy_relocs code.
13679 * reloc.h: Likewise.
13680 * reloc-types.h (struct Reloc_types) [both versions]: Add
13681 get_reloc_addend_noerror.
13682 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13683 variants of add_global which take an addend which must be zero.
13684 * i386.cc: Include "copy-relocs.h".
13685 (class Target_i386): Change type of copy_relocs_ to variable,
13686 update initializer.
13687 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13688 Change all callers.
13689 (Target_i386::do_finalize_sections): Change handling of
13690 copy_relocs_.
13691 * sparc.cc: Include "copy-relocs.h".
13692 (class Target_sparc): Change type of copy_relocs_ to variable,
13693 update initializer.
13694 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13695 Change all callers.
13696 (Target_sparc::do_finalize_sections): Change handling of
13697 copy_relocs_.
13698 * x86_64.cc: Include "copy-relocs.h".
13699 (class Target_x86_64): Change type of copy_relocs_ to variable,
13700 update initializer.
13701 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13702 class. Change all callers.
13703 (Target_x86_64::do_finalize_sections): Change handling of
13704 copy_relocs_.
13705 * Makefile.am (CCFILES): Add copy-relocs.cc.
13706 (HFILES): Add copy-relocs.h.
13707
4f4995b6
ILT
13708 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13709
85c7bf8b
ILT
13710 * testsuite/script_test_4.sh: Permit leading zeroes.
13711
4f2a9edd
ILT
137122008-04-15 Ian Lance Taylor <iant@google.com>
13713
e6188289
ILT
13714 * script-sections.cc (Script_sections::create_segments): Use
13715 header_size_adjustment even when there is enough room for the
13716 headers.
13717 * testsuite/script_test_4.sh: New file.
13718 * testsuite/script_test_4.t: New file.
13719 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13720 (check_DATA): Add script_test_4.stdout.
13721 (MOSTLYCLEANFILES): Likewise.
13722 (script_test_4): New target.
13723 (script_test_4.stdout): New target.
13724 * testsuite/Makefile.in: Rebuild.
13725
4f2a9edd
ILT
13726 * sparc.cc: Add definitions for Output_data_plt_sparc class
13727 constants.
13728
f5314dd5
DM
137292008-04-14 David S. Miller <davem@davemloft.net>
13730
13731 * sparc.cc: New file.
13732 * Makefile.am (TARGETSOURCES): Add sparc.cc
13733 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13734 * configure.tgt: Document targ_extra_size and
13735 targ_extra_big_endian. Add entries for sparc-* and
13736 sparc64-*.
13737 * configure.ac: Handle targ_extra_size and
13738 targ_extra_big_endian.
13739 * Makefile.in: Rebuild.
13740 * configure: Likewise.
13741 * po/POTFILES.in: Likewise.
13742 * po/gold.pot: Likewise.
13743
154e0e9a
ILT
137442008-04-14 Ian Lance Taylor <iant@google.com>
13745
13746 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13747 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13748 in the name/type/flags to section mapping. Don't call
13749 allocate_output_section.
13750 (Layout::choose_output_section): Change parameter from adjust_name
13751 to is_input_section. Don't permit input sections after sections
13752 are attached to segments. Don't call allocate_output_section.
13753 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13754 not write_enable_output_section.
13755 (Layout::make_output_section): Don't push to
13756 unattached_section_list_ nor call attach_to_segment. Call
13757 attach_section_to_segment if sections are attached.
13758 (Layout::attach_sections_to_segments): New function.
13759 (Layout::attach_section_to_segment): New function.
13760 (Layout::attach_allocated_section_to_segment): Rename from
13761 attach_to_segment. Remove flags parameter.
13762 (Layout::allocate_output_section): Remove function.
13763 (Layout::write_enable_output_section): Remove function.
13764 * layout.h (class Layout): Update for above changes. Add new
13765 field sections_are_attached_.
13766 * output.h (Output_section::update_flags_for_input_section): New
13767 function.
13768 * output.cc (Output_section::add_input_section): Call
13769 update_flags_for_input_section.
13770 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13771
009a67a2
CC
137722008-04-11 Cary Coutant <ccoutant@google.com>
13773
13774 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13775 thought unnecessary.
13776 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13777
759b1a24
ILT
137782008-04-11 Ian Lance Taylor <iant@google.com>
13779
13780 * output.h (class Output_section_data): Remove inline definition
13781 of set_addralign.
13782 * output.cc (Output_section_data::set_addralign): New function.
13783
c2b45e22
CC
137842008-04-11 Cary Coutant <ccoutant@google.com>
13785
13786 Add support for TLS descriptors for i386 and x86_64.
13787 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13788 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13789 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13790 GOT_TYPE_TLS_DESC.
13791 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13792 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13793 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13794 relocations.
13795 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13796 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13797 Fix problem with initial-exec relocations.
13798 (Target_i386::Relocate::relocate_tls): Likewise.
13799 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13800 relaxation.
13801 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13802 support for section-plus-offset dynamic table entries.
13803 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13804 (Output_data_dynamic::Dynamic_entry): Add support for
13805 section-plus-offset dynamic table entries.
13806 (Output_data_dynamic::Classification): Likewise.
13807 (Output_data_dynamic::classification_): Renamed offset_.
13808 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13809 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13810 (Target_x86_64::make_plt_section): New function.
13811 (Target_x86_64::reserve_tlsdesc_entries): New function.
13812 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13813 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13814 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13815 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13816 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13817 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13818 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13819 add extra PLT entry for TLS descriptors.
13820 (Output_data_plt_x86_64::got_): New field.
13821 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13822 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13823 fields.
13824 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13825 descriptors.
13826 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13827 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13828 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13829 R_386_TLS_DESC_CALL relocations.
13830 (Target_x86_64::Scan::global): Likewise.
13831 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13832 for TLS descriptors.
13833 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13834 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13835 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13836 GD-to-IE relaxation.
13837 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13838 and TLS_DESCRIPTORS.
13839 * Makefile.in: Rebuild.
13840 * configure: Rebuild.
13841 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13842 (tls_test_shared2.so): New target.
13843 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13844 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13845 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13846 (tls_shared_gd_to_ie_test_LDADD): New variable.
13847 (tls_shared_gnu2_gd_to_ie_test): New target.
13848 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13849 New targets.
13850 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13851 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13852 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13853 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13854 (tls_shared_gnu2_test): New target.
13855 (tls_test_gnu2_shared.so): New target.
13856 (tls_shared_gnu2_test_SOURCES): New variable.
13857 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13858 (tls_shared_gnu2_test_LDFLAGS): New variable.
13859 (tls_shared_gnu2_test_LDADD): New variable.
13860 * testsuite/Makefile.in: Rebuild.
13861 * testsuite/Makefile.
13862
83bfb6b7
ILT
138632008-04-11 Ian Lance Taylor <iant@google.com>
13864
13865 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13866 justsyms.t.
13867 * testsuite/Makefile.in: Rebuild.
13868
13869 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13870 long.
13871 * testsuite/script_test_2.cc (main): Adjust test.
13872
706e1f5e
ILT
138732008-04-11 David S. Miller <davem@davemloft.net>
13874 Ian Lance Taylor <iant@google.com>
13875
13876 * options.h (General_options): Add entries for '-Y' and
13877 '-relax'.
13878 * options.cc (General_options:finalize): If -Y was used, add those
13879 entries to the library path instead of the default "/lib" and
13880 "/usr/lib".
13881
7c98e6bb
DM
138822008-04-11 David S. Miller <davem@davemloft.net>
13883
13884 * testsuite/justsyms.t: Start at 0x100.
13885 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13886 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13887 long.
13888 * testsuite/script_test_2.cc: Adjust string and section length
13889 checks.
7c98e6bb 13890
99a37bfd
ILT
138912008-04-09 Ian Lance Taylor <iant@google.com>
13892
2cefc357
ILT
13893 PR gold/5996
13894 * script-sections.cc (Sections_element::allocate_to_segment): Add
13895 orphan parameter.
13896 (Output_section_definition::allocate_to_segment): Likewise.
13897 (Orphan_output_section::allocate_to_segment): Likewise.
13898 (Script_sections::attach_sections_using_phdrs_clause): Don't
13899 propagate non-PT_LOAD segments to orphan sections.
13900 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13901 readelf rather than objdump.
13902 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13903 .interp section and PT_INTERP segment are the same size.
13904 * testsuite/Makefile.in: Rebuild.
13905
99a37bfd
ILT
13906 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13907 aliases for symbols defined in the same object.
13908 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13909 (weak_alias_test_SOURCES): New variable.
13910 (weak_alias_test_DEPENDENCIES): New variable.
13911 (weak_alias_test_LDFLAGS): New variable.
13912 (weak_alias_test_LDADD): New variable.
13913 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13914 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13915 (weak_alias_test_3.o): New target.
13916 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13917 * testsuite/weak_alias_test_main.cc: New file.
13918 * testsuite/weak_alias_test_1.cc: New file.
13919 * testsuite/weak_alias_test_2.cc: New file.
13920 * testsuite/weak_alias_test_3.cc: New file.
13921
780e49c5
ILT
139222008-04-08 Ian Lance Taylor <iant@google.com>
13923
cdb0b8f5
ILT
13924 * options.h (class General_options): Add --noinhibit-exec option.
13925 * main.cc (main): Check --noinhibit-exec.
13926
0864d551
ILT
13927 * options.h (class General_options): Define --wrap as a special
13928 option. Add wrap_symbols_ field.
13929 (General_options::any_wrap_symbols): New function.
13930 (General_options::is_wrap_symbol): New function.
13931 * options.cc (General_options::parse_wrap): New function.
13932 (General_options::General_options): Initialize wrap_symbols_.
13933 * symtab.cc (Symbol_table::wrap_symbol): New function.
13934 (Symbol_table::add_from_object): Handle --wrap.
13935 * symtab.h (class Symbol_table): Declare wrap_symbol.
13936 * target.h (Target::wrap_char): New function.
13937 (Target::Target_info): Add wrap_char field.
13938 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13939 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13940 * testsuite/testfile.cc (Target_test::test_target_info):
13941 Likewise.
13942
789aa6de
ILT
13943 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13944 there is one.
13945
2c38906f
ILT
13946 * layout.h (class Layout): Add added_eh_frame_data_ field.
13947 * layout.cc (Layout::Layout): Initialize new field.
13948 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13949 output section until we find a section we merged successfully.
13950 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13951 that the size be non-zero.
13952
780e49c5
ILT
13953 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13954 qualifier.
13955
7fcd0256
ILT
139562008-04-08 Craig Silverstein <csilvers@google.com>
13957
13958 * configure.ac: Export new conditional variable HAVE_ZLIB.
13959 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13960 on HAVE_ZLIB.
13961 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13962 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13963
6835af53
ILT
139642008-04-07 Ian Lance Taylor <iant@google.com>
13965
e24f324c
ILT
13966 * version.cc (version_string): Set to "1.5".
13967
a036edd8
ILT
13968 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13969 Add issued_non_pic_error_ field. Declare check_non_pic.
13970 (Target_x86_64::Scan::check_non_pic): New function.
13971 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13972 (Target_x86_64::Scan::global): Likewise.
13973
624f8810
ILT
13974 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13975 addend parameter. Change caller. Handle merge sections.
13976 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13977 Address to Addend. Don't add in the result of
13978 local_section_offset, pass down the addend and use the returned
13979 value.
13980 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13981 Update declarations of local_section_offset and symbol_value.
13982 * testsuite/two_file_test_1.cc (t18): New function.
13983 * testsuite/two_file_test_2.cc (f18): New function.
13984 * testsuite/two_file_test_main.cc (main): Call t18.
13985 * testsuite/two_file_test.h (t18, f18): Declare.
13986
6835af53
ILT
13987 * configure.ac: Don't test for objdump, c++filt, or readelf.
13988 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13989 conditionals.
13990 (TEST_READELF): New variable.
13991 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13992 (check_PROGRAMS): Add two_file_strip_test.
13993 (two_file_strip_test): New target.
13994 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13995 (two_file_same_shared_strip_test_SOURCES): New variable.
13996 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13997 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13998 (two_file_same_shared_strip_test_LDADD): New variable.
13999 (two_file_shared_strip.so): New target.
14000 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14001 (ver_test_5.syms, ver_test_7.syms): Likewise.
14002 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14003 (strip_test_3.stdout): Use TEST_OBJDUMP.
14004 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14005
86925eef
CC
140062008-04-04 Cary Coutant <ccoutant@google.com>
14007
14008 * symtab.h (Symbol::is_weak_undefined): New function.
14009 (Symbol::is_strong_undefined): New function.
14010 (Symbol::is_absolute): New function.
14011 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14012 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14013 absolute symbols.
14014 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14015 (weak_undef_test): New target.
14016 * testsuite/Makefile.in: Rebuild.
14017 * testsuite/weak_undef_file1.cc: New file.
14018 * testsuite/weak_undef_file2.cc: New file.
14019 * testsuite/weak_undef_test.cc: New file.
14020
126f3ece
ILT
140212008-04-03 Craig Silverstein <csilvers@google.com>
14022
14023 * compressed_output.h (class Output_compressed_section): Use
14024 unsigned buffer.
14025 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14026 add zlib header.
14027 (zlib_compressed_suffix): Removed.
14028 (Output_compressed_section::set_final_data_size): Use unsigned
14029 buffers.
14030 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14031 Fix linker invocation.
14032 (flagstest_o_specialfile_and_compress_debug_sections):
14033 Likewise.
14034 * testsuite/Makefile.in: Regenerated.
14035
deae2a14
DM
140362008-04-02 David S. Miller <davem@davemloft.net>
14037
14038 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14039 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14040
70752818
ILT
140412008-04-02 Craig Silverstein <csilvers@google.com>
14042
14043 * TODO: New file.
14044
39d0cb0e
ILT
140452008-04-02 Ian Lance Taylor <iant@google.com>
14046
14047 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14048 parameters. Update for new key type to views_. Change all
14049 callers.
14050 (File_read::read): Adjust for byteshift in returned view.
14051 (File_read::add_view): New function, broken out of
14052 find_and_make_view.
14053 (File_read::make_view): New function, broken out of
14054 find_and_make_view.
14055 (File_read::find_or_make_view): Add offset and aligned
14056 parameters. Rewrite accordingly. Change all callers.
14057 (File_read::get_view): Add offset and aligned parameters. Adjust
14058 for byteshift in return value.
14059 (File_read::get_lasting_view): Likewise.
14060 * fileread.h (class File_read): Update declarations.
14061 (class File_read::View): Add byteshift_ field. Add byteshift to
14062 constructor. Add byteshift method.
14063 * archive.h (Archive::clear_uncached_views): New function.
14064 (Archive::get_view): Add aligned parameter. Change all callers.
14065 * object.h (Object::get_view): Add aligned parameter. Change all
14066 callers.
14067 (Object::get_lasting_view): Likewise.
14068
14069 * fileread.cc (File_read::release): Don't call clear_views if
14070 there are multiple objects.
14071 * fileread.h (File_read::clear_uncached_views): New function.
14072 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14073 on the archive.
14074
a1207466
CC
140752008-03-31 Cary Coutant <ccoutant@google.com>
14076
14077 Add thin archive support.
14078 * archive.cc (Archive::armagt): New const.
14079 (Archive::setup): Remove task parameter and calls to unlock.
14080 (Archive::unlock_nested_archives): New function.
14081 (Archive::read_header): Add nested_off parameter. Change
14082 all callers.
14083 (Archive::interpret_header): Likewise.
14084 (Archive::include_all_members): Change to handle thin
14085 archives.
14086 (Archive::include_member): Likewise.
14087 * archive.h (Archive::Archive): Add new parameters and
14088 initializers.
14089 (Archive::armagt): New const.
14090 (Archive::setup): Remove task parameter.
14091 (Archive::unlock_nested_archives): New function.
14092 (Archive::read_header): Add nested_off parameter.
14093 (Archive::interpret_header): Likewise.
14094 (Archive::Nested_archive_table): New typedef.
14095 (Archive::is_thin_archive_): New field.
14096 (Archive::nested_archives_): New field.
14097 (Archive::options_): New field.
14098 (Archive::dirpath_): New field.
14099 (Archive::task_): New field.
14100 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14101 for thin archives. Pass additional parameters to
14102 Archive::Archive. Unlock the archive file after calling
14103 Archive::setup.
cd536b21 14104
479f6503
ILT
141052008-03-29 Ian Lance Taylor <iant@google.com>
14106
686c8caf
ILT
14107 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14108 version symbol to be local.
14109 * testsuite/ver_test_4.sh: New file.
14110 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14111 (check_DATA): Add ver_test_4.syms.
14112 (ver_test_4.syms): New target.
14113 * testsuite/Makefile.in: Rebuild.
14114
ab794b6b
ILT
14115 * output.cc
14116 (Output_section::Input_section_sort_entry::has_priority): New
14117 function.
14118 (Output_section::Input_section_sort_entry::match_file_name): New
14119 function.
14120 (Output_section::Input_section_sort_entry::match_section_name):
14121 Remove.
14122 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14123 Remove.
14124 (Output_section::Input_section_sort_entry::match_section_file):
14125 Remove.
14126 (Output_section::Input_section_sort_compare::operator()): Rewrite
14127 using new Input_section_sort_entry functions. Sort crtbegin and
14128 crtend first. Sort sections with no priority before sections with
14129 a priority.
14130 * testsuite/initpri1.c (d3): Check j != 4.
14131 (cd5): New constructor/destructor function.
14132 (main): Check j != 2.
14133
479f6503
ILT
14134 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14135 new symbol when resolving, don't call set_is_default.
14136 * testsuite/ver_test_7.cc: New file.
14137 * testsuite/ver_test_7.sh: New file.
14138 * testsuite/Makefile.am (ver_test_7.so): New target.
14139 (ver_test_7.o): New target.
14140 (check_SCRIPTS): Add ver_test_7.sh.
14141 (check_DATA): Add ver_test_7.syms.
14142 (ver_test_7.syms): New target.
14143
2fd32231
ILT
141442008-03-28 Ian Lance Taylor <iant@google.com>
14145
14146 * layout.cc (Layout::layout): If we see an input section with a
14147 name that needs sorting, set the must_sort flag for the output
14148 section.
14149 (Layout::make_output_section): If the name of the output section
14150 indicates that it might require sorting, set the may_sort flag.
14151 * output.h (Output_section::may_sort_attached_input_sections): New
14152 function.
14153 (Output_section::set_may_sort_attached_input_sections): New
14154 function.
14155 (Output_section::must_sort_attached_input_sections): New
14156 function.
14157 (Output_section::set_must_sort_attached_input_sections): New
14158 function.
14159 (class Output_section): Declare Input_section_sort_entry. Define
14160 Input_section_sort_compare. Declare
14161 sort_attached_input_sections. Add new fields:
14162 may_sort_attached_input_sections_,
14163 must_sort_attached_input_sections_,
14164 attached_input_sections_are_sorted_.
14165 * output.cc (Output_section::Output_section): Initialize new
14166 fields.
14167 (Output_section::add_input_section): Add an entry to
14168 input_sections_ if may_sort or must_sort are true.
14169 (Output_section::set_final_data_size): Call
14170 sort_attached_input_sections if necessary.
14171 (Output_section::Input_section_sort_entry): Define new class.
14172 (Output_section::Input_section_sort_compare::operator()): New
14173 function.
14174 (Output_section::sort_attached_input_sections): New function.
14175 * configure.ac: Check whether the compiler supports constructor
14176 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14177 * testsuite/initpri1.c: New file.
14178 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14179 CONSTRUCTOR_PRIORITY.
14180 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14181 (initpri1_LDFLAGS): New variable.
14182 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14183
18e6b24e
ILT
141842008-03-27 Ian Lance Taylor <iant@google.com>
14185
49bdd526
ILT
14186 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14187 * testsuite/common_test_1.c: New file.
14188 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14189 (common_test_1_SOURCES): New variable.
14190 (common_test_1_DEPENDENCIES): New variable.
14191 (common_test_1_LDFLAGS): New variable.
14192
18e6b24e
ILT
14193 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14194 and commons_ correctly when NAME/VERSION does not override
14195 NAME/NULL.
14196 * testsuite/ver_test_6.c: New file.
14197 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14198 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14199 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14200
04bf7072
ILT
142012008-03-26 Ian Lance Taylor <iant@google.com>
14202
5871526f
ILT
14203 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14204 of an undefined symbol from a version script.
14205 * testsuite/Makefile.am (ver_test_5.so): New target.
14206 (ver_test_5.o): New target.
14207 (check_SCRIPTS): Add ver_test_5.sh.
14208 (check_DATA): Add ver_test_5.syms.
14209 (ver_test_5.syms): New target.
14210 * testsuite/ver_test_5.cc: New file.
14211 * testsuite/ver_test_5.script: New file.
14212 * testsuite/ver_test_5.sh: New file.
14213 * Makefile.in, testsuite/Makefile.in: Rebuild.
14214
04bf7072
ILT
14215 PR gold/5986
14216 Fix problems building gold with gcc 4.3.0.
14217 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14218 (gold_error_at_location, gold_warning_at_location): Use it.
14219 * configure.ac: Check whether we can compile and use a template
14220 function with a printf attribute.
14221 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14222 when jumping over bytes.
14223 * object.cc: Instantiate Object::read_section_data.
14224 * debug.h: Include <cstring>
14225 * dwarf_reader.cc: Include <algorithm>
14226 * main.cc: Include <cstring>.
14227 * options.cc: Include <cstring>.
14228 * output.cc: Include <cstring>.
14229 * script.cc: Include <cstring>.
14230 * script.h: Include <string>.
14231 * symtab.cc: Include <cstring> and <algorithm>.
14232 * target-select.cc: Include <cstring>.
14233 * version.cc: Include <string>.
14234 * testsuite/testmain.cc: Include <cstdlib>.
14235 * configure, config.in: Rebuild.
14236
874c5b28
ILT
142372008-03-25 Ian Lance Taylor <iant@google.com>
14238
819d6c3a
ILT
14239 * options.cc: Include "../bfd/bfdver.h".
14240 (options::help): Print bug reporting address.
14241
f4b2c6f5
ILT
14242 * version.cc (print_version): Adjust output for current value of
14243 BFD_VERSION_STRING.
14244
14245 * NEWS: New file.
14246
e96caa79
ILT
14247 * options.cc (options::help): Print list of supported targets.
14248 * target-select.h: Include <vector>.
14249 (class Target_selector): Make machine_, size_, and is_big_endian_
14250 fields const. Add bfd_name_ and instantiated_target_ fields.
14251 (Target_selector::Target_selector): Add bfd_name parameter.
14252 (Target_selector::recognize): Make non-virtual, call
14253 do_recognize.
14254 (Target_selector::recognize_by_name): Make non-virtual, call
14255 do_recognize_by_name.
14256 (Target_selector::supported_names): New function.
14257 (Target_selector::bfd_name): New function.
14258 (Target_selector::do_instantiate_target): New pure virtual
14259 function.
14260 (Target_selector::do_recognize): New virtual function.
14261 (Target_selector::do_recognize_by_name): New virtual function.
14262 (Target_selector::instantiate_target): New private function.
14263 (supported_target_names): Declare.
14264 * target-select.cc (Target_selector::Target_selector): Update for
14265 new parameter and fields.
14266 (select_target_by_name): Check that the name matches before
14267 calling recognize_by_name.
14268 (supported_target_names): New function.
14269 * i386.cc (class Target_selector_i386): Update Target_selector
14270 constructor call. Remove recognize and recognize_by_name. Add
14271 do_instantiate_target.
14272 * x86_64.cc (class Target_selector_x86_64): Likewise.
14273 * testsuite/testfile.cc (class Target_selector_test): Update for
14274 changes to Target_selector.
14275
874c5b28
ILT
14276 * README: Rewrite, with some notes on unsupported features.
14277
0a65a3a7
CC
142782008-03-24 Cary Coutant <ccoutant@google.com>
14279
14280 * i386.cc (Target_i386::Got_type): New enum declaration.
14281 (Target_i386::Scan::local): Updated callers of Output_data_got
14282 member functions.
14283 (Target_i386::Scan::global): Likewise.
14284 (Target_i386::Relocate::relocate): Likewise.
14285 (Target_i386::Relocate::relocate_tls): Likewise.
14286 * object.h (Got_offset_list): New class.
14287 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14288 (Sized_relobj::local_got_offset): Likewise.
14289 (Sized_relobj::set_local_got_offset): Likewise.
14290 (Sized_relobj::local_has_tls_got_offset): Removed.
14291 (Sized_relobj::local_tls_got_offset): Removed.
14292 (Sized_relobj::set_local_tls_got_offset): Removed.
14293 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14294 * output.cc (Output_data_got::add_global): Added got_type parameter.
14295 (Output_data_got::add_global_with_rel): Likewise.
14296 (Output_data_got::add_global_with_rela): Likewise.
14297 (Output_data_got::add_global_pair_with_rel): New function.
14298 (Output_data_got::add_global_pair_with_rela): New function.
14299 (Output_data_got::add_local): Added got_type parameter.
14300 (Output_data_got::add_local_with_rel): Likewise.
14301 (Output_data_got::add_local_with_rela): Likewise.
14302 (Output_data_got::add_local_pair_with_rel): New function.
14303 (Output_data_got::add_local_pair_with_rela): New function.
14304 (Output_data_got::add_global_tls): Removed.
14305 (Output_data_got::add_global_tls_with_rel): Removed.
14306 (Output_data_got::add_global_tls_with_rela): Removed.
14307 (Output_data_got::add_local_tls): Removed.
14308 (Output_data_got::add_local_tls_with_rel): Removed.
14309 (Output_data_got::add_local_tls_with_rela): Removed.
14310 * output.h (Output_data_got::add_global): Added got_type parameter.
14311 (Output_data_got::add_global_with_rel): Likewise.
14312 (Output_data_got::add_global_with_rela): Likewise.
14313 (Output_data_got::add_global_pair_with_rel): New function.
14314 (Output_data_got::add_global_pair_with_rela): New function.
14315 (Output_data_got::add_local): Added got_type parameter.
14316 (Output_data_got::add_local_with_rel): Likewise.
14317 (Output_data_got::add_local_with_rela): Likewise.
14318 (Output_data_got::add_local_pair_with_rel): New function.
14319 (Output_data_got::add_local_pair_with_rela): New function.
14320 (Output_data_got::add_global_tls): Removed.
14321 (Output_data_got::add_global_tls_with_rel): Removed.
14322 (Output_data_got::add_global_tls_with_rela): Removed.
14323 (Output_data_got::add_local_tls): Removed.
14324 (Output_data_got::add_local_tls_with_rel): Removed.
14325 (Output_data_got::add_local_tls_with_rela): Removed.
14326 * resolve.cc (Symbol::override_base_with_special): Removed
14327 reference to has_got_offset_ field.
14328 * symtab.cc (Symbol::init_fields): Replaced initialization
14329 of got_offset_ with got_offsets_. Removed initialization
14330 of has_got_offset_
53fcba31 14331 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14332 (Symbol::got_offset): Likewise.
14333 (Symbol::set_got_offset): Likewise.
14334 (Symbol::has_tls_got_offset): Removed.
14335 (Symbol::tls_got_offset): Removed.
14336 (Symbol::set_tls_got_offset): Removed.
14337 (Symbol::got_offset_): Removed.
14338 (Symbol::tls_mod_got_offset_): Removed.
14339 (Symbol::tls_pair_got_offset_): Removed.
14340 (Symbol::got_offsets_): New field.
14341 (Symbol::has_got_offset): Removed.
14342 (Symbol::has_tls_mod_got_offset): Removed.
14343 (Symbol::has_tls_pair_got_offset): Removed.
14344 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14345 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14346 member functions.
14347 (Target_x86_64::Scan::global): Likewise.
14348 (Target_x86_64::Relocate::relocate): Likewise.
14349 (Target_x86_64::Relocate::relocate_tls): Likewise.
14350
bd52eafb
BE
143512008-03-25 Ben Elliston <bje@au.ibm.com>
14352
14353 * yyscript.y: Fix spelling error in comment.
14354
8b105e34
ILT
143552008-03-24 Ian Lance Taylor <iant@google.com>
14356
8ed814a9
ILT
14357 * options.h (class General_options): Define build_id option.
14358 * layout.h (class Layout): Declare write_build_id, create_note,
14359 create_build_id. Add build_id_note_ member.
14360 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14361 "libiberty.h", "md5.h", "sha1.h".
14362 (Layout::Layout): Initialize eh_frame_data_,
14363 eh_frame_hdr_section_, and build_id_note_.
14364 (Layout::finalize): Call create_build_id.
14365 (Layout::create_note): New function, broken out of
14366 Layout::create_gold_note.
14367 (Layout::create_gold_note): Call create_note.
14368 (Layout::create_build_id): New function.
14369 (Layout::write_build_id): New function.
14370 (Close_task_runner::run): Call write_build_id.
14371
8b105e34
ILT
14372 * x86_64.cc: Correct license to GPLv3.
14373
086a1841
ILT
143742008-03-23 Ian Lance Taylor <iant@google.com>
14375
14376 * options.cc: Include "demangle.h".
14377 (parse_optional_string): New function.
14378 (parse_long_option): Handle takes_optional_argument.
14379 (parse_short_option): Update dash_z initializer. Handle
14380 takes_optional_argument.
14381 (General_options::General_options): Initialize do_demangle_.
14382 (General_options::finalize): Set do_demangle_. Handle demangling
14383 style.
14384 * options.h (parse_optional_string): Declare.
14385 (struct One_option): Add optional_arg field. Update constructor.
14386 Update call constructor calls. Add takes_optional_argument
14387 function.
14388 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14389 (DEFINE_optional_string): Define.
14390 (General_options::demangle): Change from DEFINE_bool to
14391 DEFINE_optional_string.
14392 (General_options::no_demangle): New function.
14393 (General_options::do_demangle): New function.
14394 (General_options::set_do_demangle): New function.
14395 (General_options::execstack_status_): Move definition to end of
14396 class definition.
14397 (General_options::static_): Likewise.
14398 (General_options::do_demangle_): New field.
14399 * object.cc (big_endian>::get_symbol_location_info): Call
14400 Options::do_demangle, not Options::demangle.
14401 * symtab.cc (demangle): Likewise.
14402
cbb93e63
ILT
144032008-03-22 Ian Lance Taylor <iant@google.com>
14404
14405 * gold.h: Include <cstddef> and <sys/types.h>
14406 * options.h: Include <cstring>.
14407
ec531623
ILT
144082008-03-21 Ian Lance Taylor <iant@google.com>
14409
14410 * Added source code to GNU binutils.
752937aa
NC
14411\f
14412Copyright (C) 2008-2012 Free Software Foundation, Inc.
14413
14414Copying and distribution of this file, with or without modification,
14415are permitted in any medium without royalty provided the copyright
14416notice and this notice are preserved.
14417
14418Local Variables:
14419mode: change-log
14420left-margin: 8
14421fill-column: 74
14422version-control: never
14423End:
This page took 0.925313 seconds and 4 git commands to generate.