Simplify Garbage_collection::add_reference a bit.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * gc.h (Garbage_collection::add_reference): Don't use find.
4
5 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
6
7 * object.cc (write_local_symbols): avoid std::vector copy.
8
9 2015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
10
11 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
12
13 2015-02-09 Mark Wielaard <mjw@redhat.com>
14
15 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
16 DW_LANG_Fortran03 and DW_LANG_Fortran08.
17
18 2015-02-16 Cary Coutant <ccoutant@google.com>
19
20 PR gold/13577
21 PR gold/16992
22 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
23 DF_SYMBOLIC if --dynamic-list option is used.
24 * options.cc (General_options::finalize): --dynamic-list is not
25 mutually exclusive with -Bsymbolic.
26 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
27 listed in --dynamic-list.
28 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
29 -Bsymbolic-functions.
30 * testsuite/Makefile.in: Regenerate.
31
32 2015-02-16 Cary Coutant <ccoutant@google.com>
33
34 PR gold/17971
35 * incremental.cc: Remove redundant include of "output.h".
36
37 2015-02-12 Jing Yu <jingyu@google.com>
38
39 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
40 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
41 New relocation.
42 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
43 TLSLE_MOVW_* relocations.
44 (Target_aarch64::Scan::global): Likewise.
45 (Target_aarch64::Relocate::relocate): Likewise.
46 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
47 for new TLSLE_MOVW_* relocations.
48
49 2015-02-11 Will Newton <will.newton@linaro.org>
50
51 PR gold/13321
52 * arm.cc (Target_arm::make_plt_section): Create an ARM
53 state mapping symbol at the start of the PLT.
54
55 2015-02-09 H.J. Lu <hongjiu.lu@intel.com>
56
57 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
58 Replace two_file_shared_2.so with two_file_shared_1.so.
59 * testsuite/Makefile.in: Regenerated.
60
61 2015-02-09 Alan Modra <amodra@gmail.com>
62
63 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
64 plugin_test_thin.a and defsym_test.
65 * testsuite/Makefile.in: Regenerate.
66
67 2015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
68
69 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
70 body.
71
72 2015-02-04 Peter Collingbourne <pcc@google.com>
73
74 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
75 forwarding symbols when computing symbol resolution info for plugins.
76 * plugin.h (Plugin_manager::symtab): New method.
77 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
78
79 2015-02-03 Cary Coutant <ccoutant@google.com>
80 Peter Collingbourne <pcc@google.com>
81
82 PR gold/15660
83 * archive.cc (Thin_archive_object_unlocker): New class.
84 (Archive::include_member): Unlock external members of thin archives.
85 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
86 (plugin_test_2): Likewise.
87 (plugin_test_3): Likewise.
88 (plugin_test_4): Likewise.
89 (plugin_test_5): Likewise.
90 (plugin_test_6): Likewise.
91 (plugin_test_7): Likewise.
92 (plugin_test_8): Likewise.
93 (plugin_test_9): Likewise.
94 (plugin_test_10): Likewise.
95 (plugin_test_11): New test case.
96 * testsuite/Makefile.in: Regenerate.
97 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
98 file to decide whether to claim file.
99 (all_symbols_read_hook): Likewise.
100 * testsuite/plugin_test_1.sh: Adjust expected output.
101 * testsuite/plugin_test_2.sh: Likewise.
102 * testsuite/plugin_test_3.sh: Likewise.
103 * testsuite/plugin_test_6.sh: Likewise.
104 * testsuite/plugin_test_tls.sh: Likewise.
105 * testsuite/plugin_test_11.sh: New testcase.
106
107 2015-02-03 Cary Coutant <ccoutant@google.com>
108
109 * descriptors.cc (Descriptors::open): Set artificially-low limit for
110 file descriptors when debugging enabled. Add debug output.
111 (Descriptors::release): Add debug output.
112 (Descriptors::close_some_descriptor): Likewise.
113 (Descriptors::close_all): Likewise.
114 * fileread.cc (File_read::lock): Likewise.
115 (File_read::unlock): Likewise.
116
117 2015-02-02 Cary Coutant <ccoutant@google.com>
118
119 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
120 executable output file.
121
122 2015-01-22 Han Shen <shenhan@google.com>
123
124 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
125 (Target_arm::do_plt_address_for_global): New method.
126 (Target_arm::do_plt_address_for_local): New method.
127 (Target_arm::rel_irelative_section): New method.
128 (Target_arm::make_data_plt): Add more parameters for plt ctor.
129 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
130 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
131 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
132 (Target_arm::Scan::check_non_pic): Add ifunc support.
133 (Target_arm::Scan::local): Add ifunc support.
134 (Target_arm::Scan::global): Add ifunc support.
135 (Target_arm::make_plt_section): New method.
136 (Target_arm::make_plt_entry): Change to call to make_plt_section.
137 (Target_arm::make_local_ifunc_plt_entry): New method.
138 (Target_arm::got_irelative_): New member.
139 (Target_arm::rel_irelative_): New member.
140 (Target_arm::got_section): Add creation for got_irelative_.
141 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
142 (Target_arm::Relocate::relocate): Properly set local ifunc address.
143 (Target_arm::do_dynsym_value): Properly set global ifunc address.
144 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
145 (Output_data_plt_arm::IRelative_data): New type.
146 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
147 (Output_data_plt_arm::add_entry): Add more parameters.
148 (Output_data_plt_arm::add_relocation): New method.
149 (Output_data_plt_arm::add_local_ifunc_entry): New method.
150 (Output_data_plt_arm::rel_irelative): New method.
151 (Output_data_plt_arm::entry_count): Modified.
152 (Output_data_plt_arm::address_for_global): New method.
153 (Output_data_plt_arm::address_for_local): New method.
154 gold/
155 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
156 (Output_data_plt_arm::insert_irelative_data): New method.
157 (Output_data_plt_arm::irelative_rel_): New member.
158 (Output_data_plt_arm::got_): New member.
159 (Output_data_plt_arm::got_irelative_): New member.
160 (Output_data_plt_arm::irelative_count_): New member.
161 (Output_data_plt_arm::IRelative_data_vec): New typedef.
162 (Output_data_plt_arm::irelative_data_vec_): New member.
163 (Output_data_plt_arm::do_write): Write out irelative entries.
164 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
165 more parameters to ctor.
166 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
167 more parameters to ctor.
168 * output.h (Output_data_reloc::add_local_relative): New method.
169 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
170
171 2015-01-29 Alan Modra <amodra@gmail.com>
172
173 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
174 and GOT_TLSGD to LE optimization.
175
176 2015-01-28 Cary Coutant <ccoutant@google.com>
177
178 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
179 for undef TLS symbols.
180 (Target_x86_64::Relocate::relocate_tls): Likewise.
181 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
182
183 2015-01-25 Cary Coutant <ccoutant@google.com>
184
185 * output.cc (Output_segment::set_section_addresses): Fix calculation
186 of size of relro segment.
187
188 2015-01-22 Alan Modra <amodra@gmail.com>
189
190 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
191 condition for need of ifunc plt entry.
192 (Target_powerpc::Scan::global <got relocs>): Likewise.
193
194 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
195
196 * mips.cc (reloc_high): Add r_sym.
197 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
198 reloc_high constructor.
199 (Mips_relocate_functions::relgot16_local): Likewise.
200 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
201 r_type to decide whether LO16 matches HI16.
202 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
203 rello16 and relgot16_local.
204
205 2015-01-09 Cary Coutant <ccoutant@google.com>
206
207 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
208 unless alignment is larger than page size.
209
210 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
211 Cary Coutant <ccoutant@google.com>
212
213 PR gold/17729
214 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
215 (DEFAULT_TARGET_X32): Set for x32.
216 * x86_64.cc (cmp_insn_32): New.
217 (lea_r10_insn_32): Likewise.
218 (lea_r11_insn_32): Likewise.
219 (cmp_insn_64): Likewise.
220 (lea_r10_insn_64): Likewise.
221 (lea_r11_insn_64): Likewise.
222 (Target_x86_64<size>::do_calls_non_split): Handle x32.
223 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
224 (check_DATA): Add split_x32 files.
225 (split_x32_[1234n].o): New targets.
226 (split_x32_[124]): New targets.
227 (split_x32_[1234r].stdout): New targets.
228 * testsuite/split_x32.sh: New file.
229 * testsuite/split_x32_1.s: Likewise.
230 * testsuite/split_x32_2.s: Likewise.
231 * testsuite/split_x32_3.s: Likewise.
232 * testsuite/split_x32_4.s: Likewise.
233 * testsuite/split_x32_n.s: Likewise.
234 * configure: Regenerated.
235 * testsuite/Makefile.in: Likewise.
236
237 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
238
239 PR gold/17809
240 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
241 x32.
242
243 2015-01-02 Alan Modra <amodra@gmail.com>
244
245 * version.cc (print_version): Just print current year.
246 * dwp.cc (print_version): Likewise.
247
248 2015-01-01 Alan Modra <amodra@gmail.com>
249
250 Update year range in copyright notice of all files.
251
252 2014-12-25 Alan Modra <amodra@gmail.com>
253
254 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
255 new enums.
256 (Target_arm::merge_object_attributes, ): Likewise.
257
258 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
259
260 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
261 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
262 AEABI_VFP_args_vfp to check that.
263 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
264 value and replace hardcoded values by enum values.
265
266 2014-12-22 Cary Coutant <ccoutant@google.com>
267
268 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
269
270 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
271
272 PR gold/14608
273 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
274 to "return i * i * 3;".
275
276 2014-12-16 Cary Coutant <ccoutant@google.com>
277
278 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
279 (Mapfile::print_output_data): Use current_data_size() to avoid
280 assert for sections requiring postprocessing; if address is not valid,
281 print 0.
282 (Mapfile::print_output_section): Use current_data_size(); print note
283 that addresses and sizes are before compression.
284
285 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
286
287 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
288 Cast current_group_size to unsigned long when reporting error.
289
290 2014-12-10 Jing Yu <jingyu@google.com>
291
292 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
293 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
294 Update error message.
295 (Target_aarch64::do_relax): Use absolute value of option
296 stub_group_size. Replace local variable with class member
297 stub_group_size_.
298
299 2014-12-04 Alan Modra <amodra@gmail.com>
300
301 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
302 addend of PLTREL24 reloc when not generating a plt stub. Make
303 max_branch_offset an "Address".
304 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
305 (Target_powerpc::Relocate::relocate): Likewise.
306
307 2014-12-04 Alan Modra <amodra@gmail.com>
308
309 PR 17670
310 * symtab.cc (Symbol::set_undefined): Remove assertion.
311 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
312 on symbols defined in discarded sections, instead return false.
313 Rearrange params, update all callers.
314 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
315 branches to syms in discarded sections.
316 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
317 undefined and flag as discarded.
318 (Target_powerpc::Relocate::relocate): Localize variable.
319
320 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
321
322 PR gold/17675
323 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
324 * testsuite/Makefile.in: Regenerated.
325
326 2014-12-03 Alan Modra <amodra@gmail.com>
327
328 PR 17566
329 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
330 when adding dynamic relocations against section symbols.
331
332 2014-12-01 Dimitry Ivanov <dimitry@google.com>
333
334 * layout.cc (Layout::finish_dynamic_section): When '-z global'
335 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
336 * options.h (General_options): New -z option (global).
337
338 2014-12-01 Cary Coutant <ccoutant@google.com>
339
340 PR gold/17578
341 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
342 is given.
343 (Layout::create_executable_stack_info): Warn when -z noexecstack is
344 given but some inputs require executable stack.
345
346 2014-11-26 Cary Coutant <ccoutant@google.com>
347
348 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
349 .debug_str_offsets; strip .debug_gnu_pubnames and
350 .debug_gnu_pubtypes.
351 (lines_only_debug_sections): Strip all four new sections.
352
353 2014-11-26 Jing Yu <jingyu@google.com>
354
355 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
356 register to be x0 when to relax TLSDESC_LD64_LO12.
357
358 2014-11-26 Alan Modra <amodra@gmail.com>
359
360 * powerpc.cc (struct Stub_table_owner): New.
361 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
362 unsigned int vector. Update all references.
363 (powerpc_relobj::set_stub_table): Take an unsigned int param
364 rather than a Stub_table. Update callers.
365 (Powerpc_relobj::clear_stub_table): New function.
366 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
367 stub_group_size_ vars.
368 (Target_powerpc::new_stub_table): Delete.
369 (max_branch_delta): New function, extracted from..
370 (Target_powerpc::Relocate::relocate): ..here..
371 (Target_powerpc::Branch_info::make_stub): ..and here. Return
372 status on whether stub created successfully.
373 (Stub_control::Stub_control): Add "no_size_errors" param. Move
374 default sizing to..
375 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
376 reduce on relax failure.
377 (Target_powerpc::group_sections): Add "no_size_errors" param.
378 Use stub_group_size_. Set up group info in a temp vector,
379 before building Stub_table vector. Account for input sections
380 possibly already converted to relaxed sections.
381 (Stub_table::init): Delete. Merge into..
382 (Stub_table::Stub_table): ..here.
383 (Stub_table::can_reach_stub): New function.
384 (Stub_table::add_plt_call_entry): Add "from" parameter and
385 return true iff stub could be reached.
386 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
387 param too.
388 (Stub_table::clear_stubs): Add "all" param.
389
390 2014-11-26 Alan Modra <amodra@gmail.com>
391
392 * powerpc.cc (Stub_control::set_output_and_owner): New function.
393 (Target_powerpc::group_sections): Use it.
394
395 2014-11-25 Cary Coutant <ccoutant@google.com>
396
397 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
398 (Binary_to_elf::write_symbol): Add st_size parameter.
399 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
400
401 2014-11-25 Cary Coutant <ccoutant@google.com>
402
403 PR gold/17639
404 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
405 (Sized_relobj_file::do_layout): Handle deferred sections properly
406 during GC pass 1. Don't add reloc sections to deferred list twice.
407 * object.h (Sized_relobj_file::is_deferred_layout): New function.
408 (Sized_relobj_file::is_deferred_layout_): New data member.
409
410 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
411
412 PR gold/17619
413 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
414 Check PC-relative offset overflow in PLT entry.
415
416 2014-11-21 Alan Modra <amodra@gmail.com>
417
418 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
419 for undefined weaks.
420
421 2014-11-20 Alan Modra <amodra@gmail.com>
422
423 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
424 from --stub-group-size parameter divided by 1024.
425 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
426 template parameter. Update all uses.
427 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
428 has_stub_value. Set for long branches. Don't report overflow for
429 branch to undefined weak symbols. Print info message on
430 overflowing branch to stub.
431
432 2014-11-20 Alan Modra <amodra@gmail.com>
433
434 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
435
436 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
437
438 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
439 entry for R_X86_64_GOTPLT64.
440 (Target_x86_64<size>::Relocate::relocate): Update comments for
441 R_X86_64_GOTPLT64.
442
443 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
444
445 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
446 * plugin.h: add lock definition
447
448 2014-10-29 Han Shen <shenhan@google.com>
449 Jing Yu <jingyu@google.com>
450
451 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
452 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
453 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
454 Symbol::TLS_REF.
455 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
456 method.
457 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
458 (Target_aarch64::tls_ld_to_le): New method.
459 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
460 for 64bit targets.
461 (Output_data_plt_aarch64::irelative_rel_): New data member.
462 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
463 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
464 (Output_data_plt_aarch64::add_relocation): New method.
465 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
466 offset. Add got_irelative size to got size.
467 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
468 type string with the new typename.
469 (AArch64_relocate_functions::update_adr): Replace parameter x with
470 immed.
471 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
472 (AArch64_relocate_functions::reloc_common): New method.
473 (AArch64_relocate_funcsions::rela_general): Extract common part out
474 into reloc_common method.
475 (AArch64_relocate_functions::rela_general): Likewise.
476 (AArch64_relocate_functions::pcrela_general): Likewise.
477 (AArch64_relocate_functions::adr): New method.
478 (AArch64_relocate_functions::adrp): Calculate immed before calling
479 update_adr.
480 (AArch64_relocate_functions::adrp): Likewise.
481 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
482 comparing x to 0. Calculate immed from ~x when x < 0.
483 (Target_aarch64::optimize_tls_reloc): Add new cases for
484 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
485 TLSLD_MOVW_DTPREL_G0_NC.
486 (Target_aarch64::possible_function_pointer_reloc): Implement this
487 method.
488 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
489 comment.
490 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
491 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
492 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
493 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
494 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
495 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
496 (Target_aarch64::make_plt_entry): Call add_entry with two more
497 parameters.
498 (Target_aarch64::make_local_ifunc_plt_entry): New method.
499 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
500 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
501 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
502 (Target_aarch64::Relocate::relocate_tls): Add cases for
503 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
504 TLSLD_MOVW_DTPREL_G0_NC.
505 * testsuite/icf_safe_so_test.cc: Correct test comment.
506 * testsuite/icf_safe_test.sh: Add AArch64 arch.
507
508 2014-10-22 Alan Modra <amodra@gmail.com>
509
510 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
511 thread_starter.
512
513 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
514
515 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
516
517 2014-10-17 Cary Coutant <ccoutant@google.com>
518
519 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
520 Add "typename" keyword.
521
522 2014-10-15 Han Shen <shenhan@google.com>
523 Jing Yu <jingyu@google.com>
524
525 Patch for gold aarch64 backend to support relaxation.
526 * aarch64-reloc.def: Change format.
527 * aarch64.cc (class Reloc_stub): New class.
528 (class Stub_table): New class.
529 (class AArch64_relobj): New class.
530 (class AArch64_input_section): New class.
531 (class AArch64_output_section): New class.
532 (Target_aarch64::new_stub_table): New method.
533 (Target_aarch64::new_aarch64_input_section): New method.
534 (Target_aarch64::find_aarch64_input_section): New method.
535 (Target_aarch64::scan_section_for_stubs): New method.
536 (Target_aarch64::scan_reloc_section_for_stubs): New method.
537 (Target_aarch64::relocate_stub): New method.
538 (Target_aarch64::current_target): New method.
539 (Target_aarch64::do_make_elf_object): New method.
540 (Target_aarch64::do_may_relax): New method.
541 (Target_aarch64::do_relax): New method.
542 (Target_aarch64::group_sections): New method.
543 (Target_aarch64::scan_reloc_for_stub): New method.
544 (Target_aarch64::do_make_output_section): New method.
545 (Target_aarch64::stub_tables_): New data member.
546 (Target_aarch64::aarch64_input_section_map_): New data member.
547 (AArch64_relocate_functions::maybe_apply_stub): New method.
548
549 2014-09-30 Cary Coutant <ccoutant@google.com>
550
551 PR gold/17432
552 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
553
554 2014-09-30 Kito Cheng <kito@0xlab.org>
555
556 PR gold/13597
557 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
558 hash table before sysv-style hash table.
559
560 2014-09-29 Sriraman Tallam <tmsriram@google.com>
561
562 * options.h (--pic-executable): Add negative to alias to -no-pie.
563
564 2014-09-26 Cary Coutant <ccoutant@google.com>
565
566 PR gold/16773
567 * object.cc (Sized_relobj_file): Compute value of section symbols
568 for TLS sections the same as TLS symbols.
569
570 2014-09-25 Cary Coutant <ccoutant@google.com>
571
572 PR gold/17432
573 * resolve.cc (Symbol_table::resolve): Override common placeholder
574 symbols, but adjust sizes.
575 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
576 symbols to common lists.
577
578 2014-09-24 Alan Modra <amodra@gmail.com>
579
580 * po/POTFILES.in: Regenerate.
581
582 2014-09-23 Taiju Tsuiki <tzik@google.com>
583 Cary Coutant <ccoutant@google.com>
584
585 PR gold/14860
586 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
587 on input_sections_blocker.
588 * layout.cc (Write_sections_task::locks): Unblock
589 input_sections_blocker_.
590 * layout.h (Write_sections_task::Write_sections_task): Add
591 input_sections_blocker.
592 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
593 to DEPENDENCIES.
594 * testsuite/Makefile.in: Regenerate.
595
596 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
597
598 * testsuite/Makefile.am (plugin_test_10): New test.
599 * testsuite/Makefile.in: Regenerate
600 * testsuite/plugin_common_test_2.c (c1): Align to 8.
601 * testsuite/plugin_test_10.sh: New file.
602
603 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
604
605 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
606 * resolve.cc (Symbol_table::resolve): Don't override common symbols
607 during the replacement phase.
608
609 2014-09-17 Han Shen <shenhan@google.com>
610 Jing Yu <jingyu@google.com>
611
612 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
613 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
614 * aarch64.cc (Target_aarch64): Add data members
615 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
616 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
617 constructor.
618 (Target_aarch64::do_reloc_symbol_index): New method.
619 (Target_aarch64::do_reloc_addend): New method.
620 (Target_aarch64::add_tlsdesc_info): New method.
621 (Target_aarch64::do_dynsym_value): New method.
622 (Target_aarch64::do_make_data_plt): Add new parameters: got,
623 got_irelative. Pass them to Output_data_plt_aarch64_standard.
624 (Target_aarch64::make_data_plt): Add new parameters: got,
625 got_irelative. Pass them to do_make_data_plt.
626 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
627 (Target_aarch64::Relocate:tls_gd_to_le): New method.
628 (Target_aarch64::Relocate:tls_ie_to_le): New method.
629 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
630 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
631 (Target_aarch64::got_tlsdesc_section): New method.
632 (Target_aarch64::make_local_ifunc_plt_entry): New method.
633 (Target_aarch64::define_tls_base_symbol): New method.
634 (Target_aarch64::reserve_tlsdesc_entries): New method.
635 (Target_aarch64::got_mod_index_entry): New method.
636 (Target_aarch64::rela_tlsdesc_section): New method.
637 (Target_aarch64::rela_irelative_section): New method.
638 (Target_aarch64::Tlsdesc_info): New struct.
639 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
640 relocations and tlsdesc relocations.
641 (Target_aarch64::optimize_tls_reloc): Implement method.
642 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
643 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
644 in constructor.
645 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
646 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
647 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
648 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
649 (Output_data_plt_aarch64::rela_tlsdesc): New method.
650 (Output_data_plt_aarch64::rela_irelative): New method.
651 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
652 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
653 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
654 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
655 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
656 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
657 (Output_data_plt_aarch64_standard): New member variables:
658 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
659 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
660 New parameter: got, got_irelative.
661 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
662 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
663 (Output_data_plt_aarch64::do_write): Replace got_address with
664 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
665 (AArch64_relocate_functions::update_movnz): New method.
666 (AArch64_relocate_functions): Correct format.
667 (AArch64_relocate_functions::movnz): New method.
668 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
669 before the switch. Add new cases to switch.
670 Check ie_to_le relaxation on tlsie relocations. Add code handling
671 tlsgd tlsdesc cases.
672 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
673 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
674 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
675 Call reloc_name_in_error_message to print unsupported reloc.
676 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
677 make_data_plt.
678 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
679 relocs. Fill in some more dynamic tags.
680 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
681 Skip call tls_get_addr when tlsgd is relaxed.
682 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
683 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
684 tlsdesc->ie relaxation.
685
686 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
687
688 * mips.cc (Target_mips_nacl): New class.
689 (Target_selector_mips_nacl): New class.
690 (target_selector_mips32): Rename from target_selector_mips32be and use
691 Target_selector_mips_nacl instead of Target_selector_mips.
692 (target_selector_mips32el): Rename from target_selector_mips32 and use
693 Target_selector_mips_nacl instead of Target_selector_mips.
694 (target_selector_mips64): Rename from target_selector_mips64be and use
695 Target_selector_mips_nacl instead of Target_selector_mips.
696 (target_selector_mips64el): Rename from target_selector_mips64 and use
697 Target_selector_mips_nacl instead of Target_selector_mips.
698 (Target_mips::mips_info): Add const attribute.
699
700 2014-09-02 Cary Coutant <ccoutant@google.com>
701
702 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
703 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
704 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
705 (Sized_incr_dynobj::do_section_name): Likewise.
706 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
707 (Sized_incr_dynobj::do_section_name): Likewise.
708 * object.h (Object::section_name): Likewise.
709 (Object::do_section_name): Likewise.
710 (Sized_relobj_file::do_section_name): Likewise.
711 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
712 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
713
714 2014-09-02 Cary Coutant <ccoutant@google.com>
715
716 PR gold/17005
717 * ehframe.cc (Fde::write): Add output_offset parameter.
718 (Cie::write): Likewise.
719 (Eh_frame::set_final_data_size): Account for offset within output
720 section.
721 (Eh_frame::do_sized_write): Likewise.
722 * ehframe.h (Fde::write): Add output_offset parameter.
723 (Cie::write): Likewise.
724 * output.cc (Output_section::Input_section_sort_entry): Remove
725 section_has_name_; add output_section_name parameter. Use
726 output section name for non-input sections.
727 (Output_section::Input_section_sort_entry::section_has_name): Remove.
728 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
729 (Output_section::Input_section_sort_compare): Remove logic for
730 sections without names.
731 (Output_section::Input_section_sort_init_fini_compare): Likewise.
732 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
733 Likewise.
734 (Output_section::Input_section_sort_section_name_compare): Likewise.
735
736 2014-08-29 Han Shen <shenhan@google.com>
737 Jing Yu <jingyu@google.com>
738
739 * aarch64-reloc-property.cc
740 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
741 reference reloc property in the table.
742 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
743 3 other entries.
744 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
745 2 new overloaded methods.
746 (Output_data_got_aarch64::do_write): Add code to write out
747 static relocs.
748 (class Output_data_got_aarch64::Static_reloc): New class to wrap
749 static relocs.
750 (Output_data_got_aarch64::static_relocs): New vector to
751 hold static relocs.
752 (Target_aarch64::TCB_SIZE): New const static memeber.
753 (Target_aarch64::tcb_size): New method.
754 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
755 (Target_aarch64::Relocate::relocate_tls): New method.
756 (Target_aarch64::Scan::local): Add code handling new reloc types.
757 (Target_aarch64::Scan::global): Add code handling new reloc types.
758
759 2014-08-13 Sriraman Tallam <tmsriram@google.com>
760
761 * options.h (-no-pie): Add option.
762
763 2014-08-08 Jing Yu <jingyu@google.com>
764 Han Shen <shenhan@google.com>
765
766 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
767 (DEFFILES): add aarch64-reloc.def.
768 (TARGETSOURCES): Add aarch64-reloc-property.cc.
769 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
770 * Makefile.in: Regenerate.
771 * aarch64-reloc-property.cc: New file.
772 * aarch64-reloc-property.h: New file.
773 * aarch64-reloc.def: New file.
774 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
775 with tab to make the format consistent.
776 (Output_data_got_aarch64::symbol_table_): New method.
777 (Target_aarch64::do_plt_address_for_global): New method.
778 (Target_aarch64::do_plt_address_for_local): New method.
779 (Target_aarch64::do_select_as_default_target): New method.
780 (Target_aarch64::do_make_data_plt): New method.
781 (Target_aarch64::make_data_plt): New method.
782 (Output_data_plt_aarch64::has_irelative_section): New method.
783 (Output_data_plt_aarch64::address_for_global): New method.
784 (Output_data_plt_aarch64::address_for_local): New method.
785 (Output_data_plt_aarch64::irelative_rel_): New parameter.
786 (Output_data_plt_aarch64::add_entry): Implement contents.
787 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
788 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
789 the got_pov entry to plt0.
790 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
791 Implement contents.
792 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
793 (AArch64_howto): New struct.
794 (aarch64_howto[]): New static const array.
795 (AArch64_relocate_functions): New class.
796 (Target_aarch64::Scan::get_reference_flags): Remove method.
797 (Target_aarch64::Scan::local): Implement to support a few relocations.
798 (Target_aarch64::Scan::global): Implement to support a few relocations.
799 (Target_aarch64::make_plt_section): Implement contents.
800 (Target_aarch64::make_plt_entry): Implement contents.
801 (Target_aarch64::do_finalize_sections): Implement contents.
802 (Target_aarch64::Relocate::relocate): Implement a few relocations.
803 (Target_aarch64::relocate_section): Implement contents.
804
805 2014-08-06 Alan Modra <amodra@gmail.com>
806
807 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
808
809 2014-08-06 Alan Modra <amodra@gmail.com>
810
811 PR 13227
812 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
813
814 2014-07-21 Sriraman Tallam <tmsriram@google.com>
815
816 * object.cc (Relobj::is_section_name_included): Add
817 ".rodata.nptl_version" to not garbage collect this section.
818
819 2014-07-08 Cary Coutant <ccoutant@google.com>
820
821 * expression.cc (struct Expression::Expression_eval_info): Add
822 new fields type_pointer, vis_pointer, and nonvis_pointer.
823 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
824 nonvis_pointer parameters. Adjust all calls.
825 (Symbol_expression::value): Update type, visibility, and nonvis bits
826 in caller.
827 * script.cc (Symbol_assignment::sized_finalize): Update type,
828 visibility, and remaining st_other bits for new symbol.
829 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
830 vis_pointer, and nonvis_pointer parameters.
831 * symtab.h (Symbol::set_type): New method.
832
833 * testsuite/Makefile.am (defsym_test): New test.
834 * testsuite/Makefile.in: Regenerate.
835 * testsuite/defsym_test.c: New file.
836 * testsuite/defsym_test.sh: New file.
837
838 2014-07-08 Cary Coutant <ccoutant@google.com>
839
840 PR gold/15639
841 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
842 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
843 (Sized_dynobj::base_read_symbols): ...new method.
844 * object.h (Sized_relobj_file::base_read_symbols): New method.
845 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
846 (Sized_relobj_file::base_read_symbols): ...new method.
847 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
848 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
849 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
850
851 2014-07-04 Alan Modra <amodra@gmail.com>
852
853 * po/POTFILES.in: Regenerate.
854
855 2014-07-02 Jing Yu <jingyu@google.com>
856
857 * aarch64.cc: New file
858 * Makefile.am (TARGETSOURCES): Add aarch64.cc
859 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
860 * Makefile.in: Regenerate.
861 * configure.tgt: Add entries for aarch64*.
862 * configure.ac: Likewise.
863 * configure: Likewise.
864
865 2014-06-27 Alan Modra <amodra@gmail.com>
866
867 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
868
869 2014-06-24 Cary Coutant <ccoutant@google.com>
870
871 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
872 sections.
873 (Dwo_file::sized_read_unit_index): Likewise.
874
875 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
876
877 * mips.cc: New file.
878 * Makefile.am (TARGETSOURCES): Add mips.cc
879 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
880 * configure.tgt: Add entries for mips*.
881 * configure.ac: Likewise.
882 * Makefile.in: Regenerate.
883 * configure: Likewise.
884
885 2014-06-09 Cary Coutant <ccoutant@google.com>
886
887 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
888 unit_length is within section bounds.
889
890 2014-06-09 Cary Coutant <ccoutant@google.com>
891
892 PR gold/16980
893 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
894 map.
895
896 2014-06-07 Alan Modra <amodra@gmail.com>
897
898 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
899
900 2014-06-06 Cary Coutant <ccoutant@google.com>
901
902 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
903 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
904 (Dwarf_pubnames_table::read_header): Likewise.
905 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
906 .debug_gnu_pubtypes.
907
908 2014-06-05 Joel Brobecker <brobecker@adacore.com>
909
910 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
911 * Makefile.in, configure: Regenerate.
912
913 2014-06-03 Alan Modra <amodra@gmail.com>
914
915 * powerpc.cc (addis_12_2): Define.
916 (Stub_table::do_write): Support fusion on ELFv2 stubs.
917
918 2014-06-03 Alan Modra <amodra@gmail.com>
919
920 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
921 st_other output.
922
923 2014-06-02 Alan Modra <amodra@gmail.com>
924
925 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
926 Only ignore relocs on ELFv1.
927 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
928
929 2014-05-30 Cary Coutant <ccoutant@google.com>
930
931 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
932 * testsuite/Makefile.in: Regenerate.
933 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
934
935 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
936
937 PR gold/16945
938 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
939 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
940
941 2014-05-15 Alan Modra <amodra@gmail.com>
942
943 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
944 Compare FDE contents with DW_CFA_nop rather than 0.
945
946 2014-05-13 Sriraman Tallam <tmsriram@google.com>
947
948 * symtab.h (may_need_copy_reloc): Remove check for position independent
949 code.
950 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
951 position independence before pc absolute may_need_copy_reloc call.
952 Add check for executable output befor pc relative may_need_copy_reloc
953 call.
954 * i386.cc: Ditto.
955 * arm.cc: Ditto.
956 * sparc.cc: Ditto.
957 * tilegx.cc: Ditto.
958 * powerpc.cc: Add check for no position independence before
959 may_need_copy_reloc calls.
960 * testsuite/pie_copyrelocs_test.cc: New file.
961 * testsuite/pie_copyrelocs_shared_test.cc: New file.
962 * Makefile.am (pie_copyrelocs_test): New test.
963 * Makefile.in: Regenerate.
964
965 2014-05-08 Martin Liška <mliska@suse.cz>
966
967 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
968
969 2014-05-06 Cary Coutant <ccoutant@google.com>
970
971 PR gold/16900
972 * i386.cc (Output_data_got_plt_i386): New class.
973 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
974 parameter. Change all callers.
975 (Output_data_plt_i386::layout_): Remove.
976 (Output_data_plt_i386::got_plt_): Change type.
977 (Target_i386::got_plt_): Change type. Change all references.
978 (Target_i386::got_section): Create instance of new class.
979 (Output_data_got_plt_i386::do_write): New function.
980 * x86_64.cc (Output_data_got_plt_x86_64): New class.
981 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
982 parameter. Change all callers.
983 (Output_data_plt_x86_64::layout_): Remove.
984 (Output_data_plt_x86_64::got_plt_): Change type.
985 (Target_x86_64::got_plt_): Change type. Change all references.
986 (Target_x86_64::got_section): Create instance of new class.
987 (Output_data_got_plt_x86_64::do_write): New function.
988 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
989 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
990 class.
991
992 2014-05-05 Cary Coutant <ccoutant@google.com>
993
994 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
995 if we have pubnames/pubtypes.
996
997 2014-05-02 Cary Coutant <ccoutant@google.com>
998
999 * defstd.cc (in_segment): Define __ehdr_start here...
1000 * layout.cc (Layout::finalize): ...Instead of here. Set the
1001 output segment when known.
1002 * resolve.cc (Symbol::override_base_with_special): Remember
1003 the original binding.
1004 * symtab.cc (Symbol::set_output_segment): New function.
1005 (Symbol::set_undefined): New function.
1006 * symtab.h (Symbol::is_weak_undefined): Check original undef
1007 binding.
1008 (Symbol::is_strong_undefined): New function.
1009 (Symbol::set_output_segment): New function.
1010 (Symbol::set_undefined): New function.
1011 * target-reloc.h (is_strong_undefined): Remove.
1012 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1013 Check for hidden undefs.
1014 (relocate_section): Call Symbol::is_strong_undefined.
1015
1016 * testsuite/Makefile.am (ehdr_start_test_1)
1017 (ehdr_start_test_2, ehdr_start_test_3)
1018 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1019 * testsuite/Makefile.in: Regenerate.
1020 * testsuite/ehdr_start_def.cc: New source file.
1021 * testsuite/ehdr_start_test.cc: New source file.
1022 * testsuite/ehdr_start_test.t: New linker script.
1023 * testsuite/ehdr_start_test_4.sh: New shell script.
1024
1025 2014-04-23 Cary Coutant <ccoutant@google.com>
1026
1027 PR gold/16870
1028 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1029
1030 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1031
1032 * layout.cc (Layout::include_section): Allow a target to decide
1033 whether to include a section.
1034 * target.h (Target::should_include_section): New function.
1035 (Target::do_should_include_section): New function.
1036
1037 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1038
1039 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1040 inline into ...
1041 (Copy_relocs::emit): ... here.
1042 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1043 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1044 (Copy_reloc_entry::entries_): Change from private to protected.
1045
1046 2014-04-02 Sriraman Tallam <tmsriram@google.com>
1047
1048 * icf.cc (get_section_contents): Replace copies of reloc
1049 vectors with const references.
1050
1051 2014-04-02 Cary Coutant <ccoutant@google.com>
1052
1053 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1054 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1055 * configure: Regenerate.
1056 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1057 -fno-use-linker-plugin.
1058 (LINK1, CXXLINK1): Add it to the link command.
1059 * testsuite/Makefile.in: Regenerate.
1060
1061 2014-03-12 Alan Modra <amodra@gmail.com>
1062
1063 * Makefile.in: Regenerate.
1064
1065 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1066
1067 * symtab.h (Symbol::set_nonvis): New function.
1068
1069 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1070
1071 * symtab.cc (Sized_symbol<32>::init_output_data):
1072 Instantiate the template.
1073 (Sized_symbol<64>::init_output_data): Likewise.
1074
1075 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1076
1077 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1078 adjust dynamic symbol value.
1079 * target.h (Target::adjust_dyn_symbol): New function.
1080 (Target::do_adjust_dyn_symbol): New function.
1081
1082 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1083
1084 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1085 Get the value of DYNAMIC_CUSTOM dynamic entry.
1086 * output.h (Output_data_dynamic::add_custom): New function.
1087 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1088 dynamic entry.
1089 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1090 * target.h (Target::dynamic_tag_custom_value): New function.
1091 (Target::do_dynamic_tag_custom_value): New function.
1092
1093 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1094
1095 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1096 dynsym indexes.
1097 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1098 (Target::do_has_custom_set_dynsym_indexes): New function.
1099 (Target::set_dynsym_indexes): New function.
1100 (Target::do_set_dynsym_indexes): New function.
1101
1102 2014-03-07 Alan Modra <amodra@gmail.com>
1103
1104 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1105 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1106 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1107 (Powerpc_relocate_functions::has_overflow_bitfield,
1108 overflowed): Use the above.
1109 (Target_powerpc::Relocate::relocate): Correct overflow checking
1110 for a number of relocations. Modify overflow test for 16-bit
1111 fields in instructions to signed/unsigned according to whether
1112 the field takes a signed or unsigned value.
1113
1114 2014-03-05 Alan Modra <amodra@gmail.com>
1115
1116 Update copyright years.
1117
1118 2014-03-05 Alan Modra <amodra@gmail.com>
1119
1120 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1121 R_PPC64_ADDR64_LOCAL.
1122 (Target_powerpc::Relocate::relocate): Likewise.
1123
1124 2014-03-03 Alan Modra <amodra@gmail.com>
1125
1126 * dwp.cc (print_version): Update copyright year to current.
1127
1128 2014-02-10 Alan Modra <amodra@gmail.com>
1129
1130 * po/gold.pot: Regenerate.
1131
1132 2014-02-06 Cary Coutant <ccoutant@google.com>
1133
1134 Fix problem where -u is ignored when a weak undef is seen.
1135
1136 * archive.cc (Library_base::should_include_member): Reorder
1137 code to check for -u option if a weak undef has already been seen.
1138 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1139 * testsuite/Makefile.in: Regenerate.
1140 * testsuite/weak_undef_file3.cc: New file.
1141 * testsuite/weak_undef_file4.cc: New file.
1142 * testsuite/weak_undef_test_2.cc: New file.
1143
1144 2014-02-05 Cary Coutant <ccoutant@google.com>
1145
1146 Fix issues with gold undefined symbol diagnostics.
1147
1148 PR binutils/15435
1149 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1150 check to here.
1151 * target-reloc.h (is_strong_undefined): New function.
1152 (relocate_section): Move undef vtable symbol check from here.
1153 Check for is_strong_undefined.
1154
1155 2014-02-05 Cary Coutant <ccoutant@google.com>
1156
1157 Fix problems with the --dynamic-list option.
1158
1159 PR gold/13577
1160 * options.cc (General_options::parse_dynamic_list):
1161 Set have_dynamic_list_.
1162 (General_options::General_options): Initialize have_dynamic_list_.
1163 (General_options::finalize): Turn off -Bsymbolic and
1164 -Bsymbolic-functions if --dynamic-list provided.
1165 * options.h (General_options::have_dynamic_list): New function.
1166 (General_options::have_dynamic_list_): New data member.
1167 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1168 correctly.
1169
1170 PR gold/16530
1171 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1172 in --dynamic-list, mark it.
1173
1174 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1175 (dynamic_list_2): New test case.
1176 * testsuite/Makefile.in: Regenerate.
1177 * testsuite/dynamic_list_2.cc: New file.
1178 * testsuite/dynamic_list_2.t: New file.
1179 * testsuite/dynamic_list_lib1.cc: New file.
1180 * testsuite/dynamic_list_lib2.cc: New file.
1181 * testsuite/gc_dynamic_list_test.c: New file.
1182 * testsuite/gc_dynamic_list_test.sh: New file.
1183 * testsuite/gc_dynamic_list_test.t: New file.
1184
1185 2014-01-28 Cary Coutant <ccoutant@google.com>
1186
1187 Add .gdb_index version 7 support.
1188
1189 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1190 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1191 debug sections.
1192 (Dwarf_ranges_table::read_ranges_table): Likewise.
1193 (Dwarf_pubnames_table::read_section): Check for GNU-style
1194 sections, and for compressed debug sections.
1195 (Dwarf_pubnames_table::read_header): Compute end address of table.
1196 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1197 for end of list by offset, not by offset == 0.
1198 (Dwarf_info_reader::do_read_string_table): Check for compressed
1199 debug sections.
1200 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1201 Initialize new data members.
1202 (Dwarf_pubnames_table::next_name): return flag_byte.
1203 (Dwarf_pubnames_table::end_of_table_): New data member.
1204 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1205 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1206 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1207 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1208 read skeleton type unit DIEs.
1209 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1210 (Gdb_index::do_write): Write flag_byte.
1211 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1212 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1213 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1214 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1215
1216 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1217
1218 * version.cc (print_version): Update copyright year to 2014.
1219
1220 2013-12-19 Dimitry Andric <dimitry@andric.com>
1221
1222 * stringpool.cc (Stringpool_template::reserve): Add
1223 HAVE_UNORDERED_MAP case.
1224 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1225
1226 2013-12-18 Cary Coutant <ccoutant@google.com>
1227
1228 * configure.ac: Check for <unordered_set> and <unordered_map>.
1229 * config.in: Regenerate.
1230 * configure: Regenerate.
1231 * system.h: Use <unordered_set> and <unordered_map> if available.
1232
1233 2013-12-10 Roland McGrath <mcgrathr@google.com>
1234
1235 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1236 with $(INSTALL_PROGRAM_ENV).
1237 * Makefile.in: Regenerate.
1238
1239 2013-11-22 Cary Coutant <ccoutant@google.com>
1240
1241 * configure.ac: Add check for which library is needed for
1242 dlopen.
1243 * configure: Regenerate.
1244
1245 2013-11-22 Cary Coutant <ccoutant@google.com>
1246
1247 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1248 assembler.
1249 * testsuite/Makefile.in: Regenerate.
1250
1251 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1252
1253 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1254 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1255 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1256 (Target_x86_64<size>::Scan::local): Likewise.
1257 (Target_x86_64<size>::Scan::global): Likewise.
1258 (Target_x86_64<size>::Relocate::relocate): Likewise.
1259 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1260 Likewise.
1261 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1262 R_X86_64_PC32_BND.
1263
1264 * testsuite/Makefile.am (check_PROGRAMS): Add
1265 exception_x86_64_bnd_test.
1266 (exception_x86_64_bnd_test_SOURCES): New macro.
1267 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1268 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1269 (exception_x86_64_bnd_test_LDADD): Likewise.
1270 (exception_x86_64_bnd_1.o): New rule.
1271 (exception_x86_64_bnd_2.o): Likewise.
1272 * testsuite/Makefile.in: Regenerated.
1273
1274 2013-11-15 Alan Modra <amodra@gmail.com>
1275
1276 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1277 accessor.
1278 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1279 Only call ppc64_local_entry_offset for 64-bit. Restrict
1280 symval_for_branch lookup to ELFv1.
1281 (Stub_table::add_plt_call_entry): Use unsigned int off.
1282 (Output_data_glink::Address, invalid_address): New.
1283 (Output_data_glink::add_eh_frame): Move out of line. Add
1284 support for ELFv2.
1285 (Output_data_glink::add_global_entry, find_global_entry,
1286 global_entry_address): New functions.
1287 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1288 ge_size): New variables.
1289 (Output_data_glink::set_final_data_size): Add global entry
1290 stub sizing.
1291 (Output_data_glink::do_write): Write global entry stubs.
1292 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1293 parameter. Return true for ELFv2. Adjust callers.
1294 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1295 ELFv1. Similarly for ifunc and dynamic relocation processing
1296 specific to ELFv1. Recognize that symbols are defined on
1297 their plt entries for ELFv2.
1298 (Target_powerpc::symval_for_branch): Assert if called for
1299 ELFv2 or ppc32.
1300 (Target_powerpc::Relocate::relocate): Use global entry plt
1301 stub for symbol value if such exists on ELFv2.
1302 (Target_powerpc::Relocate::relocate): Don't call
1303 symval_for_branch when ELFv2. Do adjust for local entry
1304 offset when ELFv2.
1305 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1306 plt stub for ELFv2.
1307 (Target_powerpc::do_plt_address_for_global): Similarly.
1308
1309 2013-11-14 Cary Coutant <ccoutant@google.com>
1310
1311 Revert patch -- this did not fix the problem, and there is
1312 no race there.
1313
1314 2013-11-14 Cary Coutant <ccoutant@google.com>
1315
1316 PR gold/14860
1317 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1318 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1319 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1320 updating fde_offsets_.
1321 (Eh_frame_hdr::lock_): New data member.
1322
1323 2013-11-14 Cary Coutant <ccoutant@google.com>
1324
1325 * dwp.cc (Dwo_file_entry): New type.
1326 (File_list): Use Dwo_file_entry.
1327 (Dwo_file::verify): New function.
1328 (Dwo_file::verify_dwo_list): New function.
1329 (Dwo_file::sized_verify_dwo_list): New function.
1330 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1331 list.
1332 (Dwp_options): New enum type.
1333 (dwp_options): Add --verify-only.
1334 (usage): Likewise.
1335 (main): Likewise.
1336 * dwp.h (gold_info): Add declaration.
1337
1338 2013-11-14 Cary Coutant <ccoutant@google.com>
1339
1340 PR gold/14860
1341 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1342 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1343 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1344 updating fde_offsets_.
1345 (Eh_frame_hdr::lock_): New data member.
1346
1347 2013-11-06 Cary Coutant <ccoutant@google.com>
1348
1349 PR gold/15758
1350 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1351 before reloc sections.
1352
1353 2013-11-04 Alan Modra <amodra@gmail.com>
1354
1355 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1356 (Symbol::needs_dynamic_reloc): Test new flag.
1357 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1358 (Target_powerpc::Scan::get_reference_flags): Add target param.
1359 Return FUNC_DESC_ABI for 64-bit ELFv1.
1360 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1361 call.
1362 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1363 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1364
1365 2013-10-31 Cary Coutant <ccoutant@google.com>
1366
1367 Restore support for dwp v2 DWARF package file format.
1368
1369 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1370 tu_length parameter. Adjust all callers.
1371 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1372 * dwp.cc: Include dwarf.h.
1373 (Section_bounds): New struct type.
1374 (Unit_set): New struct type.
1375 (Dwo_file::Dwo_file): Initialize new data member.
1376 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1377 Combine and rename to...
1378 (Dwo_file::read_unit_index): ...this.
1379 (Dwo_file::sized_read_compunit_index)
1380 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1381 (Dwo_file::sized_read_unit_index): ...this.
1382 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1383 parameters; add section_id parameter.
1384 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1385 (Dwo_file::add_unit_set): ...this.
1386 (Dwo_file::shndx_map_): Remove.
1387 (Dwo_file::sect_offsets_): New data member.
1388 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1389 (Dwp_output_file::add_section): Rename to...
1390 (Dwp_output_file::add_contribution): ...this.
1391 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1392 (Dwp_output_file::add_tu_set): Likewise.
1393 (Dwp_output_file::Contribution): New type.
1394 (Dwp_output_file::Section::contributions): New data member.
1395 (Dwp_output_file::Cu_or_tu_set): Remove.
1396 (Dwp_output_file::Section::Section): New ctor.
1397 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1398 (Dwp_output_file::Dwp_index::Section_table): New type.
1399 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1400 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1401 parameter.
1402 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1403 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1404 (Dwp_output_file::Dwp_index::section_table): New member function.
1405 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1406 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1407 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1408 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1409 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1410 (Dwp_output_file::Dwp_index::section_table_): New data member.
1411 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1412 (Dwp_output_file::add_output_section): New member function.
1413 (Dwp_output_file::write_new_section): New member function.
1414 (Dwp_output_file::write_contributions): New member function.
1415 (Dwp_output_file::section_id_map_): New data member.
1416 (class Dwo_id_info_reader): Remove.
1417 (class Unit_reader): New class.
1418 (get_dwarf_section_name): New function.
1419 (Dwo_file::read_executable): Adjust initializations of class data.
1420 (Dwo_file::read): Add support for v2 package file format.
1421 (Dwo_file::read_unit_index): Likewise.
1422 (Dwo_file::sized_read_unit_index): Likewise.
1423 (Dwo_file::copy_section): Likewise.
1424 (Dwo_file::add_unit_set): Likewise.
1425 (Dwp_output_file::add_output_section): Likewise.
1426 (Dwp_output_file::add_contribution): Likewise.
1427 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1428 for empty slot.
1429 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1430 file format.
1431 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1432 slot.
1433 (Dwp_output_file::initialize): Remove unused function.
1434 (Dwp_output_file::finalize): Add support for v2 package file format.
1435 (Dwp_output_file::write_index): Likewise.
1436 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1437 function prototype.
1438
1439 2013-10-31 Cary Coutant <ccoutant@google.com>
1440
1441 * configure.ac: Fix check for -fmerge-constants.
1442 * configure.ac: Regenerate.
1443
1444 2013-10-30 Roland McGrath <mcgrathr@google.com>
1445
1446 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1447 Correct 9-byte nop sequence to match what the assembler generates.
1448
1449 2013-10-30 Alan Modra <amodra@gmail.com>
1450
1451 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1452 ppc64_local_entry_offset, ppc64_local_entry_offset,
1453 do_read_symbols): New functions.
1454 (Powerpc_relobj::e_flags_, st_other_): New vars.
1455 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1456 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1457 (Powerpc_relobj::e_flags_): New var.
1458 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1459 and adjust for ELFv2.
1460 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1461 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1462 (Powerpc_dynobj::do_find_special_sections): Likewise.
1463 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1464 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1465 to ELFv2 local entry.
1466 (Target_powerpc::do_relax): No thread safe barriers needed for
1467 ELFv2.
1468 (Output_data_plt_powerpc::initial_plt_entry_size_,
1469 plt_entry_size): Delete. Replace all uses with
1470 first_plt_entry_offset() and plt_entry_size().
1471 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1472 reserved_size parm. Update callers.
1473 (Output_data_plt_powerpc::entry_count): Update.
1474 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1475 and use Target_powerpc::first_plt_entry_offset().
1476 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1477 rename to plt_entry_size.
1478 (Output_data_plt_powerpc::add_ifunc_entry,
1479 add_local_ifunc_entry): Adjust reloc for ELFv2.
1480 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1481 (glink_eh_frame_fde_64v2): New.
1482 (Stub_table::plt_call_size): Support ELFv2 sizing.
1483 (Output_data_glink::add_eh_frame): Use the new FDE.
1484 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1485 (Stub_table::do_write): Write ELFv2 stubs and glink.
1486 (Target_powerpc::Relocate::relocate): Replaces nop after call
1487 with ld 2,24(1) and adjust local offset destination for ELFv2.
1488
1489 2013-10-30 Alan Modra <amodra@gmail.com>
1490
1491 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1492 (Target_powerpc::Scan::global, local): Likewise.
1493 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1494 on all ppc64 @h and @ha relocs.
1495
1496 2013-10-14 Alan Modra <amodra@gmail.com>
1497
1498 * output.h (Output_data_got::add_constant): Tidy.
1499 (Output_data_got::add_constant_pair): New function.
1500 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1501 methods used so as to first call reserve_ent().
1502
1503 2013-10-11 Roland McGrath <mcgrathr@google.com>
1504
1505 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1506 add_got_entry and add_got_entry_pair.
1507
1508 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1509 (HAVE_PUBNAMES): Likewise.
1510 * configure: Regenerate.
1511
1512 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1513 * testsuite/Makefile.in: Regenerate.
1514
1515 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1516 Remove const from declaration.
1517 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1518 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1519 * output.h (Output_file_header): Remove const from member target_
1520 and corresponding constructor argument.
1521 * output.cc (Output_file_header::Output_file_header): Update prototype.
1522 (Output_file_header::do_sized_write): Use this->target_ in place
1523 of parameters()->target().
1524
1525 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1526
1527 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1528 * configure: Regenerate.
1529 * Makefile.in: Regenerate.
1530 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1531 * testsuite/merge_string_literals_2.c: Likewise.
1532 * testsuite/Makefile.am
1533 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1534 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1535 literal -fmerge-constants.
1536 * testsuite/Makefile.in: Regenerate.
1537
1538 * i386.cc (Target_i386): Remove unused member dynbss_.
1539 * arm.cc (Target_arm): Likewise.
1540 * powerpc.cc (Target_powerpc): Likewise.
1541 * sparc.cc (Target_sparc): Likewise.
1542 * tilegx.cc (Target_tilegx): Likewise.
1543 * x86_64.cc (Target_x86_64): Likewise.
1544 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1545 type_signature_, type_offset_.
1546 * plugin.h (Plugin_hook): Remove unused member layout_.
1547 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1548 mapfile_.
1549 (Read_member): Remove unused members input_objects_, symtab_,
1550 mapfile_, layout_.
1551 (Check_library): Remove unused member symtab_.
1552 * archive.h (Lib_group): Remove unused member lib_.
1553 * archive.cc (Lib_group::Lib_group): Update initializer.
1554 * incremental.h (Incremental_binary): Remove unused member target_.
1555 (Incremental_script_entry): Removed unused member script_.
1556 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1557 * icf.h (Icf): Remove unused member num_tracked_relocs.
1558
1559 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1560 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1561 its only use.
1562 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1563
1564 * archive.h: Use struct rather than class for forward declaration
1565 of Read_symbols_data.
1566
1567 2013-10-07 Cary Coutant <ccoutant@google.com>
1568
1569 PR gold/16010
1570 * testsuite/Makefile.am (icf_test): Fix dependencies.
1571 (icf_safe_test): Likewise.
1572 (icf_safe_so_test): Likewise.
1573 (large_symbol_alignment): Add empty _LDADD rule.
1574 * testsuite/Makefile.in: Regenerate.
1575
1576 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1577
1578 PR gold/15927
1579 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1580 relocation for R_X86_64_32 on x32.
1581
1582 2013-08-27 Roland McGrath <mcgrathr@google.com>
1583
1584 * output.cc (Output_segment::set_section_addresses): Take new
1585 Target* argument. If target->isolate_execinstr() and the segment
1586 is executable and starts at a target->abi_pagesize() boundary,
1587 pad its end out to a target->abi_pagesize() boundary with code fill.
1588 * output.h (Output_segment::set_section_addresses): Update decl.
1589 * layout.h (Layout::check_output_data_for_reset_values): Take new
1590 argument RELAX_OUTPUTS.
1591 (Layout): New member relax_output_list_.
1592 (Layout::add_relax_output): New method.
1593 * layout.cc (Layout::Layout): Update constructor.
1594 (Layout::reset_relax_output): New method.
1595 (Layout::clean_up_after_relaxation): Call it.
1596 (Layout::prepare_for_relaxation): Update caller.
1597 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1598 Call reset_relax_output before re-processing segments for
1599 isolate_execinstr case.
1600 (Layout::write_data): Handle relax_output_list_.
1601 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1602 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1603
1604 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1605
1606 PR binutils/15834
1607 * object.h: Fix typos.
1608
1609 2013-08-16 Roland McGrath <mcgrathr@google.com>
1610
1611 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1612 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1613
1614 2013-08-07 Cary Coutant <ccoutant@google.com>
1615
1616 Revert support for v2 DWP files:
1617
1618 2013-03-01 Cary Coutant <ccoutant@google.com>
1619
1620 Add dwp support for v2 DWARF package file format.
1621 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1622 tu_length parameter. Adjust all callers.
1623 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1624 * dwp.cc: Include dwarf.h.
1625 (Section_bounds): New struct type.
1626 (Unit_set): New struct type.
1627 (Dwo_file::Dwo_file): Initialize new data member.
1628 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1629 Combine and rename to...
1630 (Dwo_file::read_unit_index): ...this.
1631 (Dwo_file::sized_read_compunit_index)
1632 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1633 (Dwo_file::sized_read_unit_index): ...this.
1634 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1635 parameters; add section_id parameter.
1636 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1637 (Dwo_file::add_unit_set): ...this.
1638 (Dwo_file::shndx_map_): Remove.
1639 (Dwo_file::sect_offsets_): New data member.
1640 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1641 (Dwp_output_file::add_section): Rename to...
1642 (Dwp_output_file::add_contribution): ...this.
1643 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1644 (Dwp_output_file::add_tu_set): Likewise.
1645 (Dwp_output_file::Contribution): New type.
1646 (Dwp_output_file::Section::contributions): New data member.
1647 (Dwp_output_file::Cu_or_tu_set): Remove.
1648 (Dwp_output_file::Section::Section): New ctor.
1649 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1650 (Dwp_output_file::Dwp_index::Section_table): New type.
1651 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1652 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1653 parameter.
1654 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1655 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1656 (Dwp_output_file::Dwp_index::section_table): New member function.
1657 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1658 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1659 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1660 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1661 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1662 (Dwp_output_file::Dwp_index::section_table_): New data member.
1663 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1664 (Dwp_output_file::add_output_section): New member function.
1665 (Dwp_output_file::write_new_section): New member function.
1666 (Dwp_output_file::write_contributions): New member function.
1667 (Dwp_output_file::section_id_map_): New data member.
1668 (class Dwo_id_info_reader): Remove.
1669 (class Unit_reader): New class.
1670 (get_dwarf_section_name): New function.
1671 (Dwo_file::read_executable): Adjust initializations of class data.
1672 (Dwo_file::read): Add support for v2 package file format.
1673 (Dwo_file::read_unit_index): Likewise.
1674 (Dwo_file::sized_read_unit_index): Likewise.
1675 (Dwo_file::copy_section): Likewise.
1676 (Dwo_file::add_unit_set): Likewise.
1677 (Dwp_output_file::add_output_section): Likewise.
1678 (Dwp_output_file::add_contribution): Likewise.
1679 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1680 for empty slot.
1681 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1682 file format.
1683 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1684 slot.
1685 (Dwp_output_file::initialize): Remove unused function.
1686 (Dwp_output_file::finalize): Add support for v2 package file format.
1687 (Dwp_output_file::write_index): Likewise.
1688 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1689 function prototype.
1690
1691 2013-07-31 Cary Coutant <ccoutant@google.com>
1692
1693 * object.cc (Sized_relobj::do_output_section_address): New function.
1694 (Sized_relobj): Instantiate explicitly.
1695 * object.h (Object::output_section_address): New function.
1696 (Object::do_output_section_address): New function.
1697 (Sized_relobj::do_output_section_address): New function.
1698 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1699
1700 2013-07-30 Cary Coutant <ccoutant@google.com>
1701 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1702
1703 * parameters.cc (Parameters::entry): Return target-specific entry
1704 symbol name.
1705 * target.h (Target::entry_symbol_name): New function.
1706 (Target_info::entry_symbol_name): New data member.
1707
1708 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1709 * i386.cc (Target_i386::i386_info): Likewise.
1710 (Target_i386_nacl::i386_nacl_info): Likewise.
1711 * sparc.cc (Target_sparc::sparc_info): Likewise.
1712 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1713 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1714 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1715 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1716
1717 2013-07-22 Sterling Augustine <saugustine@google.com>
1718
1719 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1720 Convert parameter shndx to local variable. Add parameters symtab
1721 and symtab_size. Scan over section names. Find relocation
1722 section corresponding to current section. Create and initialize
1723 reloc_mapper_ and reloc_type_.
1724 (Dwarf_pubnames_table::read_header): Add assertion. Change
1725 unit_length to off_t. Initialize member unit_length_. Fill in field
1726 cu_offset_.
1727 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1728 Initialize new fields unit_length_ and cu_offset_.
1729 (Dwarf_pubnames_table::read_section): Update prototype.
1730 (Dwarf_pubnames_table::cu_offset): New member function.
1731 (Dwarf_pubnames_table::subsection_size): Likewise.
1732 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1733 New fields.
1734 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1735 member functions public.
1736 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1737 Update comment. Rework logic. Move repeated parts to...
1738 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1739 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1740 pubtypes_table_, and stmt_list_offset.
1741 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1742 Gdb_index::find_pubtype_offset,
1743 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1744 (Gdb_index::pubnames_read): Update prototype and rework logic.
1745 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1746 Forward declare.
1747 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1748 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1749 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1750 Gdb_index::map_pubtable_to_dies):
1751 Declare functions.
1752 (Gdb_index::pubnames_read): Update declaration.
1753 (Gdb_index::Pubname_offset_map): New type.
1754 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1755 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1756 Gdb_index::stmt_list_offset): Declare.
1757 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1758 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1759 Gdb_index::pubtypes_offset_): Remove.
1760
1761 2013-07-19 Roland McGrath <mcgrathr@google.com>
1762
1763 * options.h (General_options): Add -Trodata-segment option.
1764 * parameters.cc (Parameters::check_rodata_segment): New function.
1765 (Parameters::set_target_once): Call it.
1766 * parameters.h (Parameters): Declare it (private member function).
1767 * layout.cc (load_seg_unusable_for_headers): New function, broken
1768 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1769 then validate rodata segment rather than text segment.
1770 (relaxation_loop_body): Call that.
1771 (is_text_segment): New function. Don't admit a non-executable
1772 segment if TARGET->isolate_execinstr().
1773 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1774
1775 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1776
1777 PR gold/15070
1778 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1779 * nacl.h (Sniff_file::View::View): Request aligned view.
1780
1781 2013-07-11 Cary Coutant <ccoutant@google.com>
1782
1783 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1784 correct BRLT entry size.
1785
1786 2013-07-03 Alan Modra <amodra@gmail.com>
1787
1788 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1789 comment.
1790
1791 2013-07-01 Cary Coutant <ccoutant@google.com>
1792
1793 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1794 reloc_type_.
1795 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1796 (Dwarf_ranges_table::lookup_reloc): New function.
1797 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1798 reloc_type_.
1799 (Dwarf_ranges_table::lookup_reloc): New function.
1800 (Dwarf_ranges_table::reloc_type_): New data member.
1801
1802 2013-06-27 Jing Yu <jingyu@google.com>
1803
1804 PR gold/15662
1805 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1806 function.
1807 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1808 (Target_powerpc::do_relax): Call the above.
1809
1810 2013-06-27 Cary Coutant <ccoutant@google.com>
1811
1812 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1813 on garbage collected .opd section.
1814
1815 2013-06-27 Alan Modra <amodra@gmail.com>
1816
1817 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1818 is non-zero.
1819 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1820 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1821
1822 2013-06-14 Cary Coutant <ccoutant@google.com>
1823
1824 * resolve.cc (Symbol::override_base): Don't override st_type
1825 from plugin placeholder symbols.
1826 (Symbol_table::resolve): Likewise.
1827 (Symbol_table::should_override): Don't complain about TLS mismatch
1828 if the TO symbol is a plugin placeholder.
1829 * testsuite/Makefile.am (plugin_test_tls): New test.
1830 * testsuite/Makefile.in: Regenerate.
1831 * testsuite/plugin_test_tls.sh: New test script.
1832 * testsuite/two_file_test_2_tls.cc: New test source.
1833 * testsuite/two_file_test_tls.cc: New test source.
1834
1835 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1836
1837 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1838 the maximum segment alignment is larger than the page size.
1839 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1840 correctly aligns the symbols with large alignemnt.
1841 * testsuite/Makefile.in: Regenerate.
1842 * testsuite/large_symbol_alignment.cc: New file.
1843
1844 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1845 Sriraman Tallam <tmsriram@google.com>
1846
1847 * options.h (sort_section): New option.
1848 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1849 Rename from Input_section_sort_section_name_special_ordering_compare.
1850 (Input_section_sort_section_name_compare): New struct.
1851 * output.cc (Output_section::Input_section_sort_section_name_compare::
1852 operator()): New function.
1853 (Output_section::sort_attached_input_sections): Use new sort function
1854 for .text if --sort-section=name is specified.
1855 * layout.cc (Layout::make_output_section):
1856 Add sorting by name when --sort-section=name is specified.
1857 * testsuite/Makefile.am (text_section_grouping): Test option
1858 --sort-section=name.
1859 * testsuite/Makefile.in: Regenerate.
1860 * testsuite/section_sorting_name.cc: New file.
1861 * testsuite/section_sorting_name.sh: New file.
1862
1863 2013-05-21 Cary Coutant <ccoutant@google.com>
1864
1865 * symtab.h (Symbol::is_cxx_vtable): New function.
1866 * target-reloc.h (relocate_section): Check for vtable symbol.
1867 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1868 * testsuite/Makefile.in: Regenerate.
1869 * testsuite/missing_key_func.cc: New test source.
1870 * testsuite/missing_key_func.sh: New test script.
1871
1872 2013-05-21 Cary Coutant <ccoutant@google.com>
1873
1874 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1875 type of enclosing symbol.
1876 (Relocate_info::location): Check symbol type when describing symbol.
1877 * object.h (Symbol_location_info): Remove unused line_number;
1878 add enclosing_symbol_type.
1879 * testsuite/debug_msg.sh: Adjust expected output.
1880
1881 2013-05-13 Cary Coutant <ccoutant@google.com>
1882
1883 * configure.ac: Export DEFAULT_TARGET.
1884 * configure: Regenerate.
1885 * Makefile.in: Regenerate.
1886 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1887 * testsuite/Makefile.in: Regenerate.
1888 * testsuite/debug_msg.sh: Delete duplicate tests.
1889 Don't check undef_int error message match for powerpc where the
1890 source file and line number aren't available.
1891
1892 2013-05-10 Roland McGrath <mcgrathr@google.com>
1893
1894 * options.h (General_options): Add --rosegment-gap option.
1895 * options.cc (finalize): --rosegment-gap implies --rosegment.
1896 * layout.cc (set_segment_offsets): Let user option override
1897 target->rosegment_gap().
1898
1899 2013-05-10 Roland McGrath <mcgrathr@google.com>
1900
1901 * options.h (General_options): Remove leading space from help
1902 messages for -nostdlib and --rosegment.
1903
1904 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1905
1906 PR ld/15365
1907 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1908
1909 2013-05-03 Alan Modra <amodra@gmail.com>
1910
1911 * merge.cc (Output_merge_string::do_add_input_section): Correct
1912 scan for number of strings. Rename vars to avoid shadowing.
1913 Include missing terminator in input_size_.
1914
1915 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1916
1917 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1918 Restore empty string handling.
1919
1920 2013-05-01 Cary Coutant <ccoutant@google.com>
1921
1922 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1923 uninitialized warning.
1924
1925 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1926
1927 * output.cc (Output_section::add_merge_input_section): Allow
1928 to merge sections if the alignment is more than character size.
1929 * merge.h (Output_merge_string::Output_merge_string): Remove
1930 assert.
1931 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1932 only not-null strings. Check the alignment of strings.
1933 * stringpool.h
1934 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1935 alignment as the argument.
1936 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1937 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1938 Align non-zero length strings according to the addralign_.
1939 (Stringpool_template<Stringpool_char>::set_string_offsets):
1940 Updating offsets according to the given alignment.
1941 * testsuite/Makefile.am (text_section_grouping): Test if string
1942 literals are getting merged.
1943 * testsuite/Makefile.in: Regenerate.
1944 * testsuite/merge_string_literals_1.c: New file.
1945 * testsuite/merge_string_literals_2.c: Ditto.
1946 * testsuite/merge_string_literals.sh: Ditto.
1947
1948 2013-04-26 Ian Lance Taylor <iant@google.com>
1949
1950 * target-reloc.h (relocate_section): If the reloc offset is out of
1951 range, pass VIEW as NULL to relocate.relocate.
1952 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1953 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1954 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1955 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1956 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1957 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1958
1959 2013-04-26 Geoff Pike <gpike@chromium.org>
1960
1961 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1962 * layout.cc (Hash_task): New class.
1963 (Layout::queue_build_id_tasks): New function.
1964 (Layout::write_build_id): Handle single-thread portion of build ID
1965 computation. (In some cases, all of it is single-threaded.) Replace
1966 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1967 functionality in fewer lines of code.
1968 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1969 * options.h (General_options): make "--build-id" default to tree
1970 rather than sha1. Add two new options related to --build-id=tree:
1971 --build-id-chunk-size-for-treehash and
1972 --build-id-min-file-size-for-treehash.
1973 * Makefile.am: add testing of --build-id=tree and related new options
1974 (these tests will be invoked by "make check").
1975 * Makefile.in: Regenerate.
1976
1977 2013-04-25 Alan Modra <amodra@gmail.com>
1978
1979 * configure.tgt: Add powerpcle and powerpc64le.
1980
1981 2013-04-22 Alan Modra <amodra@gmail.com>
1982
1983 PR gold/15355
1984 * layout.cc (Layout::segment_precedes): Allow more than one
1985 segment with the same type and flags.
1986
1987 2013-04-15 Cary Coutant <ccoutant@google.com>
1988
1989 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1990 allocate space in file for BSS sections.
1991
1992 2013-04-15 Cary Coutant <ccoutant@google.com>
1993
1994 * script-sections.cc (Orphan_output_section): Reset address
1995 to zero after each orphaned section for relocatable links.
1996
1997 2013-04-15 Cary Coutant <ccoutant@google.com>
1998
1999 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2000 section starting address for relocatable link.
2001 * testsuite/Makefile.am (script_test_11): New test.
2002 * testsuite/Makefile.in: Regenerate.
2003 * testsuite/script_test_11.c: New source file.
2004 * testsuite/script_test_11.t: New linker script.
2005
2006 2013-04-13 Alan Modra <amodra@gmail.com>
2007
2008 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2009 owner when sections are not adjacent and exceed group size.
2010 (Target_powerpc::group_sections): Handle corner case.
2011 (Target_powerpc::Branch_info::make_stub): Handle case where
2012 stub table doesn't exist due to branches in non-exec sections.
2013 (Target_powerpc::Relocate::relocate): Likewise.
2014
2015 2013-04-11 Alan Modra <amodra@gmail.com>
2016
2017 PR gold/15354
2018 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2019 .branch_lt to match bfd ld. Adjust comments throughout file.
2020
2021 2013-04-04 Ian Lance Taylor <iant@google.com>
2022
2023 GCC PR c++/56840
2024 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2025 sections before checking whether they are included in the link.
2026
2027 2013-03-29 Sriraman Tallam <tmsriram@google.com>
2028
2029 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2030 object before calling the plugin claim_file handler. Pass the elf
2031 object of the archive to the plugin. Delete the elf object if the
2032 plugin claims the file.
2033
2034 2013-03-21 Alan Modra <amodra@gmail.com>
2035
2036 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2037 segment when omagic.
2038
2039 2013-03-21 Alan Modra <amodra@gmail.com>
2040
2041 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2042 comparison warning.
2043 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2044 uninitialized" warning.
2045
2046 2013-03-20 Alan Modra <amodra@gmail.com>
2047
2048 * symtab.h (Symbol::clear_version): New function.
2049 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2050 is_needed by weak references. Clear version for symbols defined
2051 in as-needed objects that are not needed.
2052
2053 2013-03-15 Alan Modra <amodra@gmail.com>
2054
2055 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2056 static and public. Add report_err param. Return false for data refs.
2057 (Target_powerpc::rela_dyn_section): New overloaded function.
2058 (Target_powerpc::plt_, iplt_): Elucidate.
2059 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2060 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2061 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2062 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2063 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2064 push_branch and make_plt_entry for ifunc syms when
2065 reloc_needs_plt_for_ifunc.
2066 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2067 for ifunc unless reloc_needs_plt_for_ifunc.
2068
2069 2013-03-15 Alan Modra <amodra@gmail.com>
2070
2071 * gc.h (gc_process_relocs): Don't look through function descriptors.
2072 * icf.cc (get_section_contents): Do so here instead.
2073
2074 2013-03-13 Alan Modra <amodra@gmail.com>
2075
2076 * powerpc.cc (is_branch_reloc): Forward declare.
2077 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2078 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2079 false for 64-bit, true for 32-bit non-branch relocs.
2080 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2081 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2082 nm output.
2083 (icf_safe_test): Generate linker map file as well as nm output.
2084 (icf_safe_so_test): Likewise.
2085 * testsuite/Makefile.in: Regenerate.
2086 * testsuite/icf_test.sh: Parse linker map file to determine
2087 section folding.
2088 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2089 * testsuite/icf_safe_so_test.sh: Likewise.
2090 (X86_32_or_ARM_specific_safe_fold): Merge into..
2091 (arch_specific_safe_fold): ..this.
2092 (X86_64_specific_safe_fold): Delete unused function.
2093
2094 2013-03-12 Alan Modra <amodra@gmail.com>
2095
2096 * gc.h (gc_process_relocs): Look through function descriptors
2097 to determine shndx, symvalue and addend used by ICF. Tidy
2098 variable duplication.
2099
2100 2013-03-11 Alan Modra <amodra@gmail.com>
2101
2102 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2103 * layout.cc (Layout_task_runner::run): ..to here.
2104 * symtab.h (struct Symbol_location): Extract from..
2105 (class Symbol_table): ..here.
2106 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2107 * target.h (class Target): Add function_location and
2108 do_function_location functions.
2109 (class Sized_target): Add do_function_location.
2110 * object.h (class Sized_relobj_file): Move find_shdr..
2111 (class Object): ..to here.
2112 * object.cc: Likewise. Update to suit. Instantiate.
2113 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2114 * powerpc.cc (class Powerpc_dynobj): New.
2115 (Target_powerpc::do_function_location): New function.
2116 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2117 (Powerpc_dynobj::do_read_symbols): New function.
2118 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2119
2120 2013-03-08 Ian Lance Taylor <iant@google.com>
2121
2122 * options.cc (General_options::string_to_object_format): Accept
2123 "default".
2124
2125 2013-03-08 Alan Modra <amodra@gmail.com>
2126
2127 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2128 pointer to Post_fde.
2129 (struct Post_fde): Move definition to here..
2130 * ehframe.cc (struct Post_fde): ..from here.
2131 (Cie::write): Don't alloc Post_fde.
2132 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2133
2134 2013-03-07 Alan Modra <amodra@gmail.com>
2135
2136 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2137 relocation referencing .LC0.
2138 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2139
2140 2013-03-07 Alan Modra <amodra@gmail.com>
2141
2142 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2143 always_inline. Add assembly for powerpc to avoid GOT.
2144
2145 2013-03-07 Alan Modra <amodra@gmail.com>
2146
2147 * testsuite/script_test_10.sh: Don't test .bss section
2148 header number.
2149
2150 2013-03-06 Alan Modra <amodra@gmail.com>
2151
2152 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2153 (Target_powerpc::symval_for_branch): Add symtab param. Update
2154 all callers. Handle folded sections.
2155 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2156 to Powerpc_relobj.
2157 (Global_symbol_visitor_opd::operator()): Likewise.
2158
2159 2013-03-04 Alan Modra <amodra@gmail.com>
2160
2161 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2162 * testsuite/Makefile.in: Regenerate.
2163
2164 2013-03-01 Cary Coutant <ccoutant@google.com>
2165
2166 Add dwp support for v2 DWARF package file format.
2167 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2168 tu_length parameter. Adjust all callers.
2169 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2170 * dwp.cc: Include dwarf.h.
2171 (Section_bounds): New struct type.
2172 (Unit_set): New struct type.
2173 (Dwo_file::Dwo_file): Initialize new data member.
2174 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2175 Combine and rename to...
2176 (Dwo_file::read_unit_index): ...this.
2177 (Dwo_file::sized_read_compunit_index)
2178 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2179 (Dwo_file::sized_read_unit_index): ...this.
2180 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2181 parameters; add section_id parameter.
2182 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2183 (Dwo_file::add_unit_set): ...this.
2184 (Dwo_file::shndx_map_): Remove.
2185 (Dwo_file::sect_offsets_): New data member.
2186 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2187 (Dwp_output_file::add_section): Rename to...
2188 (Dwp_output_file::add_contribution): ...this.
2189 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2190 (Dwp_output_file::add_tu_set): Likewise.
2191 (Dwp_output_file::Contribution): New type.
2192 (Dwp_output_file::Section::contributions): New data member.
2193 (Dwp_output_file::Cu_or_tu_set): Remove.
2194 (Dwp_output_file::Section::Section): New ctor.
2195 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2196 (Dwp_output_file::Dwp_index::Section_table): New type.
2197 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2198 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2199 parameter.
2200 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2201 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2202 (Dwp_output_file::Dwp_index::section_table): New member function.
2203 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2204 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2205 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2206 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2207 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2208 (Dwp_output_file::Dwp_index::section_table_): New data member.
2209 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2210 (Dwp_output_file::add_output_section): New member function.
2211 (Dwp_output_file::write_new_section): New member function.
2212 (Dwp_output_file::write_contributions): New member function.
2213 (Dwp_output_file::section_id_map_): New data member.
2214 (class Dwo_id_info_reader): Remove.
2215 (class Unit_reader): New class.
2216 (get_dwarf_section_name): New function.
2217 (Dwo_file::read_executable): Adjust initializations of class data.
2218 (Dwo_file::read): Add support for v2 package file format.
2219 (Dwo_file::read_unit_index): Likewise.
2220 (Dwo_file::sized_read_unit_index): Likewise.
2221 (Dwo_file::copy_section): Likewise.
2222 (Dwo_file::add_unit_set): Likewise.
2223 (Dwp_output_file::add_output_section): Likewise.
2224 (Dwp_output_file::add_contribution): Likewise.
2225 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2226 for empty slot.
2227 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2228 file format.
2229 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2230 slot.
2231 (Dwp_output_file::initialize): Remove unused function.
2232 (Dwp_output_file::finalize): Add support for v2 package file format.
2233 (Dwp_output_file::write_index): Likewise.
2234 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2235 function prototype.
2236
2237 2013-03-01 Cary Coutant <ccoutant@google.com>
2238
2239 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2240 function into class definition in header file.
2241 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2242 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2243 New function.
2244 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2245
2246 2013-02-28 Alan Modra <amodra@gmail.com>
2247
2248 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2249 * target.cc (Target::do_plt_fde_location): New function.
2250 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2251 accessor function, and constructor param.
2252 (struct Post_fde, Post_fdes): Declare.
2253 (Cie::write): Add post_fdes param.
2254 * ehframe.cc (Fde::write): Use plt_fde_location.
2255 (struct Post_fde): Define.
2256 (Cie::write): Stash FDEs added post merge mapping.
2257 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2258 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2259 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2260 other FDEs.
2261 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2262 (Target_powerpc::has_glink): New function.
2263 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2264 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2265 glink_eh_frame_fde_32, default_fde): New data.
2266 (Stub_table::eh_frame_added_): New var.
2267 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2268 Make const.
2269 (Stub_table::add_eh_frame): New function.
2270 (Output_data_glink::add_eh_frame): New function.
2271 (Target_powerpc::make_glink_section): Call add_eh_frame.
2272
2273 2013-02-15 Ian Lance Taylor <iant@google.com>
2274
2275 * options.h (DEFINE_uint64_alias): Define.
2276 (class General_options): Add -Ttext-segment as an alias for
2277 -Ttext.
2278
2279 2013-02-15 Alan Modra <amodra@gmail.com>
2280
2281 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2282 (Stub_table::do_write): ..here, two places.
2283 (Stub_table::plt_call_size): Use it here too.
2284
2285 2013-02-11 Ian Lance Taylor <iant@google.com>
2286
2287 * descriptors.cc (Descriptors::close_all): New function.
2288 * descriptors.h (class Descriptors): Declare close_all.
2289 (close_all_descriptors): New inline function.
2290 * plugin.cc: Include "descriptors.h".
2291 (Plugin_manager::cleanup): Call close_all_descriptors.
2292
2293 2013-02-06 Alan Modra <amodra@gmail.com>
2294
2295 * README: Update coding style link.
2296
2297 2013-01-28 Cary Coutant <ccoutant@google.com>
2298
2299 * dwp.cc (File_list): New typedef.
2300 (Dwo_name_info_reader): New class.
2301 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2302 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2303 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2304 (Dwo_file::read_executable): New function.
2305 (Dwo_file::read): Move common setup code to ...
2306 (Dwo_file::make_object): ... here.
2307 (dwp_options): Add --exec/-e.
2308 (usage): Likewise.
2309 (main): Likewise.
2310
2311 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2312
2313 * layout.cc (Layout::layout): Check for option text_reorder.
2314 (Layout::make_output_section): Ditto.
2315 * options.h (text_reorder): New option.
2316 * output.cc (Input_section_sort_compare): Remove special ordering
2317 of section names.
2318 (Output_section::
2319 Input_section_sort_section_name_special_ordering_compare::
2320 operator()): New function.
2321 (Output_section::sort_attached_input_sections): Use new sort function
2322 for .text.
2323 * output.h (Input_section_sort_section_name_special_ordering_compare):
2324 New struct.
2325 * testsuite/Makefile.am (text_section_grouping): Test option
2326 --no-text-reorder
2327 * testsuite/Makefile.in: Regenerate.
2328 * testsuite/text_section_grouping.sh: Check order of functions without
2329 default text reordering.
2330
2331 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2332
2333 * options.h (General_options): Change default to true for new_dtags.
2334
2335 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2336
2337 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2338 when enable_new_dtags is false. Only add DT_RUNPATH when
2339 enable_new_dtags is true.
2340
2341 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2342
2343 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2344 used in declaration and definition consistent.
2345 (Target_powerpc::symval_for_branch): Ditto.
2346
2347 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2348
2349 * testsuite/plugin_final_layout.cc: Fix comment.
2350
2351 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2352
2353 * layout.cc (Layout::layout): Do not do default sorting for
2354 text sections when section ordering is specified.
2355 (make_output_section): Ditto.
2356 * testsuite/plugin_final_layout.cc: Name the function sections
2357 to catch reordering issues.
2358
2359 2013-01-15 Alan Modra <amodra@gmail.com>
2360
2361 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2362 plt-thread-safe.
2363
2364 2013-01-15 Alan Modra <amodra@gmail.com>
2365
2366 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2367 * testsuite/Makefile.in: Regenerate.
2368
2369 2013-01-14 Alan Modra <amodra@gmail.com>
2370
2371 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2372 * testsuite/Makefile.in: Regenerate.
2373
2374 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2375
2376 PR bfd/14430
2377 Fix mingw gold build with plugins enabled
2378 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2379 * configure.ac: Export DLOPEN_LIBS and add headers check.
2380 * plugin.cc: Handle non-dlfcn case.
2381 * Makefile.in: Regenerate.
2382 * config.in: Regenerate.
2383 * configure: Regenerate.
2384 * testsuite/Makefile.in: Regenerate.
2385
2386 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2387
2388 * output.h (sort_attached_input_sections): Change to be public.
2389 * script-sections.cc
2390 (Output_section_definition::set_section_addresses): Sort
2391 attached input sections according to section order before linker
2392 script assigns section addresses.
2393 (Orphan_output_section::set_section_addresses): Sort
2394 attached input sections according to section order before linker
2395 script assigns section addresses.
2396 * Makefile.am (final_layout.sh): Use a simple linker script to
2397 check if section ordering still works.
2398 * Makefile.in: Regenerate.
2399
2400 2013-01-09 Ben Cheng <bccheng@google.com>
2401
2402 * arm.cc (Target_arm::attributes_accept_div): New function.
2403 (Target_arm::attributes_forbid_div): New function.
2404 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2405 attribute using the same new functions as what bfd/elf32_arm.c
2406 does.
2407
2408 2013-01-07 Cary Coutant <ccoutant@google.com>
2409
2410 PR gold/14993
2411 * output.cc (Output_section::add_input_section): For incremental
2412 updates, don't track input sections that are allocated from patch
2413 space.
2414
2415 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2416 Ian Lance Taylor <iant@google.com>
2417
2418 PR gold/14897
2419 * configure.ac (--enable-ld): Removed.
2420 (install_as_default): Set to yes only for --enable-gold=default
2421 or --disable-ld.
2422 * configure: Regenerated.
2423
2424 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2425
2426 * options.h (General_options): Add -fuse-ld= for GCC linker
2427 option compatibility.
2428
2429 2013-01-04 Cary Coutant <ccoutant@google.com>
2430
2431 * configure.ac: Fix typo restoring CXXFLAGS.
2432 * configure: Regenerate.
2433
2434 2013-01-04 Cary Coutant <ccoutant@google.com>
2435
2436 * testsuite/Makefile.am (CXXLINK_S): New macro.
2437 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2438 * testsuite/Makefile.in: Regenerate.
2439
2440 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2441
2442 * version.cc (print_version): Update copyright year to 2013.
2443
2444 2012-12-20 Ian Lance Taylor <iant@google.com>
2445
2446 * layout.cc (Layout::special_ordering_of_input_section): New
2447 function.
2448 (Layout::layout): If input section requires special ordering, must
2449 sort input sections.
2450 (Layout::make_output_section): May sort .text input sections.
2451 (Layout::is_section_name_prefix_grouped): Remove.
2452 * layout.h (class Layout): Declare
2453 special_ordering_of_input_section. Don't declare
2454 is_section_name_prefix_grouped.
2455 * output.cc (Output_section::add_input_section): Revert last
2456 change.
2457 (Output_section::Input_section_sort::match_file_name): Don't crash
2458 if called on output section data.
2459 (Output_section::Input_section_sort_compare): Sort based on
2460 special ordering.
2461 (Output_section::Input_section_sort_section_order_index_compare):
2462 Revert last patch.
2463 (Output_section::sort_attached_input_sections): Likewise.
2464
2465 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2466
2467 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2468 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2469 * output.cc (Output_section::add_input_section): Check if section
2470 name contains special prefix. Keep input sections to sort such
2471 sections.
2472 (Output_section::Input_section_sort_section_order_index_compare
2473 ::operator()): Group sections according to prefixes.
2474 (Output_section::sort_attached_input_sections): Add condition to
2475 Input_section_entry constructor call.
2476 * testsuite/Makefile.am (text_section_grouping): New test.
2477 * testsuite/Makefile.in: Regenerate.
2478 * testsuite/text_section_grouping.cc: New file.
2479 * testsuite/text_section_grouping.sh: New file.
2480
2481 2012-12-17 Nick Clifton <nickc@redhat.com>
2482
2483 * Makefile.am: Add copyright notice.
2484 * NEWS: Likewise.
2485 * README: Likewise.
2486 * configure.ac: Likewise.
2487 * ftruncate.c: Likewise.
2488 * Makefile.in: Regenerate.
2489
2490 2012-12-14 Cary Coutant <ccoutant@google.com>
2491
2492 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2493 --no-as-needed flag.
2494 (exception_separate_shared_12_test): Likewise.
2495 (incremental_copy_test): Likewise.
2496 * testsuite/Makefile.in: Regenerate.
2497
2498 2012-12-14 Cary Coutant <ccoutant@google.com>
2499
2500 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2501 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2502
2503 2012-12-12 Alan Modra <amodra@gmail.com>
2504
2505 * powerpc.cc (class Track_tls): New.
2506 (class Relocate, class Scan): Inherit Track_tls.
2507 (Target_powerpc::Scan::local, global): Track tls optimization
2508 and avoid creating plt entry for __tls_get_addr if all uses
2509 are optimized away.
2510 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2511
2512 2012-12-12 Alan Modra <amodra@gmail.com>
2513
2514 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2515 Replace no_toc_optimize with toc_optimize.
2516 * output.h (Output_section::input_sections): Provide non-const variant.
2517 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2518 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2519 accessors.
2520 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2521 (class Sort_toc_sections): New.
2522 (Target_powerpc::do_finalize_sections): Sort toc sections.
2523 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2524
2525 2012-12-10 Roland McGrath <mcgrathr@google.com>
2526
2527 * testsuite/binary_unittest.cc (read_all): New function.
2528 (Sized_binary_test): Use it instead of ::read.
2529 * fileread.cc (do_read): Don't assume pread always reads the whole
2530 amount in a single call.
2531
2532 2012-12-10 Alan Modra <amodra@gmail.com>
2533
2534 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2535 Set EM_PPC64 or EM_PPC here.
2536 (Target_selector_powerpc::do_recognize): Delete.
2537
2538 2012-12-10 Alan Modra <amodra@gmail.com>
2539
2540 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2541 stub_table_.
2542 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2543
2544 2012-12-07 Roland McGrath <mcgrathr@google.com>
2545
2546 * testsuite/binary_unittest.cc (Sized_binary_test):
2547 Use open_descriptor rather than ::open.
2548
2549 2012-12-07 Alan Modra <amodra@gmail.com>
2550
2551 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2552 typedef and invalid_address constant.
2553 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2554 instantiate constants.
2555
2556 2012-12-06 Roland McGrath <mcgrathr@google.com>
2557
2558 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2559 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2560 * aclocal.m4: Regenerate.
2561 * configure: Regenerate.
2562 * Makefile.in: Regenerate.
2563 * testsuite/Makefile.in: Regenerate.
2564
2565 2012-12-07 Alan Modra <amodra@gmail.com>
2566
2567 * options.h (General_options): Add no_toc_optimize.
2568 * powerpc.cc (ok_lo_toc_insn): New function.
2569 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2570
2571 2012-12-06 Alan Modra <amodra@gmail.com>
2572
2573 * options.h (General_options): Add plt_align, plt_static_chain,
2574 plt_thread_safe. Update stub_group_size help text.
2575 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2576 for new plt_thread_safe_ var.
2577 (use_plt_offset): Correct comments.
2578 (Target_powerpc::do_relax): Look for thread creation symbols to
2579 determine default plt_thread_safe value. Clear plt call stubs
2580 as well as branch stubs each iteration.
2581 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2582 insn constants.
2583 (l, hi, ha, write_insn): Move earlier.
2584 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2585 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2586 plt stubs too.
2587 (Stub_table::update_size): Adjust.
2588 (Stub_table::prev_size, set_prev_size): Delete.
2589 (Stub_table::stub_align): Let --plt-align affect result.
2590 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2591 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2592 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2593 (Stub_table::do_write): Support more stub variants.
2594
2595 2012-12-04 Alan Modra <amodra@gmail.com>
2596
2597 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2598 (Target_powerpc::do_define_standard_symbols): New function.
2599
2600 2012-12-03 Alan Modra <amodra@gmail.com>
2601
2602 * output.h: Formatting, whitespace.
2603
2604 2012-12-03 Alan Modra <amodra@gmail.com>
2605
2606 * layout.h (Layout::get_executable_sections): Declare.
2607 * layout.cc (Layout::get_executable_sections): New function.
2608 * arm.cc (Target_arm::group_sections): Use it.
2609 (Arm_output_section::group_sections): Delete now redundant test.
2610 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2611 param to handle relative relocs.
2612 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2613 (Output_data_reloc::add_absolute): Adjust.
2614 (Output_data_reloc::add_relative): New function.
2615 (Output_data::reset_data_size): New function.
2616 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2617 (Output_section::set_addralign): New function.
2618 (Output_section::checkpoint_set_addralign): New function.
2619 (Output_section::clear_section_offsets_need_adjustment): New function.
2620 (Output_section::input_sections): Make public.
2621 * powerpc.cc (class Output_data_brlt_powerpc): New.
2622 (class Stub_table, class Stub_control): New.
2623 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2624 stub_table_, set_stub_table, stub_table): New vectors and accessor
2625 functions.
2626 (Target_powerpc::do_may_relax, do_relax, push_branch,
2627 new_stub_table, stub_tables, brlt_section, group_sections,
2628 add_branch_lookup_table, find_branch_lookup_table,
2629 write_branch_lookup_table, make_brlt_section): New functions.
2630 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2631 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2632 branch_info_): New vars.
2633 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2634 make call stubs here.
2635 (Output_data_glink): Remove all call stub handling from this class.
2636 (Target_powerpc::Scan::local, global): Save interesting branch
2637 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2638 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2639 functions on final link.
2640 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2641 Handle long branch destinations too.
2642 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2643 do_plt_address_for_local): Adjust lookup of plt call stubs.
2644
2645 2012-11-30 Alan Modra <amodra@gmail.com>
2646
2647 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2648 relocs against protected symbols when building 32-bit shared libs.
2649
2650 2012-11-30 Alan Modra <amodra@gmail.com>
2651
2652 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2653 param. Call got_section() to make .got. Update all callers
2654 and their callers and so on.
2655
2656 2012-11-30 Alan Modra <amodra@gmail.com>
2657
2658 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2659 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2660 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2661 value if it already exists.
2662
2663 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2664
2665 PR gold/14858
2666 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2667
2668 2012-11-14 Roland McGrath <mcgrathr@google.com>
2669
2670 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2671 than bfc instruction for data sandboxing.
2672
2673 2012-11-08 Alan Modra <amodra@gmail.com>
2674
2675 * po/POTFILES.in: Regenerate.
2676
2677 2012-11-05 Alan Modra <amodra@gmail.com>
2678
2679 * configure.ac: Apply 2012-09-10 change to config.in here.
2680 * configure: Regenerate.
2681
2682 2012-11-05 Alan Modra <amodra@gmail.com>
2683
2684 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2685 (struct Opd_ent): Use "Address" rather than "Offset".
2686 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2687 (Target_powerpc::got_section): Make public.
2688 (Target_powerpc::scan_relocs): Move code setting symbols..
2689 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2690 Create _SDA_BASE_ only when referenced.
2691
2692 2012-11-02 Roland McGrath <mcgrathr@google.com>
2693
2694 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2695 from last change.
2696
2697 2012-11-01 Roland McGrath <mcgrathr@google.com>
2698
2699 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2700 for offset_in_output_section parameter.
2701 (Sized_target::relocate_special_relocatable): Likewise.
2702 * arm.cc (Target_arm::relocate_relocs): Likewise.
2703 (Target_arm::relocate_special_relocatable): Likewise.
2704 * i386.cc (Target_i386::relocate_relocs): Likewise.
2705 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2706 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2707 * target-reloc.h (relocate_relocs): Likewise.
2708 * testsuite/testfile.cc (Target_test): Likewise.
2709 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2710 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2711
2712 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2713 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2714
2715 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2716 parameter, which is unused in the [!F_SETFD] case.
2717
2718 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2719 SYMNDX to off_t before comparing it to this->data_size().
2720 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2721 * incremental.cc (Output_section_incremental_inputs::do_write):
2722 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2723
2724 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2725
2726 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2727
2728 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2729 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2730 in EABI_VER5.
2731
2732 2012-10-29 Cary Coutant <ccoutant@google.com>
2733
2734 * dwp.cc (usage): Add file and exit status parameters;
2735 add --help and --version options.
2736 (print_version): New function.
2737 (main): Add --help and --version options.
2738
2739 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2740
2741 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2742 final_layout_sequence.txt.
2743 * testsuite/Makefile.in: Regenerated.
2744
2745 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2746
2747 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2748 COMPILE generated by automake.
2749 (LINK1): Likewise.
2750 (CXXCOMPILE1): Likewise.
2751 (CXXLINK1): Likewise.
2752 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2753 (LINK): Likewise.
2754 (CXXCOMPILE): Likewise.
2755 (CXXLINK): Likewise.
2756 * testsuite/Makefile.in: Regenerated.
2757
2758 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2759
2760 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2761 on bad fwrite return.
2762
2763 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2764
2765 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2766 on val.
2767
2768 2012-10-23 Cary Coutant <ccoutant@google.com>
2769
2770 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2771 * testsuite/Makefile.in: Regenerate.
2772 * testsuite/dwp_test.h: New source file.
2773 * testsuite/dwp_test_1.cc: New source file.
2774 * testsuite/dwp_test_1.s: New source file.
2775 * testsuite/dwp_test_1.sh: New source file.
2776 * testsuite/dwp_test_1b.cc: New source file.
2777 * testsuite/dwp_test_1b.s: New source file.
2778 * testsuite/dwp_test_2.cc: New source file.
2779 * testsuite/dwp_test_2.s: New source file.
2780 * testsuite/dwp_test_2.sh: New source file.
2781 * testsuite/dwp_test_main.cc: New source file.
2782 * testsuite/dwp_test_main.s: New source file.
2783
2784 2012-10-23 Cary Coutant <ccoutant@google.com>
2785
2786 * dwp.h: New header file.
2787 * dwp.cc: New source file.
2788 * gold.h: Move shared declarations to system.h.
2789 * system.h: New header file.
2790 * Makefile.am: Add dwp.
2791 * Makefile.in: Regenerate.
2792
2793 2012-10-23 Cary Coutant <ccoutant@google.com>
2794
2795 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2796 Dwarf_info_reader::read_from_pointer.
2797 (Dwarf_pubnames_table::read_header): Likewise.
2798 (Dwarf_pubnames_table::next_name): Likewise.
2799 (Dwarf_die::read_attributes): Likewise.
2800 (Dwarf_die::skip_attributes): Likewise.
2801 (Dwarf_info_reader::read_from_pointer): New function template.
2802 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2803 (Dwarf_pubnames_table): Likewise.
2804 (Dwarf_info_reader::read_from_pointer): New function template.
2805 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2806 Dwarf_pubnames_table ctor.
2807
2808 2012-10-23 Cary Coutant <ccoutant@google.com>
2809
2810 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2811 abbrev_shndx.
2812 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2813 abbrev_shndx_.
2814 (Dwarf_info_reader::set_abbrev_shndx): New method.
2815 (Dwarf_info_reader::abbrev_shndx_): New data member.
2816
2817 2012-10-23 Cary Coutant <ccoutant@google.com>
2818
2819 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2820 from object, not parameters.
2821 (Dwarf_info_reader::parse): Likewise.
2822 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2823 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2824 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2825 methods.
2826
2827 2012-10-23 Cary Coutant <ccoutant@google.com>
2828
2829 * fileread.cc (Input_file::Input_file): New constructor.
2830 * fileread.h (class Input_file): Add new constructor.
2831
2832 2012-10-18 Alan Modra <amodra@gmail.com>
2833
2834 PR gold/14727
2835 * object.cc (Relobj::is_section_name_included): Also match
2836 .sdata personality section.
2837
2838 2012-10-18 Alan Modra <amodra@gmail.com>
2839
2840 * target-reloc.h (class Default_comdat_behavior): New, package up..
2841 (get_comdat_behaviour): ..this.
2842 (relocate_section): Add Relocate_comdat_behavior template arg,
2843 adjust code to suit.
2844 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2845 (Target_arm::scan_reloc_section): Likewise.
2846 * i386.cc (Target_i386::relocate_section): Likewise.
2847 * sparc.cc (Target_sparc::relocate_section): Likewise.
2848 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2849 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2850 * powerpc.cc (class Relocate_comdat_behavior): New.
2851 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2852 gold::relocate_section with new template arg.
2853
2854 2012-10-18 Alan Modra <amodra@gmail.com>
2855
2856 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2857 dynamic relocs for GOT_TPREL got entries, without symbol if
2858 resolving locally.
2859 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2860 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2861 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2862
2863 2012-10-17 Alan Modra <amodra@gmail.com>
2864
2865 PR gold/14726
2866 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2867
2868 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2869
2870 * layout.cc (Layout::include_section): Keep sections marked
2871 SHF_EXCLUDE when doing relocatable links.
2872
2873 2012-10-16 Alan Modra <amodra@gmail.com>
2874
2875 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2876 (Target_powerpc::do_finalize_sections): Call it.
2877 (Output_data_save_res): New class and supporting functions.
2878 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2879 normal symbols defined in object files.
2880
2881 2012-10-12 Alan Modra <amodra@gmail.com>
2882
2883 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2884 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2885 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2886 section if scan_opd_relocs not yet called.
2887 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2888
2889 2012-10-12 Alan Modra <amodra@gmail.com>
2890
2891 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2892 add_local_ifunc_entry): Revert last change.
2893 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2894
2895 2012-10-05 Alan Modra <amodra@gmail.com>
2896
2897 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2898 do_plt_address_for_global): New functions.
2899 (Output_data_got_powerpc::do_write): Don't segfault when linking
2900 statically.
2901 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2902 add_local_ifunc_entry): Return true on adding entry..
2903 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2904 glink->add_entry call. Remove unused symtab param. Adjust calls.
2905 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2906 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2907 set up symbols here.
2908 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2909 syms here. Do so even when no .iplt. Don't segfault when linking
2910 statically.
2911 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2912 new variants without reloc param.
2913 (Glink_sym_ent::Glink_sym_ent): Likewise.
2914 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2915 reloc when refs will resolve to plt call stub.
2916 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2917 R_PPC_PLTREL24 to resolve locally.
2918 (Target_powerpc::Scan::global): Correct ifunc handling.
2919 (Target_powerpc::Relocate::relocate): Correct local sym glink
2920 lookup. Don't destroy "value" when we have a plt call stub,
2921 and when checking plt call validity.
2922 (Target_powerpc::do_dynsym_value): Simplify.
2923
2924 2012-10-05 Alan Modra <amodra@gmail.com>
2925
2926 * i386.cc (Output_data_plt_i386::address_for_global,
2927 address_for_local): Add plt offset to returned value. Adjust uses.
2928 * sparc.cc (Output_data_plt_sparc::address_for_global,
2929 address_for_local): Likewise.
2930 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2931 address_for_local): Likewise.
2932 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2933 address_for_local): Likewise.
2934 * target.h (Target::plt_address_for_global, plt_address_for_local):
2935 Update comment.
2936 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2937 (Output_data_got::Got_entry::write): Nor here.
2938 * output.h: Comment fix.
2939
2940 2012-10-02 Jiong Wang <jiwang@tilera.com>
2941
2942 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2943 global_offset_table_ value for larget got.
2944 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2945
2946 2012-09-29 Alan Modra <amodra@gmail.com>
2947
2948 * powerpc.cc (Target_powerpc::iplt_): New output section.
2949 (Target_powerpc::iplt_section, make_iplt_section,
2950 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2951 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2952 Target_powerpc::plt_entry_count): Count iplt entries too.
2953 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2954 reloc section in constructor. New params.
2955 (Target_powerpc::make_plt_section): Create reloc section here instead.
2956 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2957 functions.
2958 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2959 (Output_data_glink::add_entry, find_entry): New functions to
2960 deal with local syms.
2961 (Glink_sym_ent): Add support for local syms.
2962 (Output_data_glink::do_write): Handle ifunc plt entries.
2963 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2964 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2965 (Target_powerpc::Relocate::relocate): Likewise.
2966 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2967
2968 2012-09-25 Alan Modra <amodra@gmail.com>
2969
2970 * object.h (Sized_relobj_file::adjust_local_symbol,
2971 do_adjust_local_symbol): New functions.
2972 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2973 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2974 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2975 and irregular opd entry spacing.
2976 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2977 (Global_symbol_visitor_opd): New functor.
2978 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2979 on deleted opd entries.
2980
2981 2012-09-15 Jiong Wang <jiwang@tilera.com>
2982
2983 * tilegx.cc: New file.
2984 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2985 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2986 * configure.tgt: Add entries for tilegx*.
2987 * configure.ac: Likewise.
2988 * Makefile.in: Rebuild.
2989 * configure: Likewise.
2990 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2991 tilegx.
2992
2993 2012-09-13 Alan Modra <amodra@gmail.com>
2994
2995 * target-reloc.h (scan_relocs): Call scan.local for relocs
2996 against symbols in discarded sections. Pass is_discarded
2997 param.
2998 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2999 Add is_discarded param.
3000 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3001 is_discarded to flag opd entry as discarded. Don't emit dyn
3002 relocs on such entries.
3003 (Target_powerpc::Scan::global): Similarly detect and handle
3004 such opd entries.
3005 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3006 opd_ent_. Update all uses.
3007 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3008 (Target_powerpc::relocate_section): Zero out discarded opd
3009 entry relocs.
3010
3011 2012-09-12 Ian Lance Taylor <iant@google.com>
3012
3013 PR gold/14570
3014 * output.cc: Rename Output_data_got template parameter from size
3015 to got_size for all functions. Compile all variants of
3016 Output_data_got.
3017 (Output_data_got::Got_entry::write): Correct use of size for
3018 symbol value. Use local_is_tls rather than casting to
3019 Sized_relobj_file.
3020 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3021 (class Sized_relobj_file): Add do_local_is_tls.
3022 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3023
3024 2012-09-11 Alan Modra <amodra@gmail.com>
3025
3026 PR gold/14566
3027 * layout.cc (Layout::set_segment_offsets): When using
3028 common-page-size alignment, ensure we are on a new max-page-size
3029 page.
3030 * output.cc (Output_segment::set_section_addresses): Use
3031 abi_pagesize, not common_pagesize for relro boundary.
3032 (Output_segment::set_offset): Likewise.
3033
3034 2012-09-11 Alan Modra <amodra@gmail.com>
3035
3036 * output.h (Output_data_got::add_global_tls, add_local_tls,
3037 add_local_tls_pair): New functions.
3038 (Output_data_got::add_local_pair_with_rel): Remove second
3039 reloc param. Expand comment.
3040 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3041 use_plt_or_tls_offset_, similarly for constructor param.
3042 (Output_data_got::Got_entry::write): Add got_index param.
3043 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3044 add_local_tls_pair): New functions.
3045 (Output_data_got::Got_entry::write): Handle tls symbols
3046 with use_plt_or_tls_offset_ set specially.
3047 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3048 (Output_data_got::do_write): Replace iterator with index, pass
3049 index to entry write function.
3050 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3051 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3052 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3053 call.
3054 * i386.cc (Target_i386::Scan::local): Likewise.
3055 * sparc.cc (Target_sparc::Scan::local): Likewise.
3056 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3057 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3058 do_tls_offset_for_global): New functions.
3059 (Target_powerpc::Scan::local): Correct TLS relocations and got
3060 entry values.
3061 (Target_powerpc::Scan::global): Don't emit unnecessary
3062 dynamic relocations on TLS GOT entries.
3063
3064 2012-09-10 Matthias Klose <doko@ubuntu.com>
3065
3066 * config.in: Disable sanity check for kfreebsd.
3067
3068 2012-09-10 Sterling Augustine <saugustine@google.com>
3069
3070 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3071 (Gdb_index::pubtypes_read): New parameter.
3072 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3073 to calls.
3074 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3075 pubtypes_object_.
3076
3077 2012-09-09 Alan Modra <amodra@gmail.com>
3078
3079 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3080 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3081 * gc.h (gc_process_relocs): Call target gc_add_reference.
3082 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3083 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3084 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3085 unnecessary cast.
3086 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3087 to cater for when we don't need code offset. Update use.
3088 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3089 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3090 set_opd_valid): New functions.
3091 (Target_powerpc::do_gc_add_reference): New function.
3092 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3093 stashed refs.
3094 (Target_powerpc::do_gc_mark_symbol): New function.
3095
3096 2012-09-06 Cary Coutant <ccoutant@google.com>
3097
3098 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3099 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3100 (Dwarf_die::skip_attributes): Likewise.
3101 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3102 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3103 (main): Call it.
3104 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3105
3106 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3107
3108 * testsuite/script_test_3.t: Add .got.plt output section
3109 statement.
3110 * testsuite/script_test_4.t: Likewise.
3111
3112 2012-09-05 Alan Modra <amodra@gmail.com>
3113
3114 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3115 update all uses and lose "enum" when using type.
3116
3117 2012-09-05 Alan Modra <amodra@gmail.com>
3118
3119 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3120 * configure: Regenerate.
3121 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3122 (plugin_final_layout.stdout): Likewise.
3123 (memory_test): Set page sizes to 0x1000.
3124 * testsuite/Makefile.in: Regenerate.
3125 * testsuite/discard_locals_test.sh: Add FIXME comment.
3126 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3127 * testsuite/pr14265.t: Add .got output section statement.
3128 * testsuite/script_test_2.t: Likewise.
3129 * testsuite/script_test_3.t: Likewise.
3130 * testsuite/script_test_4.t: Likewise.
3131 * testsuite/script_test_5.t: Likewise.
3132 * testsuite/script_test_6.t: Likewise.
3133 * testsuite/script_test_7.t: Likewise.
3134 * testsuite/script_test_9.t: Likewise.
3135
3136 2012-09-05 Alan Modra <amodra@gmail.com>
3137
3138 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3139 (Powerpc_relocate_functions::Status): New typedef.
3140 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3141 (Target_powerpc::Scan::local): Handle REL64.
3142 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3143 for REL32 and REL64.
3144 (Target_powerpc::symval_for_branch): New function, extracted from..
3145 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3146 checks. Report overflow errors.
3147
3148 2012-09-05 Alan Modra <amodra@gmail.com>
3149
3150 * object.h (Sized_relobj_file::emit_relocs): Delete.
3151 (Sized_relobj_file::emit_relocs_reltype): Delete.
3152 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3153 relocate_relocs for --emit-relocs.
3154 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3155 * output.h: Update comment.
3156 (Output_segment::first_section): New function.
3157 (Output_segment::first_section_load_address): Use first_section.
3158 * output.cc (Output_segment::first_section): New function extracted..
3159 (Output_segment::first_section_load_address): ..from here. Delete.
3160 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3161 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3162 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3163 adjust call to target.h function.
3164 * i386.cc (Target_i386): Likewise.
3165 * sparc.cc (Target_sparc): Likewise.
3166 * x86_64.cc (Target_x86_64): Likewise.
3167 * powerpc.cc (Target_powerpc): Likewise.
3168 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3169 first tls section has section symbol for optimised local dynamic
3170 output relocs.
3171 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3172 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3173 optimised tls code.
3174 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3175 Rename to relocate_relocs. Update error message.
3176
3177 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3178
3179 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3180 --just-symbols.
3181
3182 2012-08-31 Alan Modra <amodra@gmail.com>
3183
3184 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3185 (Powerpc_relobj::toc_base_offset): New stub function.
3186 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3187 got_mod_index_offset to tlsld_got_offset. Update all refs.
3188 (Target_powerpc::Relocate::enum skip_tls): New.
3189 (Target_powerpc::call_tls_get_addr_): New var.
3190 (Target_powerpc::is_branch_reloc): Move to file scope.
3191 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3192 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3193 New functions.
3194 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3195 (powerpc_info): Correct common_pagesize for ppc64.
3196 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3197 (Powerpc_relocate_functions): Add overflow check enums and functions.
3198 Add non-shift version of rela, rela_ua. Delete all rel public
3199 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3200 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3201 addr16_ha3, addr14 functions.
3202 (Output_data_got_powerpc::add_constant_pair): New function.
3203 (Output_data_got_powerpc::got_base_offset): Likewise.
3204 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3205 (instruction constants): Sort, add some more.
3206 (Output_data_glink::do_write): Add and use Address typedef. Use
3207 object->toc_base_offset() stub for 64-bit.
3208 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3209 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3210 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3211 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3212 Always treat .opd relocs as against locally defined symbol.
3213 Correct condition for RELATIVE relocs.
3214 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3215 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3216 for 32-bit syms with a plt entry. Correct ppc64 toc base
3217 calculations. Handle TLS relocs, and more. Add overflow
3218 checking and adjust for Powerpc_relocate_functions changes.
3219 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3220 Reinstate --emit-relocs code with FIXME.
3221
3222 2012-08-30 Alan Modra <amodra@gmail.com>
3223
3224 * layout.cc (Layout::set_segment_offsets): Set p_align to
3225 abi_pagesize, not common_pagesize.
3226 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3227 to determine whether file header can go in segment.
3228
3229 2012-08-30 Alan Modra <amodra@gmail.com>
3230
3231 * output.h (Output_reloc::Output_reloc <output section>): Add
3232 is_relative param. Adjust calls.
3233 (Output_reloc::add_output_section_relative): New functions.
3234 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3235 is_relative.
3236 (Output_reloc::symbol_value): Handle SECTION_CODE.
3237
3238 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3239
3240 * gold.cc (queue_middle_tasks): Call layout again when unique
3241 segments for sections is desired.
3242 * layout.cc (Layout::Layout): Initialize new members.
3243 (Layout::get_output_section_flags): New function.
3244 (Layout::choose_output_section): Call get_output_section_flags.
3245 (Layout::layout): Make output section for mapping to a unique segment.
3246 (Layout::insert_section_segment_map): New function.
3247 (Layout::attach_allocated_section_to_segment): Make unique segment for
3248 output sections marked so.
3249 (Layout::segment_precedes): Check for unique segments when sorting.
3250 * layout.h (Layout::Unique_segment_info): New struct.
3251 (Layout::Section_segment_map): New typedef.
3252 (Layout::insert_section_segment_map): New function.
3253 (Layout::get_output_section_flags): New function.
3254 (Layout::is_unique_segment_for_sections_specified): New function.
3255 (Layout::set_unique_segment_for_sections_specified): New function.
3256 (Layout::unique_segment_for_sections_specified_): New member.
3257 (Layout::section_segment_map_): New member.
3258 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3259 Rename is_gc_pass_one to is_pass_one.
3260 Rename is_gc_pass_two to is_pass_two.
3261 Rename is_gc_or_icf to is_two_pass.
3262 Check for which pass based on whether symbols data is present.
3263 Make it two pass when unique segments for sections is desired.
3264 * output.cc (Output_section::Output_section): Initialize new
3265 members.
3266 * output.h (Output_section::is_unique_segment): New function.
3267 (Output_section::set_is_unique_segment): New function.
3268 (Output_section::is_unique_segment_): New member.
3269 (Output_section::extra_segment_flags): New function.
3270 (Output_section::set_extra_segment_flags): New function.
3271 (Output_section::extra_segment_flags_): New member.
3272 (Output_section::segment_alignment): New function.
3273 (Output_section::set_segment_alignment): New function.
3274 (Output_section::segment_alignment_): New member.
3275 (Output_segment::Output_segment): Initialize is_unique_segment_.
3276 (Output_segment::is_unique_segment): New function.
3277 (Output_segment::set_is_unique_segment): New function.
3278 (Output_segment::is_unique_segment_): New member.
3279 * plugin.cc (allow_unique_segment_for_sections): New function.
3280 (unique_segment_for_sections): New function.
3281 (Plugin::load): Add new functions to transfer vector.
3282 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3283 * Makefile.in: Regenerate.
3284 * testsuite/plugin_final_layout.sh: Check if unique segment
3285 functionality works.
3286 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3287 are available.
3288 (allow_unique_segment_for_sections): New global.
3289 (unique_segment_for_sections): New global.
3290 (claim_file_hook): Call allow_unique_segment_for_sections.
3291 (all_symbols_read_hook): Call unique_segment_for_sections.
3292
3293 2012-08-22 Cary Coutant <ccoutant@google.com>
3294
3295 * layout.cc (Layout::include_section): Don't assert on GROUP
3296 sections with --emit-relocs.
3297
3298 2012-08-21 Cary Coutant <ccoutant@google.com>
3299
3300 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3301 if --export-dynamic-symbol names an undef symbol.
3302
3303 2012-08-18 Alan Modra <amodra@gmail.com>
3304
3305 * powerpc.cc: Formatting and white space.
3306 (Powerpc_relobj): Rename got2_section_ to special_.
3307 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3308 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3309 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3310 (Target_powerpc): Add Address typedef and invalid_address. Use
3311 throughout.
3312 (Target_powerpc::is_branch_reloc): New function.
3313 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3314 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3315 for dst_mask, value and addend.
3316 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3317 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3318 (Output_data_glink::do_write): Correct toc base. Don't try to use
3319 uint16_t for 24-bit offset. Use get_output_section_offset and
3320 check return.
3321 (Target_powerpc::Scan::local): Handle more relocs.
3322 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3323 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3324 Plug in toc restoring insn after plt calls. Translate branches
3325 to function descriptor symbols to corresponding entry point.
3326 (Target_powerpc::relocate_for_relocatable): Check return from
3327 get_output_section_offset.
3328 * symtab.h: Comment typo.
3329
3330 2012-08-14 Ian Lance Taylor <iant@google.com>
3331
3332 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3333 unsupported_relocal_local to call unsupported_reloc_global.
3334
3335 2012-08-14 Nick Clifton <nickc@redhat.com>
3336
3337 PR ld/14265
3338 * script-sections.cc (Sections_element::output_section_name): Add
3339 keep return parameter.
3340 (Output_section_element::match_name): Add keep return parameter.
3341 Return the value of the keep_ member.
3342 * script-sections.h (class Output_section): Update
3343 output_section_name prototype.
3344 * layout.cc (Layout::keep_input_section): New public member
3345 function.
3346 (Layout::choose_output_section): Pass keep parameter to
3347 output_section_name.
3348 * layout.h (class Layout): Add keep_input_section.
3349 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3350 sections.
3351 * testsuite/Makefile.am: Add a test.
3352 * testsuite/Makefile.in: Regenerate.
3353 * testsuite/pr14265.c: Source file for the test.
3354 * testsuite/pr14265.t: Linker script for the test.
3355 * testsuite/pr14265.sh: Shell script for the test.
3356
3357 2012-08-14 Alan Modra <amodra@gmail.com>
3358
3359 * target.h (Target::output_section_name): New function.
3360 (Target::do_output_section_name): New function.
3361 * layout.cc (Layout::choose_output_section): Call the above.
3362 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3363
3364 2012-08-14 Alan Modra <amodra@gmail.com>
3365
3366 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3367 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3368 for replace_constant call.
3369 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3370 (Output_data_glink::do_print_to_mapfile): New function.
3371 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3372 (Target_powerpc::Relocate::relocate): Likewise.
3373
3374 2012-08-14 Alan Modra <amodra@gmail.com>
3375
3376 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3377 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3378 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3379 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3380 all references to shndx_. Handle special case for R_PPC_PLTREL24
3381 here.
3382 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3383 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3384 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3385 here.
3386 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3387 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3388
3389 2012-08-12 Alan Modra <amodra@gmail.com>
3390
3391 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3392 (glink insn constants): Use uint32_t.
3393 (Output_data_glink::add_entry): Use insert, not [] operator.
3394
3395 2012-08-11 Alan Modra <amodra@gmail.com>
3396
3397 * object.h (Sized_relobj_file::find_shdr): New function.
3398 (Sized_relobj_file::find_special_sections): New function.
3399 * object.cc (Sized_relobj_file::find_shdr): New function.
3400 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3401 (Sized_relobj_file::find_special_sections): New function, split out..
3402 (Sized_relobj_file::do_read_symbols): ..from here.
3403 * output.h (Output_data_got::replace_constant): New function.
3404 (Output_data_got::num_entries): New function.
3405 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3406 (Output_data_got::got_offset): Protected rather than private.
3407 (Output_data_got::replace_got_entry): New function.
3408 * output.cc (Output_data_got::replace_got_entry): New function.
3409 * powerpc.cc (class Powerpc_relobj): New.
3410 (class Powerpc_relocate_functions): Delete all psymval variants or
3411 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3412 Implement _ha functions using corresponding _hi function.
3413 (Powerpc_relobj::find_special_sections): New function.
3414 (Target_powerpc::do_make_elf_object): New function.
3415 (class Output_data_got_powerpc): New.
3416 (class Output_data_glink): New.
3417 (class Powerpc_scan_relocatable_reloc): New.
3418 Many more changes througout file.
3419
3420 2012-08-09 Nick Clifton <nickc@redhat.com>
3421
3422 * po/vi.po: Updated Vietnamese translation.
3423
3424 2012-08-07 Ian Lance Taylor <iant@google.com>
3425
3426 * layout.cc (Layout::add_target_dynamic_tags): If
3427 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3428 plt_rel.
3429
3430 2012-07-30 Nick Clifton <nickc@redhat.com>
3431
3432 * po/gold.pot: Updated template.
3433 * po/es.po: Updated Spanish translation.
3434
3435 2012-07-18 Cary Coutant <ccoutant@google.com>
3436
3437 PR gold/14344
3438 * configure.ac: Add check for -gpubnames support.
3439 * configure: Regenerate.
3440 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3441 support; force -gno-pubnames.
3442 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3443 support.
3444 (gdb_index_test_4): New test.
3445 * testsuite/Makefile.in: Regenerate.
3446 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3447 * testsuite/gdb_index_test_2.sh: Likewise.
3448 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3449 * testsuite/gdb_index_test_4.sh: New script.
3450 * testsuite/gdb_index_test_comm.sh: New script with common code;
3451 don't look for space after colon.
3452
3453 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3454
3455 * gold.cc (queue_middle_tasks): Update function order only after
3456 deferred objects due to plugins are processed.
3457
3458 2012-07-11 Ian Lance Taylor <iant@google.com>
3459
3460 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3461 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3462 (Target_arm::scan_reloc_for_stub): Likewise.
3463 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3464 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3465 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3466 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3467 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3468
3469 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3470 Ian Lance Taylor <iant@google.com>
3471
3472 PR gold/14309
3473 * configure.ac: Test whether std::tr1::hash<off_t> works.
3474 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3475 needed.
3476 * output.h (class Output_fill): Add virtual destructor.
3477 * configure, config.in: Rebuild.
3478
3479 2012-06-22 Roland McGrath <mcgrathr@google.com>
3480
3481 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3482
3483 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3484
3485 * plugin.cc (Plugin::load): Handle position independent executables.
3486
3487 2012-06-06 Cary Coutant <ccoutant@google.com>
3488
3489 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3490 add .debug_macro.
3491 (lines_only_debug_sections): Likewise.
3492 (gdb_fast_lookup_sections): New static array.
3493 (is_gdb_debug_section): Rename formal parameter.
3494 (is_lines_only_debug_section): Likewise.
3495 (is_gdb_fast_lookup_section): New function.
3496 (Layout::include_section): Check for ".zdebug_" prefix; pass
3497 section name suffix to is_gdb_debug_section, et al.; check for
3498 fast-lookup sections when building .gdb_index.
3499 * options.h (--strip-debug-gdb): Update GDB version number.
3500
3501 2012-06-06 Cary Coutant <ccoutant@google.com>
3502
3503 * configure.ac: Add check for fallocate.
3504 * configure: Regenerate.
3505 * config.in: Regenerate.
3506
3507 * options.h (class General_options): Add --mmap-output-file and
3508 --posix-fallocate options.
3509 * output.cc: (posix_fallocate): Remove; replace with...
3510 (gold_fallocate): New function.
3511 (Output_file::map_no_anonymous): Call gold_fallocate.
3512 (Output_file::map): Check --mmap-output-file option.
3513
3514 2012-06-05 Jing Yu <jingyu@google.com>
3515
3516 * gold.h (textdomain): Add do {} to empty while(0).
3517 (bindtextdomain): Likewise.
3518
3519 2012-06-04 Cary Coutant <ccoutant@google.com>
3520
3521 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3522 has_dynsym_index.
3523
3524 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3525
3526 * symtab.cc (Symbol_table::define_special_symbol):
3527 Initialize *poldsym to prevent uninitialized variable errors.
3528
3529 2012-05-23 Cary Coutant <ccoutant@google.com>
3530
3531 * layout.cc (Layout::section_name_mapping): Add rules to handle
3532 exact match on .data.rel.ro.local or .data.rel.ro.
3533 (Layout::output_section_name): Check for exact matches.
3534
3535 2012-05-23 Cary Coutant <ccoutant@google.com>
3536
3537 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3538 more carefully.
3539
3540 2012-05-22 Cary Coutant <ccoutant@google.com>
3541
3542 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3543 object before exporting symbol.
3544
3545 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3546
3547 * testsuite/tls_test.cc: Include "config.h" first.
3548 * testsuite/tls_test_c.c: Likewise.
3549
3550 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3551 Nick Clifton <nickc@redhat.com>
3552
3553 PR 14072
3554 * configure.in: Add check that sysdep.h has been included before
3555 any system header files.
3556 * configure: Regenerate.
3557 * config.in: Regenerate.
3558
3559 2012-05-14 Cary Coutant <ccoutant@google.com>
3560
3561 * layout.cc (Layout::make_output_section): Mark .tdata section
3562 as RELRO.
3563 * testsuite/relro_test.cc: Add a TLS variable.
3564
3565 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3566
3567 PR gold/14091
3568 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3569 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3570 R_X86_64_64.
3571
3572 2012-05-08 Cary Coutant <ccoutant@google.com>
3573
3574 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3575 (lines_only_debug_sections): Likewise.
3576
3577 2012-05-02 Roland McGrath <mcgrathr@google.com>
3578
3579 * nacl.cc: New file.
3580 * nacl.h: New file.
3581 * Makefile.am (CCFILES, HFILES): Add them.
3582 * Makefile.in: Regenerate.
3583 * i386.cc (Output_data_plt_i386_nacl): New class.
3584 (Output_data_plt_i386_nacl_exec): New class.
3585 (Output_data_plt_i386_nacl_dyn): New class.
3586 (Target_i386_nacl): New class.
3587 (Target_selector_i386_nacl): New class.
3588 (target_selector_i386): Use it instead of Target_selector_i386.
3589 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3590 (Target_x86_64_nacl): New class.
3591 (Target_selector_x86_64_nacl): New class.
3592 (target_selector_x86_64, target_selector_x32): Use it instead of
3593 Target_selector_x86_64.
3594 * arm.cc (Output_data_plt_arm_nacl): New class.
3595 (Target_arm_nacl): New class.
3596 (Target_selector_arm_nacl): New class.
3597 (target_selector_arm, target_selector_armbe): Use it instead of
3598 Target_selector_arm.
3599
3600 * target-select.cc (select_target): Take new Input_file* and off_t
3601 arguments, pass them on to recognize method of selector.
3602 * object.cc (make_elf_sized_object): Update caller.
3603 * parameters.cc (parameters_force_valid_target): Likewise.
3604 * incremental.cc (make_sized_incremental_binary): Likewise.
3605 * target-select.h: Update decl.
3606 (Target_selector::recognize): Take new Input_file* argument,
3607 pass it on to do_recognize.
3608 (Target_selector::do_recognize): Take new Input_file* argument.
3609 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3610 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3611 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3612 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3613
3614 * target.h (Target::Target_info): New members isolate_execinstr
3615 and rosegment_gap.
3616 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3617 * arm.cc (Target_arm::arm_info): Update initializer.
3618 * i386.cc (Target_i386::i386_info): Likewise.
3619 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3620 * sparc.cc (Target_sparc::sparc_info): Likewise.
3621 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3622 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3623 * layout.cc (Layout::attach_allocated_section_to_segment):
3624 Take new const Target* argument. If target->isolate_execinstr(), act
3625 like --rosegment.
3626 (Layout::find_first_load_seg): Take new const Target* argument;
3627 if target->isolate_execinstr(), reject PF_X segments.
3628 (Layout::relaxation_loop_body): Update caller.
3629 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3630 reset file offset to zero when we hit LOAD_SEG, and then do a second
3631 loop over the segments before LOAD_SEG to reassign offsets after
3632 addresses have been determined. Handle target->rosegment_gap().
3633 (Layout::attach_section_to_segment): Take new const Target* argument;
3634 pass it to attach_allocated_section_to_segment.
3635 (Layout::make_output_section): Update caller.
3636 (Layout::attach_sections_to_segments): Take new const Target* argument;
3637 pass it to attach_section_to_segment.
3638 * gold.cc (queue_middle_tasks): Update caller.
3639 * layout.h (Layout): Update method decls with new arguments.
3640
3641 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3642 Target_info pointer to use.
3643 (Target_arm::do_make_data_plt): New virtual method.
3644 (Target_arm::make_data_plt): New method that calls it.
3645 (Target_arm::make_plt_entry): Use it.
3646 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3647 for the section alignment.
3648 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3649 method.
3650 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3651 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3652 method.
3653 (Output_data_plt_arm::get_plt_entry_size): Call it.
3654 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3655 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3656 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3657 method.
3658 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3659 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3660 method instead of sizeof(plt_entry).
3661 (Output_data_plt_arm::add_entry): Likewise.
3662 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3663 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3664 than static method.
3665 (Target_arm::plt_entry_size): Likewise.
3666 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3667 Move to ...
3668 (Output_data_plt_arm_standard): ... here, new class.
3669 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3670 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3671 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3672
3673 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3674 Take additional argument for the PLT entry size.
3675 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3676 Use get_plt_entry_size method rather than plt_entry_size variable.
3677 (Output_data_plt_x86_64::reserve_slot): Likewise.
3678 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3679 (Output_data_plt_x86_64::add_entry): Likewise.
3680 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3681 (Output_data_plt_x86_64::address_for_global): Likewise.
3682 (Output_data_plt_x86_64::address_for_local): Likewise.
3683 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3684 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3685 Make method non-static.
3686 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3687 method.
3688 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3689 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3690 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3691 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3692 virtual method.
3693 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3694 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3695 virtual method.
3696 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3697 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3698 virtual method.
3699 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3700 (Output_data_plt_x86_64::plt_entry_size)
3701 (Output_data_plt_x86_64::first_plt_entry)
3702 (Output_data_plt_x86_64::plt_entry)
3703 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3704 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3705 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3706 (Output_data_plt_x86_64_standard): ... here, new class.
3707 (Target_x86_64::Target_x86_64): Take optional argument for the
3708 Target_info pointer to use.
3709 (Target_x86_64::do_make_data_plt): New virtual method.
3710 (Target_x86_64::make_data_plt): New method to call it.
3711 (Target_x86_64::init_got_plt_for_update): Use that.
3712 Call this->plt_->add_eh_frame method here.
3713 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3714 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3715 rather than static method.
3716 (Target_x86_64::plt_entry_size): Likewise.
3717 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3718 rather than plt_entry_size variable. Move guts of PLT filling to...
3719 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3720 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3721 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3722
3723 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3724 additional argument for the section alignment.
3725 Don't do add_eh_frame_for_plt here.
3726 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3727 non-static. Use get_plt_entry_size method rather than plt_entry_size
3728 variable.
3729 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3730 method.
3731 (Output_data_plt_i386::get_plt_entry_size): Call it.
3732 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3733 (Output_data_plt_i386::add_eh_frame): New method to call it.
3734 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3735 method.
3736 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3737 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3738 method.
3739 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3740 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3741 method instead of plt_entry_size.
3742 (Output_data_plt_i386::plt_entry_size)
3743 (Output_data_plt_i386::plt_eh_frame_fde_size)
3744 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3745 (Output_data_plt_i386_standard): ... here, new class.
3746 (Output_data_plt_i386_exec): New class.
3747 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3748 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3749 (Output_data_plt_i386::exec_plt_entry): Move to ...
3750 (Output_data_plt_i386_exec::plt_entry): ... here.
3751 (Output_data_plt_i386_dyn): New class.
3752 (Output_data_plt_i386::first_plt_entry): Move to ...
3753 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3754 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3755 (Output_data_plt_i386_dyn::plt_entry): ... here.
3756 (Target_i386::Target_i386): Take optional argument for the Target_info
3757 pointer to use.
3758 (Target_i386::do_make_data_plt): New virtual method.
3759 (Target_i386::make_data_plt): New method to call it.
3760 (Target_i386::make_plt_section): Use that.
3761 Call this->plt_->add_eh_frame method here.
3762 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3763 rather than plt_entry_size variable.
3764 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3765 (Output_data_plt_i386::address_for_local): Likewise.
3766 (Output_data_plt_i386::do_write): Likewise.
3767 Move guts of PLT filling to...
3768 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3769 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3770 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3771 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3772
3773 2012-05-01 Cary Coutant <ccoutant@google.com>
3774
3775 * dwarf_reader.cc (Dwarf_die::read_attributes)
3776 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3777 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3778 * reduced_debug_output.cc
3779 (Output_reduced_debug_info_section::get_die_end): Remove
3780 DW_FORM_GNU_ref_index. Add default case.
3781
3782 2012-04-26 Mark Wielaard <mjw@redhat.com>
3783
3784 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3785 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3786 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3787 DW_AT_high_pc as offset from DW_AT_low_pc.
3788
3789 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3790 * testsuite/Makefile.in: Regenerate.
3791 * testsuite/gdb_index_test_3.c: New test source file.
3792 * testsuite/gdb_index_test_3.sh: New test source file.
3793
3794 2012-04-25 Ian Lance Taylor <iant@google.com>
3795
3796 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3797 pointer.
3798 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3799 as a class, not a struct.
3800 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3801 (Target_arm::apply_cortex_a8_workaround): Likewise.
3802 * gc.h: Declare Reloc_types as a struct, not a class.
3803 * object.h: Declare Symbols_data as a struct.
3804 * reloc.h: Declare Read_relocs_data as a struct.
3805 * target.h: Declare Relocate_info as a struct.
3806
3807 2012-04-24 David S. Miller <davem@davemloft.net>
3808
3809 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3810 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3811 and R_SPARC_WPLT30.
3812
3813 2012-04-24 Cary Coutant <ccoutant@google.com>
3814
3815 * incremental-dump.cc (find_input_containing_global): Replace
3816 magic number with symbolic constant.
3817 (dump_incremental_inputs): Update version number.
3818 * incremental.cc (Output_section_incremental_inputs): Update version
3819 number; import symbolic constants from Incremental_inputs_reader.
3820 (Incremental_inputs::create_data_sections): Align relocations
3821 section correctly for 64-bit targets.
3822 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3823 constants; add padding.
3824 (Output_section_incremental_inputs::write_header): Add assert for
3825 header_size.
3826 (Output_section_incremental_inputs::write_input_files): Add assert
3827 for input_entry_size.
3828 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3829 add assert for object_info_size, input_section_entry_size,
3830 global_sym_entry_size.
3831 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3832 for data structure sizes; use them.
3833 (Incremental_input_entry_reader): Import symbolic constants from
3834 Incremental_inputs_reader; use them.
3835
3836 2012-04-23 David S. Miller <davem@davemloft.net>
3837
3838 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3839 and elf_flags_set_.
3840 (Target_sparc::Target_sparc): Initialize new fields.
3841 (Target_sparc::do_make_elf_object): New function.
3842 (Target_sparc::do_adjust_elf_header): New function.
3843
3844 2012-04-23 Cary Coutant <ccoutant@google.com>
3845
3846 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3847 CU range table of gdb index.
3848
3849 2012-04-20 David S. Miller <davem@davemloft.net>
3850
3851 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3852 instead of false.
3853
3854 2012-04-16 David S. Miller <davem@davemloft.net>
3855
3856 * sparc.cc (Target_sparc::got_address): New function.
3857 (Sparc_relocate_functions::gdop_hix22): New function.
3858 (Sparc_relocate_functions::gdop_lox10): New function.
3859 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3860 relocs.
3861 (Target_sparc::Scan::local): Likewise if the global symbol is not
3862 preemptible and is not IFUNC.
3863 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3864 transformations for local and non-preemptible non-IFUNC global
3865 symbols.
3866
3867 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3868 writing out 64-bit part of ranges.
3869
3870 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3871 -fpic and -fpie respectively.
3872 * Makefile.in: Regenerate.
3873
3874 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3875 (Target_sparc::Target_sparc): Initialize new field.
3876 (Target_sparc::do_plt_section_for_global): New function.
3877 (Target_sparc::do_plt_section_for_local): New function.
3878 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3879 (Target_sparc::make_plt_section): New function, broken out of
3880 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3881 (Target_sparc::make_plt_entry): Call make_plt_section.
3882 (Target_sparc::make_local_ifunc_plt_entry): New function.
3883 (Target_sparc::rela_ifunc_section): New function.
3884 (Target_sparc::plt_section): Remove const.
3885 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3886 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3887 and ifunc_count_ fields.
3888 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3889 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3890 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3891 (Output_data_plt_sparc::rela_ifunc): New function.
3892 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3893 (Output_data_plt_sparc::has_ifunc_section): New function.
3894 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3895 (Output_data_plt_sparc::address_for_global): New function.
3896 (Output_data_plt_sparc::address_for_local): New function.
3897 (Output_data_plt_sparc::plt_index_to_offset): New function.
3898 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3899 and entry_count.
3900 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3901 entry_count.
3902 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3903 R_SPARC_JMP_IREL to switch.
3904 (Target_sparc::Scan::check_non_pic): Likewise.
3905 (Target_sparc::Scan::local): Handle IFUNC symbols.
3906 (Target_sparc::Scan::local): Likewise.
3907 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3908 and plt_address_for_local.
3909 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3910 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3911
3912 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3913 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3914 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3915 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3916 global relocs too.
3917 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3918 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3919 calls.
3920 * sparc.cc (Target_sparc::Scan::global): Likewise.
3921 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3922
3923 2012-04-16 Cary Coutant <ccoutant@google.com>
3924
3925 * archive.cc (Library_base::should_include_member): Check for
3926 --export-dynamic-symbol.
3927 * options.h (class General_options): Add --export-dynamic-symbol.
3928 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3929 --export-dynamic-symbol.
3930 (Symbol_table::gc_mark_undef_symbols): Likewise.
3931 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3932
3933 2012-04-12 David S. Miller <davem@davemloft.net>
3934
3935 * sparc.cc (Reloc::wdisp10): New relocation method.
3936 (Reloc::h34): Likewise.
3937 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3938 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3939 R_SPARC_WDISP10.
3940 (Target_sparc::Scan::local): Likewise.
3941 (Target_sparc::Scan::global): Likewise.
3942 (Target_sparc::Relocate::relocate): Likewise.
3943
3944 2012-04-09 Cary Coutant <ccoutant@google.com>
3945
3946 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3947 low_pc == 0.
3948
3949 2012-04-06 Ian Lance Taylor <iant@google.com>
3950
3951 * timer.cc: #include <unistd.h>.
3952
3953 2012-04-06 Roland McGrath <mcgrathr@google.com>
3954
3955 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3956 * config.in: Regenerate.
3957 * configure: Regenerate.
3958
3959 2012-04-05 Nick Clifton <nickc@redhat.com>
3960
3961 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3962 (AM_LC_MESSAGES): Add.
3963 * aclocal.m4: Regenerate.
3964 * config.in: Regenerate.
3965 * configure: Regenerate.
3966
3967 2012-03-21 Cary Coutant <ccoutant@google.com>
3968
3969 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3970 * Makefile.in: Regenerate.
3971 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3972 (Sized_elf_reloc_mapper::symbol_section): New function.
3973 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3974 (make_elf_reloc_mapper): New function.
3975 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3976 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3977 (Dwarf_abbrev_table::do_get_abbrev): New function.
3978 (Dwarf_ranges_table::read_ranges_table): New function.
3979 (Dwarf_ranges_table::read_range_list): New function.
3980 (Dwarf_pubnames_table::read_section): New function.
3981 (Dwarf_pubnames_table::read_header): New function.
3982 (Dwarf_pubnames_table::next_name): New function.
3983 (Dwarf_die::Dwarf_die): New function.
3984 (Dwarf_die::read_attributes): New function.
3985 (Dwarf_die::skip_attributes): New function.
3986 (Dwarf_die::set_name): New function.
3987 (Dwarf_die::set_linkage_name): New function.
3988 (Dwarf_die::attribute): New function.
3989 (Dwarf_die::string_attribute): New function.
3990 (Dwarf_die::int_attribute): New function.
3991 (Dwarf_die::uint_attribute): New function.
3992 (Dwarf_die::ref_attribute): New function.
3993 (Dwarf_die::child_offset): New function.
3994 (Dwarf_die::sibling_offset): New function.
3995 (Dwarf_info_reader::check_buffer): New function.
3996 (Dwarf_info_reader::parse): New function.
3997 (Dwarf_info_reader::do_parse): New function.
3998 (Dwarf_info_reader::do_read_string_table): New function.
3999 (Dwarf_info_reader::lookup_reloc): New function.
4000 (Dwarf_info_reader::get_string): New function.
4001 (Dwarf_info_reader::visit_compilation_unit): New function.
4002 (Dwarf_info_reader::visit_type_unit): New function.
4003 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4004 Sized_elf_reloc_mapper.
4005 (Sized_dwarf_line_info::symbol_section): Remove function.
4006 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4007 (Sized_dwarf_line_info::read_line_mappings): Remove object
4008 parameter, adjust callers.
4009 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4010 * dwarf_reader.h: Include <sys/types.h>.
4011 (class Track_relocs): Remove forward declaration.
4012 (class Elf_reloc_mapper): New class.
4013 (class Sized_elf_reloc_mapper): New class.
4014 (class Dwarf_abbrev_table): New class.
4015 (class Dwarf_range_list): New class.
4016 (class Dwarf_ranges_table): New class.
4017 (class Dwarf_pubnames_table): New class.
4018 (class Dwarf_die): New class.
4019 (class Dwarf_info_reader): New class.
4020 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4021 (Sized_dwarf_line_info::symbol_section): Remove member function.
4022 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4023 base class.
4024 * gdb-index.cc: New source file.
4025 * gdb-index.h: New source file.
4026 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4027 and .debug_types sections, call Layout::add_to_gdb_index.
4028 (Sized_relobj_incr::do_section_name): Implement.
4029 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4030 return type; Implement.
4031 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4032 return type.
4033 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4034 parameter list and return type.
4035 (Sized_incr_dynobj::do_section_contents): Likewise.
4036 * layout.cc: Include gdb-index.h.
4037 (Layout::Layout): Initialize gdb_index_data_.
4038 (Layout::init_fixed_output_section): Check for .gdb_index section.
4039 (Layout::add_to_gdb_index): New function. Instantiate.
4040 * layout.h: Add forward declaration for class Gdb_index.
4041 (Layout::add_to_gdb_index): New member function.
4042 (Layout::gdb_index_data_): New data member.
4043 * main.cc: Include gdb-index.h.
4044 (main): Print statistics for gdb index.
4045 * object.cc (Object::section_contents): Move code into
4046 do_section_contents.
4047 (need_decompressed_section): Check for sections needed when building
4048 gdb index.
4049 (build_compressed_section_map): Likewise.
4050 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4051 gdb index.
4052 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4053 sections; call Layout::add_to_gdb_index.
4054 (Sized_relobj_file::do_decompressed_section_contents): Call
4055 do_section_contents directly.
4056 * object.h (Object::do_section_contents): Adjust parameter list and
4057 return type.
4058 (Object::do_decompressed_section_contents): Call do_section_contents
4059 directly.
4060 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4061 return type.
4062 * options.h (class General_options): Add --gdb-index option.
4063 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4064 list and return type.
4065 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4066 * reloc.h (Track_relocs::checkpoint): New function.
4067 (Track_relocs::reset): New function.
4068
4069 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4070 New test cases.
4071 * testsuite/Makefile.in: Regenerate.
4072 * testsuite/gdb_index_test.cc: New test source file.
4073 * testsuite/gdb_index_test_1.sh: New test source file.
4074 * testsuite/gdb_index_test_2.sh: New test source file.
4075
4076 2012-03-19 Doug Kwan <dougkwan@google.com>
4077
4078 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4079 (Target_arm::do_finalize_sections): Remove code which defines
4080 __exidx_start and __exidx_end. Make symbol table parameter
4081 anonymous as it is not used.
4082 * gold.cc (queue_middle_tasks): Call target hook to define any
4083 target-specific symbols.
4084 * target.h (Target::define_standard_symbols): New method.
4085 (Target::do_define_standard_symbols): Same.
4086 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4087 * testsuite/Makefile.in: Regenerate.
4088 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4089 and __exidx_end.
4090 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4091 relocations are generated for __exidx_start and __exidx_end.
4092
4093 2012-03-16 Doug Kwan <dougkwan@google.com>
4094
4095 * testsuite/Makefile.am: Disable test initpri3b.
4096 * testsuite/Makefile.in: Regenerate.
4097
4098 2012-03-15 Doug Kwan <dougkwan@google.com>
4099
4100 * arm.cc (Target_arm::got_section): Make .got section read-only
4101 if -z now is given.
4102
4103 2012-03-15 Ian Lance Taylor <iant@google.com>
4104
4105 PR gold/13850
4106 * layout.cc (Layout::make_output_section): Correctly mark
4107 SHT_INIT_ARRAY, et. al., as relro.
4108
4109 2012-03-14 Doug Kwan <dougkwan@google.com>
4110
4111 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4112 dynamic relocations for protected symbols in shared objects.
4113
4114 2012-03-13 Ian Lance Taylor <iant@google.com>
4115
4116 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4117 keep the larger alignment.
4118
4119 2012-03-12 Cary Coutant <ccoutant@google.com>
4120
4121 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4122 handling of DW_LNE_define_file.
4123
4124 2012-03-12 Cary Coutant <ccoutant@google.com>
4125
4126 * reduced_debug_output.cc
4127 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4128 codes to switch.
4129
4130 2012-02-29 Cary Coutant <ccoutant@google.com>
4131
4132 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4133
4134 2012-02-29 Cary Coutant <ccoutant@google.com>
4135
4136 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4137 Call Object::decompressed_section_contents.
4138 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4139 New dtor.
4140 (Sized_dwarf_line_info::buffer_start_): New data member.
4141 * merge.cc (Output_merge_data::do_add_input_section): Call
4142 Object::decompressed_section_contents.
4143 (Output_merge_string::do_add_input_section): Likewise.
4144 * object.cc (need_decompressed_section): New function.
4145 (build_compressed_section_map): Decompress sections needed later.
4146 (Sized_relobj_file::do_decompressed_section_contents): New function.
4147 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4148 * object.h (Object::decompressed_section_contents): New function.
4149 (Object::discard_decompressed_sections): New function.
4150 (Object::do_decompressed_section_contents): New function.
4151 (Object::do_discard_decompressed_sections): New function.
4152 (Compressed_section_info): New type.
4153 (Compressed_section_map): Include decompressed section contents.
4154 (Sized_relobj_file::do_decompressed_section_contents): New function.
4155 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4156
4157 2012-02-16 Cary Coutant <ccoutant@google.com>
4158
4159 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4160 * testsuite/Makefile.in: Regenerate.
4161
4162 2012-02-14 Cary Coutant <ccoutant@google.com>
4163
4164 * options.cc (General_options::finalize): Disallow -pie and -static.
4165
4166 2012-02-03 Doug Kwan <dougkwan@google.com>
4167
4168 * arm.cc (Arm_relocate_functions::abs8,
4169 Arm_relocate_functions::abs16): Use
4170 Bits::has_signed_unsigned_overflow32.
4171 (Arm_relocate_functions::thm_abs8): Correct range of
4172 overflow check.
4173 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4174 in assertions.
4175
4176 2012-02-02 Doug Kwan <dougkwan@google.com>
4177
4178 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4179 position independent outputs, not just shared objects.
4180
4181 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4182
4183 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4184 * configure: Regenerated.
4185
4186 2012-01-27 Ian Lance Taylor <iant@google.com>
4187
4188 * reloc.h (Bits): New class with static functions, copied from
4189 namespace utils in arm.cc.
4190 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4191 instead.
4192
4193 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4194
4195 * incremental.cc (write_info_blocks): Correct relocation offset.
4196
4197 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4198
4199 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4200 (Relocate::tls_gd_to_le): Likewise.
4201
4202 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4203
4204 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4205
4206 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4207
4208 * configure.ac: Check if -mcmodel=medium works.
4209 * configure: Regenerated.
4210
4211 2012-01-24 Cary Coutant <ccoutant@google.com>
4212
4213 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4214 definition and ...
4215 (read_unsigned_LEB_128_x): ... this new function.
4216 (read_signed_LEB_128): Replaced with inline definition and ...
4217 (read_signed_LEB_128_x): ... this new function.
4218 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4219 (read_unsigned_LEB_128): Add inline definition.
4220 (read_signed_LEB_128_x): New function.
4221 (read_signed_LEB_128): Add inline definition.
4222 * testsuite/Makefile.am (leb128_unittest): New unit test.
4223 * testsuite/Makefile.in: Regenerate.
4224 * testsuite/leb128_unittest.cc: New unit test.
4225
4226 2012-01-23 Ian Lance Taylor <iant@google.com>
4227
4228 PR gold/13617
4229 * i386.cc (Target_i386::do_code_fill): When using a jmp
4230 instruction, pad with nop instructions.
4231 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4232
4233 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4234
4235 * x86_64.cc (gc_process_relocs): Add typename on types used in
4236 template.
4237 (scan_relocs): Likewise.
4238 (relocate_section): Likewise.
4239 (apply_relocation): Likewise.
4240
4241 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4242
4243 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4244 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4245 under x32.
4246
4247 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4248
4249 * x86_64.cc: Initial support for x32.
4250
4251 2012-01-03 Cary Coutant <ccoutant@google.com>
4252
4253 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4254 Use abstract base class for GOT.
4255 * gold/output.h (class Output_data_got_base): New abstract base class.
4256 (class Output_data_got): Derive from new base class, adjust ctors.
4257 (Output_data_got::reserve_slot): Make virtual; rename to
4258 do_reserve_slot; Adjust callers.
4259 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4260 pointer to abstract base class.
4261 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4262
4263 2011-12-18 Ian Lance Taylor <iant@google.com>
4264
4265 * object.h (Relobj::local_symbol_value): New function.
4266 (Relobj::local_plt_offset): New function.
4267 (Relobj::local_has_got_offset): New function.
4268 (Relobj::local_got_offset): New function.
4269 (Relobj::set_local_got_offset): New function.
4270 (Relobj::do_local_symbol_value): New pure virtual function.
4271 (Relobj::do_local_plt_offset): Likewise.
4272 (Relobj::do_local_has_got_offset): Likewise.
4273 (Relobj::do_local_got_offset): Likewise.
4274 (Relobj::do_set_local_got_offset): Likewise.
4275 (Sized_relobj::do_local_has_got_offset): Rename from
4276 local_has_got_offset.
4277 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4278 (Sized_relobj::do_set_local_got_offset): Rename from
4279 set_local_got_offset.
4280 (Sized_relobj_file::do_local_plt_offset): Rename from
4281 local_plt_offset.
4282 (Sized_relobj_file::do_local_symbol_value): New function.
4283 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4284 local_plt_offset.
4285 * output.cc (Output_data_got::Got_entry::write): Change object to
4286 Relobj. Use local_symbol_value.
4287 (Output_data_got::add_global_with_rel): Change rel_dyn to
4288 Output_data_reloc_generic*. Use add_global_generic.
4289 (Output_data_got::add_global_with_rela): Remove. Change all
4290 callers to use add_global_with_rel.
4291 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4292 Output_data_reloc_generic*. Use add_global_generic.
4293 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4294 callers to use add_global_pair_with_rel.
4295 (Output_data_got::add_local): Change object to Relobj*.
4296 (Output_data_got::add_local_plt): Likewise.
4297 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4298 change rel_dyn to Output_data_reloc_generic*. Use
4299 add_local_generic.
4300 (Output_data_got::add_local_with_rela): Remove. Change all
4301 callers to use all_local_with_rel.
4302 (Output_data_got::add_local_pair_with_rel): Change object to
4303 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4304 add_output_section_generic.
4305 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4306 callers to use add_local_pair_with_rel.
4307 (Output_data_got::reserve_local): Change object to Relobj*.
4308 * output.h: (class Output_data_reloc_generic): Add pure virtual
4309 declarations for add_global_generic, add_local_generic,
4310 add_output_section_generic.
4311 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4312 functions for Output_data_reloc_generic. Update declarations for
4313 changes listed in output.cc.
4314 (class Output_data_got): Change template parameter to got_size.
4315 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4316 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4317 function.
4318 (Sized_relobj_incr::do_local_plt_offset): New function.
4319 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4320 add_global_generic.
4321
4322 2011-12-17 Cary Coutant <ccoutant@google.com>
4323
4324 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4325 * resolve.cc (Symbol_table::resolve): Likewise.
4326 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4327 arrays.
4328 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4329
4330 2011-12-16 Ian Lance Taylor <iant@google.com>
4331
4332 * output.h (Output_data_reloc_generic::add): Only call
4333 add_dynamic_reloc if this is a dynamic reloc section.
4334
4335 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4336
4337 PR gold/13505
4338 * target-reloc.h (apply_relocation): Replace <64, false> with
4339 <size, big_endian>.
4340
4341 2011-11-25 Nick Clifton <nickc@redhat.com>
4342
4343 * po/it.po: New Italian translation.
4344
4345 2011-11-17 Sterling Augustine <saugustine@google.com>
4346
4347 * script.cc (script_include_directive): Implement.
4348 (read_script_file): New local variables name and search_path. Update
4349 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4350 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4351 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4352
4353 2011-11-11 Sterling Augustine <saugustine@google.com>
4354
4355 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4356 (file_or_sections_cmd): Likewise.
4357
4358 2011-11-11 Doug Kwan <dougkwan@google.com>
4359
4360 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4361 if --just-symbols is given.
4362
4363 2011-11-10 Doug Kwan <dougkwan@google.com>
4364
4365 PR gold/13362
4366 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4367 when processing data relocs.
4368 * reloc.h (Relocate_functions::rel_unaligned): New method.
4369 (Relocate_functions::pcrel_unaligned): Ditto.
4370 (Relocate_functions::rel32_unaligned): Ditto.
4371 (Relocate_functions::pcrel32_unaligned): Ditto.
4372
4373 2011-11-09 Doug Kwan <dougkwan@google.com>
4374
4375 PR gold/13362
4376 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4377 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4378 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4379 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4380 (Relocate_functions::rel_unaligned): New.
4381 (Relocate_functions::rel32_unaligned): New.
4382 * target-reloc.h (relocate_for_relocatable): Add code to handle
4383 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4384 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4385 arm_unaligned_reloc_r): New targets.
4386 * testsuite/Makefile.in: Regenerate.
4387 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4388 linking.
4389
4390 2011-11-02 Ian Lance Taylor <iant@google.com>
4391
4392 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4393 NATIVE_LINKER.
4394 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4395 * options.cc (General_options::finalize): Use library search path
4396 from configure script if specified. If not native and no sysroot,
4397 only search TOOLLIBDIR.
4398 * options.h (Search_directory::Search_directory): Change name to
4399 const std::string&.
4400 (General_options::add_to_library_path_with_sysroot): Change arg to
4401 const std::string&.
4402 * configure, Makefile.in, config.in: Rebuild.
4403
4404 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4405
4406 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4407 we are working around the ARM1176 Erratum.
4408 * options.h (General_options::fix_arm1176): Add option.
4409 * testsuite/Makefile.am: Add testcases, and keep current ones
4410 working.
4411 * testsuite/Makefile.in: Regenerate.
4412 * testsuite/arm_fix_1176.s: New file.
4413 * testsuite/arm_fix_1176.sh: Likewise.
4414
4415 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4416
4417 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4418 may_use_blx_.
4419 (Target_arm::may_use_blx): Remove method.
4420 (Target_arm::set_may_use_blx): Likewise.
4421 (Target_arm::may_use_v4t_interworking): New method.
4422 (Target_arm::may_use_v5t_interworking): Likewise.
4423 (Target_arm::may_use_blx_): Remove member variable.
4424 (Arm_relocate_functions::arm_branch_common): Check for v5T
4425 interworking.
4426 (Arm_relocate_functions::thumb_branch_common): Likewise.
4427 (Reloc_stub::stub_type_for_reloc): Likewise.
4428 (Target_arm::do_finalize_sections): Correct interworking checks.
4429 * testsuite/Makefile.am: Add new tests.
4430 * testsuite/Makefile.in: Regenerate.
4431 * testsuite/arm_farcall_arm_arm.s: New test.
4432 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4433 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4434 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4435 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4436 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4437 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4438 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4439
4440 2011-10-31 Cary Coutant <ccoutant@google.com>
4441
4442 PR gold/13023
4443 * expression.cc (Expression::eval_with_dot): Add
4444 is_section_dot_assignment parameter.
4445 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4446 absolute and assigning to dot within a section.
4447 * script-sections.cc
4448 (Output_section_element_assignment::set_section_addresses): Pass
4449 dot_section to set_if_absolute.
4450 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4451 as is_section_dot_assignment flag to eval_with_dot.
4452 (Output_section_element_dot_assignment::set_section_addresses):
4453 Likewise.
4454 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4455 parameter. Also set value if relative to dot_section; set the
4456 symbol's output_section.
4457 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4458 parameter. Adjust all callers.
4459 (Expression::eval_maybe_dot): Likewise.
4460 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4461 Adjust all callers.
4462 * testsuite/script_test_2.t: Test assignment of an absolute value
4463 to dot within an output section element.
4464
4465 2011-10-31 Cary Coutant <ccoutant@google.com>
4466
4467 * options.h (class General_options): Add --[no-]gnu-unique options.
4468 * symtab.cc (Symbol_table::sized_write_globals): Convert
4469 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4470
4471 2011-10-31 Cary Coutant <ccoutant@google.com>
4472
4473 PR gold/13359
4474 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4475 unnecessary assertion.
4476 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4477
4478 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4479
4480 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4481 gc_mark_symbol.
4482 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4483 gc_mark_symbol.
4484 Change to just keep the section associated with symbol.
4485 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4486 they are externally visible and --export-dynamic is turned on.
4487 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4488
4489 2011-10-19 Ian Lance Taylor <iant@google.com>
4490
4491 PR gold/13163
4492 * script-sections.cc
4493 (Output_section_element_dot_assignment::needs_output_section): New
4494 function.
4495
4496 2011-10-19 Ian Lance Taylor <iant@google.com>
4497
4498 PR gold/13204
4499 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4500 --section-start option was seen.
4501 * options.h (General_options::any_section_start): New function.
4502
4503 2011-10-18 David S. Miller <davem@davemloft.net>
4504
4505 PR binutils/13301
4506 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4507 member to track relocation locations that have moved during TLS
4508 reloc optimizations.
4509 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4510 (Target_sparc::Relocate::relocate): Adjust view down by 4
4511 bytes if it matches reloc_adjust_addr_.
4512 (Target_sparc::Relocate::relocate_tls): Always move the
4513 __tls_get_addr call delay slot instruction forward 4 bytes when
4514 performing relaxation.
4515
4516 2011-10-18 Cary Coutant <ccoutant@google.com>
4517
4518 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4519 (Output_file::map_no_anonymous): Check for non-zero
4520 return code from posix_fallocate.
4521
4522 2011-10-17 Cary Coutant <ccoutant@google.com>
4523
4524 PR gold/13245
4525 * plugin.cc (is_visible_from_outside): Check for symbols
4526 referenced from dynamic objects.
4527 * resolve.cc (Symbol_table::resolve): Don't count references
4528 from dynamic objects as references from real ELF files.
4529 * testsuite/plugin_test_2.sh: Adjust expected result.
4530
4531 2011-10-17 Cary Coutant <ccoutant@google.com>
4532
4533 * gold.cc: Include timer.h.
4534 (queue_middle_tasks): Stamp time.
4535 (queue_final_tasks): Likewise.
4536 * main.cc (main): Store timer in parameters. Print timers
4537 for each pass.
4538 * parameters.cc (Parameters::Parameters): Initialize timer_.
4539 (Parameters::set_timer): New function.
4540 (set_parameters_timer): New function.
4541 * parameters.h (Parameters::set_timer): New function.
4542 (Parameters::timer): New function.
4543 (Parameters::timer_): New data member.
4544 (set_parameters_timer): New function.
4545 * timer.cc (Timer::stamp): New function.
4546 (Timer::get_pass_time): New function.
4547 * timer.h (Timer::stamp): New function.
4548 (Timer::get_pass_time): New function.
4549 (Timer::pass_times_): New data member.
4550
4551 2011-10-17 Cary Coutant <ccoutant@google.com>
4552
4553 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4554 task for members of lib groups.
4555
4556 2011-10-17 Cary Coutant <ccoutant@google.com>
4557
4558 PR gold/13288
4559 * fileread.cc (File_read::find_view): Add assert.
4560 (File_read::make_view): Move bounds check (replace with assert)...
4561 (File_read::find_or_make_view): ... to here.
4562
4563 2011-10-12 Cary Coutant <ccoutant@google.com>
4564
4565 * output.cc (Output_file::open_base_file): Handle case where
4566 ::read returns less than requested size.
4567
4568 2011-10-10 Cary Coutant <ccoutant@google.com>
4569
4570 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4571 Initialize defined_count_.
4572 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4573 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4574 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4575 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4576 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4577 * incremental.h (Sized_relobj_incr::defined_count_): New data
4578 member.
4579 (Sized_incr_dynobj::defined_count_): New data member.
4580 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4581 Return zeroes instead of internal error.
4582
4583 2011-10-10 Cary Coutant <ccoutant@google.com>
4584
4585 PR gold/13249
4586 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4587 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4588 * output.h (class Output_reloc): Add use_plt_offset flag.
4589 (Output_reloc::type_): Adjust size of bit field.
4590 (Output_reloc::use_plt_offset_): New bit field.
4591 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4592 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4593 flag. Adjust all callers.
4594 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4595 creating RELATIVE relocations.
4596
4597 2011-10-10 Nick Clifton <nickc@redhat.com>
4598
4599 * po/es.po: Updated Spanish translation.
4600 * po/fi.po: Updated Finnish translation.
4601
4602 2011-10-03 Diego Novillo <dnovillo@google.com>
4603
4604 * options.cc (parse_uint): Fix dereference of RETVAL.
4605
4606 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4607
4608 * layout.h (section_order_map_): New member.
4609 (get_section_order_map): New member function.
4610 * output.cc (Output_section::add_input_section): Check for patterns
4611 only when --section-ordering-file is specified.
4612 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4613 output_sections have been formed.
4614 * layout.cc (Layout_Layout): Initialize section_order_map_.
4615 * plugin.cc (update_section_order): Store order in order_map. Do not
4616 update the order.
4617 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4618 * testsuite/Makefile.in: Regenerate.
4619 * testsuite/plugin_section_order.c: New file.
4620 * testsuite/plugin_final_layout.cc: New file.
4621 * testsuite/plugin_final_layout.sh: New file.
4622
4623 2011-09-29 Cary Coutant <ccoutant@google.com>
4624
4625 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4626 Check for NULL.
4627 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4628 symbols during incremental update.
4629 (Symbol_table::add_from_dynobj): Likewise.
4630
4631 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4632 Ian Lance Taylor <iant@google.com>
4633
4634 * symtab.cc (Symbol_table::define_special_symbol): Always
4635 canonicalize version string.
4636
4637 2011-09-26 Cary Coutant <ccoutant@google.com>
4638
4639 * gold.cc (queue_initial_tasks): Move option checks ...
4640 * options.cc (General_options::finalize): ... to here. Disable
4641 some options; make others fatal.
4642
4643 2011-09-26 Cary Coutant <ccoutant@google.com>
4644
4645 gcc PR lto/47247
4646 * plugin.cc (get_symbols_v2): New function.
4647 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4648 (is_referenced_from_outside): New function.
4649 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4650 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4651 (get_symbols): Pass version parameter.
4652 (get_symbols_v2): New function.
4653 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4654 parameter.
4655 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4656 (onload): Add LDPT_GET_SYMBOLS_V2.
4657 (all_symbols_read_hook): Use get_symbols_v2; check for
4658 LDPR_PREVAILING_DEF_IRONLY_EXP.
4659 * testsuite/plugin_test_3.sh: Update expected results.
4660
4661 2011-09-23 Simon Baldwin <simonb@google.com>
4662
4663 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4664 configuration options.
4665 * configure: Regenerate.
4666 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4667 * Makefile.in: Regenerate.
4668 * testsuite/Makefile.in: Regenerate.
4669
4670 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4671
4672 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4673
4674 2011-09-19 Cary Coutant <ccoutant@google.com>
4675
4676 * incremental.cc (can_incremental_update): Fix typo in comment.
4677 * incremental.h (can_incremental_update): Likewise.
4678
4679 2011-09-18 Cary Coutant <ccoutant@google.com>
4680
4681 * incremental.cc (can_incremental_update): New function.
4682 * incremental.h (can_incremental_update): New function.
4683 * layout.cc (Layout::init_fixed_output_section): Call it.
4684 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4685 * object.cc (Sized_relobj_file::do_layout): Call
4686 can_incremental_update.
4687
4688 2011-09-13 Cary Coutant <ccoutant@google.com>
4689
4690 * configure.ac: Check for glibc support for gnu_indirect_function
4691 support with static linking, setting automake conditional
4692 IFUNC_STATIC.
4693 * Makefile.in: Regenerate.
4694 * configure: Regenerate.
4695
4696 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4697 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4698 for IFUNC_STATIC.
4699 * testsuite/Makefile.in: Regenerate.
4700
4701 2011-09-13 Cary Coutant <ccoutant@google.com>
4702
4703 * incremental.cc (Sized_relobj_incr::do_layout): Call
4704 report_comdat_group for kept comdat sections.
4705 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4706 * testsuite/Makefile.in: Regenerate.
4707 * testsuite/incr_comdat_test_1.cc: New source file.
4708 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4709 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4710 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4711
4712 2011-09-13 Ian Lance Taylor <iant@google.com>
4713
4714 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4715 variable external_symbols_offset.
4716
4717 2011-09-12 Ian Lance Taylor <iant@google.com>
4718
4719 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4720 triggered if object has no symbols.
4721
4722 2011-09-09 David S. Miller <davem@davemloft.net>
4723
4724 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4725 (Output_fill_debug_line::do_write): Likewise.
4726
4727 2011-08-29 Cary Coutant <ccoutant@google.com>
4728
4729 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4730 casts to match formatting specs.
4731 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4732
4733 2011-08-26 Cary Coutant <ccoutant@google.com>
4734
4735 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4736 remaining hole size when allocating.
4737 (Layout::make_output_section): Set fill methods for debug sections.
4738 * layout.h (Free_list::Free_list_node): Move from private to
4739 public.
4740 (Free_list::set_min_hole_size): New function.
4741 (Free_list::begin, Free_list::end): New functions.
4742 (Free_list::min_hole_): New data member.
4743 * output.cc: Include dwarf.h.
4744 (Output_fill_debug_info::do_minimum_hole_size): New function.
4745 (Output_fill_debug_info::do_write): New function.
4746 (Output_fill_debug_line::do_minimum_hole_size): New function.
4747 (Output_fill_debug_line::do_write): New function.
4748 (Output_section::Output_section): Initialize new data member.
4749 (Output_section::set_final_data_size): Ensure patch space is larger
4750 than minimum hole size.
4751 (Output_section::do_write): Fill holes in debug sections.
4752 * output.h (Output_fill): New class.
4753 (Output_fill_debug_info): New class.
4754 (Output_fill_debug_line): New class.
4755 (Output_section::set_free_space_fill): New function.
4756 (Output_section::free_space_fill_): New data member.
4757 * testsuite/Makefile.am (incremental_test_3): Add
4758 --incremental-patch option.
4759 (incremental_test_4): Likewise.
4760 (incremental_test_5): Likewise.
4761 (incremental_test_6): Likewise.
4762 (incremental_copy_test): Likewise.
4763 (incremental_common_test_1): Likewise.
4764 * testsuite/Makefile.in: Regenerate.
4765
4766 2011-08-26 Nick Clifton <nickc@redhat.com>
4767
4768 * po/es.po: Updated Spanish translation.
4769
4770 2011-08-01 Cary Coutant <ccoutant@google.com>
4771
4772 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4773 * gold/testsuite/Makefile.in: Regenerate.
4774 * gold/testsuite/justsyms_exec.c: New source file.
4775 * gold/testsuite/justsyms_lib.c: New source file.
4776
4777 2011-08-01 Cary Coutant <ccoutant@google.com>
4778
4779 * layout.cc (Layout::set_segment_offsets): Don't realign text
4780 segment if -Ttext was specified.
4781 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4782 file type.
4783 * object.h (Sized_relobj_file::e_type): New function.
4784 (Sized_relobj_file::e_type_): New data member.
4785 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4786 base address for ET_EXEC files.
4787 * target.cc (Target::do_make_elf_object_implementation): Allow
4788 ET_EXEC files with --just-symbols option.
4789
4790 2011-07-28 Cary Coutant <ccoutant@google.com>
4791
4792 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4793 Add thread_number parameter.
4794 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4795 * workqueue-threads.cc
4796 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4797 current thread if its thread number is greater than desired thread
4798 count.
4799 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4800 Add thread_number parameter.
4801 (Workqueue::should_cancel_thread): Likewise.
4802 (Workqueue::find_runnable_or_wait): Pass thread_number to
4803 should_cancel_thread.
4804 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4805 parameter.
4806
4807 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4808
4809 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4810 only after checking if it cannot be forced local.
4811 * symtab.h (is_externally_visible): Check if the symbol is not forced
4812 local.
4813
4814 2011-07-15 Ian Lance Taylor <iant@google.com>
4815
4816 * options.h (class General_options): Add --print-output-format.
4817 Move -EL next to -EB, for better --help output.
4818 * target-select.cc: Include <cstdio>, "options.h", and
4819 "parameters.h".
4820 (Target_selector::do_target_bfd_name): New function.
4821 (print_output_format): New function.
4822 * target-select.h (class Target_selector): Update declarations.
4823 (Target_selector::target_bfd_name): New function.
4824 (print_output_format): Declare.
4825 * main.cc: Include "target-select.h".
4826 (main): Handle --print-output-format.
4827 * gold.cc: Include "target-select.h".
4828 (queue_initial_tasks): Handle --print-output-format when there are
4829 no input files.
4830 * parameters.cc (parameters_force_valid_target): Give a better
4831 error message if -EB/-EL does not match target.
4832 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4833 function.
4834
4835 2011-07-15 Ian Lance Taylor <iant@google.com>
4836
4837 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4838 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4839 (Output_data_plt_i386::do_write): Write address of .dynamic
4840 section to first entry in .got.plt section.
4841 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4842 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4843 Initialize layout_.
4844 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4845 section to first entry in .got.plt section.
4846 * layout.h (Layout::dynamic_section): New function.
4847
4848 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4849
4850 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4851 to claim_file call.
4852 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4853 input_section_position_, and input_section_glob_.
4854 (read_layout_from_file): Call function section_ordering_specified.
4855 * layout.h (is_section_ordering_specified): New function.
4856 (section_ordering_specified): New function.
4857 (section_ordering_specified_): New boolean member.
4858 * main.cc(main): Call load_plugins after layout object is defined.
4859 * output.cc (Output_section::add_input_section): Use
4860 function section_ordering_specified to check if section ordering is
4861 needed.
4862 * output.cc (Output_section::add_relaxed_input_section): Use
4863 function section_ordering_specified to check if section ordering is
4864 needed.
4865 (Output_section::update_section_layout): New function.
4866 (Output_section::sort_attached_input_sections): Check if input section
4867 must be reordered.
4868 * output.h (Output_section::update_section_layout): New function.
4869 * plugin.cc (get_section_count): New function.
4870 (get_section_type): New function.
4871 (get_section_name): New function.
4872 (get_section_contents): New function.
4873 (update_section_order): New function.
4874 (allow_section_ordering): New function.
4875 (Plugin::load): Add the new interfaces to the transfer vector.
4876 (Plugin_manager::load_plugins): New parameter.
4877 (Plugin_manager::all_symbols_read): New parameter.
4878 (Plugin_manager::claim_file): New parameter. Save the elf object for
4879 unclaimed objects.
4880 (Plugin_manager::get_elf_object): New function.
4881 (Plugin_manager::get_view): Change to directly use the bool to check
4882 if get_view is called from claim_file_hook.
4883 * plugin.h (input_objects): New function
4884 (Plugin__manager::load_plugins): New parameter.
4885 (Plugin_manager::claim_file): New parameter.
4886 (Plugin_manager::get_elf_object): New function.
4887 (Plugin_manager::in_claim_file_handler): New function.
4888 (Plugin_manager::in_claim_file_handler_): New member.
4889 (layout): New function.
4890 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4891 handler with an extra parameter. Make the elf object before calling
4892 claim_file handler.
4893 * testsuite/plugin_test.c (get_section_count): New function pointer.
4894 (get_section_type): New function pointer.
4895 (get_section_name): New function pointer.
4896 (get_section_contents): New function pointer.
4897 (update_section_order): New function pointer.
4898 (allow_section_ordering): New function pointer.
4899 (onload): Check if the new interfaces exist.
4900
4901 2011-07-13 Ian Lance Taylor <iant@google.com>
4902
4903 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4904 relro section.
4905 * x86_64.cc (Target_x86_64::got_section): Likewise.
4906 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4907 (relro_now_test_SOURCES): New variable.
4908 (relro_now_test_DEPENDENCIES): New variable.
4909 (relro_now_test_LDFLAGS): New variable.
4910 (relro_now_test_LDADD): New variable.
4911 (relro_now_test.so): New target.
4912 * testsuite/Makefile.in: Rebuild.
4913
4914 2011-07-12 Ian Lance Taylor <iant@google.com>
4915
4916 PR gold/12980
4917 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4918 GLOB_DAT relocation rather than a RELATIVE relocation for a
4919 protected symbol when creating a shared library.
4920 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4921 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4922 * testsuite/protected_main_1.cc (main): Test that protected
4923 function has same address.
4924
4925 2011-07-11 Ian Lance Taylor <iant@google.com>
4926
4927 PR gold/12979
4928 * options.h (class General_options): Add -Bgroup.
4929 * options.cc (General_options::finalize): If -Bgroup is set,
4930 default to --unresolved-symbols=report-all.
4931 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4932 * target-reloc.h (issue_undefined_symbol_error): Handle
4933 --unresolved-symbols=report-all.
4934
4935 2011-07-08 Ian Lance Taylor <iant@google.com>
4936
4937 PR gold/11985
4938 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4939 if linker script discards key sections.
4940 (Layout::create_dynamic_symtab): Likewise.
4941 (Layout::assign_local_dynsym_offsets): Likewise.
4942 (Layout::sized_create_version_sections): Likewise.
4943 (Layout::create_interp): Likewise.
4944 (Layout::finish_dynamic_section): Likewise.
4945 (Layout::set_dynamic_symbol_size): Likewise.
4946
4947 2011-07-08 Ian Lance Taylor <iant@google.com>
4948
4949 PR gold/12386
4950 * options.h (class General_options): Add --unresolved-symbols.
4951 * target-reloc.h (issue_undefined_symbol_error): Check
4952 --unresolved-symbols. Add comments.
4953
4954 2011-07-08 Ian Lance Taylor <iant@google.com>
4955
4956 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4957 expression more complex.
4958
4959 2011-07-08 Ian Lance Taylor <iant@google.com>
4960
4961 PR gold/11317
4962 * target-reloc.h (issue_undefined_symbol_error): New inline
4963 function, broken out of relocate_section.
4964 (relocate_section): Call issue_undefined_symbol_error.
4965 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4966 there is no TLS segment if we are about to issue an undefined
4967 symbol error.
4968 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4969
4970 2011-07-08 Ian Lance Taylor <iant@google.com>
4971
4972 PR gold/12279
4973 * resolve.cc (Symbol_table::should_override): Add fromtype
4974 parameter. Change all callers. Give error when linking together
4975 TLS and non-TLS symbol.
4976 (Symbol_table::should_override_with_special): Add fromtype
4977 parameter. Change all callers.
4978 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4979 there is no TLS segment if we have reported some errors.
4980 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4981
4982 2011-07-08 Ian Lance Taylor <iant@google.com>
4983
4984 PR gold/12372
4985 * target.h (Target::plt_address_for_global): New function.
4986 (Target::plt_address_for_local): New function.
4987 (Target::plt_section_for_global): Remove.
4988 (Target::plt_section_for_local): Remove.
4989 (Target::do_plt_address_for_global): New virtual function.
4990 (Target::do_plt_address_for_local): New virtual function.
4991 (Target::do_plt_section_for_global): Remove.
4992 (Target::do_plt_section_for_local): Remove.
4993 (Target::register_global_plt_entry): Add Symbol_table and Layout
4994 parameters.
4995 * output.cc (Output_data_got::Got_entry::write): Use
4996 plt_address_for_global and plt_address_for_local.
4997 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4998 address of output section.
4999 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5000 got_irelative_, and irelative_count_ fields. Update
5001 declarations.
5002 (Output_data_plt_i386::has_irelative_section): New function.
5003 (Output_data_plt_i386::entry_count): Add irelative_count_.
5004 (Output_data_plt_i386::set_final_data_size): Likewise.
5005 (class Target_i386): Add got_irelative_ and rel_irelative_
5006 fields. Update declarations.
5007 (Target_i386::Target_i386): Initialize new fields.
5008 (Target_i386::do_plt_address_for_global): New function replacing
5009 do_plt_section_for_global.
5010 (Target_i386::do_plt_address_for_local): New function replacing
5011 do_plt_section_for_local.
5012 (Target_i386::got_section): Create got_irelative_.
5013 (Target_i386::rel_irelative_section): New function.
5014 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5015 fields. Don't define __rel_iplt_{start,end}.
5016 (Output_data_plt_i386::add_entry): Add symtab and layout
5017 parameters. Change all callers. Use different PLT and GOT for
5018 IFUNC symbols.
5019 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5020 layout parameters. Change all callers. Use different PLT and
5021 GOT.
5022 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5023 (Output_data_plt_i386::rel_irelative): New function.
5024 (Output_data_plt_i386::address_for_global): New function.
5025 (Output_data_plt_i386::address_for_local): New function.
5026 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5027 IRELATIVE GOT when changing IFUNC GOT entries.
5028 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5029 reloc.
5030 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5031 if we didn't create an IRELATIVE GOT.
5032 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5033 plt_address_for_local.
5034 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5035 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5036 got_irelative_, and irelative_count_ fields. Update
5037 declarations.
5038 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5039 Initialize new fields. Remove symtab parameter. Change all
5040 callers.
5041 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5042 irelative_count_.
5043 (Output_data_plt_x86_64::has_irelative_section): New function.
5044 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5045 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5046 fields. Update declarations.
5047 (Target_x86_64::Target_x86_64): Initialize new fields.
5048 (Target_x86_64::do_plt_address_for_global): New function replacing
5049 do_plt_section_for_global.
5050 (Target_x86_64::do_plt_address_for_local): New function replacing
5051 do_plt_section_for_local.
5052 (Target_x86_64::got_section): Create got_irelative_.
5053 (Target_x86_64::rela_irelative_section): New function.
5054 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5055 all callers. Don't create __rel_iplt_{start,end}.
5056 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5057 parameters. Change all callers. Use different PLT and GOT for
5058 IFUNC symbols.
5059 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5060 layout parameters. Change all callers. Use different PLT and
5061 GOT.
5062 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5063 parameters. Change all callers. Use different PLT and GOT for
5064 IFUNC symbols.
5065 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5066 (Output_data_plt_x86_64::rela_irelative): New function.
5067 (Output_data_plt_x86_64::address_for_global): New function.
5068 (Output_data_plt_x86_64::address_for_local): New function.
5069 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5070 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5071 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5072 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5073 parameters.
5074 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5075 reloc.
5076 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5077 symbols if we didn't create an IRELATIVE GOT.
5078 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5079 plt_address_for_local.
5080 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5081 * testsuite/ifuncvar1.c: New test file.
5082 * testsuite/ifuncvar2.c: New test file.
5083 * testsuite/ifuncvar3.c: New test file.
5084 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5085 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5086 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5087 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5088 * testsuite/Makefile.in: Rebuild.
5089
5090 2011-07-07 Cary Coutant <ccoutant@google.com>
5091
5092 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5093 (two_file_test_1_ndebug.o): Likewise.
5094 (two_file_test_1b_ndebug.o): Likewise.
5095 (two_file_test_2_ndebug.o): Likewise.
5096 (two_file_test_main_ndebug.o): Likewise.
5097 (incremental_test_2): Link with no-debug versions.
5098
5099 2011-07-06 Cary Coutant <ccoutant@google.com>
5100
5101 * gold/incremental.cc
5102 (Output_section_incremental_inputs::write_info_blocks): Check for
5103 hidden and internal symbols.
5104
5105 2011-07-06 Cary Coutant <ccoutant@google.com>
5106
5107 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5108 Check disposition for startup file.
5109 (Incremental_inputs::report_command_line): Ignore
5110 --incremental-startup-unchanged option.
5111 * options.cc (General_options::parse_incremental_startup_unchanged):
5112 New function.
5113 (General_options::General_options): Initialize new data member.
5114 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5115 (General_options): Add --incremental-startup-unchanged option.
5116 (General_options::incremental_startup_disposition): New function.
5117 (General_options::incremental_startup_disposition_): New data member.
5118
5119 2011-07-06 Cary Coutant <ccoutant@google.com>
5120
5121 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5122 input file index to Script_info ctor.
5123 (Sized_incremental_binary::do_file_has_changed): Find the
5124 command-line argument for files named in scripts.
5125 * incremental.h (Script_info::Script_info): New ctor
5126 with input file index.
5127 (Script_info::input_file_index): New function.
5128 (Script_info::input_file_index_): New data member.
5129 (Incremental_binary::get_library): Add const.
5130 (Incremental_binary::get_script_info): Add const.
5131 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5132 * testsuite/Makefile.am (incremental_test_5): New test case.
5133 (incremental_test_6): New test case.
5134 * testsuite/Makefile.in: Regenerate.
5135
5136 2011-07-06 Cary Coutant <ccoutant@google.com>
5137
5138 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5139 debug output when command lines differ.
5140
5141 2011-07-06 Cary Coutant <ccoutant@google.com>
5142
5143 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5144 --incremental-patch option.
5145 * layout.cc (Free_list::allocate): Extend allocation beyond original
5146 end if enabled.
5147 (Layout::make_output_section): Mark sections that should get
5148 patch space.
5149 * options.cc (parse_percent): New function.
5150 * options.h (parse_percent): New function.
5151 (DEFINE_percent): New macro.
5152 (General_options): Add --incremental-patch option.
5153 * output.cc (Output_section::Output_section): Initialize new data
5154 members.
5155 (Output_section::add_input_section): Print section name when out
5156 of patch space.
5157 (Output_section::add_output_section_data): Likewise.
5158 (Output_section::set_final_data_size): Add patch space when
5159 doing --incremental-full.
5160 (Output_section::do_reset_address_and_file_offset): Remove patch
5161 space.
5162 (Output_segment::set_section_list_addresses): Print debug output
5163 only if --incremental-update.
5164 * output.h (Output_section::set_is_patch_space_allowed): New function.
5165 (Output_section::is_patch_space_allowed_): New data member.
5166 (Output_section::patch_space_): New data member.
5167 * parameters.cc (Parameters::incremental_full): New function.
5168 * parameters.h (Parameters::incremental_full): New function
5169 * testsuite/Makefile.am (incremental_test_2): Add test for
5170 --incremental-patch option.
5171 * testsuite/Makefile.in: Regenerate.
5172 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5173 (t18): Remove function body.
5174
5175 2011-07-05 Doug Kwan <dougkwan@google.com>
5176
5177 PR gold/12771
5178 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5179 Arm_Address type for relocation result.
5180 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5181 overflow check.
5182 (Arm_relocate_functions::abs32): Use unaligned access.
5183 (Arm_relocate_functions::rel32): Ditto.
5184 (Arm_relocate_functions::prel31): Ditto.
5185 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5186 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5187 static data relocations.
5188 * testsuite/Makefile.in: Regnerate.
5189 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5190
5191 2011-07-05 Ian Lance Taylor <iant@google.com>
5192
5193 PR gold/12392
5194 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5195 symbols if necessary.
5196 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5197
5198 2011-07-05 Ian Lance Taylor <iant@google.com>
5199
5200 PR gold/12952
5201 * resolve.cc (Symbol::override_base_with_special): Simply override
5202 version with special symbol version, ignoring previous version.
5203
5204 2011-07-05 Ian Lance Taylor <iant@google.com>
5205
5206 * object.cc (Sized_relobj_file::include_section_group): Add
5207 information to comment about signature location.
5208
5209 2011-07-02 Ian Lance Taylor <iant@google.com>
5210
5211 PR gold/12957
5212 * options.h (class General_options): Add -f and -F.
5213 * options.cc (General_options::finalize): Fatal error if -f/-F
5214 are used without -shared.
5215 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5216
5217 2011-07-02 Ian Lance Taylor <iant@google.com>
5218
5219 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5220
5221 2011-07-01 Ian Lance Taylor <iant@google.com>
5222
5223 PR gold/12525
5224 PR gold/12952
5225 * resolve.cc (Symbol::override_base_with_special): Don't override
5226 the version if the overriding symbol has a different name.
5227 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5228 all callers. If we give an error about an undefined version,
5229 define the base version if necessary.
5230 * dynobj.h (class Versions): Update declaration.
5231 * testsuite/weak_alias_test_5.cc: New file.
5232 * testsuite/weak_alias_test.script: New file.
5233 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5234 and versioned_alias have the right value, and call t2.
5235 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5236 weak_alias_test_5.so.
5237 (weak_alias_test_LDADD): Likewise.
5238 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5239 * testsuite/Makefile.in: Rebuild.
5240
5241 2011-07-01 Ian Lance Taylor <iant@google.com>
5242
5243 PR gold/12525
5244 * options.h (class General_options): Support -z notext.
5245 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5246 -Wl,-z,notext.
5247 (two_file_shared_nonpic.so): Likewise.
5248 (two_file_shared_mixed.so): Likewise.
5249 (two_file_shared_mixed_1.so): Likewise.
5250 (weak_undef_lib_nonpic.so): Likewise.
5251 (alt/weak_undef_lib_nonpic.so): Likewise.
5252 (tls_test_shared_nonpic.so): Likewise.
5253 * testsuite/Makefile.in: Rebuild.
5254
5255 2011-07-01 Ian Lance Taylor <iant@google.com>
5256
5257 PR gold/12525
5258 * configure.ac: Test whether static linking works, setting
5259 the automake conditional HAVE_STATIC.
5260 * testsuite/Makefile.am: Disable tests using -static if
5261 HAVE_STATIC is not true.
5262 * configure, testsuite/Makefile.in: Rebuild.
5263
5264 2011-07-01 Ian Lance Taylor <iant@google.com>
5265
5266 PR gold/12525
5267 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5268 Assert if we see DW_EH_PE_indirect.
5269 * target.h (Target::ehframe_datarel_base): New function.
5270 (Target::do_ehframe_datarel_base): New target function.
5271 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5272 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5273 function.
5274
5275 2011-07-01 Ian Lance Taylor <iant@google.com>
5276
5277 PR gold/12571
5278 * options.h (class General_options): Add
5279 --ld-generated-unwind-info.
5280 * ehframe.cc (Fde::write): Add address parameter. Change all
5281 callers. If associated with PLT, fill in address and size.
5282 (Cie::set_output_offset): Only add merge mapping if there is an
5283 object.
5284 (Cie::write): Add address parameter. Change all callers.
5285 (Eh_frame::add_ehframe_for_plt): New function.
5286 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5287 input_offset_ fields into union u_, with new plt field.
5288 (Fde::Fde): Adjust for new union field.
5289 (Fde::Fde) [Output_data version]: New constructor.
5290 (Fde::add_mapping): Only add merge mapping if there is an object.
5291 (class Cie): Update declarations.
5292 (class Eh_frame): Declare add_ehframe_for_plt.
5293 * layout.cc (Layout::layout_eh_frame): Break out code into
5294 make_eh_frame_section, and call it.
5295 (Layout::make_eh_frame_section): New function.
5296 (Layout::add_eh_frame_for_plt): New function.
5297 * layout.h (class Layout): Update declarations.
5298 * merge.cc (Merge_map::add_mapping): Add assertion.
5299 * i386.cc: Include "dwarf.h".
5300 (class Output_data_plt_i386): Make first_plt_entry,
5301 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5302 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5303 and plt_eh_frame_fde.
5304 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5305 boundary. Call add_eh_frame_for_plt if appropriate.
5306 * x86_64.cc: Include "dwarf.h".
5307 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5308 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5309 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5310 and plt_eh_frame_fde.
5311 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5312 appropriate.
5313
5314 2011-06-29 Ian Lance Taylor <iant@google.com>
5315
5316 PR gold/12629
5317 * object.cc (Sized_relobj_file::layout_section): Change shdr
5318 parameter to be const.
5319 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5320 out of do_layout.
5321 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5322 appropriate. Call layout_eh_frame_section.
5323 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5324 sections.
5325 * object.h (class Sized_relobj_file): Update declarations.
5326
5327 2011-06-29 Ian Lance Taylor <iant@google.com>
5328
5329 PR gold/12652
5330 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5331 modifier.
5332 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5333
5334 2011-06-29 Ian Lance Taylor <iant@google.com>
5335
5336 PR gold/12675
5337 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5338 SHT_X86_64_UNWIND.
5339 * layout.cc (Layout::layout_eh_frame): Likewise.
5340
5341 2011-06-29 Ian Lance Taylor <iant@google.com>
5342
5343 PR gold/12695
5344 * layout.cc (Layout::symtab_section_shndx): New function.
5345 * layout.h (class Layout): Declare symtab_section_shndx.
5346 * output.cc (Output_section::write_header): Call it.
5347
5348 2011-06-29 Ian Lance Taylor <iant@google.com>
5349
5350 PR gold/12818
5351 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5352 symbols which are not used in a relocation.
5353
5354 2011-06-28 Ian Lance Taylor <iant@google.com>
5355
5356 PR gold/12898
5357 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5358 script create indistinguishable segments.
5359 (Layout::set_segment_offsets): Use stable_sort when sorting
5360 segments. Pass this to Compare_segments constructor.
5361 * layout.h (class Layout): Make segment_precedes non-static.
5362 (class Compare_segments): Change from struct to class. Add
5363 layout_ field. Add constructor.
5364 * script-sections.cc
5365 (Script_sections::attach_sections_using_phdrs_clause): Rename
5366 local orphan to is_orphan. Don't report failure to put empty
5367 section in segment. On attachment failure, report name of
5368 section, and attach to first PT_LOAD segment.
5369
5370 2011-06-28 Ian Lance Taylor <iant@google.com>
5371
5372 PR gold/12934
5373 * target-select.cc (Target_selector::Target_selector): Add
5374 emulation parameter. Change all callers.
5375 (select_target_by_bfd_name): Rename from select_target_by_name.
5376 Change all callers.
5377 (select_target_by_emulation): New function.
5378 (supported_emulation_names): New function.
5379 * target-select.h (class Target_selector): Add emulation_ field.
5380 Update declarations.
5381 (Target_selector::recognize_by_bfd_name): Rename from
5382 recognize_by_name. Change all callers.
5383 (Target_selector::supported_bfd_names): Rename from
5384 supported_names. Change all callers.
5385 (Target_selector::recognize_by_emulation): New function.
5386 (Target_selector::supported_emulations): New function.
5387 (Target_selector::emulation): New function.
5388 (Target_selector::do_recognize_by_bfd_name): Rename from
5389 do_recognize_by_name. Change all callers.
5390 (Target_selector::do_supported_bfd_names): Rename from
5391 do_supported_names. Change all callers.
5392 (Target_selector::do_recognize_by_emulation): New function.
5393 (Target_selector::do_supported_emulations): New function.
5394 (select_target_by_bfd_name): Change name in declaration.
5395 (select_target_by_emulation): Declare.
5396 (supported_emulation_names): Declare.
5397 * parameters.cc (parameters_force_valid_target): Try to find
5398 target based on emulation from -m option.
5399 * options.h (class General_options): Change doc string for -m.
5400 * options.cc (help): Print emulations.
5401 (General_options::parse_V): Likewise.
5402 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5403 Add emulation parameter. Change all callers.
5404
5405 2011-06-28 Ian Lance Taylor <iant@google.com>
5406
5407 * target.h (class Target): Add osabi_ field.
5408 (Target::osabi): New function.
5409 (Target::set_osabi): New function.
5410 (Target::Target): Initialize osabi_.
5411 (Target::do_adjust_elf_header): Make pure virtual.
5412 (Sized_target::do_adjust_elf_header): Declare.
5413 * target.cc (Sized_target::do_adjust_elf_header): New function.
5414 (class Sized_target): Instantiate all versions.
5415 * freebsd.h (class Target_freebsd): Remove.
5416 (Target_selector_freebsd::do_recognize): Call set_osabi on
5417 Target.
5418 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5419 (Target_selector_freebsd::set_osabi): Remove.
5420 * i386.cc (class Target_i386): Inherit from Sized_target rather
5421 than Target_freebsd.
5422 * x86_64.cc (class Target_x86_64): Likewise.
5423
5424 2011-06-28 Ian Lance Taylor <iant@google.com>
5425
5426 * target.h (Target::can_check_for_function_pointers): Rewrite.
5427 Make non-virtual.
5428 (Target::can_icf_inline_merge_sections): Likewise.
5429 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5430 (Target::Target_info): Add can_icf_inline_merge_sections field.
5431 (Target::do_can_check_for_function_pointers): New virtual
5432 function.
5433 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5434 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5435 from can_check_for_function_pointers, move in file.
5436 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5437 section_may_have_icf_unsafe_poineters, move in file.
5438 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5439 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5440 Rename from can_check_for_function_pointers, move in file.
5441 (Target_i386::can_icf_inline_merge_sections): Remove.
5442 (Target_i386::i386_info): Initialize
5443 can_icf_inline_merge_sections.
5444 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5445 Initialize can_icf_inline_merge_sections.
5446 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5447 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5448 Rename from can_check_for_function_pointers, move in file.
5449 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5450 (Target_x86_64::x86_64_info): Initialize
5451 can_icf_inline_merge_sections.
5452 * testsuite/testfile.cc (Target_test::test_target_info):
5453 Likewise.
5454 * icf.cc (get_section_contents): Correct formatting.
5455
5456 2011-06-27 Ian Lance Taylor <iant@google.com>
5457
5458 * symtab.cc (Symbol::versioned_name): New function.
5459 (Symbol_table::add_to_final_symtab): Use versioned_name when
5460 appropriate.
5461 (Symbol_table::sized_write_symbol): Likewise.
5462 * symtab.h (class Symbol): Declare versioned_name.
5463 * stringpool.h (class Stringpool_template): Add variant of add
5464 which takes a std::basic_string.
5465 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5466 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5467 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5468 (ver_test_12.o): New target.
5469 * testsuite/Makefile.in: Rebuild.
5470
5471 2011-06-27 Doug Kwan <dougkwan@google.com>
5472
5473 * arm.cc (Arm_relocate_functions::thm_jump8,
5474 Arm_relocate_functions::thm_jump11): Use a wider signed
5475 type to compute offset.
5476 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5477 arm_thm_jump8.
5478 * testsuite/Makefile.in: Regenerate.
5479 * testsuite/arm_branch_in_range.sh: Check test results of
5480 arm_thm_jump11 and arm_thm_jump8.
5481 * testsuite/arm_thm_jump11.s: New test source file.
5482 * testsuite/arm_thm_jump11.t: New linker script.
5483 * testsuite/arm_thm_jump8.s: New test source file.
5484 * testsuite/arm_thm_jump8.t: New linker script.
5485
5486 2011-06-24 Ian Lance Taylor <iant@google.com>
5487
5488 * layout.cc: Include "object.h".
5489 (ctors_sections_in_init_array): New static variable.
5490 (Layout::is_ctors_in_init_array): New function.
5491 (Layout::layout): Add entry to ctors_sections_in_init_array if
5492 appropriate.
5493 * layout.h (class Layout): Declare is_ctors_in_init_array.
5494 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5495 is_ctors_reverse_view is set.
5496 (Sized_relobj_file::write_sections): Add layout parameter. Change
5497 all callers. Set is_ctors_reverse_view field of View_size.
5498 (Sized_relobj_file::reverse_words): New function.
5499 * object.h (Sized_relobj_file::View_size): Add
5500 is_ctors_reverse_view field.
5501 (class Sized_relobj_file): Update declarations.
5502 * testsuite/initpri3.c: New test.
5503 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5504 initpri3b.
5505 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5506 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5507 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5508 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5509 * testsuite/Makefile.in: Rebuild.
5510
5511 2011-06-24 Cary Coutant <ccoutant@google.com>
5512
5513 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5514 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5515 (debug_msg_cdebug.err): New targets.
5516 * testsuite/Makefile.in: Regenerate.
5517 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5518 Fix checks for link with shared library.
5519
5520 2011-06-24 Doug Kwan <dougkwan@google.com>
5521
5522 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5523 skip empty text sections.
5524 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5525
5526 2011-06-22 Ian Lance Taylor <iant@google.com>
5527
5528 PR gold/12910
5529 * options.h (class General_options): Add --ctors-in-init-array.
5530 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5531 friends as SHT_PROGBITS for merging sections.
5532 (Layout::layout): Remove special handling of .init_array and
5533 friends. Don't sort if doing relocatable link. Sort for .ctors
5534 and .dtors if ctors_in_init_array.
5535 (Layout::make_output_section): Force correct section types for
5536 .init_array and friends. Don't sort if doing relocatable link,
5537 Don't sort .ctors and .dtors if ctors_in_init_array.
5538 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5539 (Layout::output_section_name): Add relobj parameter. Change all
5540 callers. Handle .ctors. and .dtors. in code rather than table.
5541 Handle .ctors and .dtors if ctors_in_init_array.
5542 (Layout::match_file_name): New function, moved from output.cc.
5543 * layout.h (class Layout): Update declarations.
5544 * output.cc: Include "layout.h".
5545 (Input_section_sort_entry::get_priority): New function.
5546 (Input_section_sort_entry::match_file_name): Just call
5547 Layout::match_file_name.
5548 (Output_section::Input_section_sort_init_fini_compare::operator()):
5549 Handle .ctors and .dtors. Sort by explicit priority rather than
5550 by name.
5551 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5552 * testsuite/initpri2.c: New test.
5553 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5554 (check_PROGRAMS): Add initpri2.
5555 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5556 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5557 * configure, testsuite/Makefile.in: Rebuild.
5558
5559 2011-06-19 Ian Lance Taylor <iant@google.com>
5560
5561 PR gold/12880
5562 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5563 .interp section to a PT_INTERP segment even if we have seen a
5564 --dynamic-linker option. Don't do it if we have seen a PHDRS
5565 clause in a linker script.
5566 (Layout::finalize): Don't create a .interp section if we've
5567 already create a PT_INTERP segment.
5568 (Layout::create_interp): Always call choose_output_section (revert
5569 patch of 2011-06-17). Don't create PT_INTERP segment.
5570 * script-sections.cc
5571 (Script_sections::create_note_and_tls_segments): Add a .interp
5572 section to a PT_INTERP segment even if we have seen a
5573 --dynamic-linker option.
5574
5575 2011-06-18 Ian Lance Taylor <iant@google.com>
5576
5577 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5578 merely because a non-PT_LOAD segment has a dynamic reloc.
5579
5580 2011-06-18 Ian Lance Taylor <iant@google.com>
5581
5582 * layout.cc (Layout::finish_dynamic_section): Don't create
5583 DT_FLAGS entry if not needed.
5584
5585 2011-06-18 Ian Lance Taylor <iant@google.com>
5586
5587 PR gold/12745
5588 * layout.cc (Layout::layout_eh_frame): Correct handling of
5589 writable .eh_frame section.
5590
5591 2011-06-17 Ian Lance Taylor <iant@google.com>
5592
5593 PR gold/12893
5594 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5595 symbol is redefined with the exact same object and value.
5596
5597 2011-06-17 Ian Lance Taylor <iant@google.com>
5598
5599 PR gold/12880
5600 * layout.h (class Layout): Add interp_segment_ field.
5601 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5602 (Layout::attach_allocated_section_to_segment): If making shared
5603 library, put .interp section in PT_INTERP segment.
5604 (Layout::finalize): Also call create_interp if -dynamic-linker
5605 option was used.
5606 (Layout::create_interp): Assert that there is no PT_INTERP
5607 segment. If not using a SECTIONS clause, use make_output_section.
5608 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5609 * script-sections.cc
5610 (Script_sections::create_note_and_tls_segments): If making shared
5611 library, put .interp section in PT_INTERP segment.
5612
5613 2011-06-17 Ian Lance Taylor <iant@google.com>
5614
5615 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5616 when making a shared library.
5617
5618 2011-06-17 Ian Lance Taylor <iant@google.com>
5619
5620 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5621 parameter. Change all callers. Don't issue warning about PC32
5622 against locally defined symbol.
5623
5624 2011-06-16 Ian Lance Taylor <iant@google.com>
5625
5626 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5627 occurs in same object.
5628
5629 2011-06-14 Alan Modra <amodra@gmail.com>
5630
5631 * po/POTFILES.in: Regenerate.
5632
5633 2011-06-09 Ian Lance Taylor <iant@google.com>
5634
5635 * script-sections.cc
5636 (Orphan_output_section::set_section_addresses): For a relocatable
5637 link set address to 0.
5638
5639 2011-06-09 Cary Coutant <ccoutant@google.com>
5640
5641 PR gold/12804
5642 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5643 used with --compress-debug-sections.
5644 * gold/object.cc (Sized_relobj_file::do_layout): Report
5645 uncompressed size of compressed input sections.
5646
5647 2011-06-08 Cary Coutant <ccoutant@google.com>
5648
5649 PR gold/12804
5650 * testsuite/two_file_test_2_v1.cc: Change initialization of
5651 v2 to keep it in .data.
5652
5653 2011-06-07 Cary Coutant <ccoutant@google.com>
5654
5655 * common.cc (Symbol_table::do_allocate_commons_list): Call
5656 gold_fallback.
5657 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5658 (Errors::fallback): New function.
5659 (gold_fallback): New function.
5660 * errors.h (Errors::fallback): New function.
5661 * gold.cc (gold_exit): Change status parameter to enum; adjust
5662 all callers.
5663 (queue_initial_tasks): Call gold_fallback.
5664 * gold.h: Include cstdlib.
5665 (Exit_status): New enum type.
5666 (gold_exit): Change status parameter to enum.
5667 (gold_fallback): New function.
5668 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5669 (Layout::create_symtab_sections): Likewise.
5670 (Layout::create_shdrs): Likewise.
5671 * main.cc (main): Adjust call to gold_exit.
5672 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5673 (Output_data_got::add_got_entry_pair): Likewise.
5674 (Output_section::add_input_section): Likewise.
5675 (Output_section::add_output_section_data): Likewise.
5676 (Output_segment::set_section_list_addresses): Likewise.
5677 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5678
5679 2011-06-07 Cary Coutant <ccoutant@google.com>
5680
5681 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5682 for incremental links.
5683 * output.cc (Output_segment::set_section_list_addresses): Remove
5684 FIXME and test for TLS or BSS.
5685
5686 2011-06-07 Cary Coutant <ccoutant@google.com>
5687
5688 * testsuite/Makefile.am: Add incremental_copy_test,
5689 incremental_common_test_1.
5690 * testsuite/Makefile.in: Regenerate.
5691 * testsuite/common_test_1_v1.c: New source file.
5692 * testsuite/common_test_1_v2.c: New source file.
5693 * testsuite/copy_test_v1.cc: New source file.
5694
5695 2011-06-07 Cary Coutant <ccoutant@google.com>
5696
5697 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5698 update, allocate common from bss section's free list.
5699 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5700 linker-defined symbols.
5701 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5702 Skip GOT and PLT entries that are no longer referenced.
5703 (Output_section_incremental_inputs::write_info_blocks): Mark
5704 linker-defined symbols.
5705 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5706 * output.cc (Output_section::allocate): New function.
5707 * output.h (Output_section::allocate): New function.
5708 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5709 linker-defined symbols.
5710 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5711 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5712 (Symbol::init_base_output_data): Likewise.
5713 (Symbol::init_base_output_segment): Likewise.
5714 (Symbol::init_base_constant): Likewise.
5715 (Sized_symbol::init_output_data): Likewise.
5716 (Sized_symbol::init_output_segment): Likewise.
5717 (Sized_symbol::init_constant): Likewise.
5718 (Symbol_table::do_define_in_output_data): Likewise.
5719 (Symbol_table::do_define_in_output_segment): Likewise.
5720 (Symbol_table::do_define_as_constant): Likewise.
5721 * symtab.h (Symbol::is_predefined): New function.
5722 (Symbol::init_base_output_data): Add is_predefined parameter.
5723 (Symbol::init_base_output_segment): Likewise.
5724 (Symbol::init_base_constant): Likewise.
5725 (Symbol::is_predefined_): New data member.
5726 (Sized_symbol::init_output_data): Add is_predefined parameter.
5727 (Sized_symbol::init_output_segment): Likewise.
5728 (Sized_symbol::init_constant): Likewise.
5729 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5730
5731 2011-06-07 Cary Coutant <ccoutant@google.com>
5732
5733 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5734 instead of emit_copy_reloc.
5735 (Copy_relocs::emit_copy_reloc): Refactor.
5736 (Copy_relocs::make_copy_reloc): New function.
5737 (Copy_relocs::add_copy_reloc): Remove.
5738 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5739 section.
5740 (Copy_relocs::make_copy_reloc): New function.
5741 (Copy_relocs::add_copy_reloc): Remove.
5742 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5743 unchanged input files.
5744 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5745 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5746 Reserve BSS space for COPY relocations.
5747 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5748 (Output_section_incremental_inputs::write_info_blocks): Record
5749 whether a symbol is copied from a shared object.
5750 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5751 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5752 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5753 (Incremental_input_entry_reader::get_output_symbol_index): Add
5754 is_copy parameter.
5755 (Incremental_binary::emit_copy_relocs): New function.
5756 (Incremental_binary::do_emit_copy_relocs): New function.
5757 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5758 new data member.
5759 (Sized_incremental_binary::add_copy_reloc): New function.
5760 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5761 (Sized_incremental_binary::Copy_reloc): New struct.
5762 (Sized_incremental_binary::Copy_relocs): New typedef.
5763 (Sized_incremental_binary::copy_relocs_): New data member.
5764 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5765 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5766 * target.h (Sized_target::emit_copy_reloc): New function.
5767 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5768
5769 2011-06-02 Cary Coutant <ccoutant@google.com>
5770
5771 PR gold/12163
5772 * gold/archive.cc (Archive::Archive): Initialize new data member.
5773 (Archive::include_all_members): Return if archive has already been
5774 included.
5775 * gold/archive.h (Archive::include_all_members_): New data member.
5776
5777 2011-06-02 Nick Clifton <nickc@redhat.com>
5778
5779 * dynobj.h: Fix spelling mistake in comment.
5780 * output.cc: Likewise.
5781
5782 2011-05-31 Doug Kwan <dougkwan@google.com>
5783 Asier Llano
5784
5785 PR gold/12826
5786 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5787 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5788 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5789 redundant arm_exidx_test.so.
5790 * testsuite/Makefile.in: Regenerate.
5791 (check_SCRIPTS): Add pr12826.sh
5792 (check_DATA): Add pr12826.stdout
5793 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5794 * testsuite/pr12826.sh: New file.
5795 * testsuite/pr12826_1.s: Ditto.
5796 * testsuite/pr12826_1.s: Ditto.
5797
5798 2011-05-30 Ian Lance Taylor <iant@google.com>
5799
5800 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5801 sections.
5802
5803 2011-05-29 Ian Lance Taylor <iant@google.com>
5804
5805 PR gold/12804
5806 * testsuite/Makefile.am: Use different file name for two_file_test
5807 temporary file for each incremental test.
5808 * testsuite/Makefile.in: Rebuild.
5809
5810 2011-05-29 Ian Lance Taylor <iant@google.com>
5811
5812 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5813 binary input file is empty.
5814
5815 2011-05-27 Ian Lance Taylor <iant@google.com>
5816
5817 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5818 (ver_test_9.so): Likewise.
5819 * testsuite/Makefile.in: Rebuild.
5820
5821 2011-05-26 Cary Coutant <ccoutant@google.com>
5822
5823 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5824 * incremental.cc (Incremental_inputs::report_input_section): Fix
5825 comment, indentation.
5826 (Incremental_inputs::report_comdat_group): New function.
5827 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5828 of data for incremental input file entry.
5829 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5830 group count, COMDAT group signatures.
5831 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5832 an unchanged input file.
5833 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5834 Initialize new data member.
5835 (Incremental_object_entry::add_comdat_group): New function.
5836 (Incremental_object_entry::get_comdat_group_count): New function.
5837 (Incremental_object_entry::get_comdat_signature_key): New function.
5838 (Incremental_object_entry::groups_): New data member.
5839 (Incremental_inputs::report_comdat_group): New function.
5840 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5841 data for incremental input file entry.
5842 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5843 (Incremental_input_entry_reader::get_input_section): Adjust size of
5844 data for incremental input file entry.
5845 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5846 (Incremental_input_entry_reader::get_comdat_group_signature): New
5847 function.
5848 * object.cc (Sized_relobj::include_section_group): Report kept
5849 COMDAT groups for incremental links.
5850
5851 2011-05-24 David Meyer <pdox@google.com>
5852
5853 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5854 with name parameter. Add found_name parameter.
5855 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5856 * dirsearch.h (class Dirsearch): Update declaration.
5857
5858 2011-05-24 Ian Lance Taylor <iant@google.com>
5859
5860 * archive.cc (Library_base::should_include_member): Pull in object
5861 from archive if it defines the entry symbol.
5862 * parameters.cc (Parameters::entry): New function.
5863 * parameters.h (class Parameters): Declare entry.
5864 * output.h (class Output_file_header): Remove entry_ field.
5865 * output.cc (Output_file_header::Output_file_header): Remove entry
5866 parameter. Change all callers.
5867 (Output_file_header::entry): Use parameters->entry.
5868 * gold.cc (queue_middle_tasks): Likewise.
5869 * plugin.cc (Plugin_hook::run): Likewise.
5870
5871 2011-05-24 Cary Coutant <ccoutant@google.com>
5872
5873 * gold.cc (queue_initial_tasks): Pass incremental base filename
5874 to Output_file::open_base_file; don't print error message.
5875 * incremental-dump.cc (main): Adjust call to
5876 Output_file::open_for_modification.
5877 * incremental-dump.cc (main): Likewise.
5878 * incremental.cc (Incremental_inputs::report_command_line):
5879 Ignore --incremental-base option when comparing command lines.
5880 Ignore parameter when given as separate argument.
5881 * options.h (class General_options): Add --incremental-base.
5882 * output.cc (Output_file::Output_file):
5883 (Output_file::open_base_file): Add base_name and writable parameters;
5884 read base file into new file; print error message here.
5885 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5886 callers.
5887 * output.h (Output_file::open_for_modification): Rename to...
5888 (Output_file::open_base_file): ...this; add base_name and
5889 writable parameters; adjust all callers.
5890 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5891 callers.
5892 * testsuite/Makefile.am (incremental_test_4): Test
5893 --incremental-base.
5894 * testsuite/Makefile.in: Regenerate.
5895
5896 2011-05-24 Cary Coutant <ccoutant@google.com>
5897
5898 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5899 incremental_test_4.
5900 * testsuite/Makefile.in: Regenerate.
5901 * testsuite/two_file_test_1_v1.cc: New test source file.
5902 * testsuite/two_file_test_1b_v1.cc: New test source file.
5903 * testsuite/two_file_test_2_v1.cc: New test source file.
5904
5905 2011-05-24 Cary Coutant <ccoutant@google.com>
5906
5907 * dynobj.h (Dynobj::do_dynobj): New function.
5908 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5909 flag and soname for shared objects.
5910 * incremental.cc (Incremental_inputs::report_object): Make
5911 either Incremental_object_entry or Incremental_dynobj_entry; add
5912 soname to string table.
5913 (Incremental_inputs::report_input_section): Add assertion.
5914 (Output_section_incremental_inputs::set_final_data_size): Adjust
5915 type of input file entry for shared libraries; adjust size of
5916 shared library info entry.
5917 (Output_section_incremental_inputs::write_input_files): Write
5918 as_needed flag for shared libraries.
5919 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5920 of input file entry for shared libraries; write soname.
5921 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5922 soname from incremental info.
5923 * incremental.h (enum Incremental_input_flags): Add
5924 INCREMENTAL_INPUT_AS_NEEDED.
5925 (Incremental_input_entry::Incremental_input_entry): Initialize new
5926 data member.
5927 (Incremental_input_entry::set_as_needed): New function.
5928 (Incremental_input_entry::as_needed): New function.
5929 (Incremental_input_entry::do_dynobj_entry): New function.
5930 (Incremental_input_entry::as_needed_): New data member.
5931 (Incremental_object_entry::Incremental_object_entry): Don't check
5932 for shared library.
5933 (Incremental_object_entry::do_type): Likewise.
5934 (class Incremental_dynobj_entry): New class.
5935 (Incremental_input_entry_reader::as_needed): New function.
5936 (Incremental_input_entry_reader::get_soname): New function.
5937 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5938 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5939 size of shared library info entry.
5940 * layout.cc (Layout::finish_dynamic_section): Don't test for
5941 incremental link when adding DT_NEEDED entries.
5942 * object.h (Object::Object): Initialize new data member.
5943 (Object::dynobj): New function.
5944 (Object::set_as_needed): New function.
5945 (Object::as_needed): New function.
5946 (Object::do_dynobj): New function.
5947 (Object::as_needed_): New data member.
5948
5949 2011-05-24 Cary Coutant <ccoutant@google.com>
5950
5951 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5952 info; adjust display of GOT entries.
5953 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5954 vector of input objects; remove file_status_.
5955 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5956 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5957 got_plt reader; call target hooks to reserve GOT entries.
5958 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5959 of input file info header and GOT info entry.
5960 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5961 relocation info.
5962 (Got_plt_view_info::got_descriptor): Remove.
5963 (Got_plt_view_info::sym_index): New data member.
5964 (Got_plt_view_info::input_index): New data member.
5965 (Local_got_offset_visitor::visit): Write input file index.
5966 (Global_got_offset_visitor::visit): Write 0 for input file index.
5967 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5968 with sym_index and input_index.
5969 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5970 incremental info GOT entry; replace got_descriptor with input_index.
5971 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5972 map from input file index to object.
5973 (Sized_relobj_incr::do_layout): Replace direct data member reference
5974 with accessor function.
5975 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5976 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5977 Adjust size of input file info header.
5978 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5979 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5980 (Incremental_input_entry_reader::get_input_section): Adjust size of
5981 input file info header.
5982 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5983 of incremental info GOT entry.
5984 (Incremental_got_plt_reader::get_got_desc): Remove.
5985 (Incremental_got_plt_reader::get_got_symndx): New function.
5986 (Incremental_got_plt_reader::get_got_input_index): New function.
5987 (Sized_incremental_binary::Sized_incremental_binary): Remove
5988 file_status_; add input_objects_.
5989 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5990 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5991 (Sized_incremental_binary::file_is_unchanged): Remove.
5992 (Sized_incremental_binary::set_input_object): New function.
5993 (Sized_incremental_binary::input_object): New function.
5994 (Sized_incremental_binary::file_status_): Remove.
5995 (Sized_incremental_binary::input_objects_): New data member.
5996 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5997 references.
5998 (Sized_relobj_incr::invalid_address): Move to base class.
5999 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6000 class.
6001 (Sized_relobj_incr::do_output_section_offset): Likewise.
6002 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6003 (Sized_relobj_incr::section_offsets_): Likewise.
6004 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6005 function.
6006 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6007 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6008 with accessor function.
6009 (Sized_relobj_file::do_layout): Likewise.
6010 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6011 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6012 (Sized_relobj_file::compute_final_local_value): Replace refs to
6013 section_offsets_ with accessor function.
6014 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6015 * object.h (Relobj::Relobj): Initialize new data members.
6016 (Relobj::add_dyn_reloc): New function.
6017 (Relobj::first_dyn_reloc): New function.
6018 (Relobj::dyn_reloc_count): New function.
6019 (Relobj::first_dyn_reloc_): New data member.
6020 (Relobj::dyn_reloc_count_): New data member.
6021 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6022 references.
6023 (Sized_relobj::Address): New typedef.
6024 (Sized_relobj::invalid_address): Move here from child class.
6025 (Sized_relobj::Sized_relobj): Initialize new data members.
6026 (Sized_relobj::sized_relobj): New function.
6027 (Sized_relobj::is_output_section_offset_invalid): Move here from
6028 child class.
6029 (Sized_relobj::get_output_section_offset): Likewise.
6030 (Sized_relobj::local_has_got_offset): Likewise.
6031 (Sized_relobj::local_got_offset): Likewise.
6032 (Sized_relobj::set_local_got_offset): Likewise.
6033 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6034 (Sized_relobj::clear_got_offsets): New function.
6035 (Sized_relobj::section_offsets): Move here from child class.
6036 (Sized_relobj::do_output_section_offset): Likewise.
6037 (Sized_relobj::do_set_section_offset): Likewise.
6038 (Sized_relobj::Local_got_offsets): Likewise.
6039 (Sized_relobj::local_got_offsets_): Likewise.
6040 (Sized_relobj::section_offsets_): Likewise.
6041 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6042 references.
6043 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6044 class.
6045 (Sized_relobj_file::sized_relobj): New function
6046 (Sized_relobj_file::local_has_got_offset): Move to base class.
6047 (Sized_relobj_file::local_got_offset): Likewise.
6048 (Sized_relobj_file::set_local_got_offset): Likewise.
6049 (Sized_relobj_file::get_output_section_offset): Likewise.
6050 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6051 (Sized_relobj_file::do_output_section_offset): Likewise.
6052 (Sized_relobj_file::do_set_section_offset): Likewise.
6053 (Sized_relobj_file::Local_got_offsets): Likewise.
6054 (Sized_relobj_file::local_got_offsets_): Likewise.
6055 (Sized_relobj_file::section_offsets_): Likewise.
6056 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6057 (all constructors).
6058 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6059 (Output_reloc::get_symbol_index): Likewise.
6060 (Output_reloc::local_section_offset): Likewise.
6061 (Output_reloc::get_address): Likewise.
6062 (Output_reloc::symbol_value): Likewise.
6063 (Output_data_got::reserve_slot): Move to class definition.
6064 (Output_data_got::reserve_local): New function.
6065 (Output_data_got::reserve_slot_for_global): Remove.
6066 (Output_data_got::reserve_global): New function.
6067 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6068 (all constructors, two instantiations).
6069 (Output_reloc::get_relobj): New function (two instantiations).
6070 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6071 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6072 (Output_data_reloc::add_global): Adjust type of relobj.
6073 (Output_data_reloc::add_global_relative): Likewise.
6074 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6075 (Output_data_reloc::add_local): Likewise.
6076 (Output_data_reloc::add_local_relative): Likewise.
6077 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6078 (Output_data_reloc::add_local_section): Likewise.
6079 (Output_data_reloc::add_output_section): Likewise.
6080 (Output_data_reloc::add_absolute): Likewise.
6081 (Output_data_reloc::add_target_specific): Likewise.
6082 (Output_data_got::reserve_slot): Move definition here.
6083 (Output_data_got::reserve_local): New function.
6084 (Output_data_got::reserve_global): New function.
6085 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6086 section_offsets_ with accessor function.
6087 (Sized_relobj_file::write_sections): Likewise.
6088 (Sized_relobj_file::do_relocate_sections): Likewise.
6089 * target.h (Sized_target::reserve_local_got_entry): New function.
6090 (Sized_target::reserve_global_got_entry): New function.
6091 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6092 (Target_x86_64::reserve_global_got_entry): New function.
6093 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6094
6095 2011-05-23 Cary Coutant <ccoutant@google.com>
6096
6097 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6098 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6099 bit when checking got_type.
6100 * incremental.cc (Sized_incremental_binary::setup_readers):
6101 Store symbol table and string table locations; initialize bit vector
6102 of file status flags.
6103 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6104 unchanged files.
6105 (Sized_incremental_binary::do_process_got_plt): New function.
6106 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6107 (Output_section_incremental_inputs::set_final_data_size): Record
6108 file index for each input file.
6109 (Output_section_incremental_inputs::write_got_plt): Store file index
6110 instead of input entry offset for each GOT entry.
6111 * incremental.h
6112 (Incremental_input_entry::Incremental_input_entry): Initialize new
6113 data member.
6114 (Incremental_input_entry::set_offset): Store file index.
6115 (Incremental_input_entry::get_file_index): New function.
6116 (Incremental_input_entry::file_index_): New data member.
6117 (Incremental_binary::process_got_plt): New function.
6118 (Incremental_binary::do_process_got_plt): New function.
6119 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6120 data members.
6121 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6122 (Sized_incremental_binary::set_file_is_unchanged): New function.
6123 (Sized_incremental_binary::file_is_unchanged): New function.
6124 (Sized_incremental_binary::do_process_got_plt): New function.
6125 (Sized_incremental_binary::file_status_): New data member.
6126 (Sized_incremental_binary::main_symtab_loc_): New data member.
6127 (Sized_incremental_binary::main_strtab_loc_): New data member.
6128 * output.cc (Output_data_got::Got_entry::write): Add case
6129 RESERVED_CODE.
6130 (Output_data_got::add_global): Call add_got_entry.
6131 (Output_data_got::add_global_plt): Likewise.
6132 (Output_data_got::add_global_with_rel): Likewise.
6133 (Output_data_got::add_global_with_rela): Likewise.
6134 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6135 (Output_data_got::add_global_pair_with_rela): Likewise.
6136 (Output_data_got::add_local): Call add_got_entry.
6137 (Output_data_got::add_local_plt): Likewise.
6138 (Output_data_got::add_local_with_rel): Likewise.
6139 (Output_data_got::add_local_with_rela): Likewise.
6140 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6141 (Output_data_got::add_local_pair_with_rela): Likewise.
6142 (Output_data_got::reserve_slot): New function.
6143 (Output_data_got::reserve_slot_for_global): New function.
6144 (Output_data_got::add_got_entry): New function.
6145 (Output_data_got::add_got_entry_pair): New function.
6146 (Output_section::add_output_section_data): Edit FIXME.
6147 * output.h
6148 (Output_section_data_build::Output_section_data_build): New
6149 constructor with size parameter.
6150 (Output_data_space::Output_data_space): Likewise.
6151 (Output_data_got::Output_data_got): Initialize new data member; new
6152 constructor with size parameter.
6153 (Output_data_got::add_constant): Call add_got_entry.
6154 (Output_data_got::reserve_slot): New function.
6155 (Output_data_got::reserve_slot_for_global): New function.
6156 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6157 (Output_data_got::add_got_entry): New function.
6158 (Output_data_got::add_got_entry_pair): New function.
6159 (Output_data_got::free_list_): New data member.
6160 * target.h (Sized_target::init_got_plt_for_update): New function.
6161 (Sized_target::register_global_plt_entry): New function.
6162 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6163 Initialize new data member; call init; add constructor with PLT count.
6164 (Output_data_plt_x86_64::init): New function.
6165 (Output_data_plt_x86_64::add_relocation): New function.
6166 (Output_data_plt_x86_64::reserve_slot): New function.
6167 (Output_data_plt_x86_64::free_list_): New data member.
6168 (Target_x86_64::init_got_plt_for_update): New function.
6169 (Target_x86_64::register_global_plt_entry): New function.
6170 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6171 incremental updates.
6172 (Output_data_plt_x86_64::add_relocation): New function.
6173 * testsuite/object_unittest.cc (Object_test): Set default options.
6174
6175 2011-05-16 Ian Lance Taylor <iant@google.com>
6176
6177 * options.h (class General_options): Make -i a synonym for -r.
6178
6179 2011-05-16 Ian Lance Taylor <iant@google.com>
6180
6181 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6182
6183 2011-05-10 Cary Coutant <ccoutant@google.com>
6184
6185 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6186 strip_all (-s).
6187
6188 2011-05-06 Ian Lance Taylor <iant@google.com>
6189
6190 * layout.cc (Layout::layout): If the output section flags change,
6191 update the ordering.
6192
6193 2011-04-25 Cary Coutant <ccoutant@google.com>
6194
6195 * incremental-dump.cc (dump_incremental_inputs): Print local
6196 symbol info for each input file.
6197 * incremental.cc
6198 (Output_section_incremental_inputs::set_final_data_size): Add local
6199 symbol info to input file entries in incremental info.
6200 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6201 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6202 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6203 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6204 implementation.
6205 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6206 (Sized_incr_relobj::do_relocate): Write the local symbols.
6207 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6208 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6209 Adjust size of input file header.
6210 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6211 (Incremental_inputs_reader::get_local_symbol_count): New function.
6212 (Incremental_inputs_reader::get_input_section): Adjust size of input
6213 file header.
6214 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6215 (Sized_incr_relobj::This): New typedef.
6216 (Sized_incr_relobj::sym_size): New const data member.
6217 (Sized_incr_relobj::Local_symbol): New struct.
6218 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6219 (Sized_incr_relobj::do_local_symbol_offset): New function.
6220 (Sized_incr_relobj::local_symbol_count_): New data member.
6221 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6222 (Sized_incr_relobj::local_symbol_index_): New data member.
6223 (Sized_incr_relobj::local_symbol_offset_): New data member.
6224 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6225 (Sized_incr_relobj::local_symbols_): New data member.
6226 * object.h (Relobj::output_local_symbol_count): New function.
6227 (Relobj::local_symbol_offset): New function.
6228 (Relobj::do_output_local_symbol_count): New function.
6229 (Relobj::do_local_symbol_offset): New function.
6230 (Sized_relobj::do_output_local_symbol_count): New function.
6231 (Sized_relobj::do_local_symbol_offset): New function.
6232
6233 2011-04-22 Vladimir Simonov <sv@sw.ru>
6234
6235 * descriptors.cc (set_close_on_exec): New function.
6236 (Descriptors::open): Use set_close_on_exec.
6237 * output.cc (S_ISLNK): Define if not defined.
6238
6239 2011-04-22 Cary Coutant <ccoutant@google.com>
6240
6241 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6242 global symbol map.
6243 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6244 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6245 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6246 relocations.
6247 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6248 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6249 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6250 * incremental.h
6251 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6252 function.
6253 (Incremental_binary::apply_incremental_relocs): New function.
6254 (Incremental_binary::do_apply_incremental_relocs): New function.
6255 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6256 data member.
6257 (Sized_incremental_binary::add_global_symbol): New function.
6258 (Sized_incremental_binary::global_symbol): New function.
6259 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6260 (Sized_incremental_binary::symbol_map_): New data member.
6261 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6262 * target.h (Sized_target::apply_relocation): New function.
6263 * target-reloc.h (apply_relocation): New function.
6264 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6265
6266 2011-04-22 Doug Kwan <dougkwan@google.com>
6267
6268 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6269 flag of a SHT_ARM_EXIDX section.
6270 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6271 * testsuite/Makefile.in: Regenerate.
6272 * testsuite/arm_exidx_test.s: New file.
6273 * testsuite/arm_exidx_test.sh: Same.
6274
6275 2011-04-20 Cary Coutant <ccoutant@google.com>
6276
6277 PR gold/12689
6278 * archive.h (Incremental_archive_entry::Archive_member):
6279 Initialize arg_serial_ (second constructor).
6280
6281 2011-04-17 Ian Lance Taylor <iant@google.com>
6282
6283 * object.cc (Relocate_info::location): Simplify location string.
6284 * errors.cc (Errors::error_at_location): Don't print program
6285 name.
6286 (Errors::warning_at_location): Likewise.
6287 (Errors::undefined_symbol): Likewise.
6288 * testsuite/debug_msg.sh: Update accordingly.
6289
6290 2011-04-14 Cary Coutant <ccoutant@google.com>
6291
6292 * gold/layout.cc (Layout::symtab_section_offset): New function.
6293 * gold/layout.h (Layout::symtab_section_offset): New function.
6294 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6295
6296 2011-04-12 Ian Lance Taylor <iant@google.com>
6297
6298 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6299 with MREMAP_MAYMOVE.
6300 * output.h (class Output_file): Add map_is_allocated_ field.
6301 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6302 not available, provide stubs. If mremap is not available, #define
6303 it to gold_mremap.
6304 (MREMAP_MAYMOVE): Define if not defined.
6305 (Output_file::Output_file): Initialize map_is_allocated_.
6306 (Output_file::resize): Check map_is_allocated_.
6307 (Output_file::map_anonymous): If mmap fails, use malloc.
6308 (Output_file::unmap): Don't do anything for an anonymous map.
6309 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6310 is not available, provide stubs.
6311 (File_read::View::~View): Use free rather than delete[].
6312 (File_read::make_view): Use malloc rather than new[]. If mmap
6313 fails, use malloc.
6314 (File_read::find_or_make_view): Use malloc rather than new[].
6315 * gold.h: Remove HAVE_REMAP code.
6316 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6317 exists. Rename mremap to gold_mremap. If mmap is not available
6318 don't do anything.
6319 * configure, config.in: Rebuild.
6320
6321 2011-04-11 Ian Lance Taylor <iant@google.com>
6322
6323 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6324 initialize local variable v.
6325
6326 2011-04-11 Cary Coutant <ccoutant@google.com>
6327
6328 * archive.cc (Archive::include_member): Adjust call to
6329 report_object.
6330 (Add_archive_symbols::run): Track argument serial numbers.
6331 (Lib_group::include_member): Likewise.
6332 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6333 * archive.h (Incremental_archive_entry::Archive_member):
6334 Initialize arg_serial_.
6335 (Archive_member::arg_serial_): New data member.
6336 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6337 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6338 incremental link.
6339 (Sized_dynobj::do_for_all_local_got_entries): New function.
6340 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6341 function.
6342 * fileread.cc (get_mtime): New function.
6343 * fileread.h (get_mtime): New function.
6344 * gold.cc (queue_initial_tasks): Check for incremental update.
6345 (process_incremental_input): New function.
6346 (queue_middle_tasks): Don't force valid target for incremental
6347 update.
6348 * incremental-dump.cc (find_input_containing_global): Adjust
6349 size of symbol info entry.
6350 (dump_incremental_inputs): Dump argument serial number and
6351 in_system_directory flag; bias shndx by 1; print symbol names
6352 when dumping per-file symbol lists; use new symbol info readers.
6353 * incremental.cc
6354 (Output_section_incremental_inputs:update_data_size): New function.
6355 (Sized_incremental_binary::setup_readers): Setup input readers
6356 for each input file; build maps for files added from libraries
6357 and scripts.
6358 (Sized_incremental_binary::check_input_args): New function.
6359 (Sized_incremental_binary::do_check_inputs): Build map of argument
6360 serial numbers to input arguments.
6361 (Sized_incremental_binary::do_file_has_changed): Rename
6362 do_file_is_unchanged to this; compare file modification times.
6363 (Sized_incremental_binary::do_init_layout): New function.
6364 (Sized_incremental_binary::do_reserve_layout): New function.
6365 (Sized_incremental_binary::do_get_input_reader): Remove.
6366 (Sized_incremental_binary::get_symtab_view): New function.
6367 (Incremental_checker::can_incrementally_link_output_file): Remove.
6368 (Incremental_inputs::report_command_line): Exclude --debug options.
6369 (Incremental_inputs::report_archive_begin): Add parameter; track
6370 argument serial numbers; don't put input file entry for archive
6371 before archive members.
6372 (Incremental_inputs::report_archive_end): Put input file entry
6373 for archive after archive members.
6374 (Incremental_inputs::report_object): Add parameter; track argument
6375 serial numbers and in_system_directory flag.
6376 (Incremental_inputs::report_script): Add parameter; track argument
6377 serial numbers.
6378 (Output_section_incremental_inputs::set_final_data_size): Adjust
6379 size of symbol info entry; check for forwarding symbols.
6380 (Output_section_incremental_inputs::write_input_files): Write
6381 in_system_directory flag and argument serial number.
6382 (Output_section_incremental_inputs::write_info_blocks): Map section
6383 indices between incremental info and original input file; store
6384 input section index for each symbol.
6385 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6386 change operator() to visit().
6387 (class Global_got_offset_visitor): Likewise.
6388 (class Global_symbol_visitor_got_plt):
6389 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6390 classes.
6391 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6392 (Sized_incr_relobj::do_read_symbols): New function.
6393 (Sized_incr_relobj::do_layout): New function.
6394 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6395 (Sized_incr_relobj::do_add_symbols): New function.
6396 (Sized_incr_relobj::do_should_include_member): New function.
6397 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6398 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6399 (Sized_incr_relobj::do_section_size): New function.
6400 (Sized_incr_relobj::do_section_name): New function.
6401 (Sized_incr_relobj::do_section_contents): New function.
6402 (Sized_incr_relobj::do_section_flags): New function.
6403 (Sized_incr_relobj::do_section_entsize): New function.
6404 (Sized_incr_relobj::do_section_address): New function.
6405 (Sized_incr_relobj::do_section_type): New function.
6406 (Sized_incr_relobj::do_section_link): New function.
6407 (Sized_incr_relobj::do_section_info): New function.
6408 (Sized_incr_relobj::do_section_addralign): New function.
6409 (Sized_incr_relobj::do_initialize_xindex): New function.
6410 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6411 (Sized_incr_relobj::do_read_relocs): New function.
6412 (Sized_incr_relobj::do_gc_process_relocs): New function.
6413 (Sized_incr_relobj::do_scan_relocs): New function.
6414 (Sized_incr_relobj::do_count_local_symbols): New function.
6415 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6416 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6417 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6418 (Sized_incr_relobj::do_relocate): New function.
6419 (Sized_incr_relobj::do_set_section_offset): New function.
6420 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6421 (Sized_incr_dynobj::do_read_symbols): New function.
6422 (Sized_incr_dynobj::do_layout): New function.
6423 (Sized_incr_dynobj::do_add_symbols): New function.
6424 (Sized_incr_dynobj::do_should_include_member): New function.
6425 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6426 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6427 (Sized_incr_dynobj::do_section_size): New function.
6428 (Sized_incr_dynobj::do_section_name): New function.
6429 (Sized_incr_dynobj::do_section_contents): New function.
6430 (Sized_incr_dynobj::do_section_flags): New function.
6431 (Sized_incr_dynobj::do_section_entsize): New function.
6432 (Sized_incr_dynobj::do_section_address): New function.
6433 (Sized_incr_dynobj::do_section_type): New function.
6434 (Sized_incr_dynobj::do_section_link): New function.
6435 (Sized_incr_dynobj::do_section_info): New function.
6436 (Sized_incr_dynobj::do_section_addralign): New function.
6437 (Sized_incr_dynobj::do_initialize_xindex): New function.
6438 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6439 (make_sized_incremental_object): New function.
6440 (Incremental_library::copy_unused_symbols): New function.
6441 (Incremental_library::do_for_all_unused_symbols): New function.
6442 * incremental.h (enum Incremental_input_flags): New type.
6443 (class Incremental_checker): Remove.
6444 (Incremental_input_entry::Incremental_input_entry): Add argument
6445 serial number.
6446 (Incremental_input_entry::arg_serial): New function.
6447 (Incremental_input_entry::set_is_in_system_directory): New function.
6448 (Incremental_input_entry::is_in_system_directory): New function.
6449 (Incremental_input_entry::arg_serial_): New data member.
6450 (Incremental_input_entry::is_in_system_directory_): New data member.
6451 (class Script_info): Move here from script.h.
6452 (Script_info::Script_info): Add filename parameter.
6453 (Script_info::filename): New function.
6454 (Script_info::filename_): New data member.
6455 (Incremental_script_entry::Incremental_script_entry): Add argument
6456 serial number.
6457 (Incremental_object_entry::Incremental_object_entry): Likewise.
6458 (Incremental_object_entry::add_input_section): Build list of input
6459 sections with map to original shndx.
6460 (Incremental_object_entry::get_input_section_index): New function.
6461 (Incremental_object_entry::shndx_): New data member.
6462 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6463 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6464 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6465 serial number.
6466 (Incremental_inputs::report_archive_begin): Likewise.
6467 (Incremental_inputs::report_object): Likewise.
6468 (Incremental_inputs::report_script): Likewise.
6469 (class Incremental_global_symbol_reader): New class.
6470 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6471 and store flags and input file type.
6472 (Incremental_input_entry_reader::arg_serial): New function.
6473 (Incremental_input_entry_reader::type): Extract type from flags.
6474 (Incremental_input_entry_reader::is_in_system_directory): New function.
6475 (Incremental_input_entry_reader::get_input_section_count): Call
6476 accessor function for type.
6477 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6478 function for type; adjust size of global symbol entry.
6479 (Incremental_input_entry_reader::get_global_symbol_count): Call
6480 accessor function for type.
6481 (Incremental_input_entry_reader::get_object_count): Likewise.
6482 (Incremental_input_entry_reader::get_object_offset): Likewise.
6483 (Incremental_input_entry_reader::get_member_count): Likewise.
6484 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6485 (Incremental_input_entry_reader::get_member_offset): Likewise.
6486 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6487 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6488 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6489 (Incremental_input_entry_reader::get_global_symbol_reader): New
6490 function.
6491 (Incremental_input_entry_reader::get_output_symbol_index): New
6492 function.
6493 (Incremental_input_entry_reader::type_): Remove.
6494 (Incremental_input_entry_reader::flags_): New data member.
6495 (Incremental_inputs_reader::input_file_offset): New function.
6496 (Incremental_inputs_reader::input_file_index): New function.
6497 (Incremental_inputs_reader::input_file): Call input_file_offset.
6498 (Incremental_inputs_reader::input_file_at_offset): New function.
6499 (Incremental_relocs_reader::get_r_type): Reformat.
6500 (Incremental_relocs_reader::get_r_shndx): Reformat.
6501 (Incremental_relocs_reader::get_r_offset): Reformat.
6502 (Incremental_relocs_reader::data): New function.
6503 (Incremental_binary::Incremental_binary): Initialize new data members.
6504 (Incremental_binary::check_inputs): Add cmdline parameter.
6505 (Incremental_binary::file_is_unchanged): Remove.
6506 (Input_reader::arg_serial): New function.
6507 (Input_reader::get_unused_symbol_count): New function.
6508 (Input_reader::get_unused_symbol): New function.
6509 (Input_reader::do_arg_serial): New function.
6510 (Input_reader::do_get_unused_symbol_count): New function.
6511 (Input_reader::do_get_unused_symbol): New function.
6512 (Incremental_binary::input_file_count): New function.
6513 (Incremental_binary::get_input_reader): Change signature to use
6514 index instead of filename.
6515 (Incremental_binary::file_has_changed): New function.
6516 (Incremental_binary::get_input_argument): New function.
6517 (Incremental_binary::get_library): New function.
6518 (Incremental_binary::get_script_info): New function.
6519 (Incremental_binary::init_layout): New function.
6520 (Incremental_binary::reserve_layout): New function.
6521 (Incremental_binary::output_file): New function.
6522 (Incremental_binary::do_check_inputs): New function.
6523 (Incremental_binary::do_file_is_unchanged): Remove.
6524 (Incremental_binary::do_file_has_changed): New function.
6525 (Incremental_binary::do_init_layout): New function.
6526 (Incremental_binary::do_reserve_layout): New function.
6527 (Incremental_binary::do_input_file_count): New function.
6528 (Incremental_binary::do_get_input_reader): Change signature.
6529 (Incremental_binary::input_args_map_): New data member.
6530 (Incremental_binary::library_map_): New data member.
6531 (Incremental_binary::script_map_): New data member.
6532 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6533 new data members.
6534 (Sized_incremental_binary::output_section): New function.
6535 (Sized_incremental_binary::inputs_reader): Add const.
6536 (Sized_incremental_binary::symtab_reader): Add const.
6537 (Sized_incremental_binary::relocs_reader): Add const.
6538 (Sized_incremental_binary::got_plt_reader): Add const.
6539 (Sized_incremental_binary::get_symtab_view): New function.
6540 (Sized_incremental_binary::Inputs_reader): New typedef.
6541 (Sized_incremental_binary::Input_entry_reader): New typedef.
6542 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6543 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6544 (Sized_incremental_binary::do_file_has_changed): New function.
6545 (Sized_incremental_binary::do_init_layout): New function.
6546 (Sized_incremental_binary::do_reserve_layout): New function.
6547 (Sized_input_reader::Inputs_reader): Remove.
6548 (Sized_input_reader::Input_entry_reader): Remove.
6549 (Sized_input_reader::do_arg_serial): New function.
6550 (Sized_input_reader::do_get_unused_symbol_count): New function.
6551 (Sized_input_reader::do_get_unused_symbol): New function.
6552 (Sized_incremental_binary::do_input_file_count): New function.
6553 (Sized_incremental_binary::do_get_input_reader): Change signature;
6554 use index instead of filename.
6555 (Sized_incremental_binary::section_map_): New data member.
6556 (Sized_incremental_binary::input_entry_readers_): New data member.
6557 (class Sized_incr_relobj): New class.
6558 (class Sized_incr_dynobj): New class.
6559 (make_sized_incremental_object): New function.
6560 (class Incremental_library): New class.
6561 * layout.cc (Free_list::num_lists): New static data member.
6562 (Free_list::num_nodes): New static data member.
6563 (Free_list::num_removes): New static data member.
6564 (Free_list::num_remove_visits): New static data member.
6565 (Free_list::num_allocates): New static data member.
6566 (Free_list::num_allocate_visits): New static data member.
6567 (Free_list::init): New function.
6568 (Free_list::remove): New function.
6569 (Free_list::allocate): New function.
6570 (Free_list::dump): New function.
6571 (Free_list::print_stats): New function.
6572 (Layout_task_runner::run): Resize output file for incremental updates.
6573 (Layout::Layout): Initialize new data members.
6574 (Layout::set_incremental_base): New function.
6575 (Layout::init_fixed_output_section): New function.
6576 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6577 incremental updates.
6578 (Layout::create_gold_note): Do not create gold note section for
6579 incremental updates.
6580 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6581 for incremental updates.
6582 (Layout::set_section_offsets): For incremental updates, allocate space
6583 from free list.
6584 (Layout::create_symtab_sections): Layout with offsets relative to
6585 start of section; for incremental updates, allocate space from free
6586 list.
6587 (Layout::create_shdrs): For incremental updates, allocate space from
6588 free list.
6589 (Layout::finish_dynamic_section): For incremental updates, do not
6590 check --as-needed (fixed in subsequent patch).
6591 * layout.h (class Free_list): New class.
6592 (Layout::set_incremental_base): New function.
6593 (Layout::incremental_base): New function.
6594 (Layout::init_fixed_output_section): New function.
6595 (Layout::allocate): New function.
6596 (Layout::incremental_base_): New data member.
6597 (Layout::free_list_): New data member.
6598 * main.cc (main): Print Free_list statistics.
6599 * object.cc (Relobj::finalize_incremental_relocs): Add
6600 clear_counts parameter; clear counts only when clear_counts is set.
6601 (Sized_relobj::Sized_relobj): Initialize new base class.
6602 (Sized_relobj::do_layout): Don't report special sections.
6603 (Sized_relobj::do_for_all_local_got_entries): New function.
6604 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6605 symtab_off to all symbol table offsets.
6606 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6607 * object.h (class Got_offset_list): Move to top of file.
6608 (Object::Object): Allow case where input_file == NULL.
6609 (Object::~Object): Likewise.
6610 (Object::input_file): Assert that input_file != NULL.
6611 (Object::lock): Allow case where input_file == NULL.
6612 (Object::unlock): Likewise.
6613 (Object::is_locked): Likewise.
6614 (Object::token): Likewise.
6615 (Object::release): Likewise.
6616 (Object::is_incremental): New function.
6617 (Object::get_mtime): New function.
6618 (Object::for_all_local_got_entries): New function.
6619 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6620 (Object::set_is_in_system_directory): New function.
6621 (Object::is_in_system_directory): New function.
6622 (Object::do_is_incremental): New function.
6623 (Object::do_get_mtime): New function.
6624 (Object::do_for_all_local_got_entries): New function.
6625 (Object::is_in_system_directory_): New data member.
6626 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6627 (class Sized_relobj_base): New class.
6628 (class Sized_relobj): Derive from Sized_relobj_base.
6629 (class Sized_relobj::Symbols): Redeclare from base class.
6630 (class Sized_relobj::local_got_offset_list): Remove.
6631 (class Sized_relobj::Output_sections): Redeclare from base class.
6632 (class Sized_relobj::do_for_all_local_got_entries): New function.
6633 (class Sized_relobj::write_local_symbols): Add offset parameter.
6634 (class Sized_relobj::local_symbol_offset_): Update comment.
6635 (class Sized_relobj::local_dynsym_offset_): Update comment.
6636 * options.cc (Input_arguments::add_file): Remove const.
6637 * options.h (Input_file_argument::Input_file_argument):
6638 Initialize arg_serial_ (all constructors).
6639 (Input_file_argument::set_arg_serial): New function.
6640 (Input_file_argument::arg_serial): New function.
6641 (Input_file_argument::arg_serial_): New data member.
6642 (Input_arguments::Input_arguments): Initialize file_count_.
6643 (Input_arguments::add_file): Remove const.
6644 (Input_arguments::number_of_input_files): New function.
6645 (Input_arguments::file_count_): New data member.
6646 (Command_line::number_of_input_files): Call
6647 Input_arguments::number_of_input_files.
6648 * output.cc (Output_segment_headers::Output_segment_headers):
6649 Set current size.
6650 (Output_section::Input_section::current_data_size): New function.
6651 (Output_section::Output_section): Initialize new data members.
6652 (Output_section::add_input_section): Don't do merge sections for
6653 an incremental link; allocate space from free list for an
6654 incremental update.
6655 (Output_section::add_output_section_data): Allocate space from
6656 free list for an incremental update.
6657 (Output_section::update_data_size): New function.
6658 (Output_section::set_fixed_layout): New function.
6659 (Output_section::reserve): New function.
6660 (Output_segment::set_section_addresses): Remove const.
6661 (Output_segment::set_section_list_addresses): Remove const; allocate
6662 space from free list for an incremental update.
6663 (Output_segment::set_offset): Adjust size of RELRO segment for an
6664 incremental update.
6665 * output.h (Output_data::current_data_size): Move here from
6666 child classes.
6667 (Output_data::pre_finalize_data_size): New function.
6668 (Output_data::update_data_size): New function.
6669 (Output_section_headers::update_data_size): new function.
6670 (Output_section_data_build::current_data_size): Move to Output_data.
6671 (Output_data_strtab::update_data_size): New function.
6672 (Output_section::current_data_size): Move to Output_data.
6673 (Output_section::set_fixed_layout): New function.
6674 (Output_section::has_fixed_layout): New function.
6675 (Output_section::reserve): New function.
6676 (Output_section::update_data_size): New function.
6677 (Output_section::has_fixed_layout_): New data member.
6678 (Output_section::free_list_): New data member.
6679 (Output_segment::set_section_addresses): Remove const.
6680 (Output_segment::set_section_list_addresses): Remove const.
6681 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6682 New function.
6683 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6684 New function.
6685 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6686 parameter when calling Add_symbols constructor; store argument
6687 serial number for members of a lib group.
6688 (Add_symbols::locks): Allow case where token == NULL.
6689 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6690 (Read_member::~Read_member): New function.
6691 (Read_member::is_runnable): New function.
6692 (Read_member::locks): New function.
6693 (Read_member::run): New function.
6694 (Check_script::~Check_script): New function.
6695 (Check_script::is_runnable): New function.
6696 (Check_script::locks): New function.
6697 (Check_script::run): New function.
6698 (Check_library::~Check_library): New function.
6699 (Check_library::is_runnable): New function.
6700 (Check_library::locks): New function.
6701 (Check_library::run): New function.
6702 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6703 (Add_symbols::library_): New data member.
6704 (class Read_member): New class.
6705 (class Check_script): New class.
6706 (class Check_library): New class.
6707 * reloc.cc (Read_relocs::is_runnable): Allow case where
6708 token == NULL.
6709 (Read_relocs::locks): Likewise.
6710 (Scan_relocs::locks): Likewise.
6711 (Relocate_task::locks): Likewise.
6712 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6713 to clear counters.
6714 (Sized_relobj::incremental_relocs_scan): Fix comment.
6715 (Sized_relobj::do_relocate): Pass output file offset to
6716 write_local_symbols.
6717 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6718 from class declaration.
6719 * script.cc (read_input_script): Allocate Script_info; pass
6720 argument serial number to report_script.
6721 * script.h (class Script_info): Move to incremental.h.
6722 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6723 * symtab.h (Symbol_table::add_from_incrobj): New function.
6724 (Symbol_table::set_file_offset): New function.
6725
6726 2011-04-05 Cary Coutant <ccoutant@google.com>
6727
6728 * incremental-dump.cc (dump_incremental_inputs): Change signature
6729 to take a Sized_incremental_binary; change caller. Use readers
6730 in Sized_incremental_binary.
6731 * incremental.cc
6732 (Sized_incremental_binary::find_incremental_inputs_sections):
6733 Rename do_find_incremental_inputs_sections to this.
6734 (Sized_incremental_binary::setup_readers): New function.
6735 (Sized_incremental_binary::do_check_inputs): Check
6736 has_incremental_info_ flag; move setup code to setup_readers;
6737 use input readers.
6738 (Sized_incremental_binary::do_file_is_unchanged): New function.
6739 (Sized_incremental_binary::do_get_input_reader): New function.
6740 * incremental.h (class Incremental_binary): Move to end of file.
6741 (Incremental_binary::file_is_unchanged): New function.
6742 (Incremental_binary::do_file_is_unchanged): New function.
6743 (Incremental_binary::Input_reader): New class.
6744 (Incremental_binary::get_input_reader): New function.
6745 (class Sized_incremental_binary): Move to end of file.
6746 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6747 input section reader classes.
6748 (Sized_incremental_binary::has_incremental_info): New function.
6749 (Sized_incremental_binary::inputs_reader): New function.
6750 (Sized_incremental_binary::symtab_reader): New function.
6751 (Sized_incremental_binary::relocs_reader): New function.
6752 (Sized_incremental_binary::got_plt_reader): New function.
6753 (Sized_incremental_binary::do_file_is_unchanged): New function.
6754 (Sized_incremental_binary::Sized_input_reader): New class.
6755 (Sized_incremental_binary::get_input_reader): New function.
6756 (Sized_incremental_binary::find_incremental_inputs_sections):
6757 Rename do_find_incremental_inputs_sections to this.
6758 (Sized_incremental_binary::setup_readers): New function.
6759 (Sized_incremental_binary::has_incremental_info_): New data member.
6760 (Sized_incremental_binary::inputs_reader_): New data member.
6761 (Sized_incremental_binary::symtab_reader_): New data member.
6762 (Sized_incremental_binary::relocs_reader_): New data member.
6763 (Sized_incremental_binary::got_plt_reader_): New data member.
6764 (Sized_incremental_binary::current_input_file_): New data member.
6765
6766 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6767
6768 PR gold/12640
6769 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6770 violation.
6771
6772 2011-03-30 Cary Coutant <ccoutant@google.com>
6773
6774 * archive.cc (Archive::include_member): Adjust call to report_object.
6775 (Add_archive_symbols::run): Add script_info to call to
6776 report_archive_begin.
6777 (Lib_group::include_member): Adjust call to report_object.
6778 (Add_lib_group_symbols::run): Adjust call to report_object.
6779 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6780 blocks. Add object count for script input files.
6781 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6782 script_info parameter; change all callers.
6783 (Incremental_inputs::report_object): Add script_info parameter;
6784 change all callers.
6785 (Incremental_inputs::report_script): Store backpointer to
6786 incremental info entry.
6787 (Output_section_incremental_inputs::set_final_data_size): Record
6788 additional information for scripts.
6789 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6790 * incremental.h (Incremental_script_entry::add_object): New function.
6791 (Incremental_script_entry::get_object_count): New function.
6792 (Incremental_script_entry::get_object): New function.
6793 (Incremental_script_entry::objects_): New data member; adjust
6794 constructor.
6795 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6796 (Incremental_inputs::report_object): Add script_info parameter.
6797 (Incremental_inputs_reader::get_object_count): New function.
6798 (Incremental_inputs_reader::get_object_offset): New function.
6799 * options.cc (Input_arguments::add_file): Return reference to
6800 new input argument.
6801 * options.h (Input_argument::set_script_info): New function.
6802 (Input_argument::script_info): New function.
6803 (Input_argument::script_info_): New data member; adjust all
6804 constructors.
6805 (Input_file_group::add_file): Return reference to new input argument.
6806 (Input_file_lib::add_file): Likewise.
6807 (Input_arguments::add_file): Likewise.
6808 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6809 * script.cc (Parser_closure::Parser_closure): Add script_info
6810 parameter; adjust all callers.
6811 (Parser_closure::script_info): New function.
6812 (Parser_closure::script_info_): New data member.
6813 (read_input_script): Report scripts earlier to incremental info.
6814 (script_add_file): Set script_info in Input_argument.
6815 (script_add_library): Likewise.
6816 * script.h (Script_options::Script_info): Rewrite class.
6817
6818 2011-03-29 Cary Coutant <ccoutant@google.com>
6819
6820 * archive.cc (Library_base::should_include_member): Move
6821 method here from class Archive.
6822 (Archive::Archive): Initialize base class.
6823 (Archive::should_include_member): Move to base class.
6824 (Archive::do_for_all_unused_symbols): New function.
6825 (Add_archive_symbols::run): Remove redundant access to
6826 incremental_inputs.
6827 (Lib_group::Lib_group): Initialize base class.
6828 (Lib_group::do_filename): New function.
6829 (Lib_group::include_member): Pass pointer to Lib_group to
6830 report_object.
6831 (Lib_group::do_for_all_unused_symbols): New function.
6832 (Add_lib_group_symbols::run): Report archive information for
6833 incremental links.
6834 * archive.h (class Library_base): New base class.
6835 (class Archive): Derive from Library_base.
6836 (Archive::filename): Move to base class.
6837 (Archive::set_incremental_info): Likewise.
6838 (Archive::incremental_info): Likewise.
6839 (Archive::Should_include): Likewise.
6840 (Archive::should_include_member): Likewise.
6841 (Archive::Armap_entry): Remove.
6842 (Archive::Unused_symbol_iterator): Remove.
6843 (Archive::unused_symbols_begin): Remove.
6844 (Archive::unused_symbols_end): Remove.
6845 (Archive::do_filename): New function.
6846 (Archive::do_get_mtime): New function.
6847 (Archive::do_for_all_unused_symbols): New function.
6848 (Archive::task_): Move to base class.
6849 (Archive::incremental_info_): Likewise.
6850 (class Lib_group): Derive from Library_base.
6851 (Lib_group::do_filename): New function.
6852 (Lib_group::do_get_mtime): New function.
6853 (Lib_group::do_for_all_unused_symbols): New function.
6854 (Lib_group::task_): Move to base class.
6855 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6856 function.
6857 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6858 function.
6859 * incremental.cc (Incremental_inputs::report_archive_begin):
6860 Use Library_base; call library's get_mtime; add incremental inputs
6861 entry before members.
6862 (class Unused_symbol_visitor): New class.
6863 (Incremental_inputs::report_archive_end): Use Library_base; use
6864 visitor class to record unused symbols; don't add incremental inputs
6865 entry after members.
6866 (Incremental_inputs::report_object): Use Library_base.
6867 * incremental.h
6868 (Incremental_archive_entry::Incremental_archive_entry): Remove
6869 unused Archive parameter.
6870 (Incremental_inputs::report_archive_begin): Use Library_base.
6871 (Incremental_inputs::report_archive_end): Likewise.
6872 (Incremental_inputs::report_object): Likewise.
6873 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6874 function.
6875 * object.h (Object::for_all_global_symbols): New function.
6876 (Object::do_for_all_global_symbols): New function.
6877 (Sized_relobj::do_for_all_global_symbols): New function.
6878 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6879 function.
6880 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6881 function.
6882
6883 2011-03-27 Ian Lance Taylor <iant@google.com>
6884
6885 * archive.cc (Archive::interpret_header): Return -1 if something
6886 goes wrong. Change callers accordingly.
6887
6888 2011-03-25 Cary Coutant <ccoutant@google.com>
6889
6890 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6891 * testsuite/Makefile.in: Regenerate.
6892
6893 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6894
6895 * plugin.cc (get_view): New.
6896 (Plugin::load): Pass get_view to the plugin.
6897 (Plugin_manager::get_view): New.
6898
6899 2011-03-21 Ian Lance Taylor <iant@google.com>
6900
6901 * testsuite/final_layout.sh: Rewrite to not use dc.
6902 * testsuite/relro_test.sh: Fail if dc is not present.
6903
6904 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6905
6906 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6907 Change == to -eq.
6908 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6909 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6910 Change == to -eq.
6911 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6912 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6913
6914 2011-03-14 Ian Lance Taylor <iant@google.com>
6915
6916 * script-sections.cc (Sort_output_sections::script_compare):
6917 Rename from is_before, change return type.
6918 (Sort_output_sections::operator()): Adjust accordingly.
6919
6920 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6921
6922 PR gold/12572
6923 * testsuite/odr_violation2.cc: Add comment to make all error line
6924 numbers double digits.
6925 * testsuite/debug_msg.sh: Adjust expected errors.
6926
6927 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6928
6929 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6930 but mark earlier ones as non-canonical
6931 (offset_to_iterator): Update search target and example
6932 (do_addr2line): Return extra lines in a vector*
6933 (format_file_lineno): Extract from do_addr2line
6934 (one_addr2line): Add vector* out-param
6935 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6936 when a lineno entry appeared last for its instruction
6937 (Dwarf_line_info): Add vector* out-param
6938 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6939 * symtab.cc (Odr_violation_compare): Include the lineno in the
6940 comparison again.
6941 (linenos_from_loc): New. Combine the canonical line for an
6942 address with its other lines.
6943 (True_if_intersect): New. Helper functor to make
6944 std::set_intersection a query.
6945 (detect_odr_violations): Compare sets of lines instead of just
6946 one line for each function. This became less deterministic, but
6947 has fewer false positives.
6948 * symtab.h: Declarations.
6949 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6950 mix an optimized and non-optimized object in the same binary
6951 (odr_violation2.so): Same.
6952 * testsuite/Makefile.in: Regenerate from Makefile.am.
6953 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6954 * testsuite/debug_msg.sh: Update line numbers and add
6955 assertions.
6956 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6957 non-optimized context.
6958 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6959 isn't inlined, and use OdrDerived in an optimized context.
6960 * testsuite/odr_header1.h: Defines OdrDerived, where
6961 optimization will change the
6962 first-instruction-in-the-destructor's file and line number.
6963 * testsuite/odr_header2.h: Defines OdrBase.
6964
6965 2011-03-09 Ian Lance Taylor <iant@google.com>
6966
6967 * fileread.cc (File_read::clear_views): Don't delete the whole
6968 file view.
6969
6970 2011-03-08 Ian Lance Taylor <iant@google.com>
6971
6972 PR gold/12525
6973 * fileread.cc: #include <climits>.
6974 (GOLD_IOV_MAX): Define.
6975 (File_read::read_multiple): Limit number of entries by iov_max.
6976 * fileread.h (class File_read): Always set max_readv_entries to
6977 128.
6978
6979 2011-03-07 Ian Lance Taylor <iant@google.com>
6980
6981 PR gold/12525
6982 * options.h (class General_options): Add -dy and -dn.
6983
6984 2011-03-02 Cary Coutant <ccoutant@google.com>
6985
6986 * testsuite/script_test_9.t: Add TLS segment.
6987
6988 2011-03-02 Simon Baldwin <simonb@google.com>
6989
6990 * configure.ac: Add check for gnu_indirect_function support in
6991 the toolchain building binutils.
6992 * configure: Rebuild.
6993
6994 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6995
6996 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6997 plugin only symbols.
6998 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6999 in plugin files as not needed in the symbol table.
7000
7001 2011-02-11 Sriraman Tallam <tmsriram@google.com>
7002
7003 * output.cc (Output_section::add_input_section): Delay fill
7004 generation for section ordering.
7005
7006 2011-02-09 Ian Lance Taylor <iant@google.com>
7007
7008 PR gold/12316
7009 * object.h (class Sized_relobj): Remove clear_local_symbols.
7010 * reloc.cc (Sized_relobj::do_relocate): Don't call
7011 clear_local_symbols.
7012
7013 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
7014
7015 * plugin.cc (is_visible_from_outside): Return true for symbols
7016 in the -u option.
7017
7018 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7019
7020 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7021 filename.
7022
7023 2011-02-02 Sriraman Tallam <tmsriram@google.com>
7024
7025 * icf.h (is_section_foldable_candidate): Change type of parameter
7026 to std::string.
7027 * icf.cc (Icf::find_identical_sections): Change type of local variable
7028 section_name to be std::string.
7029 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7030
7031 2011-01-25 Ian Lance Taylor <iant@google.com>
7032
7033 * script.cc (script_add_extern): Rewrite to use
7034 add_symbol_reference.
7035
7036 2011-01-25 Doug Kwan <dougkwan@google.com>
7037
7038 * icf.cc (get_section_contents): Always lock section's object.
7039
7040 2011-01-24 Ian Lance Taylor <iant@google.com>
7041
7042 * options.h (class General_options): Accept
7043 --no-detect-odr-violations.
7044
7045 2011-01-24 Ian Lance Taylor <iant@google.com>
7046
7047 * version.cc (version_string): Bump to 1.11.
7048
7049 2011-01-24 Ian Lance Taylor <iant@google.com>
7050
7051 * plugin.cc (class Plugin_rescan): Define new class.
7052 (Plugin_manager::claim_file): Set any_claimed_.
7053 (Plugin_manager::save_archive): New function.
7054 (Plugin_manager::save_input_group): New function.
7055 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7056 necessary.
7057 (Plugin_manager::new_undefined_symbol): New function.
7058 (Plugin_manager::rescan): New function.
7059 (Plugin_manager::rescannable_defines): New function.
7060 (Plugin_manager::add_input_file): Set any_added_.
7061 * plugin.h (class Plugin_manager): define new fields rescannable_,
7062 undefined_symbols_, any_claimed_, and any_added_. Declare
7063 Plugin_rescan as friend. Declare new functions.
7064 (Plugin_manager::Rescannable): Define type.
7065 (Plugin_manager::Rescannable_list): Define type.
7066 (Plugin_manager::Undefined_symbol_list): Define type.
7067 (Plugin_manager::Plugin_manager): Initialize new fields.
7068 * archive.cc (Archive::defines_symbol): New function.
7069 (Add_archive_symbols::run): Pass archive to plugins if any.
7070 * archive.h (class Archive): Declare defines_symbol.
7071 * readsyms.cc (Input_group::~Input_group): New function.
7072 (Finish_group::run): Pass input_group to plugins if any.
7073 * readsyms.h (class Input_group): Declare destructor.
7074 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7075 any.
7076
7077 2011-01-10 Ian Lance Taylor <iant@google.com>
7078
7079 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7080 section as relro.
7081 (Layout::set_segment_offsets): Reset increase_relro before calling
7082 set_section_addresses a second time.
7083
7084 2011-01-04 Cary Coutant <ccoutant@google.com>
7085
7086 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7087 sections before NOBITS sections.
7088
7089 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7090
7091 * version.cc (print_version): Update copyright to 2011.
7092
7093 2010-12-23 Cary Coutant <ccoutant@google.com>
7094
7095 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7096 of OS to this->add. Add OD parameter to second form of the function.
7097
7098 2010-12-20 Ian Lance Taylor <iant@google.com>
7099
7100 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7101 second of two consecutive entries with same offset.
7102
7103 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7104
7105 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7106 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7107 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7108 to avoid unneeded links against $(LDADD).
7109 * testsuite/Makefile.in: Regenerate.
7110
7111 2010-12-15 Ian Lance Taylor <iant@google.com>
7112
7113 PR gold/12324
7114 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7115 for R_X86_64_32 and R_X86_64_PC32.
7116 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7117 ver_matching_def_pic.o.
7118 (ver_matching_def_pic.o): New target.
7119
7120 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7121
7122 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7123 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7124 Move definition before File_read::View member definitions.
7125 (File_read::View::~View): Initialize and hold lock before
7126 updating current_mapped_bytes.
7127
7128 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7129
7130 * dwarf_reader.cc: Remove outdated comment.
7131 * gold-threads.cc: Fix typo in error message.
7132 * archive.cc: Fix typos in comments.
7133 * archive.h: Likewise.
7134 * arm-reloc-property.cc: Likewise.
7135 * arm-reloc-property.h: Likewise.
7136 * arm-reloc.def: Likewise.
7137 * arm.cc: Likewise.
7138 * attributes.h: Likewise.
7139 * cref.cc: Likewise.
7140 * ehframe.cc: Likewise.
7141 * fileread.h: Likewise.
7142 * gold.h: Likewise.
7143 * i386.cc: Likewise.
7144 * icf.cc: Likewise.
7145 * incremental.h: Likewise.
7146 * int_encoding.cc: Likewise.
7147 * layout.h: Likewise.
7148 * main.cc: Likewise.
7149 * merge.h: Likewise.
7150 * object.cc: Likewise.
7151 * object.h: Likewise.
7152 * options.cc: Likewise.
7153 * readsyms.cc: Likewise.
7154 * reduced_debug_output.cc: Likewise.
7155 * reloc.cc: Likewise.
7156 * script-sections.cc: Likewise.
7157 * sparc.cc: Likewise.
7158 * symtab.h: Likewise.
7159 * target-reloc.h: Likewise.
7160 * target.cc: Likewise.
7161 * target.h: Likewise.
7162 * timer.cc: Likewise.
7163 * timer.h: Likewise.
7164 * x86_64.cc: Likewise.
7165
7166 2010-12-09 Cary Coutant <ccoutant@google.com>
7167
7168 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7169 stack.
7170 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7171 parameter; change all callers.
7172 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7173 * options.h (warn_execstack): New option.
7174
7175 2010-12-07 Doug Kwan <dougkwan@google.com>
7176
7177 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7178 like function call relocations.
7179
7180 2010-12-07 Ian Lance Taylor <iant@google.com>
7181
7182 * archive.cc (Archive::get_elf_object_for_member): Permit
7183 punconfigured to be NULL.
7184 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7185 (Archive::include_member): Pass NULL to get_elf_object_for_member
7186 if we searched for the archive and this is the first included
7187 object.
7188
7189 2010-12-01 Ian Lance Taylor <iant@google.com>
7190
7191 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7192 track_relocs_type_ field.
7193 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7194 Set track_relocs_type_.
7195 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7196 contents when using RELA relocs.
7197 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7198 reloc_map_.
7199 * reloc.cc (Track_relocs::next_addend): New function.
7200 * reloc.h (class Track_relocs): Declare next_addend.
7201
7202 2010-12-01 Ian Lance Taylor <iant@google.com>
7203
7204 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7205 virtual destructor.
7206
7207 2010-12-01 Ian Lance Taylor <iant@google.com>
7208
7209 * README: Update compilers known to work and fail.
7210
7211 2010-11-23 Matthias Klose <doko@ubuntu.com>
7212
7213 * configure.in: For --enable-gold, handle value `default' instead of
7214 `both*'. Always install ld as ld.bfd, install as ld if gold is
7215 not the default.
7216 * configure: Regenerate.
7217
7218 2010-11-18 Doug Kwan <dougkwan@google.com>
7219
7220 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7221 and right_alignment to be zero. Store result alignment only if it is
7222 greater than existing alignment.
7223
7224 2010-11-16 Cary Coutant <ccoutant@google.com>
7225
7226 PR gold/12220
7227 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7228 Check for ".zdebug_line".
7229
7230 2010-11-16 Doug Kwan <dougkwan@google.com>
7231 Cary Coutant <ccoutant@google.com>
7232
7233 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7234 by reference; adjust all callers.
7235 * output.cc (Output_segment::set_section_addresses): Adjust references
7236 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7237 list is empty.
7238 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7239 end at page boundary.
7240
7241 2010-11-16 Cary Coutant <ccoutant@google.com>
7242
7243 PR gold/12220
7244 * layout.cc (Layout::choose_output_section): Transform names of
7245 compressed sections even when using a script with a SECTIONS clause.
7246 (Layout::output_section_name): Remove code to transform
7247 compressed debug section names.
7248 * output.cc (Output_section::add_input_section): Use uncompressed
7249 section size when tracking input sections.
7250
7251 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7252
7253 * symtab.h (Symbol::NON_PIC_REF): Remove.
7254 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7255 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7256 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7257 (Symbol::use_plt_offset): Take a flags argument and pass it
7258 directly to needs_dynamic_reloc. Restrict check for undefined
7259 weak symbols to function calls.
7260 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7261 (Target_arm::Scan::global): Use it.
7262 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7263 (Target_arm::Relocate::relocate): Likewise.
7264 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7265 parameter with an r_type parameter. Use get_reference_flags
7266 to get the flags.
7267 (Target_arm::Relocate::relocate): Update accordingly.
7268 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7269 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7270 (Target_i386::Scan::global): Likewise.
7271 (Target_i386::Relocate::relocate): Likewise.
7272 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7273 parameter with an r_type parameter. Use get_reference_flags
7274 to get the flags.
7275 (Target_i386::Relocate::relocate): Update accordingly.
7276 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7277 (Target_powerpc::Scan::global): Use it.
7278 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7279 (Target_powerpc::Relocate::relocate): Likewise.
7280 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7281 (Target_sparc::Scan::global): Use it.
7282 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7283 (Target_sparc::Relocate::relocate): Likewise.
7284 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7285 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7286 (Target_x86_64::Scan::global): Likewise.
7287 (Target_x86_64::Relocate::relocate): Likewise.
7288
7289 2010-11-08 Doug Kwan <dougkwan@google.com>
7290 Cary Coutant <ccoutant@google.com>
7291
7292 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7293 (Arm_exidx_merge_section::section_contents_): New data member.
7294 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7295 (Arm_input_section::~Arm_input_section): De-allocate memory.
7296 (Arm_input_section::original_contents_): New data member.
7297 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7298 in parameters instead of calling Object::section_contents without
7299 locking.
7300 (Arm_output_section::group_section): New parameter TASK. Pass it
7301 to callees that need locking objects.
7302 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7303 to lock EXIDX input sections. Fix a formatting issue. Call
7304 Arm_exidx_merged_section::build_contents to create merged section
7305 contents.
7306 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7307 to lock object of stub table owner.
7308 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7309 TEXT_SIZE to initialize data member TEXT_SIZE_.
7310 (Arm_exidx_input_section::addralign): Fix typo in comment.
7311 (Arm_exidx_input_section::text_size): New method.
7312 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7313 that require locking objects. Lock objects before scanning for stubs
7314 and updating local symbols.
7315 (Arm_input_section<big_endian>::init): Copy contents of original
7316 input section.
7317 (Arm_input_section<big_endian>::do_write): Use saved contents of
7318 original input section instead of calling Object::section_contents
7319 without locking.
7320 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7321 size without calling Object::section_size().
7322 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7323 for size. Allocate a buffer for merged EXIDX entries.
7324 (Arm_exidx_merged_section::build_contents): New method.
7325 (Arm_exidx_merged_section::do_write): Move merge section contents
7326 building code to Arm_exidx_merged_section::build_contetns. Write
7327 out contetns in buffer instead of building it on the fly.
7328 (Arm_relobj::make_exidx_input_section): Also pass text section size
7329 to Arm_exidx_input_section constructor.
7330 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7331 (Arm_dynobj::do_read_symbols): Fix memory leak.
7332 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7333 * target.h: (class Task): Add forward declaration.
7334 (Target::relax): Add new parameter TASK and pass it to
7335 Target::do_relax().
7336 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7337
7338 2010-11-05 Cary Coutant <ccoutant@google.com>
7339
7340 PR gold/10708
7341 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7342 object when reading from the file.
7343 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7344 second layout pass.
7345 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7346 when reading section contents.
7347 (get_section_contents): Likewise.
7348 (icf::find_identical_sections): Likewise.
7349 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7350 object when reading from the file.
7351 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7352 the object when doing deferred section layout.
7353
7354 2010-11-03 Nick Clifton <nickc@redhat.com>
7355
7356 PR gold/12001
7357 * script.h (class Symbol_assignment: name): New member. Returns
7358 the name of the symbol.
7359 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7360 Returns true if the given symbol name is on the list of
7361 assignments wating to be processed.
7362 * archive.cc (should_incldue_member): If the symbol is undefined,
7363 check to see if it is on the list of symbols pending assignment.
7364
7365 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7366
7367 * script-sections.cc (Script_sections::find_memory_region): Check
7368 for a NULL output section pointer.
7369
7370 2010-10-29 Doug Kwan <dougkwan@google.com>
7371
7372 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7373 Output_section::add_relaxed_input_section.
7374 * output.cc (Output_section::add_relaxed_input_section): Add new
7375 arguments LAYOUT and NAME. Set section order index.
7376 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7377 Copy section order index.
7378 * output.h (Output_section::add_relaxed_input_section): Add new
7379 arguments LAYOUT and NAME.
7380
7381 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7382
7383 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7384 NATIVE_OR_CROSS_LINKER.
7385 * testsuite/Makefile.in: Regenerate.
7386
7387 2010-10-20 Doug Kwan <dougkwan@google.com>
7388
7389 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7390 without SHF_LINK_ORDER flags.
7391 * layout.cc (Layout::choose_output_section): Do not filter
7392 SHF_LINK_ORDER flag in a relocatable link.
7393
7394 2010-10-17 Cary Coutant <ccoutant@google.com>
7395
7396 * output.h (Output_segment::set_section_addresses): Change function
7397 signature. Update all callers.
7398 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7399 sections.
7400 (Output_segment::set_section_addresses): Align after last TLS
7401 section. Add padding before last relro section instead of after.
7402
7403 2010-10-17 Doug Kwan <dougkwan@google.com>
7404
7405 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7406 GOT output section to be writable.
7407
7408 2010-10-14 Cary Coutant <ccoutant@google.com>
7409
7410 * debug.h (DEBUG_INCREMENTAL): New flag.
7411 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7412 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7413 mode.
7414 * incremental.cc (report_command_line): Ignore all forms of
7415 --incremental.
7416 * layout.cc (Layout::Layout): Check parameters for incremental link
7417 mode.
7418 * options.cc (General_options::parse_incremental): New function.
7419 (General_options::parse_no_incremental): New function.
7420 (General_options::parse_incremental_full): New function.
7421 (General_options::parse_incremental_update): New function.
7422 (General_options::incremental_mode_): New data member.
7423 (General_options::finalize): Check incremental_mode_.
7424 * options.h (General_options): Update help text for --incremental.
7425 Add --no-incremental, --incremental-full, --incremental-update.
7426 (General_options::Incremental_mode): New enum type.
7427 (General_options::incremental_mode): New function.
7428 (General_options::incremental_mode_): New data member.
7429 * parameters.cc (Parameters::incremental_mode_): New data member.
7430 (Parameters::set_options): Set incremental_mode_.
7431 (Parameters::set_incremental_full): New function.
7432 (Parameters::incremental): New function.
7433 (Parameters::incremental_update): New function.
7434 (set_parameters_incremental_full): New function.
7435 * parameters.h (Parameters::set_incremental_full): New function.
7436 (Parameters::incremental): New function.
7437 (Parameters::incremental_update): New function.
7438 (Parameters::incremental_mode_): New data member.
7439 (set_parameters_incremental_full): New function.
7440 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7441 incremental link mode.
7442 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7443 (Sized_relobj::do_relocate_sections): Likewise.
7444 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7445 option.
7446 * testsuite/Makefile.in: Regenerate.
7447 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7448
7449 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7450
7451 * script-sections.h (class Script_sections): Make
7452 Sections_elements typedef public.
7453 * script-sections.cc (class Sort_output_sections): Add elements_
7454 field. Add constructor which sets it; change all callers.
7455 (Sort_output_sections::is_before): New function.
7456 (Sort_output_sections::operator()): Call is_before.
7457 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7458 conditional.
7459 * testsuite/script_test_10.sh: New test. Test script section
7460 order.
7461 * testsuite/script_test_10.t: Likewise.
7462 * testsuite/script_test_10.s: Likewise.
7463 * testsuite/Makefile.am: Wrap the cross linker tests and the
7464 common tests into NATIVE_OR_CROSS_LINKER.
7465 (check_SCRIPTS): Add script_test_10.sh.
7466 (check_DATA): Add script_test_10.stdout.
7467 (script_test_10.o, script_test_10): New targets.
7468 (script_test_10.stdout): New target.
7469 * configure, testsuite/Makefile.in: Regenerate.
7470
7471 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7472
7473 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7474 error for the deprecated relocations.
7475 (Target_arm::Scan::global): Likewise.
7476 (Target_arm::Relocate::relocate): Likewise.
7477
7478 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7479
7480 * fileread.cc (Input_file::find_file): Initialize *found_name
7481 and *namep when using the fallback search for case 4.
7482
7483 2010-10-11 Cary Coutant <ccoutant@google.com>
7484
7485 * options.h (class General_options): Redefine -z lazy as an alias for
7486 the negation of -z now.
7487
7488 2010-10-11 Ian Lance Taylor <iant@google.com>
7489
7490 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7491 binding.
7492
7493 2010-10-06 Nick Clifton <nickc@redhat.com>
7494
7495 * script-sections.cc(class Memory_region): Remove
7496 current_lma_offset_ field. Rename current_vma_offset_ to
7497 current_offset_. Add last_section_ field.
7498 (Memory_region::get_current_vma_address): Rename to
7499 get_current_address.
7500 (Memory_region::get_current_lma_address): Delete.
7501 (Memory_region::increment_vma_offset): Rename to
7502 increment_offset.
7503 (Memory_region::increment_lma_offset): Delete.
7504 (Memory_region::attributes_compatible): New method. Returns
7505 true if the provided section is compatible with the region.
7506 (Memory_region::get_last_section): New method. Returns the last
7507 section to use the region.
7508 (Memory_region::set_last_section): New method. Stores the last
7509 section to use the region.
7510 (Script_sections::block_in_region): New method. Returns true if
7511 a block of memory is contained within a region.
7512 (Script_sections::find_memory_region): New method. Locates a
7513 memory region to be used to set a VMA or LMA address.
7514 (Output_section_definition::set_section_addresses): Add code to
7515 check for addresses set by memory regions.
7516 (Output_segment::set_section_addresses): Remove memory region
7517 walking code.
7518 (Script_sections::create_segment): Add a warning if a header
7519 segment is created outside of any region.
7520 * script-sections.h (class Script_sections): Add prototypes for
7521 find_memory_region and block_in_region methods.
7522 * testsuite/memory_test.s: Use .long instead of .word.
7523 * testsuite/memory_test.t: Add some more output sections.
7524 * testsuite/memory_test.sh: Update expected output.
7525
7526 2010-10-02 Doug Kwan <dougkwan@google.com>
7527
7528 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7529 defintion to symtab.h
7530 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7531 declaration to defintion.
7532
7533 2010-10-01 Nick Clifton <nickc@redhat.com>
7534
7535 * expression.cc (eval): Replace dummy argument with NULL.
7536 (eval_maybe_dot): Check for a NULL result section pointer.
7537 (Symbol_expression::value): Likewise.
7538 (Dot_expression::value): Likewise.
7539 (BINARY_EXPRESSION): Likewise.
7540 (Max_expression::value): Likewise.
7541 (Min_expression::value): Likewise.
7542 (Absolute_expression::value): Likewise.
7543 (Addr_expression::value_from_output_section): Likewise.
7544 (Loaddddr_expression::value_from_output_section): Likewise.
7545 (Segment_start_expression::value): Likewise.
7546 * script-sections.cc
7547 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7548 argument with NULL.
7549 (Sections_elememt_dot_assignment::set_section_addresses):
7550 Likewise.
7551 (Output_data_expression::do_write_to_buffer): Likewise.
7552 (Output_section_definition::finalize_symbols): Likewise.
7553 (Output_section_definition::set_section_addresses): Likewise.
7554
7555 2010-09-30 Doug Kwan <dougkwan@google.com>
7556
7557 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7558
7559 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7560
7561 * target.h (Target::can_icf_inline_merge_sections): New virtual
7562 function.
7563 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7564 virtual function.
7565 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7566 virtual function.
7567 * icf.cc (get_section_contents): Inline merge sections only when
7568 target allows it.
7569
7570 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7571
7572 * configure: Regenerate.
7573
7574 2010-09-17 Ian Lance Taylor <iant@google.com>
7575
7576 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7577 * testsuite/Makefile.am (memory_test.o): New target.
7578 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7579 memory_test.t.
7580 * testsuite/Makefile.in: Rebuild.
7581
7582 2010-09-17 Doug Kwan <dougkwan@google.com>
7583
7584 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7585 defintion if relocation uses GOT entries of the symbol.
7586 * testsuite/icf_safe_test.sh: Fix test.
7587 * testsuite/icf_safe_so_test.sh: Fix test.
7588
7589 2010-09-16 Cary Coutant <ccoutant@google.com>
7590
7591 * script_sections.cc (class Memory_region): Remove "NULL" from
7592 vector initializations.
7593
7594 2010-09-15 Cary Coutant <ccoutant@google.com>
7595
7596 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7597 Resolve forwarding symbols.
7598
7599 2010-09-15 Doug Kwan <dougkwan@google.com>
7600
7601 * gold/testsuite/script_test_3.t: Add ARM special sections.
7602 * gold/testsuite/script_test_4.t: Same.
7603 * gold/testsuite/script_test_5.t: Same.
7604 * gold/testsuite/script_test_6.t: Same.
7605 * gold/testsuite/script_test_7.t: Same.
7606 * gold/testsuite/script_test_7.t: Same.
7607 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7608
7609 2010-09-14 Cary Coutant <ccoutant@google.com>
7610
7611 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7612 (Target_x86_64::Relocate::relocate_tls): Replace check for
7613 saw_tls_block_reloc_ with test for executable section.
7614
7615 2010-09-12 Cary Coutant <ccoutant@google.com>
7616
7617 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7618 position-independent executables to shared libraries need dynamic
7619 relocations.
7620 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7621 position-independent executables.
7622 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7623 * testsuite/Makefile.in: Regenerate.
7624
7625 2010-09-10 Nick Clifton <nickc@redhat.com>
7626
7627 PR gold/11997
7628 * testsuite/memory_test.t: Discard any sections that are not
7629 needed.
7630
7631 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7632
7633 PR gold/11996
7634 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7635 "This::" to work around a bug in gcc 4.2.
7636
7637 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7638
7639 2010-09-09 Rafael Espindola <espindola@google.com>
7640
7641 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7642 sections with different PF_X flags in the same segment.
7643 (Layout::find_first_load_seg): Search all segments to find the first
7644 one.
7645 * options.h (rosegment): New.
7646
7647 2010-09-08 Rafael Espindola <espindola@google.com>
7648
7649 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7650
7651 2010-09-08 Doug Kwan <dougkwan@google.com>
7652
7653 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7654 (Arm_relobj::do_relocate_sections): Add new parameter for output
7655 file to match the parent.
7656 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7657 of local symbols instead of input values. Update code to track
7658 changes in gold::relocate_section.
7659 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7660 (Sized_relobj::compute_final_local_value_internal): New methods.
7661 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7662 body into private version of Sized_relobj::compute_final_local_value.
7663 Call the inline method.
7664 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7665 merged symbol value if there is one.
7666 (Symbol_value::has_output_value): New method defintiion.
7667 (Sized_relobj::Compute_final_local_value_status): New enum type.
7668 (Sized_relobj::compute_final_local_value): New methods.
7669 (Sized_relobj::compute_final_local_value_internal): New methods.
7670 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7671 and arm_cortex_a8.sh.
7672 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7673 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7674 New tests.
7675 * Makefile.in: Regenerate.
7676 * testsuite/arm_bl_out_of_range.s: Update test.
7677 * testsuite/thumb_bl_out_of_range.s: Ditto.
7678 * testsuite/thumb_blx_out_of_range.s: Ditto.
7679 * testsuite/arm_branch_out_of_range.sh: New file.
7680 * testsuite/arm_cortex_a8.sh: Ditto.
7681 * testsuite/arm_cortex_a8_b.s: Ditto.
7682 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7683 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7684 * testsuite/arm_cortex_a8_bl.s: Ditto.
7685 * testsuite/arm_cortex_a8_blx.s: Ditto.
7686 * testsuite/arm_cortex_a8_local.s: Ditto.
7687 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7688 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7689
7690 2010-09-08 Rafael Espindola <espindola@google.com>
7691
7692 * Makefile.am (memory_test.stdout): Run readelf with -W.
7693 * Makefile.in: Regenerate.
7694 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7695 64 bit output.
7696
7697 2010-09-08 Rafael Espindola <espindola@google.com>
7698
7699 * script-sections.cc (Script_sections::add_memory_region): Convert
7700 field precision to int.
7701 * script.cc (script_set_section_region, script_set_section_region):
7702 Convert field precision to int.
7703
7704 2010-09-08 Rafael Espindola <espindola@google.com>
7705
7706 * arm.cc (do_finalize_sections): Create the __exidx_start and
7707 __exdix_end symbols even when the section is missing.
7708
7709 2010-09-08 Nick Clifton <nickc@redhat.com>
7710
7711 * README: Remove claim that MEMORY is not supported.
7712 * expression.cc (script_exp_function_origin)
7713 (script_exp_function_length): Move from here to ...
7714 * script.cc: ... here.
7715 (script_set_section_region, script_add_memory)
7716 (script_parse_memory_attr, script_include_directive): New
7717 functions.
7718 * script-sections.cc
7719 (class Memory_region): New class.
7720 (class Output_section_definition): Add set_memory_region,
7721 set_section_vma, set_section_lma and get_section_name methods.
7722 (class Script_Sections): Add add_memory_region,
7723 find_memory_region, find_memory_region_origin,
7724 find_memory_region_length and set_memory_region methods.
7725 Have set_section_addresses method walk the list of set memory
7726 regions.
7727 Extend the print methos to display memory regions.
7728 * script-sections.h: Add prototypes for new methods.
7729 Add enum for MEMORY region attributes.
7730 * yyscript.y: Add support for parsing MEMORY regions.
7731 * script-c.h: Add prototypes for new functions.
7732 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7733 * testsuite/Makefile.in: Regenerate.
7734 * testsuite/memory_test.sh: New script.
7735 * testsuite/memory_test.s: New assembler source file.
7736 * testsuite/memory_test.t: New linker script.
7737
7738 2010-08-27 Doug Kwan <dougkwan@google.com>
7739
7740 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7741 reference override an existing dynamic weak reference.
7742 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7743 * testsuite/Makefile.in: Regenerate.
7744 * testsuite/dyn_weak_ref.sh: New file.
7745 * testsuite/dyn_weak_ref_1.c: Ditto.
7746 * testsuite/dyn_weak_ref_2.c: Ditto.
7747
7748 2010-08-27 Ian Lance Taylor <iant@google.com>
7749
7750 * incremental.h (class Incremental_input_entry): Add virtual
7751 destructor.
7752
7753 2010-08-27 Ian Lance Taylor <iant@google.com>
7754
7755 * testsuite/start_lib_test_3.c: Mark t3 as used.
7756
7757 2010-08-27 Nick Clifton <nickc@redhat.com>
7758
7759 * options.cc (version_script): Fix small typo in previous
7760 whitespace tidyup.
7761
7762 2010-08-25 Nick Clifton <nickc@redhat.com>
7763
7764 * archive.cc: Formatting fixes: Remove whitespace between
7765 typename and following asterisk. Remove whitespace between
7766 function name and opening parenthesis.
7767 * archive.h: Likewise.
7768 * arm.cc: Likewise.
7769 * attributes.cc: Likewise.
7770 * attributes.h: Likewise.
7771 * common.cc: Likewise.
7772 * copy-relocs.cc: Likewise.
7773 * dirsearch.h: Likewise.
7774 * dynobj.cc: Likewise.
7775 * ehframe.cc: Likewise.
7776 * ehframe.h: Likewise.
7777 * expression.cc: Likewise.
7778 * fileread.cc: Likewise.
7779 * fileread.h: Likewise.
7780 * gc.h: Likewise.
7781 * gold-threads.cc: Likewise.
7782 * gold.cc: Likewise.
7783 * i386.cc: Likewise.
7784 * icf.h: Likewise.
7785 * incremental-dump.cc: Likewise.
7786 * incremental.cc: Likewise.
7787 * layout.cc: Likewise.
7788 * layout.h: Likewise.
7789 * main.cc: Likewise.
7790 * merge.cc: Likewise.
7791 * merge.h: Likewise.
7792 * object.cc: Likewise.
7793 * object.h: Likewise.
7794 * options.cc: Likewise.
7795 * options.h: Likewise.
7796 * output.cc: Likewise.
7797 * output.h: Likewise.
7798 * plugin.cc: Likewise.
7799 * plugin.h: Likewise.
7800 * powerpc.cc: Likewise.
7801 * reloc.cc: Likewise.
7802 * script-c.h: Likewise.
7803 * script-sections.cc: Likewise.
7804 * script.cc: Likewise.
7805 * stringpool.cc: Likewise.
7806 * symtab.cc: Likewise.
7807 * symtab.h: Likewise.
7808 * target.cc: Likewise.
7809 * timer.cc: Likewise.
7810 * timer.h: Likewise.
7811 * version.cc: Likewise.
7812 * x86_64.cc: Likewise.
7813
7814 2010-08-24 Nick Clifton <nickc@redhat.com>
7815
7816 PR 11899
7817 * layout.cc (segment_precedes): Sort segments by their physical
7818 addresses, if they have been set.
7819
7820 2010-08-23 Cary Coutant <ccoutant@google.com>
7821
7822 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7823 symbols data.
7824 (Lib_group::include_member): Unlock object after deleting its
7825 symbols data.
7826 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7827 the bug fixed here.
7828
7829 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7830 Cary Coutant <ccoutant@google.com>
7831
7832 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7833 constructor, and set_blocker.
7834 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7835 readsyms_blocker_.
7836 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7837 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7838 * testsuite/Makefile.am (start_lib_test): New test case.
7839 * testsuite/Makefile.in: Regenerate.
7840 * testsuite/start_lib_test_main.c: New file.
7841 * testsuite/start_lib_test_1.c: New file.
7842 * testsuite/start_lib_test_2.c: New file.
7843 * testsuite/start_lib_test_3.c: New file.
7844
7845 2010-08-19 Ian Lance Taylor <iant@google.com>
7846
7847 * Makefile.in: Rebuild with automake 1.11.1.
7848 * aclocal.m4: Likewise.
7849 * testsuite/Makefile.in: Likewise.
7850
7851 2010-08-19 Ian Lance Taylor <iant@google.com>
7852
7853 PR 10893
7854 * i386.cc (class Output_data_plt_i386): Update declarations.
7855 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7856 local_ifuncs_ fields.
7857 (Target_i386::do_plt_section_for_global): New function.
7858 (Target_i386::do_plt_section_for_local): New function.
7859 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7860 parameter; change all callers. Initialize global_ifuncs_ and
7861 local_ifuncs_. If doing a static link define __rel_iplt_start and
7862 __rel_iplt_end.
7863 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7864 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7865 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7866 symbols.
7867 (Target_i386::make_plt_section): New function, broken out of
7868 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7869 (Target_i386::make_plt_entry): Call make_plt_section.
7870 (Target_i386::make_local_ifunc_plt_entry): New function.
7871 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7872 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7873 R_386_IRELATIVE to switch.
7874 (Target_i386::Scan::global): Likewise.
7875 (Target_i386::Relocate::relocate): Likewise.
7876 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7877 switch.
7878 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7879 (Target_x86_64::do_plt_section_for_global): New function.
7880 (Target_x86_64::do_plt_section_for_local): New function.
7881 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7882 parameter; change all callers. If doing a static link define
7883 __rela_iplt_start and __rela_iplt_end.
7884 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7885 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7886 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7887 to point to .plt.
7888 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7889 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7890 switch.
7891 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7892 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7893 R_X86_64_IRELATIVE to switch.
7894 (Target_x86_64::Scan::global): Likewise.
7895 (Target_x86_64::Relocate::relocate): Likewise.
7896 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7897 switch.
7898 * target.h (class Target): Add plt_section_for_global and
7899 plt_section_for_local functions. Add do_plt_section_for_global
7900 and do_plt_section_for_local virtual functions.
7901 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7902 clarifying comments.
7903 (Symbol::use_plt_offset): Handle IFUNC symbol.
7904 * object.cc (Sized_relobj::Sized_relobj): Initialize
7905 local_plt_offsets_.
7906 (Sized_relobj::local_has_plt_offset): New function.
7907 (Sized_relobj::local_plt_offset): New function.
7908 (Sized_relobj::set_local_plt_offset): New function.
7909 (Sized_relobj::do_count): Handle IFUNC symbol.
7910 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7911 a bit away from input_shndx_ field. Add set_is_func_symbol and
7912 is_ifunc_symbol functions.
7913 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7914 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7915 local_plt_offsets_ field.
7916 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7917 * output.h (class Output_section_data): Add non-const
7918 output_section function.
7919 (class Output_data_got): Update declarations.
7920 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7921 Add use_plt_offset parameter to global and local constructors.
7922 Change all callers. Change local_sym_index_ field to 31 bits.
7923 Change GSYM_CODE and CONSTANT_CODE accordingly.
7924 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7925 doing a static link don't set sh_link field.
7926 (Output_data_got::Got_entry::write): Use PLT offset if
7927 appropriate.
7928 (Output_data_got::add_global_plt): New function.
7929 (Output_data_got::add_local_plt): New function.
7930 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7931 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7932 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7933 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7934 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7935 IFUNC conditional.
7936 * testsuite/ifunc-sel.h: New file.
7937 * testsuite/ifuncmain1.c: New file.
7938 * testsuite/ifuncmain1vis.c: New file.
7939 * testsuite/ifuncmod1.c: New file.
7940 * testsuite/ifuncdep2.c: New file.
7941 * testsuite/ifuncmain2.c: New file.
7942 * testsuite/ifuncmain3.c: New file.
7943 * testsuite/ifuncmod3.c: New file.
7944 * testsuite/ifuncmain4.c: New file.
7945 * testsuite/ifuncmain5.c: New file.
7946 * testsuite/ifuncmod5.c: New file.
7947 * testsuite/ifuncmain6pie.c: New file.
7948 * testsuite/ifuncmod6.c: New file.
7949 * testsuite/ifuncmain7.c: New file.
7950 * configure, testsuite/Makefile.in: Rebuild.
7951
7952 2010-08-18 Ian Lance Taylor <iant@google.com>
7953
7954 * incremental.cc
7955 (Output_section_incremental_inputs::write_input_files): Add cast
7956 to avoid signed/unsigned comparison warning.
7957 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7958
7959 2010-08-12 Cary Coutant <ccoutant@google.com>
7960
7961 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7962
7963 2010-08-13 Ian Lance Taylor <iant@google.com>
7964
7965 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7966
7967 2010-08-12 Cary Coutant <ccoutant@google.com>
7968 Doug Kwan <dougkwan@google.com>
7969
7970 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7971 defintion overrides non-weak undef, remember that the original undef
7972 is not weak.
7973 * symtab.cc (Symbol_table::sized_write_global): For undef without
7974 an original weak binding, set binding to global in output.
7975 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7976 * testsuite/Makefile.in: Regenerate.
7977 * testsuite/strong_ref_weak_def.sh: New file.
7978 * testsuite/strong_ref_weak_def_1.c: Ditto.
7979 * testsuite/strong_ref_weak_def_2.c: Ditto.
7980
7981 2010-08-12 Cary Coutant <ccoutant@google.com>
7982
7983 * testsuite/incremental_test.sh: Rewrite.
7984 * testsuite/incremental_test_1.c: Rewrite.
7985 * testsuite/incremental_test_2.c: Rewrite.
7986
7987 2010-08-12 Cary Coutant <ccoutant@google.com>
7988
7989 * arm.cc (Target_arm::got_size): Add const.
7990 (Target_arm::got_entry_count): New function.
7991 (Target_arm::plt_entry_count): New function.
7992 (Target_arm::first_plt_entry_offset): New function.
7993 (Target_arm::plt_entry_size): New function.
7994 (Output_data_plt_arm::entry_count): New function.
7995 (Output_data_plt_arm::first_plt_entry_offset): New function.
7996 (Output_data_plt_arm::get_plt_entry_size): New function.
7997 * i386.cc (Target_i386::got_size): Add const.
7998 (Target_i386::got_entry_count): New function.
7999 (Target_i386::plt_entry_count): New function.
8000 (Target_i386::first_plt_entry_offset): New function.
8001 (Target_i386::plt_entry_size): New function.
8002 (Output_data_plt_i386::entry_count): New function.
8003 (Output_data_plt_i386::first_plt_entry_offset): New function.
8004 (Output_data_plt_i386::get_plt_entry_size): New function.
8005 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8006 find_incremental_inputs_sections. Dump incremental_got_plt section.
8007 * incremental.cc: Include target.h.
8008 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8009 parameter. Adjust all callers. Find incremental_got_plt section.
8010 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8011 section.
8012 (Output_section_incremental_inputs::set_final_data_size): Calculate
8013 size of incremental_got_plt section.
8014 (Output_section_incremental_inputs::do_write): Write the
8015 incremental_got_plt section.
8016 (Got_plt_view_info): New struct.
8017 (Local_got_offset_visitor): New class.
8018 (Global_got_offset_visitor): New class.
8019 (Global_symbol_visitor_got_plt): New class.
8020 (Output_section_incremental_inputs::write_got_plt): New function.
8021 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8022 Add parameter. Adjust all callers.
8023 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8024 (Incremental_inputs::got_plt_section): New function.
8025 (Incremental_inputs::got_plt_section_): New data member.
8026 (Incremental_got_plt_reader): New class.
8027 * layout.cc (Layout::create_incremental_info_sections): Add the
8028 incremental_got_plt section.
8029 * object.h (Got_offset_list::get_list): New function.
8030 (Got offset_list::for_all_got_offsets): New function.
8031 (Sized_relobj::local_got_offset_list): New function.
8032 * powerpc.cc (Target_powerpc::got_size): Add const.
8033 (Target_powerpc::got_entry_count): New function.
8034 (Target_powerpc::plt_entry_count): New function.
8035 (Target_powerpc::first_plt_entry_offset): New function.
8036 (Target_powerpc::plt_entry_size): New function.
8037 (Output_data_plt_powerpc::entry_count): New function.
8038 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8039 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8040 * sparc.cc (Target_sparc::got_size): Add const.
8041 (Target_sparc::got_entry_count): New function.
8042 (Target_sparc::plt_entry_count): New function.
8043 (Target_sparc::first_plt_entry_offset): New function.
8044 (Target_sparc::plt_entry_size): New function.
8045 (Output_data_plt_sparc::entry_count): New function.
8046 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8047 (Output_data_plt_sparc::get_plt_entry_size): New function.
8048 * symtab.h (Symbol::got_offset_list): New function.
8049 (Symbol_table::for_all_symbols): New function.
8050 * target.h (Sized_target::got_entry_count): New function.
8051 (Sized_target::plt_entry_count): New function.
8052 (Sized_target::plt_entry_size): New function.
8053 * x86_64.cc (Target_x86_64::got_size): Add const.
8054 (Target_x86_64::got_entry_count): New function.
8055 (Target_x86_64::plt_entry_count): New function.
8056 (Target_x86_64::first_plt_entry_offset): New function.
8057 (Target_x86_64::plt_entry_size): New function.
8058 (Output_data_plt_x86_64::entry_count): New function.
8059 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8060 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8061
8062 2010-08-12 Cary Coutant <ccoutant@google.com>
8063
8064 * archive.cc: Include incremental.h.
8065 (Archive::Archive): Initialize incremental_info_.
8066 (Archive::include_member): Record archive members in incremental info.
8067 (Add_archive_symbols::run): Record begin and end of an archive in
8068 incremental info.
8069 (Lib_group::include_member): Record objects in incremental info.
8070 * archive.h (Incremental_archive_entry): Forward declaration.
8071 (Archive::set_incremental_info): New member function.
8072 (Archive::incremental_info): New member function.
8073 (Archive::Unused_symbol_iterator): New class.
8074 (Archive::unused_symbols_begin): New member function.
8075 (Archive::unused_symbols_end): New member function.
8076 (Archive::incremental_info_): New data member.
8077 * incremental-dump.cc (find_input_containing_global): New function.
8078 (dump_incremental_inputs): Dump new incremental info sections.
8079 * incremental.cc: Include symtab.h.
8080 (Output_section_incremental_inputs): New class.
8081 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8082 new incremental info sections.
8083 (Sized_incremental_binary::do_check_inputs): Likewise.
8084 (Incremental_inputs::report_archive): Remove.
8085 (Incremental_inputs::report_archive_begin): New function.
8086 (Incremental_inputs::report_archive_end): New function.
8087 (Incremental_inputs::report_object): New function.
8088 (Incremental_inputs::finalize_inputs): Remove.
8089 (Incremental_inputs::report_input_section): New function.
8090 (Incremental_inputs::report_script): Rewrite.
8091 (Incremental_inputs::finalize): Do nothing but finalize string table.
8092 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8093 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8094 (Incremental_inputs::create_data_sections): New function.
8095 (Incremental_inputs::relocs_entsize): New function.
8096 (Output_section_incremental_inputs::set_final_data_size): New function.
8097 (Output_section_incremental_inputs::do_write): New function.
8098 (Output_section_incremental_inputs::write_header): New function.
8099 (Output_section_incremental_inputs::write_input_files): New function.
8100 (Output_section_incremental_inputs::write_info_blocks): New function.
8101 (Output_section_incremental_inputs::write_symtab): New function.
8102 * incremental.h (Incremental_script_entry): Forward declaration.
8103 (Incremental_object_entry): Forward declaration.
8104 (Incremental_archive_entry): Forward declaration.
8105 (Incremental_inputs): Forward declaration.
8106 (Incremental_inputs_header_data): Remove.
8107 (Incremental_inputs_header): Remove.
8108 (Incremental_inputs_header_write): Remove.
8109 (Incremental_inputs_entry_data): Remove.
8110 (Incremental_inputs_entry): Remove.
8111 (Incremental_inputs_entry_write): Remove.
8112 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8113 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8114 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8115 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8116 Likewise.
8117 (Incremental_input_entry): New class.
8118 (Incremental_script_entry): New class.
8119 (Incremental_object_entry): New class.
8120 (Incremental_archive_entry): New class.
8121 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8122 (Incremental_inputs::report_inputs): Remove.
8123 (Incremental_inputs::report_archive): Remove.
8124 (Incremental_inputs::report_archive_begin): New function.
8125 (Incremental_inputs::report_archive_end): New function.
8126 (Incremental_inputs::report_object): Change prototype.
8127 (Incremental_inputs::report_input_section): New function.
8128 (Incremental_inputs::report_script): Change prototype.
8129 (Incremental_inputs::get_reloc_count): New function.
8130 (Incremental_inputs::set_reloc_count): New function.
8131 (Incremental_inputs::create_data_sections): New function.
8132 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8133 (Incremental_inputs::inputs_section): New function.
8134 (Incremental_inputs::symtab_section): New function.
8135 (Incremental_inputs::relocs_section): New function.
8136 (Incremental_inputs::get_stringpool): Add const.
8137 (Incremental_inputs::command_line): Add const.
8138 (Incremental_inputs::inputs): Remove.
8139 (Incremental_inputs::command_line_key): New function.
8140 (Incremental_inputs::input_file_count): New function.
8141 (Incremental_inputs::input_files): New function.
8142 (Incremental_inputs::relocs_entsize): New function.
8143 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8144 (Incremental_inputs::finalize_inputs): Remove.
8145 (Incremental_inputs::Input_info): Remove.
8146 (Incremental_inputs::lock_): Remove.
8147 (Incremental_inputs::inputs_): Change type.
8148 (Incremental_inputs::inputs_map_): Remove.
8149 (Incremental_inputs::current_object_entry_): New data member.
8150 (Incremental_inputs::inputs_section_): New data member.
8151 (Incremental_inputs::symtab_section_): New data member.
8152 (Incremental_inputs::relocs_section_): New data member.
8153 (Incremental_inputs::reloc_count_): New data member.
8154 (Incremental_inputs_reader): New class.
8155 (Incremental_symtab_reader): New class.
8156 (Incremental_relocs_reader): New class.
8157 * layout.cc (Layout::finalize): Move finalization of incremental info
8158 and creation of incremental info sections to follow finalization of
8159 symbol table. Set offsets for postprocessing sections.
8160 (Layout::create_incremental_info_sections): Call
8161 Incremental_inputs::create_data_sections. Add incremental symtab
8162 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8163 sections to layout after input sections.
8164 * layout.h (struct Timespec): Forward declaration.
8165 (Layout::incremental_inputs): Add const.
8166 (Layout::create_incremental_info_sections): Add parameter.
8167 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8168 * object.cc: Include incremental.h.
8169 (Relobj::finalize_incremental_relocs): New function.
8170 (Sized_relobj::do_layout): Record input sections in incremental info.
8171 * object.h (Object::output_section): New function.
8172 (Object::output_section_offset): Moved from Relobj.
8173 (Object::get_incremental_reloc_base): New function.
8174 (Object::get_incremental_reloc_count): New function.
8175 (Object::do_output_section): New function.
8176 (Object::do_output_section_offset): Moved from Relobj.
8177 (Object::do_get_incremental_reloc_base): New function.
8178 (Object::do_get_incremental_reloc_count): New function.
8179 (Object::Object): Initialize new data members.
8180 (Relobj::output_section): Renamed do_output_section and moved to
8181 protected.
8182 (Relobj::output_section_offset): Moved to Object.
8183 (Relobj::do_get_incremental_reloc_base): New function.
8184 (Relobj::do_get_incremental_reloc_count): New function.
8185 (Relobj::allocate_incremental_reloc_counts): New function.
8186 (Relobj::count_incremental_reloc): New function.
8187 (Relobj::finalize_incremental_relocs): New function.
8188 (Relobj::next_incremental_reloc_index): New function.
8189 (Relobj::reloc_counts_): New data member.
8190 (Relobj::reloc_bases_): New data member.
8191 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8192 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8193 (Sized_relobj::incremental_relocs_scan): New function.
8194 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8195 (Sized_relobj::incremental_relocs_write): New function.
8196 (Sized_relobj::incremental_relocs_write_reltype): New function.
8197 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8198 incremental link.
8199 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8200 archives and object files elsewhere.
8201 (Add_symbols::run): Report object files here.
8202 (Finish_group::run): Report end of archive at end of group.
8203 * reloc.cc: Include layout.h, incremental.h.
8204 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8205 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8206 (Sized_relobj::incremental_relocs_scan): New function.
8207 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8208 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8209 (Sized_relobj::incremental_relocs_write): New function.
8210 (Sized_relobj::incremental_relocs_write_reltype): New function.
8211 * script.cc (read_input_script): Rewrite test for incremental link.
8212 Change call to Incremental_inputs::report_script.
8213 * symtab.h (Symbol_table::first_global_index): New function.
8214 (Symbol_table::output_count): New function.
8215
8216 2010-08-12 Doug Kwan <dougkwan@google.com>
8217
8218 * arm.cc (Target_arm::merge_object_attributes): Check command line
8219 options --no-wchar-size-warning and --no-enum-size-warning.
8220 * options.h (General_options): Add ld-compatible options
8221 --no-enum-size-warning and --no-wchar-size-warning.
8222
8223 2010-08-04 Ian Lance Taylor <iant@google.com>
8224
8225 * x86_64.cc (Target_x86_64::Scan::local): Use
8226 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8227 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8228 (Target_x86_64::Scan::global): Likewise.
8229 (Target_x86_64::Relocate::relocate): Likewise.
8230 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8231 Likewise.
8232
8233 2010-08-03 Cary Coutant <ccoutant@google.com>
8234
8235 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8236 to reserve space in merged_strings vector. Keep total input size
8237 for stats.
8238 (Output_merge_string::do_print_merge_stats): Print total input size.
8239 * merge.h (Output_merge_string): Add input_size_ field.
8240 * stringpool.cc (Stringpool_template::string_length): Move
8241 implementations out of Stringpool_template class and place in
8242 stringpool.h.
8243 * stringpool.h (string_length): Move out of Stringpool_template.
8244
8245 2010-08-03 Ian Lance Taylor <iant@google.com>
8246
8247 PR 11712
8248 * layout.cc (relaxation_loop_body): If address of load segment is
8249 set, adjust address to include headers if possible.
8250
8251 2010-08-03 Ian Lance Taylor <iant@google.com>
8252
8253 * version.cc (version_string): Bump to 1.10.
8254
8255 2010-08-03 Ian Lance Taylor <iant@google.com>
8256
8257 PR 11805
8258 * layout.h (enum Output_section_order): Define.
8259 (class Layout): Update declarations.
8260 * layout.cc (Layout::get_output_section): Add order parameter.
8261 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8262 is_first_non_relro parameters. Change all callers.
8263 (Layout::choose_output_section): Likewise.
8264 (Layout::add_output_section_data): Likewise.
8265 (Layout::make_output_section): Likewise. Set order.
8266 (Layout::default_section_order): New function.
8267 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8268 * output.cc (Output_section::Output_section): Initialize order_.
8269 Don't initialize deleted fields.
8270 (Output_segment::Output_segment): Don't initialize deleted
8271 fields.
8272 (Output_segment::add_output_section_to_load): New function
8273 replacing add_output_section. Change all callers to call this or
8274 add_output_section_to_nonload.
8275 (Output_segment::add_output_section_to_nonload): New function.
8276 (Output_segment::remove_output_section): Rewrite.
8277 (Output_segment::add_initial_output_data): Likewise.
8278 (Output_segment::has_any_data_sections): Likewise.
8279 (Output_segment::is_first_section_relro): Likewise.
8280 (Output_segment::maximum_alignment): Likewise.
8281 (Output_segment::has_dynamic_reloc): New function replacing
8282 dynamic_reloc_count. Change all callers.
8283 (Output_segment::has_dynamic_reloc_list): New function replacing
8284 dynamic_reloc_count_list. Change all callers.
8285 (Output_segment::set_section_addresses): Rewrite.
8286 (Output_segment::set_offset): Rewrite.
8287 (Output_segment::find_first_and_last_list): Remove.
8288 (Output_segment::set_tls_offsets): Rewrite.
8289 (Output_segment::first_section_load_address): Likewise.
8290 (Output_segment::output_section_count): Likewise.
8291 (Output_segment::section_with_lowest_load_address): Likewise.
8292 (Output_segment::write_section_headers): Likewise.
8293 (Output_segment::print_sections_to_map): Likewise.
8294 * output.h (class Output_data): Remove dynamic_reloc_count_
8295 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8296 (Output_data::add_dynamic_reloc): Rewrite.
8297 (Output_data::has_dynamic_reloc): New function.
8298 (Output_data::dynamic_reloc_count): Remove.
8299 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8300 is_last_relro_, is_first_non_relro_, is_interp_,
8301 is_dynamic_linker_section_ fields. Add order and set_order
8302 functions. Remove is_relro_local, set_is_relro_local,
8303 is_last_relro, set_is_last_relro, is_first_non_relro,
8304 set_is_first_non_relro functions, is_interp, set_is_interp,
8305 is_dynamic_linker_section, and set_is_dynamic_linker_section
8306 functions.
8307 (class Output_segment): Change Output_data_list from std::list to
8308 std:;vector. Add output_lists_ field. Remove output_data_ and
8309 output_bss_ fields. Update declarations.
8310
8311 2010-08-02 Ian Lance Taylor <iant@google.com>
8312
8313 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8314 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8315 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8316
8317 2010-08-02 Ian Lance Taylor <iant@google.com>
8318
8319 PR 11855
8320 * script.cc (Script_options::Script_options): Initialize
8321 symbol_definitions_ and symbol_references_.
8322 (Script_options::add_symbol_assignment): Update
8323 symbol_definitions_ and symbol_references_.
8324 (Script_options::add_symbol_reference): New function.
8325 (script_symbol): New function.
8326 * script.h (class Script_options): Add symbol_definitions_ and
8327 symbol_references_ fields.
8328 (Script_options::referenced_const_iterator): New type.
8329 (Script_options::referenced_begin): New function.
8330 (Script_options::referenced_end): New function.
8331 (Script_options::is_referenced): New function.
8332 (Script_options::any_unreferenced): New function.
8333 * script-c.h (script_symbol): Declare.
8334 * yyscript.y (exp): Call script_symbol.
8335 * symtab.cc: Include "script.h".
8336 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8337 Change all callers. Check symbols referenced by scripts.
8338 (Symbol_table::add_undefined_symbols_from_command_line): Add
8339 layout parameter. Change all callers.
8340 (Symbol_table::do_add_undefined_symbols_from_command_line):
8341 Likewise. Break out loop body. Check symbols referenced by
8342 scripts.
8343 (Symbol_table::add_undefined_symbol_from_command_line): New
8344 function broken out of
8345 do_add_undefined_symbols_from_command_line.
8346 * symtab.h (class Symbol_table): Update declarations.
8347 * archive.cc: Include "layout.h".
8348 (Archive::should_include_member): Add layout parameter. Change
8349 all callers. Check for symbol mentioned in expression.
8350 * archive.h (class Archive): Update declaration.
8351 * object.cc (Sized_relobj::do_should_include_member): Add layout
8352 parameter.
8353 * object.h (Object::should_include_member): Add layout parameter.
8354 Change all callers.
8355 (Object::do_should_include_member): Add layout parameter.
8356 (class Sized_relobj): Update declaration.
8357 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8358 parameter.
8359 * dynobj.h (class Sized_dynobj): Update declaration.
8360 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8361 layout parameter.
8362 * plugin.h (class Sized_pluginobj): Update declaration.
8363
8364 2010-08-02 Ian Lance Taylor <iant@google.com>
8365
8366 PR 11866
8367 * output.cc (Output_segment::set_offset): Search for the first and
8368 last sections rather than assuming that the list is in order.
8369 (Output_segment::find_first_and_last_list): New function.
8370 * output.h (class Output_segment): Update declarations.
8371 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8372 (relro_strip_test_SOURCES): New variable.
8373 (relro_strip_test_DEPENDENCIES): New variable.
8374 (relro_strip_test_LDFLAGS): New variable.
8375 (relro_strip_test_LDADD): New variable.
8376 (relro_strip_test.so): New target.
8377
8378 2010-08-02 Ian Lance Taylor <iant@google.com>
8379
8380 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8381 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8382 (Target_i386::got_tlsdesc_section): New function.
8383 (Target_i386::got_section): Create space for GOT entries for
8384 TLSDESC relocations.
8385 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8386 R_386_TLS_GOTDESC.
8387 (Target_i386::Scan::global): Likewise.
8388 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8389 using TLSDESC GOT.
8390 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8391 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8392 (Target_x86_64::got_tlsdesc_section): New function.
8393 (Target_x86_64::got_section): Create space for GOT entries for
8394 TLSDESC relocations.
8395 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8396 R_386_TLS_GOTDESC.
8397 (Target_x86_64::Scan::global): Likewise.
8398 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8399 using TLSDESC GOT.
8400
8401 2010-08-02 Ian Lance Taylor <iant@google.com>
8402
8403 * testsuite/final_layout.sh: Use dc to convert from hex to
8404 decimal.
8405
8406 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8407
8408 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8409 paramter to the call to gold::gc_process_relocs.
8410 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8411 paramter to the call to gold::gc_process_relocs.
8412 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8413 parameter to the call to gold::gc_process_relocs.
8414 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8415 template parameter to the call to gold::gc_process_relocs.
8416 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8417 paramter to the call to gold::gc_process_relocs.
8418 * gc.h (get_embedded_addend_size): New function.
8419 (gc_process_relocs): Save the size of the reloc for use by ICF.
8420 * icf.cc (get_section_contents): Get the addend from the text section
8421 for SHT_REL relocation sections.
8422 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8423 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8424 * int_encoding.h (read_from_pointer): New overloaded function.
8425 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8426 * testsuite/icf_sht_rel_addend_test.sh: New file.
8427 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8428 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8429
8430 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8431
8432 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8433 * Makefile.in: Regenerate.
8434 * testsuite/Makefile.in: Regenerate.
8435
8436 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8437
8438 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8439 * gold/testsuite/debug_msg.cc: Likewise.
8440 * gold/testsuite/odr_violation1.cc
8441 * gold/testsuite/odr_violation2.cc
8442
8443 2010-07-21 Cary Coutant <ccoutant@google.com>
8444
8445 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8446 string, and length fields.
8447 (Output_merge_string::Merged_strings_list): New type.
8448 (Output_merge_string::Merged_strings_lists): New typedef.
8449 (Output_merge_string): Replace merged_strings_ with
8450 merged_strings_lists_.
8451 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8452 Merged_strings_list per input object and section. Don't store pointer
8453 to the string. Don't store length with each merged string entry.
8454 (Output_merge_string::finalize_merged_data): Loop over list of merged
8455 strings lists. Recompute length of each merged string.
8456
8457 2010-07-15 Cary Coutant <ccoutant@google.com>
8458
8459 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8460 here.
8461
8462 2010-07-14 Ian Lance Taylor <iant@google.com>
8463
8464 * descriptors.cc (Descriptors::open): Report correct name in error
8465 message.
8466
8467 2010-07-13 Doug Kwan <dougkwan@google.com>
8468
8469 * arm.cc (Arm_input_section::Arm_input_section): For a
8470 SHT_ARM_EXIDX section, always keeps the input sections.
8471 (Arm_input_section::set_exidx_section_link): New method.
8472 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8473 has_errors_ to false.
8474 (Arm_exidx_input_section::has_errors,
8475 Arm_exidx_input_section::set_has_errors): New methods.
8476 (Arm_exidx_input_section::has_errors_): New data member.
8477 (Arm_relobj::get_exidx_shndx_list): New method.
8478 (Arm_output_section::append_text_sections_to_list): Do not skip
8479 section without SHF_EXECINSTR.
8480 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8481 errors.
8482 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8483 section header. Make error messages more verbose. Check for
8484 a non-executable section linked to an EXIDX section.
8485 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8486 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8487 check that there is no deferred EXIDX section if we exit early.
8488 Instead of not making an EXIDX section in case of an error, make one
8489 and set the has_errors flag of it.
8490 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8491 in a relocatable link.
8492 (Target_arm::do_relax): Look for the EXIDX output section instead of
8493 assuming that it is called .ARM.exidx.
8494 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8495 section list. Do not check for SHF_EXECINSTR section flags but
8496 skip any input section with errors.
8497 * output.cc (Output_section::Output_section): Initialize
8498 always_keeps_input_sections_ to false.
8499 (Output_section::add_input_section): Check for
8500 always_keeps_input_sections_.
8501 * output.h (Output_section::always_keeps_input_sections,
8502 Output_section::set_always_keeps_input_sections): New methods.
8503 (Output_section::always_keeps_input_sections): New data member.
8504
8505 2010-07-13 Rafael Espindola <espindola@google.com>
8506
8507 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8508 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8509
8510 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8511 Ian Lance Taylor <iant@google.com>
8512
8513 * output.h (Output_section_lookup_maps::add_merge_section):
8514 Correct check of whether value was inserted.
8515 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8516 (Output_section_lookup_maps::add_relaxed_input_section):
8517 Likewise.
8518 * arm.cc (Target_arm::got_section): Remove used local os.
8519 * i386.cc (Target_i386::got_section): Likewise.
8520 * x86_64.cc (Target_x86_64::got_section): Likewise.
8521 * sparc.cc (Target_sparc::got_section): Likewise.
8522 (Target_sparc::relocate): Remove unused local have_got_offset.
8523 * powerpc.cc (Target_powerpc::relocate): Likewise.
8524
8525 2010-07-13 Ian Lance Taylor <iant@google.com>
8526
8527 * compressed_output.cc (zlib_decompress): Fix signature in
8528 !HAVE_ZLIB_H case.
8529
8530 * archive.cc (Archive::include_member): Unlock an external member
8531 of a thin archive. Don't bother to delete an object we know is
8532 NULL.
8533
8534 2010-07-12 Cary Coutant <ccoutant@google.com>
8535
8536 * compressed_output.cc (zlib_decompress): New function.
8537 (get_uncompressed_size): New function.
8538 (decompress_input_section): New function.
8539 * compressed_output.h (get_uncompressed_size): New function.
8540 (decompress_input_section): New function.
8541 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8542 Handle compressed debug sections.
8543 * layout.cc (is_compressed_debug_section): New function.
8544 (Layout::output_section_name): Map compressed section names to
8545 canonical names.
8546 * layout.h (is_compressed_debug_section): New function.
8547 (is_debug_info_section): Recognize compressed debug sections.
8548 * merge.cc: Include compressed_output.h.
8549 (Output_merge_data::do_add_input_section): Handle compressed
8550 debug sections.
8551 (Output_merge_string::do_add_input_section): Handle compressed
8552 debug sections.
8553 * object.cc: Include compressed_output.h.
8554 (Sized_relobj::Sized_relobj): Initialize new data members.
8555 (build_compressed_section_map): New function.
8556 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8557 * object.h (Object::section_is_compressed): New method.
8558 (Object::do_section_is_compressed): New method.
8559 (Sized_relobj::Compressed_section_map): New type.
8560 (Sized_relobj::do_section_is_compressed): New method.
8561 (Sized_relobj::compressed_sections_): New data member.
8562 * output.cc (Output_section::add_input_section): Handle compressed
8563 debug sections.
8564 * reloc.cc: Include compressed_output.h.
8565 (Sized_relobj::write_sections): Handle compressed debug sections.
8566
8567 2010-07-08 Cary Coutant <ccoutant@google.com>
8568
8569 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8570 weak when resolving to a dynamic def.
8571 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8572 for weak undef/dynamic def cases. Adjust callers.
8573 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8574 undef_binding_weak_.
8575 (Symbol_table::sized_write_globals): Adjust symbol binding.
8576 (Symbol_table::sized_write_symbol): Add binding parameter.
8577 * symtab.h (Symbol::set_undef_binding): New method.
8578 (Symbol::is_undef_binding_weak): New method.
8579 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8580 (Symbol_table::should_override): Add new parameter.
8581 (Symbol_table::sized_write_symbol): Add new parameter.
8582
8583 * testsuite/weak_undef_file1.cc: Add new test case.
8584 * testsuite/weak_undef_file2.cc: Fix header comment.
8585 * testsuite/weak_undef_test.cc: Add new test case.
8586
8587 2010-06-29 Doug Kwan <dougkwan@google.com>
8588
8589 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8590 Initialize USE_SYMBOL_.
8591 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8592 definition.
8593 (Arm_reloc_property::uses_symbol_): New data member declaration.
8594 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8595 uses symbol value and symbol is undefined but not weakly undefined.
8596
8597 2010-06-28 Rafael Espindola <espindola@google.com>
8598
8599 * plugin.cc (Plugin::load): Use dlerror.
8600
8601 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8602
8603 * symtab.cc (detect_odr_violations): When reporting an ODR
8604 violation, report an object where the symbol is defined.
8605
8606 2010-06-25 Doug Kwan <dougkwan@google.com>
8607
8608 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8609 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8610 definition.
8611 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8612 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8613 target hook to detect function points.
8614 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8615 * icf.h (Icf::check_section_for_function_pointers): Change type of
8616 parameter SECTION_NAME to const reference to std::string. Use
8617 target hook to determine if section may have unsafe pointers.
8618 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8619 method definition.
8620
8621 2010-06-21 Rafael Espindola <espindola@google.com>
8622
8623 * fileread.cc (Input_file::find_fie): New
8624 (Input_file::open): Use Input_file::find_fie.
8625 * fileread.h (Input_file::find_fie): New
8626 * plugin.cc (set_extra_library_path): New.
8627 (Plugin::load): Add set_extra_library_path to the transfer vector.
8628 (Plugin_manager::set_extra_library_path): New.
8629 (Plugin_manager::add_input_file): Use the extra search path if set.
8630 (set_extra_library_path(): New.
8631 * plugin.h (Plugin_manager): Add set_extra_library_path and
8632 extra_search_path_.
8633
8634 2010-06-19 Cary Coutant <ccoutant@google.com>
8635
8636 * layout.cc (gdb_sections): Add .debug_types.
8637 (lines_only_debug_sections): Likewise.
8638
8639 2010-06-18 Rafael Espindola <espindola@google.com>
8640
8641 * plugin.cc (add_input_file,add_input_library)
8642 (Plugin_manager::add_input_file): Make filename arguments const.
8643 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8644 const.
8645
8646 2010-06-16 Doug Kwan <dougkwan@google.com>
8647
8648 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8649 .ARM.attributes section if we have not merged any input
8650 attributes sections.
8651
8652 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8653
8654 * arm.cc: Allow combining objects with no EABI version
8655 information.
8656
8657 2010-06-15 Rafael Espindola <espindola@google.com>
8658
8659 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8660
8661 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8662
8663 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8664 (struct iovec): Correct !HAVE_READV definition.
8665
8666 2010-06-10 Cary Coutant <ccoutant@google.com>
8667
8668 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8669 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8670 reloc sections.
8671 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8672
8673 PR 11683
8674 * symtab.h (Symbol::is_placeholder): New member function.
8675 * target-reloc.h (relocate_section): Check for placeholder symbols.
8676
8677 * testsuite/Makefile.am (plugin_test_8): New test.
8678 (plugin_test_9): New test.
8679 * testsuite/Makefile.in: Regenerate.
8680
8681 2010-06-09 Nick Clifton <nickc@redhat.com>
8682
8683 * yyscript.y (input_list_element): Allow strings prefixed with
8684 the '-' character. Treat these as libraries.
8685 * script.cc (script_add_library): New function. Adds a library
8686 specified by "-l<name>" found in an input script.
8687 * script-c.h: Add prototype for script_add_library.
8688
8689 2010-06-07 Doug Kwan <dougkwan@google.com>
8690
8691 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8692 Restrict stub-group size to be within long conditional branch
8693 range when working around cortex-A8 erratum.
8694
8695 2010-06-07 Damien Diederen <dd@crosstwine.com>
8696
8697 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8698 #ifdef typo.
8699
8700 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8701
8702 PR gold/11658
8703 * output.cc
8704 (Output_section::Input_section_sort_entry::compare_section_ordering):
8705 Change to return non-zero correctly.
8706 (Output_section::Input_section_sort_section_order_index_compare
8707 ::operator()): Change to fix ambiguity in comparisons.
8708
8709 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8710
8711 * gold.h (is_wildcard_string): New function.
8712 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8713 (Layout::layout_eh_frame): Ditto.
8714 (Layout::find_section_order_index): New method.
8715 (Layout::read_layout_from_file): New method.
8716 * layout.h (Layout::find_section_order_index): New method.
8717 (Layout::read_layout_from_file): New method.
8718 (Layout::input_section_position_): New private member.
8719 (Layout::input_section_glob_): New private member.
8720 * main.cc (main): Call read_layout_from_file here.
8721 * options.h (--section-ordering-file): New option.
8722 * output.cc (Output_section::input_section_order_specified_): New
8723 member.
8724 (Output_section::Output_section): Initialize new member.
8725 (Output_section::add_input_section): Add new parameter.
8726 Keep input sections when --section-ordering-file is used.
8727 (Output_section::set_final_data_size): Sort input sections when
8728 section ordering file is specified.
8729 (Output_section::Input_section_sort_entry): Add new parameter.
8730 Check sorting type.
8731 (Output_section::Input_section_sort_entry::compare_section_ordering):
8732 New method.
8733 (Output_section::Input_section_sort_compare::operator()): Change to
8734 consider section_order_index.
8735 (Output_section::Input_section_sort_init_fini_compare::operator()):
8736 Change to consider section_order_index.
8737 (Output_section::Input_section_sort_section_order_index_compare
8738 ::operator()): New method.
8739 (Output_section::sort_attached_input_sections): Change to sort
8740 according to section order when specified.
8741 (Output_section::add_input_section<32, true>): Add new parameter.
8742 (Output_section::add_input_section<64, true>): Add new parameter.
8743 (Output_section::add_input_section<32, false>): Add new parameter.
8744 (Output_section::add_input_section<64, false>): Add new parameter.
8745 * output.h (Output_section::add_input_section): Add new parameter.
8746 (Output_section::input_section_order_specified): New
8747 method.
8748 (Output_section::set_input_section_order_specified): New method.
8749 (Input_section::Input_section): Initialize section_order_index_.
8750 (Input_section::section_order_index): New method.
8751 (Input_section::set_section_order_index): New method.
8752 (Input_section::section_order_index_): New member.
8753 (Input_section::Input_section_sort_section_order_index_compare): New
8754 struct.
8755 (Output_section::input_section_order_specified_): New member.
8756 * script-sections.cc (is_wildcard_string): Delete and move modified
8757 method to gold.h.
8758 (Output_section_element_input::Output_section_element_input): Modify
8759 call to is_wildcard_string.
8760 (Output_section_element_input::Input_section_pattern
8761 ::Input_section_pattern): Ditto.
8762 (Output_section_element_input::Output_section_element_input): Ditto.
8763 * testsuite/Makefile.am (final_layout): New test case.
8764 * testsuite/Makefile.in: Regenerate.
8765 * testsuite/final_layout.cc: New file.
8766 * testsuite/final_layout.sh: New file.
8767
8768 2010-06-01 Rafael Espindola <espindola@google.com>
8769
8770 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8771
8772 2010-06-01 Rafael Espindola <espindola@google.com>
8773
8774 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8775 visibility of symbols.
8776
8777 2010-05-27 Doug Kwan <dougkwan@google.com>
8778
8779 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8780 from start of output section instead of address for a local symbol
8781 in a merged or relaxed section when doing a relocatable link.
8782
8783 2010-05-26 Rafael Espindola <espindola@google.com>
8784
8785 PR 11604
8786 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8787 adding sections the garbage collector removed.
8788 * gold/testsuite/Makefile.am: Add test.
8789 * gold/testsuite/Makefile.in: Regenerate.
8790 * gold/testsuite/plugin_test_7.sh: New.
8791 * gold/testsuite/plugin_test_7_1.c: New.
8792 * gold/testsuite/plugin_test_7_2.c: New.
8793
8794 2010-05-26 Rafael Espindola <espindola@google.com>
8795
8796 * script-sections.cc (Output_section_definition::set_section_addresses):
8797 Check for --section-start.
8798
8799 2010-05-26 Doug Kwan <dougkwan@google.com>
8800
8801 * arm.cc (Arm_scan_relocatable_relocs): New class.
8802 (Target_arm::relocate_special_relocatable): New method.
8803 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8804 (Arm_relocate_functions::thumb_branch_common): Same.
8805 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8806 instead of Default_scan_relocatable_relocs.
8807 * target-reloc.h (relocate_for_relocatable): Let target handle
8808 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8809 * target.h (Sized_target::relocate_special_relocatable): New method.
8810
8811 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8812
8813 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8814
8815 2010-05-23 Doug Kwan <dougkwan@google.com>
8816
8817 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8818 instead of a cast.
8819 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8820 with a direct branch, not a conditional branch, to a stub.
8821 * merge.cc (Output_merge_base::record_input_section): New method
8822 defintion.
8823 (Output_merge_data::do_add_input_section): Record input section if
8824 keeps-input-sections flag is set.
8825 (Output_merge_string::do_add_input_section): Ditto.
8826 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8827 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8828 INPUT_SECTIONS_.
8829 (Output_merge_base::keeps_input_sections,
8830 Output_merge_base::set_keeps_input_sections,
8831 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8832 method definitions.
8833 (Output_merge_base::Input_sections): New type declaration.
8834 (Output_merge_base::input_sections_begin,
8835 Output_merge_base::input_sections_end,
8836 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8837 (Output_merge_base::bool keeps_input_sections_,
8838 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8839 Output_merge_base::input_sections_): New data members.
8840 (Output_merge_data::do_set_keeps_input_sections): New method
8841 defintion.
8842 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8843 * output.cc (Output_section::Input_section::relobj): Move method
8844 defintion from class declaration to here and handle merge sections.
8845 (Output_section::Input_section::shndx): Ditto.
8846 (Output_section::Output_section): Remove initializations of removed
8847 data members and initialize new data member LOOKUP_MAPS_.
8848 (Output_section::add_input_section): Set keeps-input-sections flag
8849 for a newly created merge output section as appropriate. Adjust code
8850 to use Output_section_lookup_maps class.
8851 (Output_section::add_relaxed_input_section): Adjst code for lookup
8852 maps code refactoring.
8853 (Output_section::add_merge_input_section): Add a new parameter
8854 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8855 class. If adding input section to a newly created merge output
8856 section fails, remove the new merge section.
8857 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8858 Adjust code for use of the Output_section_lookup_maps class.
8859 (Output_section::find_merge_section): Ditto.
8860 (Output_section::build_lookup_maps): New method defintion.
8861 (Output_section::find_relaxed_input_section): Adjust code to use
8862 Output_section_lookup_maps class.
8863 (Output_section::get_input_sections): Export merge sections. Adjust
8864 code to use Output_section_lookup_maps class.
8865 (Output_section:::add_script_input_section): Adjust code to use
8866 Output_section_lookup_maps class. Update lookup maps for merge
8867 sections also.
8868 (Output_section::discard_states): Use Output_section_lookup_maps.
8869 (Output_section::restore_states): Same.
8870 * output.h (Merge_section_properties): Move class defintion out of
8871 Output_section.
8872 (Output_section_lookup_maps): New class.
8873 (Output_section::Input_section::is_merge_section): New method
8874 defintion.
8875 (Output_section::Input_section::relobj): Move defintion out of class
8876 defintion. Declare method only.
8877 (Output_section::Input_section::shndx): Ditto.
8878 (Output_section::Input_section::output_merge_base): New method defintion.
8879 (Output_section::Input_section::u2_.pomb): New union field.
8880 (Output_section::Merge_section_by_properties_map,
8881 Output_section::Output_section_data_by_input_section_map,
8882 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8883 Remove types.
8884 (Output_section::add_merge_input_section): Add new parameter
8885 KEEPS_INPUT_SECTIONS.
8886 (Output_section::build_lookup_maps): New method declaration.
8887 (Output_section::merge_section_map_,
8888 Output_section::merge_section_by_properties_map_,
8889 Output_section::relaxed_input_section_map_,
8890 Output_section::is_relaxed_input_section_map_valid_): Remove data
8891 members.
8892 (Output_section::lookup_maps_): New data member.
8893
8894 2010-05-21 Doug Kwan <dougkwan@google.com>
8895
8896 PR gold/11619
8897 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8898 avoid a compilation error.
8899
8900 2010-05-19 Rafael Espindola <espindola@google.com>
8901
8902 * script-sections.cc (Output_section_definition::allocate_to_segment):
8903 Update the phdrs_list even when the output section is NULL.
8904 * testsuite/Makefile.am: Add test.
8905 * testsuite/Makefile.in: Regenerate.
8906 * testsuite/script_test_9.cc: New.
8907 * testsuite/script_test_9.sh: New.
8908 * testsuite/script_test_9.t: New.
8909
8910 2010-05-19 Doug Kwan <dougkwan@google.com>
8911
8912 * arm.cc (Arm_input_section::original_size): New method.
8913 (Arm_input_section::do_addralign): Add a cast.
8914 (Arm_input_section::do_output_offset): Remove static cast.
8915 (Arm_input_section::original_addralign,
8916 Arm_input_section::original_size_): Change type to uint32_t.
8917 (Arm_input_section::init): Add safe casts for section alignment
8918 and size.
8919 (Arm_input_section::set_final_data_size): Do not set address and
8920 offset of stub table.
8921 (Arm_output_section::fix_exidx_coverage): Change use of of
8922 Output_section::Simple_input_section to that of
8923 Output_section::Input_section.
8924 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8925 except for the first pass.
8926 * output.cc (Output_section::get_input_sections): Change type of
8927 input_sections to std::list<Input_section>.
8928 (Output_section::add_script_input_section): Rename from
8929 Output_section::add_simple_input_section. Change type of SIS
8930 parameter from Simple_input_section to Input_section.
8931 * output.h (Output_section::Simple_input_section): Remove class.
8932 (Output_section::Input_section): Change class visibility to public.
8933 (Output_section::Input_section::addralign): Use stored alignments
8934 for special input sections if set.
8935 (Output_section::Input_section::set_addralign): New method.
8936 (Output_section::get_input_sections): Change parameter type from
8937 list of Simple_input_section to list of Input_section.
8938 (Output_section::add_script_input_section): Rename from
8939 Output_section::add_simple_input_section. Change first parameter's
8940 type from Simple_input_section to Input_section and remove the
8941 second and third parameters.
8942 * script-sections.cc (Input_section::Input_section_list): Change
8943 type to list of Output_section::Input_section/
8944 (Input_section_info::Input_section_info): Change parameter type of
8945 INPUT_SECTION to Output_section::Input_section.
8946 (Input_section_info::input_section): Change return type.
8947 (Input_section_info::input_section_): Change type to
8948 Output_section::Input_section.
8949 (Output_section_element_input::set_section_addresses): Adjust code
8950 to use Output_section::Input_section instead of
8951 Output_section::Simple_input_section. Adjust code for renaming
8952 of Output_section::add_simple_input_section.
8953 (Orphan_output_section::set_section_addresses): Ditto.
8954
8955 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8956
8957 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8958 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8959
8960 2010-05-18 Rafael Espindola <espindola@google.com>
8961
8962 * options.cc (General_options::finalize): Handle -nostdlib.
8963 * options.h (nostdlib): New option.
8964 * script.cc (script_add_search_dir): Handle -nostdlib.
8965
8966 2010-05-12 Doug Kwan <dougkwan@google.com>
8967
8968 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8969 attributes section only if there no attributes section after merging.
8970 (Target_arm::merge_object_attributes): Move value of
8971 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8972 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8973 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8974 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8975 and arm_attr_merge_7.stdout.
8976 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8977 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8978 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8979 arm_attr_merge_7b.o): New rules.
8980 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8981 arm_attr_merge_7
8982 * testsuite/Makefile.in: Regenerate.
8983 * testsuite/arm_attr_merge.sh: New file.
8984 * testsuite/arm_attr_merge_[67][ab].s: Same.
8985
8986 2010-05-05 Nick Clifton <nickc@redhat.com>
8987
8988 * po/es.po: Updated Spanish translation.
8989
8990 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8991
8992 * Makefile.am (install-exec-local): Properly install gold as
8993 default cross linker.
8994 * Makefile.in: Regenerated.
8995
8996 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8997 Nick Clifton <nickc@redhat.com>
8998
8999 * configure.ac (install_as_default): Define and set to false
9000 unless --enable-gold or --enable-gold=both/gold has been
9001 specified.
9002 * configure: Regenerate.
9003
9004 * Makefile.am (install-exec-local): Install the executable as
9005 'ld.gold'. If install_as_default is true then also install it as
9006 'ld'.
9007 * Makefile.in: Regenerated.
9008
9009 2010-04-24 Ian Lance Taylor <iant@google.com>
9010
9011 * layout.cc (Layout::layout_reloc): In relocatable link don't
9012 combine reloc sections for grouped sections.
9013
9014 2010-04-23 Sriraman Tallam <tmsriram@google.com>
9015
9016 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9017 sections that are not ordinary to icf.
9018 * icf.cc (get_section_contents): Handle relocation pointing to section
9019 with no object or shndx information.
9020 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9021 * testsuite/Makefile.in: Regenerate.
9022 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9023 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9024
9025 2010-04-22 Ian Lance Taylor <iant@google.com>
9026
9027 * expression.cc (Expression::Expression_eval_info): Add
9028 result_alignment_pointer field.
9029 (Expression::eval_with_dot): Add result_alignment_pointer
9030 parameter. Change all callers.
9031 (Expression::eval_maybe_dot): Likewise.
9032 (class Binary_expression): Add alignment_pointer parameter to
9033 left_value and right_value. Change all callers.
9034 (BINARY_EXPRESSION): Set result alignment.
9035 (class Trinary_expression): Add alignment_pointer parameter to
9036 arg2_value and arg3_value. Change all callers.
9037 (Trinary_cond::value): Set result alignment.
9038 (Max_expression::value, Min_expression::value): Likewise.
9039 (Align_expression::value): Likewise.
9040 * script-sections.cc (class Sections_element): Add dot_alignment
9041 parameter to set_section_addresses virtual function. Update
9042 instantiations.
9043 (class Output_section_element): Likewise.
9044 (Script_sections::create_segments): Add dot_alignment parameter.
9045 Change all callers.
9046 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9047 (Script_sections::set_phdrs_clause_addresses): Likewise.
9048 * script-sections.h: Update declarations.
9049 * script.h: Update declarations.
9050 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9051 min_p_align.
9052 * testsuite/script_test_3.t: Set large alignment.
9053 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9054 segment has expected alignment.
9055
9056 2010-04-22 Nick Clifton <nickc@redhat.com>
9057
9058 * po/gold.pot: Updated by the Translation project.
9059 * po/vi.po: Updated Vietnamese translation.
9060
9061 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9062
9063 * testsuite/Makefile.am (check_PROGRAMS): Add
9064 icf_virtual_function_folding_test.
9065 * testsuite/Makefile.in: Regenerated.
9066
9067 2010-04-15 Andrew Haley <aph@redhat.com>
9068
9069 * options.h (merge_exidx_entries): New option.
9070 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9071 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9072 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9073 (Target_arm::merge_exidx_entries): New function.
9074 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9075 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9076 to Arm_exidx_fixup constructor.
9077 Add new arg, merge_exidx_entries.
9078 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9079 Arm_output_section::fix_exidx_coverage.
9080
9081 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9082
9083 * icf.cc (get_section_contents): Check for preemptible functions.
9084 Ignore addend when appropriate.
9085 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9086 section folded.
9087 (add_from_relobj): Check for section folded.
9088 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9089 * symtab.h (should_add_dynsym_entry): Add new parameter.
9090 * target-reloc.h (scan_relocs): Check for section folded.
9091 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9092 Check reloc types for function pointers in shared objects.
9093 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9094 case.
9095 (icf_preemptible_functions_test): New test case.
9096 (icf_string_merge_test): New test case.
9097 * testsuite.Makefile.in: Regenerate.
9098 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9099 bar_glob. Refactor code.
9100 * testsuite/icf_preemptible_functions_test.cc: New file.
9101 * testsuite/icf_preemptible_functions_test.sh: New file.
9102 * testsuite/icf_string_merge_test.cc: New file.
9103 * testsuite/icf_string_merge_test.sh: New file.
9104 * testsuite/icf_virtual_function_folding_test.cc: New file.
9105 * testsuite/icf_virtual_function_folding_test.sh: New file.
9106
9107 2010-04-14 Doug Kwan <dougkwan@google.com>
9108
9109 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9110 for local symbol recounting if we remove a section due to ICF.
9111 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9112 there are no regular objects in input.
9113
9114 2010-04-13 Doug Kwan <dougkwan@google.com>
9115
9116 * arm.cc (Arm_input_section::set_final_data_size): Compute
9117 accurate final data size instead of using current data size.
9118
9119 2010-04-09 Doug Kwan <dougkwan@google.com>
9120
9121 * layout.cc (Layout::choose_output_section): Handle script section
9122 types.
9123 (Layout::make_output_section_for_script): Add section type parameter.
9124 Handle script section types.
9125 * layout.h (Layout::make_output_section_for_script): Add section
9126 type parameter.
9127 * output.cc (Output_section::Output_section): Initialize data member
9128 is_noload_.
9129 (Output_section::do_reset_address_and_file_offset): Do not set address
9130 to 0 if section is a NOLOAD section.
9131 * output.h (Output_section::is_noload): New method.
9132 (Output_section::set_is_noload): Ditto.
9133 (Output_section::is_noload_): New data member.
9134 * script-c.h (Script_section_type): New enum type.
9135 (struct Parser_output_section_header): Add new file section_type.
9136 * script-sections.cc (Sections_element::output_section_name): Add
9137 parameter for returning script section type.
9138 (Output_section_definition::output_section_name): Ditto.
9139 (Output_section_definition::section_type)P; New method.
9140 (Output_section_definiton::script_section_type_name): Ditto.
9141 (Output_section_definition::script_section_type_): New data member.
9142 (Output_section_definition::Output_section_definition): Initialize
9143 data member Output_section_definition::script_section_type_.
9144 (Output_section_definition::create_sections): Pass script section type
9145 to Layout::make_output_section_for_script.
9146 (Output_section_definition::output_section_name): Return script
9147 section type to caller.
9148 (Output_section_definition::set_section_address): Do not advance
9149 dot value and load address if section type is NOLOAD. Set address
9150 of NOLOAD sections regardless of section flags.
9151 (Output_section_definition::print): Print section type if it is
9152 not SCRIPT_SECTION_TYPE_NONE.
9153 (Output_section_definition::section_type): New method.
9154 (Output_section_definition::script_section_type_name): Ditto.
9155 (Script_sections::output_section_name): Add new parameter
9156 PSECTION_TYPE for returning script section type. Pass it to
9157 section elements. Handle discard sections.
9158 (Sort_output_sections::operator()): Handle NOLOAD sections.
9159 * script-sections.h (Script_sections::Section_type): New enum type.
9160 (Script_sections::output_section_name): Add a new parameter for
9161 returning script section type.
9162 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9163 INFO and NOLOAD.
9164 * yyscript.y (union): Add new field SECTION_TYPE.
9165 (COPY, DSECT, INFO, NOLOAD): New tokens.
9166 (opt_address_and_section_type): Change type to output_section_header.
9167 (section_type): New non-terminal
9168 (section_header): Handle section type.
9169 (opt_address_and_section_type): Return section type value.
9170
9171 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9172
9173 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9174 * testsuite/plugin_common_test_2.c (foo): Likewise.
9175
9176 2010-04-08 Doug Kwan <dougkwan@google.com>
9177
9178 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9179 Output_merge_data.
9180 * output.cc (Output_section::add_merge_input_section): Simplify
9181 code and return status of Output_merge_base::add_input_section.
9182 Update merge section map only if Output_merge_base::add_input_section
9183 returns true.
9184
9185 2010-04-07 Doug Kwan <dougkwan@google.com>
9186
9187 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9188 if section is marked as containing instructions but has no mapping
9189 symbols.
9190 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9191 correct section index.
9192 (Arm_relobj::find_linked_text_section): Ditto.
9193
9194 2010-04-07 Cary Coutant <ccoutant@google.com>
9195
9196 * archive.cc (include_member): Destroy Read_symbols_data object before
9197 releasing file.
9198 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9199 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9200 (Read_symbols_data::~Read_symbols_data) New destructor.
9201 (Section_relocs::Section_relocs) New constructor.
9202 (Section_relocs::~Section_relocs) New destructor.
9203 (Read_relocs_data::Read_relocs_data) New constructor.
9204 (Read_relocs_data::~Read_relocs_data) New destructor.
9205 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9206 pointers to NULL after deleting.
9207
9208 2010-04-07 Doug Kwan <dougkwan@google.com>
9209
9210 * arm.cc: Replace "endianity" with "endianness" in comments.
9211 (Arm_exidx_cantunwind): Ditto.
9212 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9213 (Arm_relobj::merge_flags_and_attributes): New method.
9214 (Arm_relobj::merge_flags_and_attributes_): New data member.
9215 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9216 (Arm_relobj::scan_sections_for_stubs): Ditto.
9217 (Arm_relobj::do_read_symbols): Check to see if we really want to
9218 merge processor-specific flags and attributes. Exit early if
9219 an object is empty except for section names and the undefined symbol.
9220 (Target_arm::do_finalize_sections): Move check for ELF format to
9221 Arm_relobj::do_read_symbols. Merge processor specific flags and
9222 attributes from a regular object only when we have determined that
9223 it is aapropriate. Do not create an .ARM.attributes section in
9224 output if there is no regular input object.
9225 (Target_arm::merge_processor_specific_flags): Check
9226 --warn-mismatch before printing any error.
9227 (Target_arm::merge_object_attributes): Ditto.
9228 * gold.cc (queue_middle_tasks): Handle the case in which there is
9229 no regular object in input.
9230 * options.cc (General_options::parse_EB): New method.
9231 (General_options::parse_EL): Same.
9232 (General_options::General_options): Initialize endianness_.
9233 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9234 New options.
9235 (General_options::Endianness): New enum.
9236 (General_options::endianness): New method.
9237 (General_options::endianness_): New data member.
9238 * parameters.cc (Parameters::set_options): Check target endianness.
9239 (Parameters::set_target_once): Ditto.
9240 (Parameters::check_target_endianness): New method.
9241 (parameters_force_valid_target): If either -EL or -EB is specified,
9242 use it to define endianness of default target.
9243 * parameters.h (Parameters::check_target_endianness): New method
9244 declaration.
9245 * target.h (class Target): Change "endianity" to "endianness"
9246 in comments.
9247
9248 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9249
9250 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9251 * configure: Regenerate.
9252 * Makefile.in: Regenerate.
9253 * testsuite/Makefile.in: Regenerate.
9254
9255 2010-04-06 Cary Coutant <ccoutant@google.com>
9256
9257 gcc PR lto/42757
9258 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9259 prevailing definitions of common symbols.
9260 * testsuite/plugin_test_6.sh: New test case.
9261 * testsuite/plugin_common_test_1.c: New test case.
9262 * testsuite/plugin_common_test_2.c: New test case.
9263 * testsuite/Makefile.am (plugin_test_6): New test case.
9264 * testsuite/Makefile.in: Regenerate.
9265
9266 2010-04-06 Nick Clifton <nickc@redhat.com>
9267
9268 * po/vi.po: New Vietnamese translation.
9269
9270 2010-03-30 Doug Kwan <dougkwan@google.com>
9271
9272 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9273
9274 2010-03-25 Doug Kwan <dougkwan@google.com>
9275
9276 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9277 to avoid a conversion warning on a 32-bit host.
9278
9279 2010-03-24 Ian Lance Taylor <iant@google.com>
9280
9281 * testsuite/script_test_3.t: Add a TLS segment.
9282 * testsuite/Makefile.am (check_PROGRAMS): Add
9283 tls_phdrs_script_test.
9284 (tls_phdrs_script_test_SOURCES): Define.
9285 (tls_phdrs_script_test_DEPENDENCIES): Define.
9286 (tls_phdrs_script_test_LDFLAGS): Define.
9287 (tls_phdrs_script_test_LDADD): Define.
9288 * testsuite/Makefile.in: Rebuild.
9289
9290 2010-03-23 Cary Coutant <ccoutant@google.com>
9291
9292 * fileread.cc (find_or_make_view): Fix comment.
9293
9294 2010-03-23 Ian Lance Taylor <iant@google.com>
9295
9296 * script-sections.cc (class Orphan_section_placement): Define
9297 PLACE_TLS and PLACE_TLS_BSS.
9298 (Orphan_section_placement::Orphan_section_placement): Initialize
9299 new places.
9300 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9301 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9302 (tls_script_test_SOURCES): Define.
9303 (tls_script_test_DEPENDENCIES): Define.
9304 (tls_script_test_LDFLAGS): Define.
9305 (tls_script_test_LDADD): Define.
9306 * testsuite/Makefile.in: Rebuild.
9307
9308 2010-03-22 Doug Kwan <dougkwan@google.com>
9309
9310 * arm.cc (Arm_relocate_functions::abs8,
9311 Arm_relocate_functions::abs16): Use correct check for overflow
9312 specified in the ARM ELF specs.
9313 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9314 target of a BLX instruction specially.
9315 (Reloc_stub::stub_type_for_reloc): Ditto.
9316 (Relocate::relocate): Use symbolic names instead of numeric relocation
9317 codes to report error.
9318 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9319 workaround.
9320 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9321 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9322 thumb2_blx_out_of_range.stdout
9323 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9324 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9325 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9326 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9327 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9328 thumb2_blx_in_range, thumb2_blx_in_range.o,
9329 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9330 thumb2_blx_out_of_range.o): New rules.
9331 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9332 thumb2_blx_in_range and thumb2_blx_out_of_range.
9333 * testsuite/Makefile.in: Regenerate.
9334 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9335 * testsuite/thumb_blx_in_range.s: New file.
9336 * testsuite/thumb_blx_out_of_range.s: New file.
9337
9338 2010-03-22 Rafael Espindola <espindola@google.com>
9339
9340 * archive.cc (Should_include): Move to archive.h.
9341 (should_include_member): Make it a member of Archive.
9342 (Lib_group): New.
9343 (Add_lib_group_symbols): New.
9344 * archive.h: Include options.h.
9345 (Archive_member): Moved from Archive.
9346 (Should_include): Moved from archive.cc.
9347 (Lib_group): New.
9348 (Add_lib_group_symbols): New.
9349 * dynobj.cc (do_should_include_member): New.
9350 * dynobj.h (do_should_include_member): New.
9351 * gold.cc (queue_initial_tasks): Update call to queue.
9352 * main.cc (main): Print lib group stats.
9353 * object.cc (do_should_include_member): New.
9354 * object.h: Include archive.h.
9355 (Object::should_include_member): New.
9356 (Object::do_should_include_member): New.
9357 (Sized_relobj::do_should_include_member): New.
9358 * options.cc (General_options::parse_start_lib): New.
9359 (General_options::parse_end_lib): New.
9360 (Input_arguments::add_file): Handle lib groups.
9361 (Input_arguments::start_group): Check we are not in a lib.
9362 (Input_arguments::start_lib): New.
9363 (Input_arguments::end_lib): New.
9364 * options.h (General_options): Add start_lib and end_lib.
9365 (Input_argument::lib_): New.
9366 (Input_argument::lib): New.
9367 (Input_argument::is_lib): New.
9368 (Input_file_lib): New.
9369 (Input_arguments::in_lib_): New.
9370 (Input_arguments::in_lib): New.
9371 (Input_arguments::start_lib): New.
9372 (Input_arguments::end_lib_): New.
9373 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9374 in unused members as preempted.
9375 (Sized_pluginobj::do_should_include_member): New.
9376 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9377 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9378 return the blocker.
9379 (Read_symbols::do_whole_lib_group): New.
9380 (Read_symbols::do_lib_group): New.
9381 (Read_symbols::do_read_symbols): Handle lib groups.
9382 (Read_symbols::get_name): Handle lib groups.
9383 * readsyms.h (Read_symbols): Add an archive member pointer.
9384 (Read_symbols::do_whole_lib_group): New.
9385 (Read_symbols::do_lib_group): New.
9386 (Read_symbols::member_): New.
9387 * script.cc (read_input_script): Update call to queue_soon.
9388
9389 2010-03-19 Doug Kwan <dougkwan@google.com>
9390
9391 * arm.cc (Stub_table::Stub_table): Initialize new data members
9392 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9393 (Stub_table::add_reloc_stub): Assign stub offset and update
9394 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9395 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9396 New data members.
9397 (Stub_table::update_data_size_and_addralign): Use
9398 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9399 instead of going over all reloc stubs.
9400 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9401 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9402 Stringpool_template::offset_ to size of Stringpool_char.
9403 (Stringpool_template::new_key_offset): Remove code to initialize
9404 Stringpool_template::offset_.
9405 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9406 Stringpool_template::offset_ to zero.
9407
9408 2010-03-15 Doug Kwan <dougkwan@google.com>
9409
9410 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9411 offset_.
9412 (Stringpool_template::new_key_offset): New method.
9413 (Stringpool_template::add_string): Assign offsets when adding new
9414 strings.
9415 (Stringpool_template::set_string_offsets): Do not set string offsets
9416 when not optimizing.
9417 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9418 member size_.
9419 (Chunked_vector::clear): Clear size_.
9420 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9421 (Chunked_vector::size): Return size_.
9422 (Chunked_vector::push_back): Use size_ to find insert position.
9423 (Chunked_vector::size_): New data member.
9424 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9425 (Stringpool_template::new_key_offset): New method declaration.
9426 (Stringpool_template::offset_): New data member.
9427
9428 2010-03-15 Rafael Espindola <espindola@google.com>
9429
9430 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9431 Add_symbols' constructor.
9432 * readsyms.h (Add_symbols): Remove the input_group member.
9433
9434 2010-03-10 Ian Lance Taylor <iant@google.com>
9435
9436 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9437 target to ask whether a reference to a symbol requires a stack
9438 split.
9439 * target.h (Target::is_call_to_non_split): New function.
9440 (Target::do_is_call_to_non_split): Declare virtual function.
9441 * target.cc: Include "symtab.h".
9442 (Target::do_is_call_to_non_split): New function.
9443 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9444
9445 2010-03-10 Cary Coutant <ccoutant@google.com>
9446
9447 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9448 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9449 (File_read::open[2]): Add whole_file_view_ to list of views.
9450 (File_read::make_view): Remove test of whole_file_view_.
9451 (File_read::find_or_make_view): Create whole_file_view_ if
9452 necessary.
9453 (File_read::clear_views): Replace bool parameter with enum;
9454 adjust all callers. Don't delete views with permanent data;
9455 do delete cached views and views from archives if
9456 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9457 if clearing the corresponding view.
9458 * fileread.h (File_read::Clear_views_mode): New enum.
9459 (File_read::View::is_permanent_view): New method.
9460 (File_read::clear_views): Replace bool parameter
9461 with enum; adjust all callers.
9462 * options.h (General_options): Change keep_files_mapped option;
9463 add map_whole_files.
9464 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9465 releasing the file.
9466 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9467 the file.
9468
9469 2010-03-10 David S. Miller <davem@davemloft.net>
9470
9471 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9472
9473 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9474
9475 * icf.cc (get_section_contents): Add '@' marker after processing the
9476 merge reloc.
9477
9478 2010-03-08 Doug Kwan <dougkwan@google.com>
9479
9480 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9481 due to a conversion warning.
9482 (Arm_relobj::update_output_local_symbol_count): Check for local
9483 symbol with unset output index.
9484
9485 2010-03-05 Ian Lance Taylor <iant@google.com>
9486
9487 * options.h (class General_options): Add --spare-dynamic-tags.
9488 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9489 --spare-dynamic-tags.
9490
9491 2010-03-05 Ian Lance Taylor <iant@google.com>
9492
9493 * incremental.cc: Include "libiberty.h".
9494
9495 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9496
9497 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9498 function, is_info_ member.
9499 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9500 (Versions::Versions): Update caller.
9501 (Versions::define_base_version): Likewise.
9502 (Versions::add_def): Likewise.
9503
9504 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9505
9506 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9507 (Scan::possible_function_pointer_reloc): New function.
9508 (Scan::local_reloc_may_be_function_pointer): Change to call
9509 possible_function_pointer_reloc.
9510 (Scan::global_reloc_may_be_function_pointer): Ditto.
9511 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9512 relocations in ".data.rel.ro._ZTV" section.
9513 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9514 * testsuite/icf_safe_so_test.cc: Ditto.
9515 * testsuite/icf_safe_test.cc: Ditto.
9516 * testsuite/icf_safe_test.sh: Ditto.
9517
9518 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9519 Ian Lance Taylor <iant@google.com>
9520
9521 * target-reloc.h (relocate_section): Check the symbol table index
9522 for -1U before setting the local symbol index.
9523 (scan_relocatable_relocs): If copying the relocation, record that
9524 the local symbol is required.
9525 * object.h (Symbol_value::is_output_symtab_index_set): New
9526 function.
9527 (Symbol_value::may_be_discarded_from_output_symtab): New
9528 function.
9529 (Symbol_value::has_output_symtab_entry): New function.
9530 (Symbol_value::needs_output_symtab_entry): Remove.
9531 (Symbol_value::output_symtab_index): Make sure the symbol index is
9532 set.
9533 (Symbol_value::set_output_symtab_index): Make sure the symbol
9534 index is not set. Make sure the new index is valid.
9535 (Symbol_value::set_must_have_output_symtab_entry): New function.
9536 (Symbol_value::has_output_dynsym_entry): New function.
9537 (Symbol_value::set_output_dynsym_index): Make sure the new index
9538 is valid.
9539 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9540 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9541 local symbol if permitted.
9542 (Sized_relobj::do_finalize_local_symbols): Call
9543 is_output_symtab_index_set rather than needs_output_symtab_entry.
9544 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9545 rather than needs_output_symtab_entry. Call
9546 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9547 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9548 is_output_symtab_index_set rather than needs_output_symtab_entry.
9549 * testsuite/discard_locals_relocatable_test.c: New file.
9550 * testsuite/discard_locals_test.sh: Test -r.
9551 * testsuite/Makefile.am (check_DATA): Add
9552 discard_locals_relocatable_test1.syms,
9553 discard_local_relocatable_test2.syms.
9554 (MOSTLYCLEANFILES): Likewise. Also add
9555 discard_locals_relocatable_test1.lout and
9556 discard_locals_relocatable_test2.out.
9557 (discard_locals_relocatable_test1.syms): New target.
9558 (discard_locals_relocatable_test.o): New target.
9559 (discard_locals_relocatable_test1.out): New target.
9560 (discard_locals_relocatable_test2.syms): New target.
9561 (discard_locals_relocatable_test2.out): New target.
9562 (various): Add missing ../ld-new dependencies.
9563 * testsuite/Makefile.in: Rebuild.
9564
9565 2010-03-03 Nick Clifton <nickc@redhat.com>
9566
9567 * po/fi.po: New Finnish translation.
9568
9569 2010-03-01 Doug Kwan <dougkwan@google.com>
9570
9571 * layout.cc (Layout::Layout): Force section types of .init_array*,
9572 .preinit_array* and .fini_array* sections.
9573 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9574 Fix check of return value of std::string::find.().
9575 (Output_section::Input_section_sort_compare::operator()): Remove
9576 comment about .init_array.
9577 (Output_section::Input_section_sort_init_fini_compare::operator()):
9578 New method.
9579 (Output_section::sort_attached_input_sections): Handle .init_array
9580 and .fini_array specially.
9581 * output.h (Output_section::Inut_section_sort_compare): Update
9582 comment.
9583 (Output_section::Input_section_sort_init_fini_compare): New struct.
9584
9585 2010-02-26 Doug Kwan <dougkwan@google.com>
9586
9587 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9588 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9589 * testsuite/debug_msg.sh: Avoid matching source line number for
9590 use of global variable undef_int.
9591
9592 2010-02-26 Doug Kwan <dougkwan@google.com>
9593
9594 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9595 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9596 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9597 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9598 * options.cc (General_options::General_options): Initialize member
9599 fix_v4bx_.
9600 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9601 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9602 and rm_no_fix_v4bx.stdout
9603 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9604 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9605 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9606 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9607 and arm_no_fix_v4bx.
9608 * Makefile.in: Regenerate.
9609 * testsuite/arm_fix_v4bx.s: New file.
9610 * testsuite/arm_fix_v4bx.sh: Ditto.
9611
9612 2010-02-24 Doug Kwan <dougkwan@google.com>
9613
9614 * arm.cc (Target_arm::got_section): Make the .got section the first
9615 non RELRO section in the data segment.
9616 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9617 suffixes of section names.
9618
9619 2010-02-24 Doug Kwan <dougkwan@google.com>
9620
9621 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9622 flags and attributes merging if an input file is a binary file.
9623 * fileread.cc (Input_file::open): Record format of original file.
9624 * fileread.h (Input_file::Format): New enum type.
9625 (Input_file::Input_file): Initialize data member format_.
9626 (Input_file::format): New method definition.
9627 (Input_file::format_):: New data member.
9628
9629 2010-02-24 Doug Kwan <dougkwan@google.com>
9630
9631 * arm.cc (Arm_output_data_got): New class.
9632 (ARM_TCB_SIZE): New constant
9633 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9634 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9635 If user uses a script with a SECTIONS clause, issue only a warning
9636 for a misplaced EXIDX input section. Otherwise, issue an error.
9637 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9638 garbage collection.
9639 (Target_arm::got_mode_index_entry): Handle static linking.
9640 (Target_arm::Scan::local): Ditto.
9641 (Target_arm::Scan::global): Ditto.
9642 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9643 all incorrectly implemented relocations.
9644 (Target_arm::fix_exidx_coverage): Pass layout to
9645 Arm_output_section::fix_exidx_coverage.
9646 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9647 from ".ARM.exidx." and ".ARM.extab.".
9648
9649 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9650
9651 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9652 section if it does not already exist.
9653 * attributes.cc (Attributes_section_data::Attributes_section_data):
9654 Don't crash if size is zero.
9655
9656 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9657 Ian Lance Taylor <iant@google.com>
9658
9659 * gold.cc (queue_middle_tasks): If no input files were opened,
9660 exit.
9661 * workqueue.h (Task_function::Task_function): Assert that there is
9662 a blocker.
9663
9664 2010-02-22 Doug Kwan <dougkwan@google.com>
9665
9666 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9667 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9668 types to avoid warnings due to different uint64_t implementations
9669 on different hosts.
9670
9671 2010-02-21 Doug Kwan <dougkwan@google.com>
9672
9673 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9674 handling of the maximum backward branch offset.
9675 (Arm_relocate_functions::thumb_branch_common): Ditto.
9676 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9677 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9678 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9679 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9680 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9681 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9682 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9683 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9684 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9685 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9686 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9687 thumb2_bl_out_of_range.o): New rules.
9688 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9689 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9690 thumb2_bl_out_of_range
9691 * testsuite/Makefile.in: Regenerate.
9692 * testsuite/arm_bl_in_range.s: New file.
9693 * testsuite/arm_bl_out_of_range.s: Ditto.
9694 * testsuite/arm_branch_in_range.sh: Ditto.
9695 * testsuite/arm_branch_range.t: Ditto.
9696 * testsuite/thumb2_branch_range.t: Ditto.
9697 * testsuite/thumb_bl_in_range.s: Ditto.
9698 * testsuite/thumb_bl_out_of_range.s: Ditto.
9699 * testsuite/thumb_branch_range.t: Ditto.
9700
9701 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9702
9703 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9704 Add reloc offset information.
9705 * icf.cc (get_section_contents): Change iterators to point to the new
9706 vectors. Add reloc offset information to the contents.
9707 * icf.h (Icf::Sections_reachable_info): New typedef.
9708 (Icf::Sections_reachable_list): New typedef.
9709 (Icf::Offset_info): New typedef.
9710 (Icf::Reloc_info): New struct typedef.
9711 (Icf::Reloc_info_list): New typedef.
9712 (Icf::symbol_reloc_list): Delete method.
9713 (Icf::addend_reloc_list): Delete method.
9714 (Icf::section_reloc_list): Delete method.
9715 (Icf::reloc_info_list): New method.
9716 (Icf::reloc_info_list_): New member.
9717
9718 2010-02-19 Doug Kwan <dougkwan@google.com>
9719
9720 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9721 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9722 * arm.cc (Arm_relocation_functions): New forward declaration.
9723 (Target_arm::Target_arm): Initialize new data members
9724 got_mod_index_offset_ and tls_base_symbol_defined_.
9725 (Target_arm::Relocate::relocate_tls): New method.
9726 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9727 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9728 New methods.
9729 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9730 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9731 (Target_arm::got_mod_index_offset_,
9732 Target_arm::tls_base_symbol_defined_): New data members.
9733 (Target_arm::Scan::local, Target::Scan::global,
9734 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9735 relocations.
9736
9737 2010-02-18 Doug Kwan <dougkwan@google.com>
9738
9739 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9740 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9741 text section as a parameter becuase some broken tools may not set
9742 the link in section header.
9743 (Target_arm::has_got_section): New method.
9744 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9745 without any mapping symbol as data only. Remove warning.
9746 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9747 link in its section header, try to discover the link by inspecting the
9748 REL31 relocation at the beginning of the section.
9749 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9750 in error message.
9751 (Target_arm::Scan::global): Treat any reference to the symbol
9752 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9753
9754 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9755
9756 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9757 (Scan::global_reloc_may_be_function_pointer): New function.
9758 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9759 (Scan::global_reloc_may_be_function_pointer): New function.
9760 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9761 (Scan::global_reloc_may_be_function_pointer): New function.
9762 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9763 (Scan::global_reloc_may_be_function_pointer): New function.
9764 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9765 (Scan::global_reloc_may_be_function_pointer): New function.
9766 (Scan::possible_function_pointer_reloc): New function.
9767 (Target_x86_64::can_check_for_function_pointers): New function.
9768 * gc.h (gc_process_relocs): Scan relocation types to determine if
9769 function pointers were taken for targets that support it.
9770 * icf.cc (Icf::find_identical_sections): Include functions for
9771 folding in safe ICF whose pointer is not taken.
9772 * icf.h (Secn_fptr_taken_set): New typedef.
9773 (fptr_section_id_): New member.
9774 (section_has_function_pointers): New function.
9775 (set_section_has_function_pointers): New function.
9776 (check_section_for_function_pointers): New function.
9777 * options.h: Fix comment for safe ICF option.
9778 * target.h (can_check_for_function_pointers): New function.
9779 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9780 Modify icf_safe_test for X86-64.
9781 * testsuite/Makefile.in: Regenerate.
9782 * testsuite/icf_safe_so_test.cc: New file.
9783 * testsuite/icf_safe_so_test.sh: New file.
9784 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9785 (main): Change to take pointer to function kept_func_3.
9786 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9787 folding is done correctly for X86-64.
9788
9789 2010-02-12 David S. Miller <davem@davemloft.net>
9790
9791 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9792 is_symbolless parameter.
9793 (Output_reloc<SHT_REL>::is_symbolless): New.
9794 (Output_reloc<SHT_REL>::is_symbolless_): New.
9795 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9796 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9797 (Output_reloc<SHT_RELA>::is_symbolless): New.
9798 (Output_data_reloc::add_global): Handle is_symbolless.
9799 (Output_data_reloc::add_global_relative): Likewise.
9800 (Output_data_reloc::add_local): Likewise.
9801 (Output_data_reloc::add_local_relative): Likewise.
9802 (Output_data_reloc::add_symbolless_global_addend): New.
9803 (Output_data_reloc::add_symbolless_local_addend): New.
9804 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9805 is_symbolless.
9806 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9807 instead of ->is_relative_
9808 (Output_reloc::write): Likewise.
9809 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9810 (Output_reloc::write_rel): Simplify.
9811
9812 * sparc.cc (Target_sparc::Scan::local): Use
9813 ->add_symbolless_local_addend as needed.
9814 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9815 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9816 based upon relocation offset.
9817
9818 2010-02-11 Doug Kwan <dougkwan@google.com>
9819
9820 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9821 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9822 beginning of function.
9823 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9824 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9825 parameter is_32bit in calls to should_apply_static_reloc.
9826 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9827 (check_DATA): Add arm_abs_global.stdout.
9828 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9829 arm_abs_global.stdout): New rules.
9830 (MOSTLLYCLEANFILES): Add arm_abs_global
9831 * Makefile.in: Regenerate.
9832 * testsuite/arm_abs_global.s: New file.
9833 * testsuite/arm_abs_global.sh: Ditto.
9834 * testsuite/arm_abs_lib.s: Ditto.
9835
9836 2010-02-11 Ian Lance Taylor <iant@google.com>
9837
9838 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9839 Read_relocs task.
9840 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9841 Allocate_commons_task first.
9842 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9843 task, rather than symtab_lock_.
9844 (Gc_process_relocs::~Gc_process_relocs): New function.
9845 (Gc_process_relocs::is_runnable): Check this_blocker_.
9846 (Gc_process_relocs::locks): Use next_blocker_ rather than
9847 blocker_.
9848 (Scan_relocs::~Scan_relocs): New function.
9849 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9850 symtab_lock_.
9851 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9852 next_blocker_.
9853 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9854 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9855 constructor accordingly.
9856 (class Gc_process_relocs): Likewise.
9857 (class Scan_relocs): Likewise.
9858 * common.h (class Allocate_commons_task): Remove symtab_lock_
9859 field, and corresponding constructor parameter.
9860 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9861 symtab_lock_.
9862 (Allocate_commons_task::locks): Likewise.
9863
9864 2010-02-11 Ian Lance Taylor <iant@google.com>
9865
9866 * gold-threads.h (class Once): Define.
9867 (class Initialize_lock): Rewrite as child of Once.
9868 * gold-threads.cc (class Once_initialize): Define.
9869 (once_pointer_control): New static variable.
9870 (once_pointer, once_arg): New static variables.
9871 (c_run_once): New static function.
9872 (Once::Once, Once::run_once, Once::internal_run): New functions.
9873 (class Initialize_lock_once): Remove.
9874 (initialize_lock_control): Remove.
9875 (initialize_lock_pointer): Remove.
9876 (initialize_lock_once): Remove.
9877 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9878 (Initialize_lock::initialize): Rewrite.
9879 (Initialize_lock::do_run_once): New function.
9880 * archive.cc (Archive::interpret_header): Only clear name if it is
9881 not already empty.
9882 * fileread.cc: Include "gold-threads.h"
9883 (file_counts_lock): New static variable.
9884 (file_counts_initialize_lock): Likewise.
9885 (File_read::release): Only increment counts when using --stats.
9886 Use a lock around the increment.
9887 * parameters.cc (class Set_parameters_target_once): Define.
9888 (set_parameters_target_once): New static variable.
9889 (Parameters::Parameters): Move here from parameters.h.
9890 (Parameters::set_target): Rewrite.
9891 (Parameters::set_target_once): New function.
9892 (Parameters::clear_target): Move here and rewrite.
9893 * parameters.h (class Parameters): Update declarations. Add
9894 set_parameters_target_once_ field.
9895 (Parameters::Parameters): Move to parameters.cc.
9896 (Parameters::clear_target): Likewise.
9897 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9898 task.
9899 (Start_group::~Start_group): New function.
9900 (Start_group::is_runnable): New function.
9901 (Start_group::locks, Start_group::run): New functions.
9902 (Finish_group::run): Change saw_undefined to size_t.
9903 * readsyms.h (class Start_group): Define.
9904 (class Finish_group): Change saw_undefined_ field to size_t.
9905 (Finish_group::Finish_group): Remove saw_undefined and
9906 this_blocker parameters. Change all callers.
9907 (Finish_group::set_saw_undefined): New function.
9908 (Finish_group::set_blocker): New function.
9909 * symtab.h (class Symbol_table): Change saw_undefined to return
9910 size_t. Change saw_undefined_ field to size_t.
9911 * target-select.cc (Set_target_once::do_run_once): New function.
9912 (Target_selector::Target_selector): Initialize set_target_once_
9913 field. Don't initialize lock_ and initialize_lock_ fields.
9914 (Target_selector::instantiate_target): Rewrite.
9915 (Target_selector::set_target): New function.
9916 * target-select.h (class Set_target_once): Define.
9917 (class Target_selector): Update declarations. Make
9918 Set_target_once a friend. Remove lock_ and initialize_lock_
9919 fields. Add set_target_once_ field.
9920
9921 2010-02-10 Ian Lance Taylor <iant@google.com>
9922
9923 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9924 queueing any tasks.
9925 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9926 (queue_middle_tasks): Add all blockers before queueing any tasks.
9927 (queue_final_tasks): Likewise.
9928 * token.h (Task_token::add_blockers): New function.
9929 * object.h (Input_objects::number_of_relobjs): New function.
9930
9931 2010-02-10 Ian Lance Taylor <iant@google.com>
9932
9933 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9934 shared, not if not position independent.
9935 * x86_64.cc (Relocate::relocate_tls): Likewise.
9936 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9937 (tls_pie_pic_test): New target.
9938 * testsuite/Makefile.in: Rebuild.
9939
9940 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9941 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9942 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9943 * testsuite/Makefile.in: Rebuild.
9944
9945 2010-02-09 David S. Miller <davem@davemloft.net>
9946
9947 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9948 R_SPARC_RELATIVE using ->add_local_relative().
9949 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9950
9951 * output.h (Output_data_dynamic::add_section_size): New method
9952 that takes two Output_data objects.
9953 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9954 entry param. Handle it in initializers.
9955 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9956 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9957 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9958 arg.
9959 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9960 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9961 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9962 for dynrel_includes_plt.
9963 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9964 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9965 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9966 before .rela.plt
9967 (Target_sparc::do_finalize_sections): Update to pass true for
9968 dynrel_includes_plt.
9969 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9970 output before .rela.plt
9971 (Target_powerpc::do_finalize_sections): Update to pass true for
9972 dynrel_includes_plt when 32-bit.
9973
9974 2010-02-08 Doug Kwan <dougkwan@google.com>
9975
9976 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9977 method.
9978 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9979 Arm_relobj::scan_section_for_cortex_a8_stubs,
9980 Arm_relobj::do_relocation_section): Instead of calling
9981 Output_section::output_address, use faster
9982 Arm_relobj::simple_input_section_output_address.
9983
9984 2010-02-08 David S. Miller <davem@davemloft.net>
9985
9986 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9987 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9988 relocation helper function.
9989
9990 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9991 just like R_SPARC_GOT{10,13,22}.
9992 (Target_sparc::Scan::local): Likewise.
9993 (Target_sparc::Relocate:relocate): Likewise.
9994
9995 2010-02-06 Ian Lance Taylor <iant@google.com>
9996
9997 * configure.ac: Rewrite targetobjs duplicate removal code to use
9998 only shell constructs.
9999 * configure: Rebuild.
10000
10001 2010-02-05 Doug Kwan <dougkwan@google.com>
10002
10003 PR 11247
10004 * arm.cc (Arm_relobj::section_is_scannable): New method.
10005 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10006 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10007
10008 2010-02-04 Doug Kwan <dougkwan@google.com>
10009
10010 PR 11247
10011 * arm-reloc-property.cc (cstdio): Include.
10012 * configure.ac (targetobjs): Remove duplicates.
10013 * configure: Regenerate.
10014 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10015 big and little endian version for a given address size.
10016
10017 2010-02-03 Doug Kwan <dougkwan@google.com>
10018
10019 * arm-reloc-property.cc
10020 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10021 definition.
10022 * arm-reloc-property.h
10023 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10024 New method definition.
10025 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10026 declaration.
10027 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10028 overflow to N.
10029 (GOT_PREL): Change implemented to Y.
10030 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10031 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10032 (Arm_relocate_functions::movw_abs_nc): Remove method.
10033 (Arm_relocate_functions::movt_abs): Ditto.
10034 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10035 (Arm_relocate_functions::thm_movt_abs): Ditto.
10036 (Arm_relocate_functions::movw_rel_nc): Ditto.
10037 (Arm_relocate_functions::movw_rel): Ditto.
10038 (Arm_relocate_functions::movt_rel): Ditto.
10039 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10040 (Arm_relocate_functions:thm_movw_rel): Ditto.
10041 (Arm_relocate_functions:thm_movt_rel): Ditto.
10042 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10043 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10044 New method definitions.
10045 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10046 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10047 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10048 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10049 (Target_arm::Relocate::relocate): Check for non-static or
10050 unimplemented relocation code and exit early. Change calls to
10051 Target_arm::reloc_uses_thumb_bit and
10052 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10053 instead. Refactor code to handle similar relocations to increase
10054 code sharing. Remove check for unsupported relocation code in switch
10055 statement.
10056 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10057 relocation property table to find out size. Change error message to
10058 print out the name of a relocation code instead of the numeric value.
10059 (Target_arm::scan_reloc_for_stub): Use relocation property table
10060 instead of calling Target_arm::reloc_uses_thumb_bit().
10061
10062 2010-02-02 Doug Kwan <dougkwan@google.com>
10063
10064 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10065 types of relaxed input section.
10066
10067 2010-02-02 Doug Kwan <dougkwan@google.com>
10068
10069 * Makefile.am (HFILES): Add arm-reloc-property.h.
10070 (DEFFILES): New.
10071 (TARGETSOURCES): Add arm-reloc-property.cc
10072 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
10073 (libgold_a_SOURCES): $(DEFFILES)
10074 * Makefile.in: Regenerate.
10075 * arm-reloc-property.cc: New file.
10076 * arm-reloc-property.h: New file.
10077 * arm-reloc.def: New file.
10078 * arm.cc: Update comments.
10079 (arm-reloc-property.h): New included header.
10080 (arm_reloc_property_table): New global variable.
10081 (Target_arm::do_select_as_default_target): New method definition.
10082 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10083 arm-reloc-property to targ_extra_obj.
10084 * parameters.cc (set_parameters_target): Call
10085 Target::select_as_default_target().
10086 * target.h (Target::select_as_default_target): New method definition.
10087 (Target::do_select_as_default_target): Same.
10088
10089 2010-02-01 Doug Kwan <dougkwan@google.com>
10090
10091 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10092 first_output_text_section_.
10093 (Arm_exidx_fixup::first_output_text_section): New method definition.
10094 (Arm_exidx_fixup::first_output_text_section_): New data member.
10095 (Arm_exidx_fixup::process_exidx_section): Record the first text
10096 output section seen.
10097 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10098 and entsize in output section header.
10099
10100 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10101
10102 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10103 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10104 (Arm_relocate_functions::thm_alu11): New Method.
10105 (Arm_relocate_functions::thm_pc8): New Method.
10106 (Arm_relocate_functions::thm_pc12): New Method.
10107 (Target_arm::Scan::local): Handle the relocations.
10108 (Target_arm::Scan::global): Likewise.
10109 (Target_arm::Relocate::relocate): Likewise.
10110 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10111
10112 2010-01-29 Doug Kwan <dougkwan@google.com>
10113
10114 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10115 of relocation types as ld.
10116
10117 2010-01-29 Doug Kwan <dougkwan@google.com>
10118
10119 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10120 to public.
10121 (Arm_relocate_functions::thumb_branch_common): Ditto.
10122 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10123 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10124 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10125 Arm_relocate_functions::jump24): Remove.
10126 (Target_arm::Relocate::relocate): Adjust code to call
10127 Arm_relocation_functions::arm_branch_common and
10128 Arm_relocation_functions::thumb_branch_common instead of their removed
10129 wrappers. Merge switch-cases together to reduce source code size.
10130
10131 2010-01-29 Doug Kwan <dougkwan@google.com>
10132
10133 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10134 output_local_symbol_count_needs_update_.
10135 (Arm_relobj::output_local_symbol_count_needs_update,
10136 Arm_relobj::set_output_local_symbol_count_needs_update,
10137 Arm_relobj::update_output_local_symbol_count): New methods.
10138 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10139 member.
10140 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10141 of pointed function as in a R_ARM_PREL31 relocation.
10142 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10143 for output local symbol count updating.
10144 (Target_arm::do_relax): Update output local symbol counts in objects
10145 if necessary.
10146 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10147
10148 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10149
10150 * arm.cc: Added support for the ARM relocations:
10151 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10152 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10153 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10154 movw_prel_nc).
10155 (Arm_relocate_functions::movw_rel): New method.
10156 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10157 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10158 thm_movw_prel_nc).
10159 (Arm_relocate_functions::thm_movw_rel): New method.
10160 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10161 thm_movt_prel).
10162 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10163 relocations.
10164 (Target_arm::Scan::global): Likewise.
10165 (Target_arm::Relocate::relocate): Likewise.
10166 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10167 Likewise.
10168
10169 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10170
10171 * arm.cc: Added support for ARM group relocations.
10172 (Target_arm::reloc_needs_sym_origin): New method.
10173 (Arm_relocate_functions::calc_grp_kn): New method.
10174 (Arm_relocate_functions::calc_grp_residual): New method.
10175 (Arm_relocate_functions::calc_grp_gn): New method.
10176 (Arm_relocate_functions::arm_grp_alu): New Method.
10177 (Arm_relocate_functions::arm_grp_ldr): New Method.
10178 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10179 (Arm_relocate_functions::arm_grp_ldc): New Method.
10180 (Target_arm::Scan::local): Handle the ARM group relocations.
10181 (Target_arm::Scan::global): Likewise.
10182 (Target_arm::Relocate::relocate): Likewise.
10183 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10184 Likewise.
10185
10186 2010-01-26 Doug Kwan <dougkwan@google.com>
10187
10188 * arm.cc (set): Include.
10189 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10190 pointer type.
10191 (Arm_output_section::Text_section_list): New type.
10192 (Arm_output_section::append_text_sections_to_list): New method.
10193 (Arm_output_section::fix_exidx_coverage): Ditto.
10194 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10195 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10196 Relobj::set_section_offset() instead of
10197 Sized_relobj::invalidate_section_offset().
10198 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10199 parameter for section headers. Ignore relocation sections for
10200 unallocated sections and EXIDX sections.
10201 (Target_arm::fix_exidx_coverage): New method.
10202 (Target_arm::output_section_address_less_than): New type.
10203 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10204 linked text section instead of the EXIDX section.
10205 (Arm_output_section::create_stub_group): Add an assertion to check
10206 that this is not an EXIDX output section.
10207 (Arm_output_section::append_text_sections_to_list): New method.
10208 (Arm_output_section::fix_exidx_coverage): Ditto.
10209 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10210 Arm_relobj::section_needs_reloc_stub_scanning.
10211 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10212 first pass.
10213 (Target_arm::fix_exidx_coverage): New method.
10214 * object.h (Relobj::set_output_section): New method.
10215 (Sized_relobj::invalidate_section_offset): Remove method.
10216 (Sized_relobj::do_invalidate_section_offset): Remove method.
10217 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10218
10219 2010-01-25 Doug Kwan <dougkwan@google.com>
10220
10221 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10222 Fix warning due to signed and unsigned comparison on a 32-bit host.
10223
10224 2010-01-22 Doug Kwan <dougkwan@google.com>
10225
10226 * arm.cc (Target_arm::do_relax): Record an output section for section
10227 offset adjustment it contains any stub table that has changed.
10228 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10229 offsets in an output section if necessary.
10230 * output.cc (Output_section::Output_section): Initialize
10231 section_offsets_need_adjustments_.
10232 (Output_section::add_input_section_for_script): Renamed to
10233 Output_section::add_simple_input_section.
10234 (Output_section::save_states): Add a comment.
10235 (Output_section::discard_states): New method defintion.
10236 (Output_section::adjust_section_offsets): Same.
10237 * output.h (Output_section::add_input_section_for_script): Renamed to
10238 Output_section::add_simple_input_section.
10239 (Output_section::discard_states): New method declaration.
10240 (Output_section::adjust_section_offsets): Same.
10241 (Output_section::section_offsets_need_adjustment,
10242 Output_section::set_section_offsets_need_adjustment): New method
10243 definitions.
10244 (Output_section::section_offsets_need_adjustment_): New data member.
10245 * script-sections.cc
10246 (Output_section_element_input::set_section_address): Adjust code for
10247 renaming of Output_section::add_input_section_for_script.
10248 (Orphan_output_section::set_section_address): Same.
10249
10250 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10251
10252 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10253 Fix_v4bx enum values .
10254 * gold/options.h (General_options): New option definitions.
10255 (General_options::fix_v4bx): New method.
10256 (General_options::Fix_v4bx): New enum.
10257 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10258 (General_options::parse_fix_v4bx_interworking): New method.
10259
10260 2010-01-22 Doug Kwan <dougkwan@google.com>
10261
10262 * arm.cc (Arm_exidx_fixup): New class.
10263
10264 2010-01-21 Doug Kwan <dougkwan@google.com>
10265
10266 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10267 classes.
10268 (Arm_exidx_section_offset_map): New type.
10269
10270 2010-01-21 Doug Kwan <dougkwan@google.com>
10271
10272 * arm.cc (Arm_exidx_input_section): New class.
10273 (Arm_relobj::exidx_input_section_by_link,
10274 Arm_relobj::exidx_input_section_by_shndx,
10275 Arm_relobj::make_exidx_input_section): New methods.
10276 (read_arm_attributes_section): Remove.
10277 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10278 information about them.
10279 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10280 to here.
10281
10282 2010-01-20 Doug Kwan <dougkwan@google.com>
10283
10284 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10285 Input_section_specifier to Section_id.
10286 (Target_arm::new_arm_input_section: Adjust code for change of key
10287 type.
10288 (Target_arm::find_arm_input_section): Ditto.
10289 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10290 (Section_id): Remove.
10291 (Garbage_collection::Section_id_hash): Remove.
10292 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10293 (Section_id): Remove.
10294 (Icf::Section_id_hash): Remove.
10295 * object.h (Section_id, Const_section_id, Section_id_hash,
10296 Const_section_id_hash): New type definitions.
10297 * output.cc (Output_section::add_relaxed_input_section): Change to
10298 use Const_section_id instead of Input_section_specifier as key type.
10299 (Output_section::add_merge_input_section): Ditto.
10300 (Output_section::build_relaxation_map): Change to use Section_id
10301 instead of Input_section_specifier as key type.
10302 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10303 Ditto.
10304 (Output_section::convert_input_sections_to_relaxed_sections): Change
10305 to use Const_section_id instead of Input_section_specifier as key type.
10306 (Output_section::find_merge_section): Ditto.
10307 (Output_section::find_relaxed_input_section): Ditto.
10308 * output.h (Input_section_specifier): Remove class.
10309 (Output_section::Output_section_data_by_input_section_map): Change
10310 key type to Const_section_id.
10311 (Output_section::Output_relaxed_input_section_by_input_section_map):
10312 Ditto.
10313 (Output_section::Relaxation_map): Change key type to Section_id.
10314
10315 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10316
10317 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10318 (class Arm_v4bx_stub): New class.
10319 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10320 (Stub_factory::make_arm_v4bx_stub): New method.
10321 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10322 (Stub_table::empty): Handle v4bx stubs.
10323 (Stub_table::add_arm_v4bx_stub): New method.
10324 (Stub_table::find_arm_v4bx_stub): New method.
10325 (Arm_relocate_functions::v4bx): New method.
10326 (Target_arm::fix_v4bx): New method.
10327 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10328 (Stub_table::relocate_stubs): Likewise.
10329 (Stub_table::do_write): Likewise.
10330 (Stub_table::update_data_size_and_addralign): Likewise.
10331 (Stub_table::finalize_stubs): Likewise.
10332 (Target_arm::Scan::local): Likewise.
10333 (Target_arm::Scan::global): Likewise.
10334 (Target_arm::do_finalize_sections): Likewise.
10335 (Target_arm::Relocate::relocate): Likewise.
10336 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10337 Likewise.
10338 (Target_arm::scan_reloc_for_stub): Likewise.
10339 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10340
10341 2010-01-19 Ian Lance Taylor <iant@google.com>
10342
10343 * output.cc (Output_section_headers::do_sized_write): Write large
10344 segment count to sh_info field.
10345 (Output_file_header::do_sized_write): For large segment count,
10346 write PN_XNUM to e_phnum field.
10347
10348 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10349
10350 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10351 (Arm_relocate_functions::thm_jump8): New function.
10352 (Arm_relocate_functions::thm_jump11): New function.
10353 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10354 R_ARM_THM_JUMP11.
10355 (Target_arm::Scan::global): Likewise.
10356 (Target_arm::Relocate::relocate): Likewise.
10357 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10358 Likewise.
10359
10360 2010-01-14 Doug Kwan <dougkwan@google.com>
10361
10362 * arm.cc (map, utility): Include headers.
10363 (Target_arm::apply_cortex_a8_workaround): New method.
10364 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10365 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10366 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10367 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10368 the --[no-]fix-cortex-a8 command line options.
10369 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10370 (Target_arm::relocate_stub): Use addend in instruction template.
10371 * options.h (DEFINE_bool): Set the user-set flag.
10372 (General_options): Add --[no-]-fix-cortex options.
10373 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10374 : Update fast look-up map after conversion.
10375
10376 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10377
10378 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10379 in the first pass of do_layout.
10380
10381 2010-01-13 Doug Kwan <dougkwan@google.com>
10382
10383 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10384 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10385 apparent compiler problem of not folding static constant integral
10386 data members of elfcpp::Elf_sizes<32>.
10387
10388 2010-01-13 Doug Kwan <dougkwan@google.com>
10389
10390 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10391 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10392 Arm_relobj::scan_section_for_cortex_a8_erratum,
10393 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10394 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10395 sections to scan for relocation stubs into a new method
10396 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10397 relocation and Cortex-A8 stub scanning.
10398 (Target_arm::do_relax): Force stubs to be after stubbed sections
10399 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10400 the beginning of a new relaxation pass. Update a comment.
10401 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10402
10403 2010-01-12 Ian Lance Taylor <iant@google.com>
10404
10405 * target-reloc.h (visibility_error): New inline function.
10406 (relocate_section): Call visibility_error.
10407 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10408 (MOSTLYCLEANFILES): Likewise.
10409 (protected_4_pic.o, protected_3.err): New targets.
10410 * testsuite/protected_4.cc: New file.
10411
10412 2010-01-12 Doug Kwan <dougkwan@google.com>
10413
10414 * arm.cc (Cortex_a8_reloc): New class.
10415 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10416 and cortex_a8_relocs_info_.
10417 (Target_arm::fix_cortex_a8): New method definition.
10418 (Target_arm::Cortex_a8_relocs_info): New type.
10419 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10420 New data member declarations.
10421 (Target_arm::scan_reloc_for_stub): Record information about
10422 relocations for THUMB branches that might be exempted from the
10423 Cortex-A8 workaround.
10424 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10425 at the beginning of a relaxation pass.
10426
10427 2010-01-12 Doug Kwan <dougkwan@google.com>
10428
10429 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10430 (Arm_relobj::Mapping_symbol_position,
10431 Arm_reloj::Mapping_symbol_position_less,
10432 Arm_relobj::Mapping_symbols_info): New types.
10433 (Target_arm::is_mapping_symbol_name): New method definition.
10434 (Arm_relobj::do_count_local_symbols): Save information about mapping
10435 symbols.
10436
10437 2010-01-11 Doug Kwan <dougkwan@google.com>
10438
10439 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10440 Arm_relocate_functions::thumb32_branch_upper,
10441 Arm_relocate_functions::thumb32_branch_lower,
10442 Arm_relocate_functions::thumb32_cond_branch_offset,
10443 Arm_relocate_functions::thumb32_cond_branch_upper,
10444 Arm_relocate_functions::thumb32_cond_branch_lower,
10445 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10446 branch offset encoding.
10447 (Arm_relocate_functions::thumb_branch_common): Use new branch
10448 offset encoding methods to avoid code duplication.
10449 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10450 (Stub_addend_reader::operator()): Use new branch encoding method
10451 to avoid code duplication.
10452
10453 2010-01-11 Doug Kwan <dougkwan@google.com>
10454
10455 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10456 (Target_arm::do_finalize_sections): Define special EXIDX section
10457 symbols only if referenced.
10458 * gc.h (Garbage_collection::add_reference): New method.
10459 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10460 code duplication.
10461
10462 2010-01-11 Ian Lance Taylor <iant@google.com>
10463
10464 * script.cc (Version_script_info::build_expression_list_lookup):
10465 Change complaing about duplicate wildcard match from error to
10466 warning.
10467
10468 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10469 of 2009-12-30.
10470 (Version_script_info::Version_script_info): Initialize globs_,
10471 default_version_, default_is_global_, and exact_. Don't
10472 initialize globals_ or locals_.
10473 (Version_script_info::build_lookup_tables): Build local symbols
10474 first.
10475 (Version_script_info::unquote): New function.
10476 (Version_script_info::add_exact_match): New function.
10477 (Version_script_info::build_expression_list_lookup): Remove lookup
10478 parameter. Add is_global parameter. Change all callers. Handle
10479 wildcard pattern specially. Unquote pattern. Call
10480 add_exact_match.
10481 (Version_script_info::get_name_to_match): New function.
10482 (Version_script_info::get_symbol_version): New function.
10483 (Version_script_info::get_symbol_version_helper): Remove.
10484 (Version_script_info::check_unmatched_names): Call unquote.
10485 * script.h (class Version_script_info): Change get_symbol_version
10486 to be non-inline and add is_global parameter; change all callers.
10487 Rewrite symbol_is_local. Update declarations. Define struct
10488 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10489 Remove globals_ and locals_ members. Add exact_, globs_,
10490 default_version_, is_global_.
10491 (Version_script_info::Glob): Remove pattern, add expression and
10492 is_global. Update constructor. Change all callers.
10493 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10494 default version.
10495 (Versions::symbol_section_contents): If a symbol is undefined, or
10496 defined in a dynamic object, set the version index to
10497 VER_NDX_LOCAL.
10498 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10499 symbol_is_local.
10500 (Symbol_table::add_from_pluginobj): Likewise.
10501 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10502
10503 2010-01-11 Doug Kwan <dougkwan@google.com>
10504
10505 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10506 (incremental_dump_LDADD): Add linking option for libintl.
10507 * Makefile.in: Regenerate.
10508
10509 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10510
10511 PR gold/11144
10512 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10513 instead of -Ds.
10514 * testsuite/Makefile.in: Regenerated.
10515
10516 2010-01-10 Doug Kwan <dougkwan@google.com>
10517
10518 * options.h (DEFINE_var): Use parentheses around argument varname__
10519 in macro body to avoid any unintended subsequent substitutions.
10520
10521 2010-01-10 Ian Lance Taylor <iant@google.com>
10522
10523 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10524 candidates before doing symbol resolution.
10525
10526 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10527 ODR candidates if only one is weak.
10528
10529 2010-01-08 Ian Lance Taylor <iant@google.com>
10530
10531 * script.cc (Version_script_info::build_expression_list_lookup):
10532 Don't warn about ambiguous version, just record the ambiguity.
10533 (Version_script_info::get_symbol_version_helper): Give error if
10534 version is ambiguous.
10535
10536 2010-01-08 Doug Kwan <dougkwan@google.com>
10537
10538 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10539 prev_data_size_ and prev_addralign_. Remove initializer for
10540 deleted data member has_been_changed_.
10541 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10542 to determine if the table is empty.
10543 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10544 Remove.
10545 (Stub_table::add_reloc_stub): Define method in class definition
10546 instead of just declaring it there.
10547 (Stub_table::add_cortex_a8_stub): New method definition.
10548 (Stub_table::update_data_size_and_addralign): Ditto.
10549 (Stub_table::finalize_stubs): Ditto.
10550 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10551 (Stub_table::do_addralign_): Return address alignment in the
10552 (Stub_table::do_reset_address_and_file_offset): Define method in
10553 class definition instead of declaring it there. Set current data
10554 size to be the data size of the previous pass.
10555 (Stub_table::set_final_data_size): Use current data size as the
10556 final data size.
10557 (Stub_table::relocate_stub): Change parameter type of stub from
10558 Reloc_stub pointer to Stub pointer.
10559 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10560 (Stub_table::Cortex_a8_stub_list): New typedef.
10561 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10562 Stub_table::prev_addralign_): New data member.
10563 (Arm_relobj::Arm_relobj): Initialize data member
10564 section_has_cortex_a8_workaround_.
10565 (Arm_relobj::section_has_cortex_a8_workaround,
10566 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10567 definitions.
10568 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10569 declarations.
10570 (Target_arm::relocate_stub): Change parameter type of stub from
10571 Reloc_stub pointer to Stub pointer.
10572 (Insn_template::size, Insn_template::alignment): Handle
10573 THUMB16_SPECIAL_TYPE.
10574 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10575 Stub_table::update_data_size_and_addralign,
10576 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10577 definitions.
10578 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10579 (Stub_table::do_write): Ditto.
10580 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10581
10582 2010-01-08 Ian Lance Taylor <iant@google.com>
10583
10584 PR 11108
10585 * symtab.h (class Symbol): Remove fields is_target_special_ and
10586 has_plt_offset_. Add field is_defined_in_discarded_section_.
10587 (Symbol::is_defined_in_discarded_section): New function.
10588 (Symbol::set_is_defined_in_discarded_section): New function.
10589 (Symbol::has_plt_offset): Rewrite.
10590 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10591 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10592 Don't initialize is_target_special_ or has_plt_offset_.
10593 Initialize is_defined_in_discarded_section_.
10594 (Symbol_table::add_from_relobj): If appropriate, set
10595 is_defined_in_discarded_section.
10596 * resolve.cc (Symbol::override_base_with_special): Don't test
10597 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10598 * target-reloc.h (relocate_section): Do special handling for
10599 symbols defined in discarded sections for global symbols as well
10600 as local symbols.
10601
10602 2010-01-08 Ian Lance Taylor <iant@google.com>
10603
10604 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10605 the SHT_SYMTAB case.
10606
10607 2010-01-08 Ian Lance Taylor <iant@google.com>
10608
10609 * object.cc (Sized_relobj::do_layout): Don't get confused if
10610 layout_eh_frame returns NULL.
10611
10612 2010-01-08 Ian Lance Taylor <iant@google.com>
10613
10614 PR 11084
10615 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10616 dynamic symbol table, use the normal symbol table.
10617 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10618 symbol table.
10619
10620 2010-01-08 Ian Lance Taylor <iant@google.com>
10621
10622 PR 11072
10623 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10624 sections.
10625
10626 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10627
10628 * version.cc (print_version): Change to "Copyright 2010".
10629
10630 2010-01-08 Ian Lance Taylor <iant@google.com>
10631
10632 PR 10287
10633 PR 11063
10634 * i386.cc (class Target_i386): Change return type of plt_section
10635 to be non-const.
10636 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10637 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10638 tls_desc_rel_ field.
10639 (Output_data_plt_i386::rel_tls_desc): New function.
10640 (Target_i386::rel_tls_desc_section): New function.
10641 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10642 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10643 R_386_TLS_DESC reloc in rel_tls_desc_section.
10644 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10645 Define struct Tlsdesc_info.
10646 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10647 (Target_x86_64::do_reloc_symbol_index): New function.
10648 (Target_x86_64::add_tlsdesc_info): New function.
10649 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10650 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10651 tlsdesc_rel_ field.
10652 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10653 all callers.
10654 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10655 (Target_x86_64::rela_tlsdesc_section): New function.
10656 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10657 handling.
10658 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10659 (Target_x86_64::do_reloc_addend): New function.
10660 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10661 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10662 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10663 (Output_reloc::type): New function.
10664 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10665 (Output_reloc::is_target_specific): New function.
10666 (Output_reloc::target_arg): New function.
10667 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10668 absolute relocs and target specific relocs.
10669 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10670 add_target_specific.
10671 (class Output_data_reloc) [SHT_RELA]: Likewise.
10672 * output.cc (Output_reloc::Output_reloc): Add four new versions
10673 for absolute relocs and target specific relocs.
10674 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10675 (Output_reloc::get_symbol_index): Likewise.
10676 (Output_reloc::local_section_offset): Check that local_sym_index_
10677 is not TARGET_CODE or 0.
10678 (Output_reloc::symbol_value): Likewise.
10679 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10680 reloc.
10681 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10682 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10683 functions.
10684 * layout.cc (add_target_dynamic_tags): Use output section for
10685 DT_PLTRELSZ and DT_JMPREL.
10686
10687 2010-01-07 Ian Lance Taylor <iant@google.com>
10688
10689 PR 11061
10690 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10691 function.
10692 (class Output_data_reloc_generic): Define.
10693 (class Output_data_reloc_base): Change base class to
10694 Output_data_reloc_generic. Change add() method to call
10695 bump_relative_reloc_count for a relative reloc. Remove
10696 sort_relocs_ field.
10697 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10698 to sort_relocs().
10699 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10700 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10701 appropriate.
10702 * layout.h (class Layout): Update declaration.
10703
10704 2010-01-07 Ian Lance Taylor <iant@google.com>
10705
10706 * output.h (class Output_data): Add const version of
10707 output_section and do_output_section.
10708 (class Output_section_data): Add const version of
10709 do_output_section.
10710 (class Output_section): Likewise.
10711 * layout.cc (Layout::add_target_dynamic_tags): New function.
10712 * layout.h (class Layout): Update declarations.
10713 * arm.cc (Target_arm::do_finalize_sections): Use
10714 add_target_dynamic_tags.
10715 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10716 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10717 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10718 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10719
10720 2010-01-07 Ian Lance Taylor <iant@google.com>
10721
10722 PR 11042
10723 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10724 object as needed.
10725
10726 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10727 Ian Lance Taylor <iant@google.com>
10728
10729 PR 11019
10730 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10731 Xindex::read_symtab_xindex.
10732
10733 2010-01-07 Doug Kwan <dougkwan@google.com>
10734
10735 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10736 (Insn_template::thumb16_bcond_insn): New method declaration.
10737 (Insn_template): Fix spelling.
10738 (Stub::thumb16_special): New method declaration.
10739 (Stub::do_write): Define virtual method which was previously pure
10740 virtual.
10741 (Stub::do_thumb16_special): New method declaration.
10742 (Stub::do_fixed_endian_write): New template member.
10743 (Reloc_stub::do_write): Remove.
10744 (Reloc_stub::do_fixed_endian_write): Remove.
10745 (Cortex_a8_stub): New class definition.
10746 (Stub_factory::make_cortex_a8_stub): New method definition.
10747 (Stub_factory::Stub_factory): Add missing static storage class
10748 qualifier for elf32_arm_stub_a8_veneer_blx.
10749
10750 2010-01-07 Ian Lance Taylor <iant@google.com>
10751
10752 PR 10980
10753 * options.h (class General_options): Add --warn-unresolved-symbols
10754 and --error-unresolved-symbols.
10755 * errors.cc (Errors::undefined_symbol): Implement
10756 --warn-unresolved-symbols.
10757
10758 * options.h (class General_options): Add -z text and -z textoff.
10759 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10760
10761 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10762
10763 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10764 (Garbage_collection::cident_sections): New function.
10765 (Garbage_collection::add_cident_section): New function.
10766 (Garbage_collection::cident_sections_): New member.
10767 (gc_process_relocs): Add references to sections whose names are C
10768 identifiers.
10769 * gold.h (cident_section_start_prefix): New constant.
10770 (cident_section_stop_prefix): New constant.
10771 (is_cident): New function.
10772 * layout.cc (Layout::define_section_symbols): Replace string constants
10773 with the newly defined constants.
10774 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10775 C identifiers.
10776 * testsuite/Makefile.am: Add gc_orphan_section_test.
10777 * testsuite/Makefile.in: Regenerate.
10778 * testsuite/gc_orphan_section_test.cc: New file.
10779 * testsuite/gc_orphan_section_test.sh: New file.
10780
10781 2010-01-06 Ian Lance Taylor <iant@google.com>
10782
10783 PR 10980
10784 * options.h (class General_options): Add --warn-shared-textrel.
10785 * layout.cc (Layout::finish_dynamic_section): Implement
10786 --warn-shared-textrel.
10787
10788 PR 10980
10789 * options.h (class General_options): Add --warn-multiple-gp.
10790
10791 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10792
10793 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10794 $(THREADSLIB) and $(LIBDL).
10795 * Makefile.in: Rebuild.
10796
10797 2010-01-06 Ian Lance Taylor <iant@google.com>
10798
10799 PR 10980
10800 * options.cc (General_options::parse_section_start): New function.
10801 (General_options::section_start): New function.
10802 (General_options::General_options): Initialize all members.
10803 * options.h: Include <map>
10804 (class General_options): Add --section-start. Add section_starts_
10805 member.
10806 * layout.cc (Layout::attach_allocated_section_to_segment): If
10807 --section-start was used, set the address of the segment. Remove
10808 local sort_sections.
10809 (Layout::relaxation_loop_body): If the address of the load segment
10810 has been set by --section-start, don't use it.
10811 * output.h (Output_segment::update_flags_for_output_section): New
10812 function.
10813 * output.cc (Output_segment::add_output_section): Call
10814 update_flags_for_output_section.
10815
10816 2010-01-05 Ian Lance Taylor <iant@google.com>
10817
10818 PR 10980
10819 * options.h (class General_options): Add --undefined-version.
10820 * script.cc (struct Version_expression): Add was_matched_by_symbol
10821 field.
10822 (Version_script_info::matched_symbol): New function.
10823 (Version_script_info::get_symbol_version_helper): Call
10824 matched_symbol.
10825 (Version_script_info::check_unmatched_names): New function.
10826 * script.h (class Version_script_info): Update declarations.
10827 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10828
10829 * options.h (class General_options): Use DEFINE_bool_alias for
10830 allow_multiple_definition.
10831 * resolve.cc (Symbol_table::should_override): Don't test
10832 allow_multiple_definition.
10833
10834 PR 10980
10835 * options.h (class General_options): Add --cref.
10836 * main.cc (main): Print cref table if --cref. Don't close mapfile
10837 until after printing cref table.
10838 * cref.cc: Include "symtab.h".
10839 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10840 (Cref_table_compare::operator()): New function.
10841 (Cref_inputs::gather_cref): New function.
10842 (filecol): New static const.
10843 (Cref_inputs::print_cref): New function.
10844 (Cref::print_cref): New function.
10845 * cref.h: Include <cstdio>.
10846 (class Cref): Update declarations.
10847 * mapfile.h (Mapfile::file): New function.
10848 * object.h (class Object): Define Symbols. Declare virtual
10849 do_get_global_symbols.
10850 (Object::get_global_symbols): New function.
10851 * object.cc (Input_objects::add_object): Pass object to cref_ if
10852 --cref.
10853 (Input_objects::archive_start): Likewise.
10854 (Input_objects::archive_stop): Likewise.
10855 (Input_objects::print_cref): New function.
10856 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10857 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10858 --cref.
10859 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10860 function.
10861 * plugin.h (class Sized_pluginobj): Update declarations.
10862
10863 2010-01-05 Ian Lance Taylor <iant@google.com>
10864
10865 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10866 to is_default_version. Rename insdef to insdefault.
10867 (Symbol_table::add_from_relobj): Rename def to is_default_version
10868 and local to is_forced_local.
10869 (Symbol_table::add_from_pluginobj): Likewise.
10870 (Symbol_table::add_from_dynobj): Likewise.
10871 (Symbol_table::define_special_symbol): Rename insdef to
10872 insdefault.
10873
10874 2010-01-04 Ian Lance Taylor <iant@google.com>
10875
10876 PR 10980
10877 * options.h (class General_options): Add
10878 --allow-multiple-definition and -z muldefs.
10879 * resolve.cc (Symbol_table::should_override): Don't warn about a
10880 multiple symbol definition if --allow-multiple-definition or -z
10881 muldefs.
10882
10883 PR 10980
10884 * options.h (class General_options): Add --add-needed and
10885 --copy-dt-needed-entries. Tweak --as-needed help entry.
10886 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10887 error if --copy-dt-needed-entries aka --add-needed is used and
10888 would cause a change in behaviour.
10889
10890 PR 10980
10891 * options.h (class General_options): Add -G as a short version of
10892 --shared. Add no-op options -assert, -g, and -i.
10893
10894 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10895
10896 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10897 check for .text or .gnu.linkonce.t sections.
10898 * icf.cc (Icf::find_identical_sections): Ditto.
10899 Change the detection for mangled function name within the section
10900 name.
10901 * icf.h (is_section_foldable_candidate): New function.
10902
10903 2009-12-30 Ian Lance Taylor <iant@google.com>
10904
10905 PR 10980
10906 * options.h (class General_options): Permit two dashes with
10907 --retain-symbols-file.
10908
10909 2009-12-30 Ian Lance Taylor <iant@google.com>
10910
10911 PR 10979
10912 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10913 don't put the file header and segment headers in the text
10914 segment.
10915
10916 PR 10979
10917 * common.cc (Sort_commons::operator()): Stabilize sort when both
10918 entries are NULL.
10919 (Symbol_table::do_allocate_commons_list): When allocating common
10920 symbols, skip a symbol which is no longer common.
10921 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10922 an object before checking its type.
10923 * testsuite/common_test_2.c: New file.
10924 * testsuite/common_test_3.c: New file.
10925 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10926 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10927 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10928 (common_test_2_pic.o, common_test_2.so): New targets.
10929 (common_test_3_pic.o, common_test_3.so): New targets.
10930 * testsuite/Makefile.in: Rebuild.
10931
10932 PR 10979
10933 * script.cc (read_input_script): If we see a new SECTIONS clause,
10934 and we have added an input section, give an error.
10935 * layout.h (class Layout): Add have_added_input_section function.
10936 Add have_added_input_section_ field.
10937 * layout.cc (Layout::Layout): Initialize
10938 have_added_input_section_.
10939 (Layout::layout): Set have_added_input_section_.
10940 (Layout::layout_eh_frame): Likewise.
10941
10942 2009-12-30 Ian Lance Taylor <iant@google.com>
10943
10944 PR 10931
10945 * options.h (class General_options): Add --sort-common option.
10946 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10947 * common.cc (Sort_common): Add sort_order parameter to
10948 constructor. Add sort_order_ field.
10949 (Sort_commons::operator): Check sort_order_.
10950 (Symbol_table::allocate_commons): Determine the sort order.
10951 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10952 Change all callers.
10953 (Symbol_table::do_allocate_commons_list): Likewise.
10954
10955 2009-12-30 Ian Lance Taylor <iant@google.com>
10956
10957 PR 10916
10958 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10959 symbols from this object, don't change the visibility of an
10960 undefined symbol.
10961 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10962
10963 2009-12-30 Ian Lance Taylor <iant@google.com>
10964
10965 PR 10861
10966 * script.h (class Version_script_info): Define Language enum.
10967 Update declarations. Define Glob, Exact, and Lookup types. Add
10968 new fields globals_, locals_, and is_finalized_.
10969 * script.cc: Various formatting fixes.
10970 (class Parser_closure): Change language_stack_ from a vector of
10971 std::string to one of Version_script_info::Language. Adjust all
10972 uses accordingly.
10973 (class Lazy_demangler): Remove.
10974 (struct Version_expression): Change language from std::string to
10975 Version_script_info::Language.
10976 (Version_script_info::Version_script_info): New function.
10977 (Version_script_info::~Version_script_info): Don't call clear.
10978 (Version_script_info::finalize): New function.
10979 (Version_script_info::build_lookup_tables): New function.
10980 (Version_script_info::build_expression_list_lookup): New
10981 function.
10982 (Version_script_info::get_symbol_version_helper): Rewrite to use
10983 lookup tables.
10984 (Version_script_info::print_expression_list): Adjust to use
10985 Version_script_info::Language.
10986 (script_push_lex_into_version_mode): Check that the version script
10987 has not been finalized.
10988 (version_script_push_lang): Change language string to
10989 Version_script_info::Language.
10990 * options.cc (Command_line::version_script): New function.
10991 * options.h (class General_options): Add finalize_dynamic_list
10992 function. Change version_script from declaration to definition.
10993 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10994 * testsuite/version_script.map: Remove duplicate def of foo.
10995 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10996 version_script.map.
10997 * testsuite/Makefile.in: Rebuild.
10998
10999 2009-12-30 Ian Lance Taylor <iant@google.com>
11000
11001 PR 10843
11002 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11003 if the input symbol index is 0, make the output symbol index 0.
11004
11005 2009-12-30 Ian Lance Taylor <iant@google.com>
11006
11007 PR 10670
11008 * options.h (class General_options): Add -x/--discard-all.
11009 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11010 --discard-all. If the local symbol needs a dynamic entry, check
11011 that before handling --discard-locals.
11012
11013 2009-12-30 Ian Lance Taylor <iant@google.com>
11014
11015 PR 10450
11016 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11017 flags to PF_R.
11018 (Output_segment::add_output_section): Don't change the flags if
11019 the type is PT_TLS.
11020
11021 PR 10450
11022 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11023 GNU hash table if they need a dynamic value. Otherwise, don't add
11024 them if they are defined in a dynamic object or are forced local.
11025
11026 2009-12-29 Ian Lance Taylor <iant@google.com>
11027
11028 PR 10450
11029 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11030 .gnu.hash table for a 32-bit target.
11031
11032 PR 10450
11033 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11034 regular and a dynamic object only needs a dynamic symbol table
11035 entry if it is externally visible.
11036
11037 PR 10450
11038 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11039 constructor. Add global_offset_table_ field.
11040 (Target_i386::got_section): Set global_offset_table_.
11041 (Target_i386::do_finalize_sections): Set global_offset_table_
11042 size.
11043 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11044 in constructor. Add global_offset_table_ field.
11045 (Target_x86_64::got_section): Set global_offset_table_.
11046 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11047 size.
11048
11049 * layout.cc (Layout::Layout): Initialize increase_relro_.
11050 (Layout::get_output_section): Add is_relro, is_last_relro, and
11051 is_first_non_relro parameters. Change all callers.
11052 (Layout::choose_output_section): Likewise.
11053 (Layout::add_output_section_data): Likewise.
11054 (Layout::make_output_section): Likewise.
11055 (Layout::set_segment_offsets): Clear increase_relro when using a
11056 linker script.
11057 * layout.h (class Layout): Add increase_relro method. Add
11058 increase_relro_ field. Update declarations.
11059 * output.cc (Output_section::Output_section): Initialize
11060 is_last_relro_ and is_first_non_relro_.
11061 (Output_segment::add_output_section): Group relro sections is
11062 do_sort is true. Handle is_last_relro and is_first_non_relro.
11063 (Output_segment::maximum_alignment): Remove relro handling.
11064 (Output_segment::set_section_addresses): Add increase_relro
11065 parameter. Change all callers. Add initial alignment to align
11066 relro sections on separate page. Remove old relro handling.
11067 (Output_segment::set_section_list_addresses): Remove in_relro
11068 parameter. Change all callers.
11069 (Output_segment::set_offset): Add increase parameter. Change all
11070 callers. Remove old relro handling.
11071 * output.h (class Output_section): Add new methods: is_last_relro,
11072 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11073 Add is_last_relro_ and is_first_non_relro_ fields.
11074 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11075 Create separate .got.plt section. Call increase_relro.
11076 * x86_64.cc (Target_x86_64::got_section): Likewise.
11077 * testsuite/relro_script_test.t: Add .got.plt.
11078
11079 PR 10450
11080 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11081 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11082 (Layout::finalize): Call set_dynamic_symbol_size.
11083 (Layout::set_dynamic_symbol_size): New function.
11084 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11085 set_dynamic_symbol_size.
11086
11087 PR 10450
11088 * output.h (class Output_section): Add is_entsize_zero_ field.
11089 * output.cc (Output_section::Output_section): Initialize
11090 is_entsize_zero_.
11091 (Output_section::set_entsize): If two different entsizes are
11092 requested, force it to zero.
11093 (Output_section::add_input_section): Set flags for .debug_str
11094 before updating section flags. Set entsize.
11095 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11096 and SHF_STRING if all input sections have those flags.
11097
11098 2009-12-29 Rafael Espindola <espindola@google.com>
11099
11100 * main.cc (main): Fix the sys time reporting.
11101 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11102 reporting.
11103
11104 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11105
11106 * options.cc (General_options::parse_version): Allow -v to exit
11107 without an error if there is nothing to link.
11108
11109 2009-12-29 Ian Lance Taylor <iant@google.com>
11110
11111 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11112 using a version of gcc before 4.1.
11113 * configure: Rebuild.
11114
11115 2009-12-28 Chris Demetriou <cgd@google.com>
11116
11117 * attributes.cc (Output_attributes_section_data::do_write): Use
11118 std::vector::front rather than std::vector::data.
11119
11120 2009-12-28 Ian Lance Taylor <iant@google.com>
11121
11122 * symtab.h (class Symbol_table): Add enum Defined.
11123 * resolve.cc (Symbol_table::should_override): Add defined
11124 parameter. Change all callers. Test whether object is NULL
11125 before calling a method on it.
11126 (Symbol_table::report_resolve_problem): Add defined parameter.
11127 Change all callers.
11128 (Symbol_table::should_override_with_special): Likewise.
11129 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11130 parameter. Change all callers.
11131 (Symbol_table::do_define_in_output_data): Likewise.
11132 (Symbol_table::define_in_output_segment): Likewise.
11133 (Symbol_table::do_define_in_output_segment): Likewise.
11134 (Symbol_table::define_as_constant): Likewise.
11135 (Symbol_table::do_define_as_constant): Likewise.
11136 * script.h (class Symbol_assignment): Add is_defsym parameter to
11137 constructor; change all callers.
11138 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11139 parameter. Change all callers. Add is_defsym_ field.
11140 (class Parser_closure): Add parsing_defsym parameter to
11141 constructor; change all callers. Add parsing_defsym accessor
11142 function. Add parsing_defsym_ field.
11143
11144 2009-12-28 Ian Lance Taylor <iant@google.com>
11145
11146 * gold.cc (queue_middle_tasks): Fix formatting.
11147 * object.cc (Relobj::is_section_name_included): Likewise.
11148
11149 2009-12-23 Ian Lance Taylor <iant@google.com>
11150
11151 * i386.cc (Target_i386::do_calls_non_split): Recognize
11152 -fsplit-stack prologue for a function with a static chain.
11153 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11154 -fsplit-stack prologue when using %r11.
11155
11156 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11157
11158 * options.cc (General_options::parse_version): Make -v continue and do
11159 the link like GNU ld does.
11160
11161 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11162
11163 * Makefile.am (CCFILES): Add timer.cc.
11164 (HFILES): Add timer.h.
11165 * configure.ac: Check for sysconf and times.
11166 * main.cc: include timer.h.
11167 (main): Use Timer instead of get_run_time.
11168 * timer.cc: New.
11169 * timer.h: New.
11170 * workqueue.cc: include timer.h.
11171 (Workqueue::find_and_run_task):
11172 Report user, sys and wall time.
11173 * Makefile.in: Regenerate.
11174 * config.in: Regenerate.
11175 * configure: Regenerate.
11176
11177 2009-12-16 Doug Kwan <dougkwan@google.com>
11178
11179 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11180 sections.
11181 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11182 relaxed input sections.
11183 * output.cc (Output_section::find_relaxed_input_section): Change
11184 return type to Output_relaxed_input_section pointer. Adjust code
11185 for new type of relaxed_input_section_map_.
11186 * output.h (Output_section::find_relaxed_input_section): Change
11187 return type to Output_relaxed_input_section pointer.
11188 (Output_section::Output_relaxed_input_section_by_input_section_map):
11189 New type.
11190 (Output_section::relaxed_input_section_map_): Change type to
11191 Output_section::Output_relaxed_input_section_by_input_section_map.
11192 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11193 input section.
11194
11195 2009-12-15 Ian Lance Taylor <iant@google.com>
11196
11197 * layout.cc (Layout::create_shstrtab): Only write out after input
11198 sections if we are compressing debug sections.
11199
11200 2009-12-15 Ian Lance Taylor <iant@google.com>
11201
11202 * archive.cc (Archive::add_symbols): Only look up a symbol without
11203 a version if there is, in fact, a version.
11204
11205 2009-12-14 Ian Lance Taylor <iant@google.com>
11206
11207 Revert -Wshadow changes, all changes from:
11208 2009-12-11 Doug Kwan <dougkwan@google.com>
11209 2009-12-11 Nick Clifton <nickc@redhat.com>
11210 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11211
11212 2009-12-11 Doug Kwan <dougkwan@google.com>
11213
11214 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11215 due to -Wshadow.
11216 * attributes.cc (Object_attribute::size): Ditto.
11217 (Attributes_section_data::size): Ditto.
11218 (Attributes_section_data::Attributes_section_data): Ditto.
11219 (Output_attributes_section_data::do_write): Ditto.
11220 * attributes.h (Object_attribute::set_type): Ditto.
11221 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11222
11223 2009-12-11 Nick Clifton <nickc@redhat.com>
11224
11225 * archive.cc: Fix shadowed variable warnings.
11226 * arm.cc: Likewise.
11227 * compressed_output.cc: Likewise.
11228 * compressed_output.h: Likewise.
11229 * configure: Likewise.
11230 * dwarf_reader.cc: Likewise.
11231 * dynobj.cc: Likewise.
11232 * dynobj.h: Likewise.
11233 * ehframe.cc: Likewise.
11234 * ehframe.h: Likewise.
11235 * errors.cc: Likewise.
11236 * expression.cc: Likewise.
11237 * fileread.cc: Likewise.
11238 * fileread.h: Likewise.
11239 * freebsd.h: Likewise.
11240 * i386.cc: Likewise.
11241 * icf.cc: Likewise.
11242 * incremental.h: Likewise.
11243 * layout.cc: Likewise.
11244 * layout.h: Likewise.
11245 * mapfile.cc: Likewise.
11246 * merge.cc: Likewise.
11247 * merge.h: Likewise.
11248 * object.cc: Likewise.
11249 * object.h: Likewise.
11250 * options.h: Likewise.
11251 * output.cc: Likewise.
11252 * output.h: Likewise.
11253 * parameters.cc: Likewise.
11254 * plugin.cc: Likewise.
11255 * powerpc.cc: Likewise.
11256 * reduced_debug_output.cc: Likewise.
11257 * reduced_debug_output.h: Likewise.
11258 * reloc.cc: Likewise.
11259 * reloc.h: Likewise.
11260 * resolve.cc: Likewise.
11261 * script-sections.cc: Likewise.
11262 * script.cc: Likewise.
11263 * script.h: Likewise.
11264 * sparc.cc: Likewise.
11265 * symtab.cc: Likewise.
11266 * symtab.h: Likewise.
11267 * target-select.cc: Likewise.
11268 * target-select.h: Likewise.
11269 * token.h: Likewise.
11270 * workqueue.cc: Likewise.
11271 * workqueue.h: Likewise.
11272 * x86_64.cc: Likewise.
11273
11274 2009-12-10 Doug Kwan <dougkwan@google.com>
11275
11276 * arm.cc (attributes.h): New include.
11277 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11278 (Arm_relobj::~Arm_relobj): Delete object pointed by
11279 attributes_section_data_.
11280 (Arm_relobj::attributes_section_data): New method definition.
11281 (Arm_relobj::attributes_section_data_): New data member declaration.
11282 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11283 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11284 attributes_section_data_.
11285 (Arm_dynobj::attributes_section_data): New method definition.
11286 (Arm_dynobj::attributes_section_data_): New data member declaration.
11287 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11288 initialization value of may_use_blx_ to false.
11289 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11290 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11291 object attributes to compute results instead of hard-coding.
11292 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11293 Target_arm::get_secondary_compatible_arch,
11294 Target_arm::set_secondary_compatible_arch
11295 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11296 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11297 New method declarations.
11298 (Target_arm::get_aeabi_object_attribute): New method definition.
11299 (Target_arm::attributes_section_data_): New data member declaration.
11300 (read_arm_attributes_section): New template definition.
11301 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11302 (Arm_dynobj::do_read_symbols): Ditto.
11303 (Target_arm::do_finalize_sections): Merge attributes sections from
11304 input. Check for BLX use after attributes section merging.
11305 Fix __exidx_start and __exidx_end visibility. Create an
11306 .ARM.attributes section if necessary.
11307 (Target_arm::get_secondary_compatible_arch,
11308 Target_arm::set_secondary_compatible_arch,
11309 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11310 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11311 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11312 New method definitions.
11313
11314 2009-12-09 Ian Lance Taylor <iant@google.com>
11315
11316 * plugin.cc (Plugin::load): Don't cast from void* to a function
11317 pointer.
11318
11319 2009-12-09 Ian Lance Taylor <iant@google.com>
11320
11321 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11322 information fields.
11323
11324 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11325
11326 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11327 Replace two_file_shared_1.so with two_file_shared_2.so.
11328 * testsuite/Makefile.in: Regenerated.
11329
11330 2009-12-08 Doug Kwan <dougkwan@google.com>
11331
11332 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11333 (HFILES): Add attributes.h and int_encoding.h.
11334 * Makefile.in: Regenerate.
11335 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11336 function definitions to int_encoding.cc
11337 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11338 prototypes to int_encoding.h
11339 * reduced_debug_output.cc (int_encoding.h): New include.
11340 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11341 function definitions to int_encoding.cc
11342 (insert_into_vector, read_from_pointer): Move template definitions to
11343 int_encoding.h
11344 * attributes.cc: New file.
11345 * attributes.h: New file.
11346 * int_encoding.cc: New file.
11347 * int_encoding.h: New file.
11348
11349 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11350
11351 PR gold/11055
11352 * incremental-dump.cc (dump_incremental_inputs): New.
11353 (main): Use dump_incremental_inputs.
11354
11355 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11356
11357 PR gold/10893
11358 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11359 checking elfcpp::STT_FUNC.
11360 (Target_i386::Relocate::relocate): Likewise.
11361 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11362
11363 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11364 symbols from shared libraries into normal FUNC symbols.
11365
11366 * symtab.h (Symbol): Add is_func and use it.
11367
11368 2009-12-05 Doug Kwan <dougkwan@google.com>
11369
11370 * arm.cc (Target_arm::arm_info): Initialize new fields
11371 attributes_section and attributes_vendor.
11372 * i386.cc (Target_i386::i386_info): Same.
11373 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11374 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11375 fields attributes_section and attributes_vendor.
11376 * sparc.cc (Target_sparc::sparc_info): Same.
11377 * target.h (Target::attributes_section, Target::attributes_vendor,
11378 Target::is_attributes_section, Target::attribute_arg_type,
11379 Target::attributes_order): New method definitions.
11380 (Target::Target_info::attributes_section,
11381 Target::Target_info::attributes_vendor): New fields.
11382 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11383 virtual method definitions.
11384 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11385 attributes_section and attributes_vendor.
11386 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11387
11388 2009-12-05 Doug Kwan <dougkwan@google.com>
11389
11390 * arm.cc: Update comments about interworking and stub generation.
11391 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11392 considered as non-PIC.
11393 (Arm_relocate_functions::base_abs): Fix formatting.
11394 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11395 of function to use GOT entry address instead of offset.
11396 (Target_arm::Scan::global): Issue an error if a symbol would need a
11397 PLT does not get one because it is untyped. Remove code to create
11398 dynamic symbols for relative branches.
11399 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11400 takes unsigned integer instead of boolean.
11401
11402 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11403
11404 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11405 (two_file_test_LDADD): Likewise.
11406 (common_test_1_LDADD): Likewise.
11407 (exception_test_LDADD) Likewise.
11408 (weak_test_LDADD): Likewise.
11409 (many_sections_test_LDADD): Likewise.
11410 (initpri1_LDADD): Likewise.
11411 (script_test_1_LDADD): Likewise.
11412 (script_test_2_LDADD): Likewise.
11413 (justsyms_LDADD): Likewise.
11414 (binary_test_LDADD): Likewise.
11415 (large_LDADD): Likewise.
11416 * testsuite/Makefile.in: Regenerated.
11417
11418 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11419
11420 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11421 (Symbol_table::override_with_special): Likewise.
11422 (Symbol_table::add_from_object): Likewise.
11423
11424 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11425
11426 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11427 Don't set the data_offset twice.
11428
11429 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11430
11431 * testsuite/Makefile.in: Regenerate.
11432
11433 2009-12-03 Doug Kwan <dougkwan@google.com>
11434
11435 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11436 (Target_arm::do_finalize_sections): Add parameter for symbol table
11437 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11438 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11439 parameter for symbol table pointer.
11440 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11441 an additional parameter for a pointer to symbol table.
11442 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11443 parameter for a symbol table pointer.
11444 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11445 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11446 Ditto.
11447 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11448 parameter for a symbol table pointer.
11449
11450 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11451
11452 * incremental.cc (Incremental_inputs_header)
11453 (Incremental_inputs_header_write, Incremental_inputs_entry)
11454 (Incremental_inputs_entry_write): Move ...
11455 * incremental.h (Incremental_inputs_header)
11456 (Incremental_inputs_header_write, Incremental_inputs_entry)
11457 (Incremental_inputs_entry_write): here.
11458
11459 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11460
11461 * incremental.cc (make_sized_incremental_binary): Set the target.
11462 Error if it is incompatible.
11463 * output.h (Output_file): Add filename method.
11464
11465 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11466
11467 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11468 from the get_* methods.
11469
11470 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11471
11472 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11473 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11474 Write 0 for the data_offset of scripts.
11475
11476 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11477
11478 * testsuite/Makefile.am: Add the incremental_test.sh test.
11479 * testsuite/incremental_test.sh: New.
11480 * testsuite/incremental_test_1.c: New.
11481 * testsuite/incremental_test_2.c: New.
11482
11483 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11484
11485 * incremental-dump.cc (main): Fix typos.
11486
11487 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11488
11489 PR gold/11025
11490 * incremental-dump.cc (main): Use llu to print 64 bit values.
11491
11492 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11493 H.J. Lu <hongjiu.lu@intel.com>
11494
11495 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11496 $(LIBDL).
11497 (incremental_dump_LDADD): Likewise.
11498 * Makefile.in: Regenerated.
11499
11500 2009-11-25 Doug Kwan <dougkwan@google.com>
11501
11502 Revert:
11503
11504 2009-11-25 Doug Kwan <dougkwan@google.com>
11505
11506 * arm.cc (Target_arm::Target_arm): Move method definition
11507 outside of class definition. Add code to handle
11508 --target1-rel, --target1-abs and --target2= options.
11509 (Target_arm::get_reloc_reloc_type): Change method to be
11510 non-static and const.
11511 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11512 New data member declaration.
11513 (Target_arm::Scan::local, Target_arm::Scan::global,
11514 Target_arm::Relocate::relocate,
11515 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11516 Adjust call to Target_arm::get_real_reloc_type.
11517 (Target_arm::get_real_reloc_type): Use command line options
11518 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11519 * options.h (--target1-rel, --target1-abs, --target2): New
11520 ARM-only options.
11521
11522 2009-11-25 Doug Kwan <dougkwan@google.com>
11523
11524 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11525 class definition. Add code to handle --target1-rel, --target1-abs
11526 and --target2= options.
11527 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11528 and const.
11529 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11530 member declaration.
11531 (Target_arm::Scan::local, Target_arm::Scan::global,
11532 Target_arm::Relocate::relocate,
11533 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11534 call to Target_arm::get_real_reloc_type.
11535 (Target_arm::get_real_reloc_type): Use command line options to
11536 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11537 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11538 options.
11539
11540 2009-11-25 Doug Kwan <dougkwan@google.com>
11541
11542 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11543 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11544 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11545 formatting.
11546 (Arm_relocate_functions::thm_call): Replace body with a call to
11547 Arm_relocate_functions::thumb_branch_common.
11548 (Arm_relocate_functions::thm_jump24,
11549 Arm_relocate_functions::thm_xpc22): New method definitions.
11550 (Arm_relocate_functions::thumb_branch_common): New method definition.
11551 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11552 operator.
11553 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11554 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11555
11556 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11557
11558 * Makefile.am: Build incremental-dump
11559 * Makefile.in: Regenerate.
11560 * incremental-dump.cc: New.
11561 * incremental.cc (Incremental_inputs_header_data,
11562 Incremental_inputs_entry_data): Move to incremental.h
11563 * incremental.h: (Incremental_inputs_header_data,
11564 Incremental_inputs_entry_data): Move from incremental.cc
11565
11566 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11567
11568 * incremental.cc (Incremental_inputs_header,
11569 Incremental_inputs_header_write, Incremental_inputs_entry,
11570 Incremental_inputs_entry_write): Add a typedef with the data type.
11571
11572 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11573
11574 * incremental.cc (Incremental_inputs_header,
11575 Incremental_inputs_header_write, Incremental_inputs_entry,
11576 Incremental_inputs_entry_write): Update comment about which
11577 type has the filed descriptions.
11578
11579 2009-11-15 Doug Kwan <dougkwan@google.com>
11580
11581 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11582 (Arm_relocate_functions::arm_branch_common): Change method defintion
11583 in class definition to a method declaration and update list of formal
11584 parameters.
11585 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11586 Arm_relocation_functions::jump24): Adjust call to
11587 Arm_relocate_functions::arm_branch_common. Update list of formal
11588 parameters.
11589 (Arm_relocate_functions::xpc25): New method definition.
11590 (Arm_relocate_functions::arm_branch_common): Move method defintion
11591 out from class definition. Use stubs for mode-switching and extending
11592 branch ranges.
11593 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11594 specially. Change code to enable use of stubs in ARM branches.
11595
11596 2009-11-10 Doug Kwan <dougkwan@google.com>
11597
11598 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11599 in method declaration.
11600 (Target_arm::relocate_stub): New method declaration.
11601 (Target_arm::default_target): Change to return a pointer instead of
11602 a const reference.
11603 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11604 Target_arm::default_target.
11605 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11606 method definition.
11607 (Target_arm::relocate_section): Adjust view.
11608 (Target_arm::relocate_stub): New method definition.
11609
11610 2009-11-10 Doug Kwan <dougkwan@google.com>
11611
11612 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11613 a format warning.
11614 * incremental.cc (open_incremental_binary): Initialized local
11615 variables to avoid warnings.
11616 * object.cc (make_elf_object): Ditto.
11617 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11618 a format warning.
11619
11620 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11621
11622 PR gold/10930
11623 * testsuite/plugin_test.c: Include "config.h".
11624
11625 2009-11-09 Doug Kwan <dougkwan@google.com>
11626
11627 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11628 (arm_symbol_value): Remove.
11629 (Arm_relocate_functions::arm_branch_common,
11630 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11631 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11632 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11633 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11634 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11635 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11636 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11637 Arm_relocate_functions::thm_mobw_abs_nc,
11638 Arm_relocate_functions::thm_mov_abs,
11639 Arm_relocate_functions::movw_prel_nc,
11640 Arm_relocate_functions::thm_movt_abs,
11641 Arm_relocate_functions::movt_prel,
11642 Arm_relocate_functions::thm_movw_prel_nc,
11643 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11644 (Target_arm::Relocate::relocate): Only decompose address into two
11645 parts if relocation type uses the thumb-bit and pass the actual
11646 bit instead of a flag indicating that the thumb-bit is used. Adjust
11647 calls to methods in Arm_relocate_functions for this change.
11648
11649 2009-11-08 Ian Lance Taylor <iant@google.com>
11650
11651 PR 10925
11652 * reloc.cc: Instantiate
11653 Sized_relobj::initialize_input_to_output_maps and
11654 Sized_relobj:free_input_to_output_maps.
11655
11656 2009-11-06 Ian Lance Taylor <iant@google.com>
11657
11658 PR 10876
11659 * defstd.cc (in_segment): Set only_if_ref true for "end".
11660
11661 2009-11-06 Doug Kwan <dougkwan@google.com>
11662
11663 * arm.cc (class Reloc_stub): Correct a comment.
11664 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11665 (Target_arm::scan_section_for_stubs): New method declaration.
11666 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11667 Change methods from private to protected.
11668 (Target_arm::do_may_relax): New method definition.
11669 (Target_arm::do_relax, Target_arm::group_sections,
11670 Target_arm::scan_reloc_for_stub,
11671 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11672 (Target_arm::arm_input_section_map_): New data member declaration.
11673 (Target_arm::scan_reloc_for_stub,
11674 Target_arm::scan_reloc_section_for_stubs,
11675 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11676 Target_arm::do_relax): New method definitions.
11677
11678 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11679
11680 * configure.ac: Check for (struct stat)::st_mtim
11681 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11682 * config.in: Regenerate.
11683 * configure: Regenerate.
11684
11685 2009-11-05 Ian Lance Taylor <iant@google.com>
11686
11687 PR 10910
11688 * output.cc (Output_segment::add_output_section): Add missing
11689 return statement.
11690
11691 2009-11-04 Ian Lance Taylor <iant@google.com>
11692
11693 PR 10880
11694 * object.h (class Object): Add is_needed and set_is_needed
11695 methods. Add is_needed_ field. Make bool fields into bitfields.
11696 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11697 defined in a dynamic object and referenced by a regular object,
11698 set is_needed for the dynamic object.
11699 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11700 if the file is marked with as_needed and it is not needed.
11701
11702 2009-11-04 Ian Lance Taylor <iant@google.com>
11703
11704 PR 10887
11705 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11706 tags if data is discarded by linker script.
11707 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11708 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11709 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11710 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11711
11712 2009-11-04 Ian Lance Taylor <iant@google.com>
11713
11714 * layout.cc (Layout::get_output_section): Add is_interp and
11715 is_dynamic_linker_section parameters. Change all callers.
11716 (Layout::choose_output_section): Likewise.
11717 (Layout::make_output_section): Likewise.
11718 (Layout::add_output_section_data): Add is_dynamic_linker_section
11719 parameter. Change all callers.
11720 * layout.h (class Layout): Update declarations.
11721 * output.h (class Output_section): Add is_interp, set_is_interp,
11722 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11723 Add is_interp_, is_dynamic_linker_section_ fields. Change
11724 generate_code_fills_at_write_ to a bitfield.
11725 * output.cc (Output_section::Output_sections): Initialize new
11726 fields.
11727 (Output_segment::add_output_section): Add do_sort parameter.
11728 Change all callers.
11729
11730 2009-11-03 Ian Lance Taylor <iant@google.com>
11731
11732 PR 10860
11733 * options.h (class General_options): Add --warn-common.
11734 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11735 merging two common symbols.
11736 (Symbol_table::should_override): Handle --warn-common when merging
11737 a common symbol with a defined symbol. Use report_resolve_problem
11738 for multiple definitions.
11739 (Symbol_table::report_resolve_problem): New function.
11740 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11741
11742 2009-11-03 Doug Kwan <dougkwan@google.com>
11743
11744 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11745 stub_factory_.
11746 (Target_arm::stub_factory): New method definition.
11747 (Target_arm::new_arm_input_section,
11748 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11749 Target_arm::reloc_uses_thumb_bit): New method declarations.
11750 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11751 New type definitions.
11752 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11753 member declarations.
11754 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11755 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11756 New method definitions.
11757
11758 2009-11-03 Ian Lance Taylor <iant@google.com>
11759
11760 * options.h (class General_options): Add --warn_constructors.
11761
11762 2009-11-03 Ian Lance Taylor <iant@google.com>
11763
11764 PR 10893
11765 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11766 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11767
11768 2009-11-03 Ian Lance Taylor <iant@google.com>
11769
11770 PR 10895
11771 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11772 --msgid-bugs-address.
11773 (install-pdf): New target.
11774 (install-data_yes): Look up one directory to find mkinstalldirs.
11775
11776 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11777
11778 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11779 tree.
11780
11781 2009-10-30 Doug Kwan <dougkwan@google.com>
11782
11783 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11784
11785 2009-10-30 Doug Kwan <dougkwan@google.com>
11786
11787 * arm.cc (Stub_addend_reader): New struct template definition
11788 and partial specializations.
11789 (Stub_addend_reader::operator()): New method definition for a
11790 partially specialized template.
11791
11792 2009-10-30 Doug Kwan <dougkwan@google.com>
11793
11794 * arm.cc (Arm_relobj::processor_specific_flags): New method
11795 definition.
11796 (Arm_relobj::do_read_symbols): New method declaration.
11797 (Arm_relobj::processor_specific_flags_): New data member declaration.
11798 (Arm_dynobj): New class definition.
11799 (Target_arm::do_finalize_sections): Add input_objects parameter.
11800 (Target_arm::do_adjust_elf_header): New method declaration.
11801 (Target_arm::are_eabi_versions_compatible,
11802 (Target_arm::merge_processor_specific_flags): New method declaration.
11803 (Target_arm::do_make_elf_object): New overloaded method definitions
11804 and declaration.
11805 (Arm_relobj::do_read_symbols): New method definition.
11806 (Arm_dynobj::do_read_symbols): Ditto.
11807 (Target_arm::do_finalize_sections): Add input_objects parameters.
11808 Merge processor-specific flags from all input objects.
11809 (Target_arm::are_eabi_versions_compatible,
11810 Target_arm::merge_processor_specific_flags,
11811 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11812 New method definitions.
11813 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11814 Input_objects pointer type parameter.
11815 * layout.cc (Layout::finalize): Pass input objects to target's.
11816 finalize_sections function.
11817 * output.cc (Output_file_header::do_sized_write): Set ELF file
11818 header's processor-specific flags.
11819 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11820 Input_objects pointer type parameter.
11821 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11822 * target.h (Input_objects): New forward class declaration.
11823 (Target::processor_specific_flags,
11824 Target::are_processor_specific_flags_sect): New method definitions.
11825 (Target::finalize_sections): Add input_objects parameter.
11826 (Target::Target): Initialize processor_specific_flags_ and
11827 are_processor_specific_flags_set_.
11828 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11829 parameter.
11830 (Target::set_processor_specific_flags): New method definition.
11831 (Target::processor_specific_flags_,
11832 Target::are_processor_specific_flags_set_): New data member
11833 declarations.
11834 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11835 Input_objects pointer type parameter.
11836
11837 2009-10-30 Doug Kwan <dougkwan@google.com>
11838
11839 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11840
11841 2009-10-28 Ian Lance Taylor <iant@google.com>
11842
11843 * object.h (class Relobj): Drop options parameter from
11844 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11845 do_scan_relocs, do_relocate. Change all callers.
11846 (class Sized_relobj): Drop options parameters from
11847 do_gc_process_relocs, do_scan_relocs, do_relocate,
11848 do_relocate_sections, relocate_sections, emit_relocs_scan,
11849 emit_relocs_scan_reltype. Change all callers.
11850 (struct Relocate_info): Remove options field and all references to
11851 it.
11852 * reloc.h (class Read_relocs): Remove options constructor
11853 parameter and options_ field. Change all callers.
11854 (class Gc_process_relocs, class Scan_relocs): Likewise.
11855 (class Relocate_task): Likewise.
11856 * target-reloc.h (scan_relocs): Remove options parameter. Change
11857 all callers.
11858 (scan_relocatable_relocs): Likewise.
11859 * target.h (class Sized_target): Remove options parameter from
11860 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11861 all callers.
11862 * gc.h (gc_process_relocs): Remove options parameter. Change all
11863 callers.
11864 * arm.cc: Update functions to remove options parameters.
11865 * i386.cc: Likewise.
11866 * powerpc.cc: Likewise.
11867 * sparc.cc: Likewise.
11868 * x86_64.cc: Likewise.
11869 * testsuite/testfile.cc: Likewise.
11870
11871 2009-10-28 Doug Kwan <dougkwan@google.com>
11872
11873 * arm.cc (Arm_relobj): New class definition.
11874 (Arm_relobj::scan_sections_for_stubs,
11875 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11876 New method definitions.
11877
11878 2009-10-28 Cary Coutant <ccoutant@google.com>
11879
11880 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11881 (Plugin::cleanup_done_): New member.
11882 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11883 (Plugin_manager::cleanup_done_): Remove.
11884 (Plugin_manager::add_input_file): Edit error message.
11885 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11886 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11887
11888 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11889
11890 * fileread.cc: (File_read::View::~View): Use the new
11891 data_ownership_ filed.
11892 (File_read::~File_read): Dispose the new whole_file_view_.
11893 (File_read::open): Mmap the whole file if needed.
11894 (File_read::open): Use whole_file_view_ instead of contents_.
11895 (File_read::find_view): Use whole_file_view_ if applicable.
11896 (File_read::do_read): Use whole_file_view_ instead of contents_.
11897 (File_read::make_view): Use whole_file_view_ instead of contents_,
11898 update File_read::View::View call.
11899 (File_read::find_or_make_view): Update File_read::View::View
11900 call.
11901 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11902 remove contents_
11903 (File_read::View::Data_ownership): New enum.
11904 (File_read::View::View): Replace bool mapped_ with Data_ownership
11905 argument.
11906 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11907 (File_read::View::data_ownership_): New field.
11908 (File_read::contents_): Remove (replaced by whole_file_view_).
11909 (File_read::whole_file_view_): New field.
11910 * options.h (class General_options): Add --keep-files-mapped.
11911
11912 2009-10-27 Cary Coutant <ccoutant@google.com>
11913
11914 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11915 * testsuite/Makefile.am (plugin_test_5): New test case.
11916 * testsuite/Makefile.in: Regenerate.
11917
11918 2009-10-25 Doug Kwan <dougkwan@google.com>
11919
11920 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11921 from private to protected to allow access by child class.
11922 (Sized_relobj::do_relocate_sections): New method declaration.
11923 (Sized_relobj::relocate_sections): Virtualize.
11924 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11925 Sized_relobj::relocate_sections. Instantiate template explicitly
11926 for different target sizes and endianity.
11927
11928 2009-10-24 Doug Kwan <dougkwan@google.com>
11929
11930 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11931 (Arm_input_section::as_arm_input_section): New method.
11932 (Arm_output_section): New class definition.
11933 (Arm_output_section::create_stub_group,
11934 Arm_output_section::group_sections): New method definitions.
11935
11936 2009-10-22 Doug Kwan <dougkwan@google.com>
11937
11938 * arm.cc (Arm_input_section): New class definition.
11939 (Arm_input_section::init, Arm_input_section:do_write,
11940 Arm_input_section::set_final_data_size,
11941 Arm_input_section::do_reset_address_and_file_offset): New method
11942 definitions.
11943
11944 2009-10-21 Doug Kwan <dougkwan@google.com>
11945
11946 * arm.cc (Stub_table, Arm_input_section): New forward class
11947 declarations.
11948 (Stub_table): New class defintion.
11949 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11950 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11951 New method definition.
11952
11953 2009-10-21 Doug Kwan <dougkwan@google.com>
11954
11955 * arm.cc: Update copyright comments.
11956 (Target_arm): New forward class template declaration.
11957 (Arm_address): New type.
11958 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11959 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11960 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11961 constants.
11962 (Insn_template): Same.
11963 (DEF_STUBS): New macro.
11964 (Stub_type): New enum type.
11965 (Stub_template): New class definition.
11966 (Stub): Same.
11967 (Reloc_stub): Same.
11968 (Stub_factory): Same.
11969 (Target_arm::Target_arm): Initialize may_use_blx_ and
11970 should_force_pic_veneer_.
11971 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11972 Target_arm::should_force_pic_veneer,
11973 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11974 Target_arm::using_thumb_only, Target_arm:;default_target): New
11975 method defintions.
11976 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11977 New data member declarations.
11978 (Insn_template::size, Insn_template::alignment): New method defintions.
11979 (Stub_template::Stub_template): New method definition.
11980 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11981 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11982 (Stub_factory::Stub_factory): New method definition.
11983 * gold.h (string_hash): New template.
11984 * output.h (Input_section_specifier::hash_value): Use
11985 gold::string_hash.
11986 (Input_section_specifier::string_hash): Remove.
11987 * stringpool.cc (Stringpool_template::string_hash): Use
11988 gold::string_hash.
11989
11990 2009-10-20 Doug Kwan <dougkwan@google.com>
11991
11992 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11993 symbols of relaxed input sections.
11994 * output.h (Output_section::find_relaxed_input_section): Make
11995 method public.
11996
11997 2009-10-16 Doug Kwan <dougkwan@google.com>
11998
11999 * dynobj.cc (Versions::Versions): Initialize version_script_.
12000 Only insert base version symbol definition for a shared object
12001 if version script defines any version versions.
12002 (Versions::define_base_version): New method definition.
12003 (Versions::add_def): Check that base version is not needed.
12004 (Versions::add_need): Define base version lazily.
12005 * dynobj.h (Versions::define_base_version): New method declaration.
12006 (Versions::needs_base_version_): New data member declaration.
12007 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12008 (check_DATA): Add no_version_test.stdout.
12009 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12010 New make rules.
12011 * testsuite/Makefile.in: Regenerate.
12012 * testsuite/no_version_test.c: New file.
12013 * testsuite/no_version_test.sh: Ditto.
12014
12015 2009-10-16 Doug Kwan <dougkwan@google.com>
12016
12017 * expression.cc (class Segment_start_expression): New class definition.
12018 (Segment_start_expression::value): New method definition.
12019 (script_exp_function_segment_start): Return a new
12020 Segment_start_expression.
12021 * gold/script-c.h (script_saw_segment_start_expression): New function
12022 prototype.
12023 * script-sections.cc (Script_sections::Script_sections): Initialize
12024 SAW_SEGMENT_START_EXPRESSION_ to false.
12025 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12026 and -Tbbs options to specify section addresses if given in
12027 command line and no SEGMENT_START expression is seen in a script.
12028 * script-sections.h (Script_sections::saw_segment_start_expression,
12029 Script_sections::set_saw_segment_start_expression): New method
12030 definition.
12031 (Script_sections::saw_segment_start_expression_): New data member
12032 declaration.
12033 * script.cc (script_saw_segment_start_expression): New function.
12034 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12035 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12036 script_test_7.sh and script_test_8.sh.
12037 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12038 script_test_8.stdout.
12039 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12040 (script_test_6, script_test_6.stdout, script_test_7,
12041 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12042 * Makefile.in: Regenerate.
12043 * testsuite/script_test_6.sh: New file.
12044 * testsuite/script_test_6.t: Same.
12045 * testsuite/script_test_7.sh: Same.
12046 * testsuite/script_test_7.t: Same.
12047 * testsuite/script_test_8.sh: Same.
12048
12049 2009-10-16 Doug Kwan <dougkwan@google.com>
12050
12051 * output.cc (Output_segment::set_section_list_address): Cast
12052 expressions to unsigned long long type to avoid format warnings.
12053
12054 2009-10-15 Ian Lance Taylor <iant@google.com>
12055
12056 * script.cc (Script_options::add_symbol_assignment): Always add a
12057 dot assignment to script_sections_.
12058 * script-sections.cc (Script_sections::add_dot_assignment):
12059 Initialize if necessary.
12060
12061 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12062 program headers with no load segment if there is a linker script.
12063
12064 * layout.cc (Layout::set_segment_offsets): Align the file offset
12065 to the segment aligment for -N or -n with no load segment.
12066 * output.cc (Output_segment::add_output_section): Don't crash if
12067 the first section is a TLS section.
12068 (Output_segment::set_section_list_addresses): Print an error
12069 message if the address moves backward in a linker script.
12070 * script-sections.cc
12071 (Output_section_element_input::set_section_addresses): Don't
12072 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12073 (Orphan_output_section::set_section_addresses): Likewise.
12074
12075 2009-10-15 Doug Kwan <dougkwan@google.com>
12076
12077 * layout.cc (Layout::finish_dynamic_section): Generate tags
12078 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12079 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12080 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12081
12082 2009-10-14 Ian Lance Taylor <iant@google.com>
12083
12084 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12085 fields.
12086 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12087 data_shdr fields of relinfo.
12088 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12089 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12090 R_386_TLS_LDO_32, adjust based on section flags.
12091 (Target_i386::Relocate::fix_up_ldo): Remove.
12092
12093 2009-10-13 Ian Lance Taylor <iant@google.com>
12094
12095 Add support for -pie.
12096 * options.h (class General_options): Add -pie and
12097 --pic-executable.
12098 (General_options::output_is_position_independent): Test -pie.
12099 (General_options::output_is_executable): Return true if not shared
12100 and not relocatable.
12101 (General_options::output_is_pie): Remove.
12102 * options.cc (General_options::finalize): Reject incompatible uses
12103 of -pie.
12104 * gold.cc (queue_middle_tasks): A -pie link is not static.
12105 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12106 * symtab.cc (Symbol::final_value_is_known): Return false if
12107 output_is_position_independent.
12108 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12109 output_is_position_independent.
12110 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12111 output_is_position_independent.
12112 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12113 output_is_position_independent.
12114 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12115 two_file_pie_test.
12116 (basic_pie_test.o, basic_pie_test): New targets.
12117 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12118 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12119 (two_file_pie_test): New target.
12120 * testsuite/Makefile.in: Rebuild.
12121 * README: Remove note saying that -pie is not supported.
12122
12123 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12124
12125 * options.h (class General_options): Add -init and -fini.
12126 * layout.cc (Layout::finish_dynamic_section): Emit
12127 given init and fini functions.
12128
12129 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12130
12131 * gc.h (gc_process_relocs): Check if icf is enabled using new
12132 function.
12133 * gold.cc (queue_initial_tasks): Likewise.
12134 (queue_middle_tasks): Likewise.
12135 * object.cc (do_layout): Likewise.
12136 * symtab.cc (is_section_folded): Likewise.
12137 * main.cc (main): Likewise.
12138 * reloc.cc (Read_relocs::run): Likewise.
12139 (Sized_relobj::do_scan_relocs): Likewise.
12140 * icf.cc (is_function_ctor_or_dtor): New function.
12141 (Icf::find_identical_sections): Check if function is ctor or dtor when
12142 safe icf is chosen.
12143 * options.h (General_options::icf): Change option to be an enum.
12144 (Icf_status): New enum.
12145 (icf_enabled): New method.
12146 (icf_safe_folding): New method.
12147 (set_icf_status): New method.
12148 (icf_status_): New variable.
12149 * (options.cc) (General_options::finalize): Set icf_status_.
12150 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12151 icf_test and icf_keep_unique_test to use the --icf enum flag.
12152 * testsuite/icf_safe_test.sh: New file.
12153 * testsuite/icf_safe_test.cc: New file.
12154
12155 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12156
12157 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12158 includes to gc.h and icf.h.
12159 * arm.cc: Include gc.h.
12160 * gold.cc: Likewise.
12161 * i386.cc: Likewise.
12162 * powerpc.cc: Likewise.
12163 * sparc.cc: Likewise.
12164 * x86_64.cc: Likewise.
12165 * gc.h: Include icf.h.
12166
12167 2009-10-11 Ian Lance Taylor <iant@google.com>
12168
12169 * plugin.cc: Include "gold.h" before other header files.
12170
12171 2009-10-10 Chris Demetriou <cgd@google.com>
12172
12173 * options.h (Input_file_argument::Input_file_type): New enum.
12174 (Input_file_argument::is_lib_): Replace with...
12175 (Input_file_argument::type_): New member.
12176 (Input_file_argument::Input_file_argument): Take Input_file_type
12177 'type' rather than boolean 'is_lib' as second argument.
12178 (Input_file_argument::is_lib): Use type_.
12179 (Input_file_argument::is_searched_file): New function.
12180 (Input_file_argument::may_need_search): Handle is_searched_file.
12181 * options.cc (General_options::parse_library): Support -l:filename.
12182 (General_options::parse_just_symbols): Update for Input_file_argument
12183 changes.
12184 (Command_line::process): Likewise.
12185 * archive.cc (Archive::get_file_and_offset): Likewise.
12186 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12187 * script.cc (read_script_file, script_add_file): Likewise.
12188 * fileread.cc (Input_file::Input_file): Likewise.
12189 (Input_file::will_search_for): Handle is_searched_file.
12190 (Input_file::open): Likewise.
12191 * readsyms.cc (Read_symbols::get_name): Likewise.
12192 * testsuite/Makefile.am (searched_file_test): New test.
12193 * testsuite/Makefile.in: Regenerate.
12194 * testsuite/searched_file_test.cc: New file.
12195 * testsuite/searched_file_test_lib.cc: New file.
12196
12197 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12198 Ian Lance Taylor <iant@google.com>
12199
12200 * descriptor.cc: Include <cstdio> and "binary-io.h".
12201 (Descriptors::open): Open the files in binary mode always.
12202 * script.cc (Lex::get_token): Treat \r as whitespace.
12203
12204 2009-10-09 Ian Lance Taylor <iant@google.com>
12205
12206 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12207
12208 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12209 Ian Lance Taylor <iant@google.com>
12210
12211 * configure.ac: Check for readv function also.
12212 * fileread.cc (readv): Define if not HAVE_READV.
12213 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12214 does not exist.
12215 * config.in: Regenerate.
12216 * configure: Regenerate.
12217
12218 2009-10-09 Doug Kwan <dougkwan@google.com>
12219
12220 * layout.cc (Layout::make_output_section): Call target hook to make
12221 ordinary output section.
12222 (Layout::finalize): Adjust parameter list of call the
12223 Target::may_relax().
12224 * layout.h (class Layout::section_list): New method.
12225 * merge.h (Output_merge_base::entsize): Change visibility to public.
12226 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12227 New methods.
12228 (Output_merge_string::do_is_string): New method.
12229 * object.cc (Sized_relobj::do_setup): renamed from
12230 Sized_relobj::set_up.
12231 * object.h (Sized_relobj::adjust_shndx,
12232 Sized_relobj::initializ_input_to_output_maps,
12233 Sized_relobj::free_input_to_output_maps): Change visibilities to
12234 protected.
12235 (Sized_relobj::setup): Virtualize.
12236 (Sized_relobj::do_setup): New method declaration.
12237 (Sized_relobj::invalidate_section_offset,
12238 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12239 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12240 * options.cc (parse_int): New function.
12241 * options.h (parse_int): New declaration.
12242 (DEFINE_int): New macro.
12243 (stub_group_size): New option.
12244 * output.cc (Output_section::Output_section): Initialize memebers
12245 merge_section_map_, merge_section_by_properties_map_,
12246 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12247 (Output_section::add_input_section): Handled deferred code-fill
12248 generation and remove an old comment.
12249 (Output_section::add_relaxed_input_section): New method definition.
12250 (Output_section::add_merge_input_section): Use merge section by
12251 properties map to speed to search. Update merge section maps
12252 as appropriate.
12253 (Output_section::build_relaxation_map): New method definition.
12254 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12255 Same.
12256 (Output_section::relax_input_section): Renamed to
12257 Output_section::convert_input_sections_to_relaxed_sections and change
12258 interface to take a vector of pointers to relaxed sections.
12259 (Output_section::find_merge_section,
12260 Output_section::find_relaxed_input_section): New method definitions.
12261 (Output_section::is_input_address_mapped,
12262 Output_section::output_offset, Output_section::output_address):
12263 Use output section data maps to speed up searching.
12264 (Output_section::find_starting_output_address): Add comments.
12265 (Output_section::do_write,
12266 Output_section::write_to_postprocessing_buffer): Do code-fill
12267 generation as appropriate.
12268 (Output_section::get_input_sections): Invalidate relaxed input section
12269 map.
12270 (Output_section::restore_states): Adjust type of checkpoint .
12271 Invalidate relaxed input section map.
12272 * output.h (Output_merge_base): New class declaration.
12273 (Input_section_specifier): New class defintion.
12274 (class Output_relaxed_input_section) Change base class to
12275 Output_section_data_build.
12276 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12277 base class initializer.
12278 (Output_section::add_relaxed_input_section): New method declaration.
12279 (Output_section::Input_section): Change visibility to protected.
12280 (Output_section::Input_section::relobj,
12281 Output_section::Input_section::shndx): Handle relaxed input sections.
12282 Output_section::input_sections) Change visibility to protected. Also
12283 define overload to return a non-const pointer.
12284 (Output_section::Merge_section_properties): New class defintion.
12285 (Output_section::Merge_section_by_properties_map,
12286 Output_section::Output_section_data_by_input_section_map,
12287 Output_section::Relaxation_map): New types.
12288 (Output_section::relax_input_section): Rename method to
12289 Output_section::convert_input_sections_to_relaxed_sections and change
12290 interface to take a vector of relaxed section pointers.
12291 (Output_section::find_merge_section,
12292 Output_section::find_relaxed_input_section,
12293 Output_section::build_relaxation_map,
12294 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12295 New method declarations.
12296 (Output_section::merge_section_map_
12297 Output_section::merge_section_by_properties_map_,
12298 Output_section::relaxed_input_section_map_,
12299 Output_section::is_relaxed_input_section_map_valid_,
12300 Output_section::generate_code_fills_at_write_): New data members.
12301 * script-sections.cc
12302 (Output_section_element_input::set_section_addresses): Call
12303 current_data_size and addralign methods of relaxed input sections.
12304 (Orphan_output_section::set_section_addresses): Call current_data_size
12305 and addralign methods of relaxed input sections.
12306 * symtab.cc (Symbol_table::compute_final_value): Extract template
12307 from the body of Symbol_table::sized_finalize_symbol.
12308 (Symbol_table::sized_finalized_symbol): Call
12309 Symbol_table::compute_final_value.
12310 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12311 (Symbol_table::compute_final_value): New templated method declaration.
12312 * target.cc (Target::do_make_output_section): New method defintion.
12313 * target.h (Target::make_output_section): New method declaration.
12314 (Target::relax): Add more parameters for input objects, symbol table
12315 and layout. Adjust call to do_relax.
12316 (Target::do_make_output_section): New method declaration.
12317 (Target::do_relax): Add parameters for input objects, symbol table
12318 and layout.
12319
12320 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12321
12322 * pread.c: Include stdio.h.
12323
12324 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12325
12326 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12327 defined.
12328
12329 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12330
12331 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12332 Change read_shndx type to unsigned int.
12333 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12334 int.
12335 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12336 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12337 Change read_shndx type to unsigned int.
12338 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12339 int.
12340 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12341 * layout.cc (Layout::create_symtab_sections): Cast the result of
12342 local_symcount * symsize to off_t in the gold_assert.
12343
12344 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12345
12346 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12347 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12348 R_ARM_BASE_ABS.
12349 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12350 (Arm_relocate_functions::thm_abs5): New function.
12351 (Arm_relocate_functions::abs12): New function.
12352 (Arm_relocate_functions::abs16): New function.
12353 (Arm_relocate_functions::base_abs): New function.
12354 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12355 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12356 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12357 R_ARM_BASE_ABS.
12358 (Scan::global): Likewise.
12359 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12360 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12361 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12362 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12363 R_ARM_BASE_ABS.
12364
12365 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12366
12367 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12368 (Arm_relocate_functions::movt_prel): New function.
12369 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12370 (Arm_relocate_functions::thm_movt_prel): New function.
12371 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12372 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12373 (Scan::global, Relocate::relocate): Likewise.
12374 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12375
12376 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12377
12378 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12379 Incremental_checker.
12380 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12381 unsigned int.
12382 (class Incremental_inputs_header): New class.
12383 (Incremental_inputs_header_writer): Edit comment.
12384 (Incremental_inputs_entry): New class.
12385 (Incremental_inputs_entry_writer): Edit comment.
12386 (Sized_incremental_binary::do_find_incremental_inputs_section):
12387 Add *strtab_shndx parameter, fill it.
12388 (Sized_incremental_binary::do_check_inputs): New method.
12389 (Incremental_checker::can_incrementally_link_output_file): Use
12390 Sized_incremental_binary::check_inputs.
12391 (Incremental_inputs::report_command_line): Save command line in
12392 command_line_.
12393 * incremental.h:
12394 (Incremental_binary::find_incremental_inputs_section): New
12395 method.
12396 (Incremental_binary::do_find_incremental_inputs_section): Add
12397 strtab_shndx parameter.
12398 (Incremental_binary::do_check_inputs): New pure virtual method.
12399 (Sized_incremental_binary::do_check_inputs): Declare.
12400 (Incremental_checker::Incremental_checker): Add incremental_inputs
12401 parameter, use it to initialize incremental_inputs_.
12402 (Incremental_checker::incremental_inputs_): New field.
12403 (Incremental_checker::command_line): New method.
12404 (Incremental_checker::inputs): New method.
12405 (Incremental_checker::command_line_): New field.
12406
12407 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12408
12409 * incremental.cc: Include <cstdarg> and "target-select.h".
12410 (vexplain_no_incremental): New function.
12411 (explain_no_incremental): New function.
12412 (Incremental_binary::error): New method.
12413 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12414 method.
12415 (make_sized_incremental_binary): New function.
12416 (open_incremental_binary): New function.
12417 (can_incrementally_link_file): Add checks if output is ELF and has
12418 inputs section.
12419 * incremental.h: Include "elfcpp_file.h" and "output.h".
12420 (Incremental_binary): New class.
12421 (Sized_incremental_binary): New class.
12422 (open_incremental_binary): Declare.
12423 * object.cc (is_elf_object): Use
12424 elfcpp::Elf_recognizer::is_elf_file.
12425 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12426 * output.h (Output_file::filesize): New method.
12427
12428 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12429
12430 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12431 New function.
12432 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12433 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12434 function.
12435 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12436 function.
12437 (Arm_relocate_functions::movw_abs_nc): New function.
12438 (Arm_relocate_functions::movt_abs): New function.
12439 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12440 (Arm_relocate_functions::thm_movt_abs): New function.
12441 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12442 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12443 (Scan::global): Likewise.
12444 (Relocate::relocate): Likewise.
12445 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12446
12447 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12448
12449 * arm.cc (Arm_relocate_functions::got_prel) New function.
12450 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12451 (Relocate::relocate): Likewise.
12452 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12453
12454 2009-10-06 Ian Lance Taylor <iant@google.com>
12455
12456 * options.h (class General_options): Define
12457 split_stack_adjust_size parameter.
12458 * object.h (class Object): Add uses_split_stack_ and
12459 has_no_split_stack_ fields. Add uses_split_stack and
12460 has_no_split_stack accessor functions. Declare
12461 handle_split_stack_section.
12462 (class Reloc_symbol_changes): Define.
12463 (class Sized_relobj): Define Function_offsets. Declare
12464 split_stack_adjust, split_stack_adjust_reltype, and
12465 find_functions.
12466 * object.cc (Object::handle_split_stack_section): New function.
12467 (Sized_relobj::do_layout): Call handle_split_stack_section.
12468 * dynobj.cc (Sized_dynobj::do_layout): Call
12469 handle_split_stack_section.
12470 * reloc.cc (Sized_relobj::relocate_sections): Call
12471 split_stack_adjust for executable sections in split_stack
12472 objects. Pass reloc_map to relocate_section.
12473 (Sized_relobj::split_stack_adjust): New function.
12474 (Sized_relobj::split_stack_adjust_reltype): New function.
12475 (Sized_relobj::find_functions): New function.
12476 * target-reloc.h: Include "object.h".
12477 (relocate_section): Add reloc_symbol_changes parameter. Change
12478 all callers.
12479 * target.h (class Target): Add calls_non_split method. Declare
12480 do_calls_non_split virtual method. Declare match_view and
12481 set_view_to_nop.
12482 * target.cc: Include "elfcpp.h".
12483 (Target::do_calls_non_split): New function.
12484 (Target::match_view): New function.
12485 (Target::set_view_to_nop): New function.
12486 * gold.cc (queue_middle_tasks): Give an error if mixing
12487 split-stack and non-split-stack objects with -r.
12488 * i386.cc (Target_i386::relocate_section): Add
12489 reloc_symbol_changes parameter.
12490 (Target_i386::do_calls_non_split): New function.
12491 * x86_64.cc (Target_x86_64::relocate_section): Add
12492 reloc_symbol_changes parameter.
12493 (Target_x86_64::do_calls_non_split): New function.
12494 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12495 parameter.
12496 * powerpc.cc (Target_powerpc::relocate_section): Add
12497 reloc_symbol_changes parameter.
12498 * sparc.cc (Target_sparc::relocate_section): Add
12499 reloc_symbol_changes parameter.
12500 * configure.ac: Call AM_CONDITIONAL for the default target.
12501 * configure: Rebuild.
12502 * testsuite/Makefile.am (TEST_AS): New variable.
12503 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12504 (check_DATA): Add split_i386 and split_x86_64 files.
12505 (SPLIT_DEFSYMS): Define.
12506 (split_i386_[1234n].o): New targets.
12507 (split_i386_[124]): New targets.
12508 (split_i386_[1234r].stdout): New targets.
12509 (split_x86_64_[1234n].o): New targets.
12510 (split_x86_64_[124]): New targets.
12511 (split_x86_64_[1234r].stdout): New targets.
12512 (MOSTLYCLEANFILES): Add new executables.
12513 * testsuite/split_i386.sh: New file.
12514 * testsuite/split_x86_64.sh: New file.
12515 * testsuite/split_i386_1.s: New file.
12516 * testsuite/split_i386_2.s: New file.
12517 * testsuite/split_i386_3.s: New file.
12518 * testsuite/split_i386_4.s: New file.
12519 * testsuite/split_i386_n.s: New file.
12520 * testsuite/split_x86_64_1.s: New file.
12521 * testsuite/split_x86_64_2.s: New file.
12522 * testsuite/split_x86_64_3.s: New file.
12523 * testsuite/split_x86_64_4.s: New file.
12524 * testsuite/split_x86_64_n.s: New file.
12525 * testsuite/testfile.cc (Target_test): Update relocation_section
12526 function.
12527 * testsuite/Makefile.in: Rebuild.
12528
12529 2009-10-06 Ian Lance Taylor <iant@google.com>
12530
12531 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12532 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12533 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12534 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12535 the address on ldo_addrs_.
12536 (Target_i386::Relocate::fix_up_ldo): New function.
12537
12538 2009-10-06 Rafael Espindola <espindola@google.com>
12539
12540 * plugin.cc (add_input_library): New.
12541 (Plugin::load): Add add_input_library to tv.
12542 (Plugin_manager::add_input_file): Add the is_lib argument.
12543 (add_input_file): Update call to Plugin_manager::add_input_file.
12544 (add_input_library): New.
12545 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12546
12547 2009-09-30 Doug Kwan <dougkwan@google.com>
12548
12549 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12550 symbol and call Symbol::may_need_copy_reloc to determine if
12551 a copy reloc is needed.
12552 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12553 nocopyreloc is given in command line.
12554 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12555 given in command line.
12556 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12557 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12558 of the removed Target_i386::may_need_copy_reloc.
12559 * options.h (copyreloc): New option with default value false.
12560 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12561 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12562 instead of the removed Target_powerpc::may_need_copy_reloc.
12563 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12564 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12565 instead of the removed Target_sparc::may_need_copy_reloc.
12566 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12567 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12568 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12569 instead of the removed Target_x86_64::may_need_copy_reloc.
12570
12571 2009-09-30 Ian Lance Taylor <iant@google.com>
12572
12573 * object.h (class Object): Remove target_ field, and target,
12574 sized_target, and set_target methods.
12575 (Object::sized_target): Remove.
12576 (class Sized_relobj): Update declarations. Remove sized_target.
12577 * object.cc (Sized_relobj::setup): Remove target parameter.
12578 Change all callers.
12579 (Input_objects::add_object): Don't do anything with the target.
12580 (make_elf_sized_object): Add punconfigured parameter. Change all
12581 callers. Set or test parameter target.
12582 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12583 Change all callers.
12584 * parameters.cc (Parameters::set_target): Change parameter type to
12585 be non-const.
12586 (Parameters::default_target): Remove.
12587 (set_parameters_target): Change parameter type to be non-const.
12588 (parameters_force_valid_target): New function.
12589 (parameters_clear_target): New function.
12590 * parameters.h (class Parameters): Update declarations. Remove
12591 default_target method. Add sized_target and clear_target
12592 methods. Change target_ to be non-const.
12593 (set_parameters_target): Update declaration.
12594 (parameters_force_valid_target): Declare.
12595 (parameters_clear_target): Declare.
12596 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12597 as NULL if we aren't searching.
12598 (Add_symbols::run): Don't check for compatible target.
12599 * fileread.cc (Input_file::open_binary): Call
12600 parameters_force_valid_target.
12601 * gold.cc (queue_middle_tasks): Likewise.
12602 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12603 set_target on object.
12604 * dynobj.h (class Sized_dynobj): Update declarations.
12605 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12606 make_elf_object returns NULL.
12607 (Archive::include_member): Don't check whether object target is
12608 compatible.
12609 * output.cc (Output_section::add_input_section): Get target from
12610 parameters.
12611 (Output_section::relax_input_section): Likewise.
12612 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12613 parameters.
12614 (Sized_relobj::do_scan_relocs): Likewise.
12615 (Sized_relobj::relocate_sections): Likewise.
12616 * resolve.cc (Symbol_table::resolve): Likewise.
12617 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12618 parameter. Change all callers.
12619 (Symbol_table::add_from_object): Get target from parameters.
12620 (Symbol_table::add_from_relobj): Don't check object target.
12621 (Symbol_table::add_from_dynobj): Likewise.
12622 (Symbol_table::define_special_symbol): Get target from
12623 parameters.
12624 * symtab.h (class Symbol_table): Update declaration.
12625 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12626 parameter. Change all callers. Clear parameter target.
12627 (Binary_test): Test target here.
12628 * testsuite/object_unittest.cc (gold_testsuite): Remove
12629 target_test_pointer parameter. Change all callers.
12630 (Object_test): Test target here.
12631
12632 2009-09-26 Ian Lance Taylor <iant@google.com>
12633
12634 * testsuite/initpri1.c: Don't try to use constructor priorities if
12635 compiling with gcc before 4.3.
12636
12637 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12638
12639 * testsuite/retain_symbols_file_test.sh (check_present): Change
12640 output file name to retain_symbols_file_test.stdout.
12641 (check_absent): Likewise.
12642
12643 2009-09-18 Craig Silverstein <csilvers@google.com>
12644
12645 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12646 * options.cc: Include <cerrno> and <fstream>.
12647 (General_options::finalize): Parse -retain-symbols-file tag.
12648 * options.h: New flag.
12649 (General_options): New method should_retain_symbol, new
12650 variable symbols_to_retain.
12651 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12652 should_retain_symbol map.
12653 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12654 * testsuite/Makefile.in: Regenerate.
12655 * testsuite/retain_symbols_file_test.sh: New file.
12656
12657 2009-09-18 Nick Clifton <nickc@redhat.com>
12658
12659 * po/es.po: Updated Spanish translation.
12660
12661 2009-09-17 Doug Kwan <dougkwan@google.com>
12662
12663 * debug.h (DEBUG_RELAXATION): New constant.
12664 (DEBUG_ALL): Add DEBUG_RELAXATION.
12665 (debug_string_to_enum): Add relaxation debug option.
12666 * layout.cc
12667 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12668 Layout::Relaxation_debug_check::read_sections,
12669 Layout::Relaxation_debug_check::read_sections): New method definitions.
12670 (Layout::Layout): Initialize data members
12671 record_output_section_data_from_scrips_,
12672 script_output_section_data_list_ and relaxation_debug_check_.
12673 (Layout::save_segments, Layout::restore_segments,
12674 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12675 Layout::relaxation_loop_body): New method definitions.
12676 (Layout::finalize): Support relaxation. Move section layout code to
12677 Layout::relaxation_loop_body.
12678 (Layout::set_asection_address_from_script): Move code for orphan
12679 section placement out.
12680 (Layout::place_orphan_sections_in_script): New method definition.
12681 * layout.h (Output_segment_headers, Output_file_header):
12682 New forward class declarations.
12683 (Layout::~Layout): Define.
12684 (Layout::new_output_section_data_from_script): New method definition.
12685 (Layout::place_orphan_sections_in_script): New method declaration.
12686 (Layout::Segment_states): New type declaration.
12687 (Layout::save_segments, Layout::restore_segments,
12688 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12689 Layout::relaxation_loop_body): New method declarations.
12690 (Layout::Output_section_data_list): New type declaration.
12691 (Layout::Relaxation_debug_check): New class definition.
12692 (Layout::record_output_section_data_from_script_,
12693 Layout::script_output_section_data_list_, Layout::segment_states_,
12694 Layout::relaxation_debug_check_): New data members.
12695 * output.cc: (Output_section_headers::do_size): New method definition.
12696 (Output_section_headers::Output_section_headers): Move size
12697 computation to Output_section_headers::do_size.
12698 (Output_segment_headers::do_size): New method definition.
12699 (Output_file_header::Output_file_header): Move size computation to
12700 Output_file_header::do_size and call it.
12701 (Output_file_header::do_size): New method definition.
12702 (Output_data_group::Output_data_group): Adjust call to
12703 Output_section_data.
12704 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12705 (Output_symtab_xindex::do_write): Add array bound check.
12706 (Output_section::Input_section::print_to_mapfile): Handle
12707 RELAXED_INPUT_SECTION_CODE.
12708 (Output_section::Output_section): Initialize data member checkpoint_.
12709 (Output_section::~Output_section): Delete checkpoint object pointed
12710 by checkpoint_.
12711 (Output_section::add_input_section): Always add an Input_section if
12712 relaxing.
12713 (Output_section::add_merge_input_section): Add assert.
12714 (Output_section::relax_input_section): New method definition.
12715 (Output_section::set_final_data_size): Set load address to zero for
12716 an unallocated section.
12717 (Output_section::do_address_and_file_offset_have_reset_values):
12718 New method definition.
12719 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12720 Handle relaxed input section.
12721 (Output_section::sort_attached_input_sections): Checkpoint input
12722 section list lazily.
12723 (Output_section::get_input_sections): Change type of input_sections to
12724 list of Simple_input_section pointers. Checkpoint input section list
12725 lazily. Also handle relaxed input sections.
12726 (Output_section::add_input_section_for_script): Take a reference to
12727 a Simple_input_section object instead of Relobj pointer and section
12728 index as parameter. Handle relaxed input sections.
12729 (Output_section::save_states, Output_section::restore_states): New
12730 method definitions.
12731 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12732 (Output_data::is_data_size_fixed): New method definition.
12733 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12734 if it is fixed.
12735 (Output_data::address_and_file_offset_have_reset_values): New method
12736 definition.
12737 (Output_data::do_address_and_file_offset_have_reset_values): New method
12738 definition.
12739 (Output_data::set_data_size): Check that data size is not fixed.
12740 (Output_data::fix_data_size): New method definition.
12741 (Output_data::is_data_size_fixed_): New data member.
12742 (Output_section_headers::set_final_data_size): New method definition.
12743 (Output_section_headers::do_size): New method declaration.
12744 (Output_segment_headers::set_final_data_size): New method definition.
12745 (Output_segment_headers::do_size): New method declaration.
12746 (Output_file_header::set_final_data_size)::New method definition.
12747 (Output_file_header::do_size)::New method declaration.
12748 (Output_section_data::Output_section_data): Add new parameter
12749 is_data_size_fixed and use it to fix data size.
12750 (Output_data_const::Output_data_const): Adjust call to base class
12751 constructor and fix data size.
12752 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12753 base class constructor and fix data size.
12754 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12755 base class constructor and fix data size.
12756 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12757 class constructor and fix data size.
12758 (Output_data_group::set_final_data_size): New method definition.
12759 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12760 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12761 class constructor and fix data size.
12762 (Output_relaxed_input_section): New class definition.
12763 (Output_section::Simple_input_section): New class definition.
12764 (Output_section::get_input_sections): Adjust parameter list.
12765 (Output_section::add_input_section_for_script): Same.
12766 (Output_section::save_states, Output_section::restore_states,
12767 Output_section::do_address_and_file_offset_have_reset_values,
12768 (Output_section::Input_section::Input_section): Handle
12769 RELAXED_INPUT_SECTION_CODE. Add new overload for
12770 Output_relaxed_input_section.
12771 (Output_section::Input_section::is_input_section,
12772 Output_section::Input_section::set_output_section): Handle relaxed
12773 input section.
12774 (Output_section::Input_section::is_relaxed_input_section,
12775 Output_section::Input_section::output_section_data,
12776 Output_section::Input_section::relaxed_input_section): New method
12777 definitions.
12778 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12779 value.
12780 (Output_section::Input_section::u1_): Update comments.
12781 (Output_section::Input_section::u2_): Add new union member poris.
12782 (Output_section::Checkpoint_output_section): New classs definition.
12783 (Output_section::relax_input_section): New method declaration.
12784 (Output_section::checkpoint_): New data member.
12785 (Output_segment): Update comments.
12786 (Output_segment::Output_segment): Un-privatize copy constructor.
12787 (Output_segment::operator=): Un-privatize.
12788 * script-sections.cc (Output_section_element::Input_section_list):
12789 Change element type to Output_section::Simple_input_section.
12790 (Output_section_element_dot_assignment::set_section_addresses):
12791 Register output section data for relaxation clean up.
12792 (Output_data_exression::Output_data_expression): Adjust call to base
12793 constructor to fix data size.
12794 (Output_section_element_data::set_section_addresses): Register
12795 Output_data_expression object for relaxation clean up.
12796 (struct Input_section_info): Replace Relobj pointer and section index
12797 pair with Output_section::Simple_input_section and Convert struct to a
12798 class.
12799 (Input_section_sorter::operator()): Adjust access to
12800 Input_section_info data member to use accessors.
12801 (Output_section_element_input::set_section_addresses): Use layout
12802 parameter. Adjust code to use Output_section::Simple_input_section
12803 and Input_secction_info classes. Register filler for relaxation
12804 clean up.
12805 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12806 and section index pair with Output_section::Simple_input_section
12807 class. Adjust code accordingly.
12808 (Phdrs_element::release_segment): New method definition.
12809 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12810 segment list.
12811 (Script_sections::release_segments): New method definition.
12812 * gold/script-sections.h (Script_sections::release_segments): New
12813 method declaration.
12814 * gold/target.h (Target::may_relax, Target::relax,
12815 Target::do_may_relax, Target::do_relax): New method definitions.
12816
12817 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12818
12819 * arm.cc (has_signed_unsigned_overflow): New function.
12820 (Arm_relocate_functions::abs8): New function.
12821 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12822 (Target_arm::Scan::global): Likewise.
12823 (Target_arm::relocate::relocate): Likewise.
12824 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12825 Likewise.
12826
12827 2009-09-16 Cary Coutant <ccoutant@google.com>
12828
12829 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12830 * testsuite/Makefile.in: Regenerate.
12831
12832 2009-09-11 Nick Clifton <nickc@redhat.com>
12833
12834 * po/gold.pot: Updated by the Translation project.
12835
12836 2009-09-08 Cary Coutant <ccoutant@google.com>
12837
12838 * output.cc (Output_file::open): Add execute permission to empty file.
12839 * testsuite/Makefile.am (permission_test): New test.
12840 * testsuite/Makefile.in: Regenerate.
12841
12842 2009-09-02 Ian Lance Taylor <iant@google.com>
12843
12844 * output.cc (Output_file::resize): Call map_no_anonymous rather
12845 than map.
12846
12847 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12848
12849 * gold.cc: Include "incremental.h".
12850 (queue_initial_tasks): Call Incremental_checker methods.
12851 * incremental.cc: Include "output.h".
12852 (Incremental_checker::can_incrementally_link_output_file): New
12853 method.
12854 * incremental.h (Incremental_checker): New class.
12855
12856 * output.cc (Output_file::open_for_modification): New method.
12857 (Output_file::map_anonymous): Changed return type to bool. Record
12858 map in base_ field.
12859 (Output_file::map_no_anonymous): New method, broken out of map.
12860 (Output_file::map): Use map_no_anonymous and map_anonymous.
12861 * output.h (class Output_file): Update declarations.
12862
12863 2009-08-24 Cary Coutant <ccoutant@google.com>
12864
12865 * options.h (Command_line::Pre_options): New class.
12866 (Command_line::pre_options): New member.
12867 * options.cc (gold::options::ready_to_register): New variable.
12868 (One_option::register_option): Do nothing if not registering options.
12869 Assert if same short option registered twice.
12870 (General_options::General_options): Turn off option registration when
12871 done constructing.
12872 (Command_line::Pre_options::Pre_options): New constructor.
12873
12874 2009-08-24 Cary Coutant <ccoutant@google.com>
12875
12876 * options.h (General_options::no_keep_memory): Remove incorrect
12877 short option.
12878
12879 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12880
12881 * Makefile.am (am__skiplex, am__skipyacc): New.
12882 * Makefile.in: Regenerate.
12883
12884 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12885
12886 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12887 (INCLUDES): ... this.
12888 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12889 (AM_CPPFLAGS): Renamed from ...
12890 (INCLUDE): ... this.
12891 * Makefile.in, testsuite/Makefile.in: Regenerate.
12892
12893 * Makefile.in: Regenerate.
12894 * aclocal.m4: Likewise.
12895 * config.in: Likewise.
12896 * configure: Likewise.
12897 * testsuite/Makefile.in: Likewise.
12898
12899 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12900 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12901 * Makefile.in: Regenerate.
12902 * testsuite/Makefile.in: Regenerate.
12903
12904 2009-08-19 Cary Coutant <ccoutant@google.com>
12905
12906 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12907 symbols in shared libraries overridden by hidden or internal symbols
12908 in the main program.
12909
12910 2009-08-19 Chris Demetriou <cgd@google.com>
12911
12912 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12913 checking source file names in error messages.
12914
12915 2009-08-18 Doug Kwan <dougkwan@google.com>
12916
12917 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12918 an elcpp::Ehdr as parameter. Adjust call to set_target.
12919 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12920 an elfcpp::Ehdr as parameter.
12921 * object.cc (Object::set_target): Remove the version that looks up
12922 a target and sets it.
12923 (Sized_relobj::setup): Take a Target object instead of
12924 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12925 (make_elf_sized_object): Find target and ask target to
12926 make an ELF object.
12927 * object.h: (Object::set_target): Remove the version that looks up
12928 a target and sets it.
12929 (Sized_relobj::setup): Take a Target object instead of
12930 an elfcpp:Ehdr as parameter.
12931 * target.cc: Include dynobj.h.
12932 (Target::do_make_elf_object_implementation): New.
12933 (Target::do_make_elf_object): New.
12934 * target.h (Target::make_elf_object): New template declaration.
12935 (Target::do_make_elf_object): New method declarations.
12936 (Target::do_make_elf_object_implementation): New template declaration.
12937
12938 2009-08-14 Ian Lance Taylor <iant@google.com>
12939
12940 * gold.h (FUNCTION_NAME): Define.
12941 (gold_unreachable): Use FUNCTION_NAME.
12942
12943 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12944
12945 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12946 symbol in the --keep-unique list is not found.
12947
12948 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12949
12950 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12951 been maked as --keep-unique.
12952 (Icf::unfold_section): New function.
12953 * icf.h (Icf::unfold_section): New function.
12954 * options.h (General_options::keep_unique): New option.
12955 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12956 * testsuite/Makefile.in: Regenerate.
12957 * testsuite/icf_keep_unique_test.sh: New file.
12958 * testsuite/icf_keep_unique_test.cc: New file.
12959
12960 2009-08-12 Cary Coutant <ccoutant@google.com>
12961
12962 PR 10471
12963 * resolve.cc (Symbol_table::resolve): Check for references from
12964 dynamic objects to hidden and internal symbols.
12965 * testsuite/Makefile.am (hidden_test.sh): New test.
12966 * testsuite/Makefile.in: Regenerate.
12967 * testsuite/hidden_test.sh: New script.
12968 * testsuite/hidden_test_1.c: New test source.
12969 * testsuite/hidden_test_main.c: New test source.
12970
12971 2009-08-11 Doug Kwan <dougkwan@google.com>
12972
12973 * arm.cc: Update comments.
12974 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12975 segment to locate the .ARM.exidx section if present.
12976
12977 2009-08-09 Doug Kwan <dougkwan@google.com>
12978
12979 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12980 patch.
12981
12982 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12983 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12984 compiler warnings.
12985
12986 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12987
12988 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12989 valid tls_segment only for non-debug-section relocations.
12990 * testsuite/Makefile.am: Add gc_tls_test.
12991 * testsuite/Makefile.in: Regenerate.
12992 * testsuite/gc_tls_test.cc: New file.
12993 * testsuite/gc_tls_test.sh: New file.
12994
12995 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12996
12997 * icf.cc: New file.
12998 * icf.h: New file.
12999 * Makefile.am (CCFILES): Add icf.cc.
13000 (HFILES): Add icf.h
13001 * Makefile.in: Regenerate.
13002 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13003 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13004 section, symbol and addend information for the relocs.
13005 * gold.cc (queue_middle_tasks): Call identical code folding.
13006 * gold.h: Add defines for multimap.
13007 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13008 to the call of finalize_local_symbols.
13009 * main.cc (main): Create object of class Icf.
13010 * object.cc (Sized_relobj::do_layout): Allow this function to be
13011 called twice during icf.
13012 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13013 to sections marked as identical by icf.
13014 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13015 when available.
13016 (Sized_relobj::do_section_entsize): New function.
13017 * object.h (Object::section_entsize): New function.
13018 (Object::do_section_entsize): New pure virtual function.
13019 (Relobj::finalize_local_symbols): Add new parameter.
13020 (Relobj::do_section_entsize): New function.
13021 * options.h (General_options::icf): New option.
13022 (General_options::icf_iterations): New option.
13023 (General_options::print_icf_sections): New option.
13024 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13025 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13026 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13027 icf.
13028 * symtab.cc (Symbol_table::is_section_folded): New function.
13029 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13030 to sections marked as identical by icf.
13031 * symtab.h (Symbol_table::set_icf): New function.
13032 (Symbol_table::icf): New function.
13033 (Symbol_table::is_section_folded): New function.
13034 (Symbol_table::icf_): New data member.
13035 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13036 * testsuite/Makefile.am: Add commands to build icf_test.
13037 * testsuite/Makefile.in: Regenerate.
13038 * testsuite/icf_test.sh: New file.
13039 * testsuite/icf_test.cc: New file.
13040
13041 2009-07-24 Chris Demetriou <cgd@google.com>
13042
13043 * layout.cc (is_compressible_debug_section): Fix incorrect
13044 comment about compressed section names.
13045
13046 2009-07-20 Ian Lance Taylor <ian@airs.com>
13047
13048 PR 10419
13049 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13050
13051 2009-07-16 Ian Lance Taylor <iant@google.com>
13052
13053 PR 10400
13054 * layout.h: #include <map>.
13055 (class Kept_section): Change from struct to class. Add accessors
13056 and setters. Add section size to Comdat_group mapping. Change
13057 Comdat_group to std::map. Add is_comdat_ field. Add
13058 linkonce_size field in union.
13059 (class Layout): Update declaration of find_or_add_kept_section.
13060 Don't declare find_kept_object.
13061 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13062 parameter. Add object, shndx, is_comdat, and is_group_name
13063 parameters. Change all callers. Adjust for new Kept_section.
13064 (Layout::find_kept_object): Remove.
13065 * object.cc (Sized_relobj::include_section_group): Update use of
13066 Kept_section. Rename secnum to shndx. Only record
13067 Kept_comdat_section if sections are the same size.
13068 (Sized_relobj::include_linkonce_section): Update use of
13069 Kept_section. Only record Kept_comdat_section if sections are the
13070 same size. Set size of linkonce section.
13071 (Sized_relobj::map_to_kept_section): Update call to
13072 get_kept_comdat_section.
13073 * object.h (class Sized_relobj): Rename fields in
13074 Kept_comdat_section to drop trailing underscores; change object
13075 field to Relobj*. Change Kept_comdat_section_table to store
13076 struct rather than pointer.
13077 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13078 Add kept_object and kept_shndx parameters. Change all callers.
13079 (Sized_relobj::get_kept_comdat_section): Change return type to
13080 bool. Add kept_object and kept_shndx parameters. Change all
13081 callers.
13082 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13083 Layout::find_or_add_kept_section.
13084
13085 2009-07-09 Ian Lance Taylor <iant@google.com>
13086
13087 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13088 Reserve space in the hash table.
13089
13090 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13091
13092 * fileread.cc (File_read::get_mtime): New method.
13093 * fileread.h (Timespec): New structure.
13094 (File_read::get_mtime): New method.
13095 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13096 Renamed from timestamp_nsec.
13097 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13098 Elf_Xword.
13099 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13100 timestamp_nsec.
13101 (Incremental_inputs::report_archive): Save mtime; style fix.
13102 (Incremental_inputs::report_obejct): Save mtime; style fix.
13103 (Incremental_inputs::report_script): Save mtime; style fix.
13104 (Incremental_inputs::finalize_inputs): Style fix.
13105 (Incremental_inputs::finalize): Style fix.
13106 (Incremental_inputs::create_input_section_data): Store inputs
13107 mtime.
13108 * incremental.h (Incremental_inputs::report_script): Add mtime
13109 argument.
13110 (Incremental_inputs::Input_info::Input_info): Intialize only one
13111 union member.
13112 (Incremental_inputs::Input_info::archive): Move to nameless
13113 union.
13114 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13115 (Incremental_inputs::Input_info::script): Move to nameless union.
13116 (Incremental_inputs::mtime): New field.
13117 * script.cc (read_input_script): Pass file mtime to
13118 Incremental_input.
13119 * script.h (Script_info::inputs): Style fix.
13120
13121 2009-07-01 Ian Lance Taylor <ian@airs.com>
13122
13123 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13124 instead of 32.
13125
13126 2009-06-24 Ian Lance Taylor <iant@google.com>
13127
13128 PR 10156
13129 * layout.cc (Layout::choose_output_section): If we find an
13130 existing section, update the flags.
13131 (Layout::create_notes): New function, broken out of
13132 Layout::finalize.
13133 (Layout::finalize): Don't create note sections.
13134 (Layout::create_note): Don't crash if linker script discards
13135 section.
13136 (Layout::create_gold_note): Likewise.
13137 (Layout::create_build_id): Likewise. Don't set
13138 after_input_sections on the section.
13139 (Layout::create_executable_stack_info): Remove target parameter.
13140 Change caller.
13141 * layout.h (class Layout): Declare create_notes. Update
13142 declaration of create_executable_stack_info.
13143 * gold.cc (queue_middle_tasks): Call create_notes.
13144 * output.cc (Output_section::update_flags_for_input_section): Move
13145 here from output.h. If SHF_ALLOC flag is newly set, mark address
13146 invalid.
13147 * output.h (Output_data::mark_address_invalid): New function.
13148 (class Output_section): Only declare, not define,
13149 update_flags_for_input_section. Remove set_flags.
13150
13151 2009-06-24 Ian Lance Taylor <iant@google.com>
13152
13153 * script-sections.cc (Output_section_definition::
13154 set_section_addresses): Rename shadowing local load_address to
13155 laddr.
13156
13157 2009-06-24 Ian Lance Taylor <iant@google.com>
13158
13159 PR 10244
13160 * reloc.cc (relocate_sections): Skip empty relocation sections.
13161
13162 2009-06-23 Ian Lance Taylor <iant@google.com>
13163
13164 PR 10156
13165 * layout.cc (Layout::create_note): Use choose_output_section
13166 rather than make_output_section.
13167
13168 2009-06-23 Ian Lance Taylor <iant@google.com>
13169
13170 PR 10237
13171 * options.cc (General_options::parse_V): Set printed_version_.
13172 (General_options::General_options): Initialize printed_version_.
13173 * options.h (class General_options): Add printed_version_ field.
13174 * gold.cc (queue_initial_tasks): If there are no input files,
13175 don't give a fatal error if we printed the version information.
13176 (queue_middle_tasks): If using -r with a shared object, give a
13177 fatal error rather than an ordinary error.
13178
13179 2009-06-23 Ian Lance Taylor <iant@google.com>
13180
13181 PR 10219
13182 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13183 (Layout::make_output_section): Set have_stabstr_section_ if we see
13184 a .stab*str section.
13185 (Layout::finalize): Call link_stabs_sections.
13186 (Layout::link_stabs_sections): New file.
13187 * layout.h (class Layout): Add have_stabstr_section_ field.
13188 Declare link_stabs_sections.
13189
13190 2009-06-23 Doug Kwan <dougkwan@google.com>
13191
13192 * Makefile.am (libgold_a_LIBADD): New.
13193 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13194 * Makefile.in: Regenerate.
13195 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13196 * configure: Regenerate.
13197 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13198 * fileread.cc: Include sys/state.h
13199 * gold.h: Declare memmem and strndup if found missing.
13200 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13201
13202 2009-06-23 Ian Lance Taylor <iant@google.com>
13203
13204 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13205 * configure: Rebuild.
13206
13207 2009-06-23 Ian Lance Taylor <iant@google.com>
13208
13209 PR 10147
13210 * object.cc (Object::section_contents): Don't try to get a view if
13211 the section has length zero.
13212 (Object::handle_gnu_warning_section): If the section is empty, use
13213 the name of the section as the warning.
13214
13215 2009-06-23 Ian Lance Taylor <iant@google.com>
13216
13217 PR 10133
13218 * stringpool.h (class Stringpool_template): Add optimize_ field.
13219 (Stringpool_template::set_optimize): New function.
13220 * stringpool.cc (Stringpool_template::Stringpool_template):
13221 Initialize optimize_ field.
13222 (Stringpool_template::set_string_offsets): Test local optimize
13223 fild rather than parameter.
13224 * layout.cc (Layout::Layout): Call set_optimize on the section
13225 name stringpool.
13226
13227 2009-06-22 Ian Lance Taylor <iant@google.com>
13228
13229 PR 10030
13230 * yyscript.y: Parse TARGET.
13231 * script.cc (script_set_target): New function.
13232 * script-c.h (script_set_target): Declare.
13233 * options.cc (General_options::string_to_object_format): Rename
13234 from string_to_object_format in anonymous namespace. Change
13235 callers.
13236 * options.h (class General_options): Declare
13237 string_to_object_format.
13238
13239 2009-06-22 Ian Lance Taylor <iant@google.com>
13240
13241 * script-sections.cc (Script_sections::create_segments): Don't put
13242 program headers in a PT_LOAD segment if -n or -N.
13243
13244 2009-06-22 Ian Lance Taylor <iant@google.com>
13245
13246 PR 10141
13247 * options.h (class General_options): Add -z lazy and -z now. Sort
13248 -z options into alphabetical order.
13249 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13250
13251 2009-06-21 Ian Lance Taylor <iant@google.com>
13252
13253 * layout.cc (Layout::make_output_section): Call
13254 Target::new_output_section.
13255 (Layout::attach_allocated_section_to_segment): Put large section
13256 sections in a separate load segment with the large segment flag
13257 set.
13258 (Layout::segment_precedes): Sort large data segments after other
13259 load segments.
13260 (align_file_offset): New static function.
13261 (Layout::set_segment_offsets): Use align_file_offset.
13262 * output.h (class Output_section): Add is_small_section_ and
13263 is_large_section_ fields.
13264 (Output_section::is_small_section): New function.
13265 (Output_section::set_is_small_section): New function.
13266 (Output_section::is_large_section): New function.
13267 (Output_section::set_is_large_section): New function.
13268 (Output_section::is_large_data_section): New function.
13269 (class Output_segment): Add is_large_data_segment_ field.
13270 (Output_segment::is_large_data_segment): New function.
13271 (Output_segment::set_is_large_data_segment): New function.
13272 * output.cc (Output_section::Output_section): Initialize new
13273 fields.
13274 (Output_segment::Output_segment): Likewise.
13275 (Output_segment::add_output_section): Add assertion that large
13276 data sections always go in large data segments. Force small data
13277 sections to the end of the list of data sections. Force small BSS
13278 sections to the start of the list of BSS sections. For large BSS
13279 sections to the end of the list of BSS sections.
13280 * symtab.h (class Symbol): Declare is_common_shndx.
13281 (Symbol::is_defined): Check Symbol::is_common_shndx.
13282 (Symbol::is_common): Likewise.
13283 (class Symbol_table): Define enum Commons_section_type. Update
13284 declarations. Add small_commons_ and large_commons_ fields.
13285 * symtab.cc (Symbol::is_common_shndx): New function.
13286 (Symbol_table::Symbol_table): Initialize new fields.
13287 (Symbol_table::add_from_object): Put small and large common
13288 symbols in the right list.
13289 (Symbol_table::sized_finalized_symbol): Check
13290 Symbol::is_common_shndx.
13291 (Symbol_table::sized_write_globals): Likewise.
13292 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13293 common symbol lists. Don't call do_allocate_commons_list if the
13294 list is empty.
13295 (Symbol_table::do_allocate_commons_list): Remove is_tls
13296 parameter. Add comons_section_type parameter. Change all
13297 callers. Handle small and large common symbols.
13298 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13299 Symbol::is_common_shndx.
13300 * resolve.cc (symbol_to_bits): Likewise.
13301 * target.h (Target::small_common_shndx): New function.
13302 (Target::small_common_section_flags): New function.
13303 (Target::large_common_shndx): New function.
13304 (Target::large_common_section_flags): New function.
13305 (Target::new_output_section): New function.
13306 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13307 small_common_section_flags, and large_common_section_flags
13308 fields.
13309 (Target::do_new_output_section): New virtual function.
13310 * arm.cc (Target_arm::arm_info): Initialize new fields.
13311 * i386.cc (Target_i386::i386_info): Likewise.
13312 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13313 Likewise.
13314 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13315 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13316 (Target_x86_64::do_new_output_section): New function.
13317 * configure.ac: Define conditional MCMODEL_MEDIUM.
13318 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13319 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13320 (large_LDFLAGS): Define.
13321 * testsuite/large.c: New file.
13322 * testsuite/testfile.cc (Target_test::test_target_info):
13323 Initialize new fields.
13324 * configure, testsuite/Makefile.in: Rebuild.
13325
13326 2009-06-05 Doug Kwan <dougkwan@google.com>
13327
13328 * Makefile.am (CCFILES): Add target.cc.
13329 * Makefile.in: Regenerate.
13330 * i386.cc (class Target_i386): Define new virtual method to
13331 override do_is_local_label_name in parent.
13332 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13333 local symbols if --discard-locals or -X is given.
13334 * options.h (class General_options): Declare new options
13335 '--discard-locals' and '-X' for discarding locals.
13336 * target.h (class Target): Define new methods is_local_label_name.
13337 Declare new virtual method do_is_local_label_name.
13338 * target.cc: New file.
13339 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13340 (check_SCRIPTS): Add discard_locals_test.sh.
13341 (check_DATA): Add discard_local_tests.syms.
13342 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13343 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13344 * testsuite/Makefile.in: Regenerate.
13345 * testsuite/discard_locals_test.c: New file.
13346 * testsuite/discard_locals_test.sh: Same.
13347
13348 2009-06-05 Doug Kwan <dougkwan@google.com>
13349
13350 * object.cc (Sized_relobj::Sized_relobj): Initialize
13351 discarded_eh_frame_shndx_ to -1U.
13352 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13353 section.
13354 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13355 a discarded .eh_frame section.
13356 (Sized_relobj::do_finalize_local_symbols): Ditto.
13357 * object.h (class Sized_relobj): Declare new member
13358 discarded_eh_frame_shndx_.
13359 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13360 (local_labels_test.o, local_labels_test): New rules.
13361 * testsuite/Makefile.in: Regenerate.
13362
13363 2009-06-04 Doug Kwan <dougkwan@google.com>
13364
13365 * layout.cc (Layout::section_name_mapping): Add mapping for
13366 special ARM sections.
13367
13368 2009-06-03 Doug Kwan <dougkwan@google.com>
13369
13370 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13371 (utils::has_overflow): Same.
13372
13373 2009-06-03 Ian Lance Taylor <iant@google.com>
13374
13375 * layout.cc (Layout::section_name_mapping): New array, replacing
13376 Layout::linkonce_mapping.
13377 (Layout::section_name_mapping_count): New variable, replacing
13378 Layout::linkonce_mapping_count.
13379 (Layout::linkonce_output_name): Remove.
13380 (Layout::output_section_name): Rewrite.
13381 * layout.h (class Layout): Rename Linkonce_mapping to
13382 Section_name_mapping, linkonce_mapping to section_name_mapping,
13383 linkonce_mapping_count to section_name_mapping_count. Don't
13384 declare linkonce_output_name.
13385
13386 2009-06-03 Doug Kwan <dougkwan@google.com>
13387
13388 * gold/arm.cc (namespace utils): New.
13389 (Target_arm::reloc_is_non_pic): Define new method.
13390 (class Arm_relocate_functions): New.
13391 (Target_arm::Relocate::relocate): Handle relocation types used by
13392 Android.
13393
13394 2009-06-03 Ian Lance Taylor <iant@google.com>
13395
13396 * arm.cc (Target_arm::scan::global): Use || instead of |.
13397
13398 2009-06-02 Doug Kwan <dougkwan@google.com>
13399
13400 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13401 issued_non_pic_error_.
13402 (class Target_arm::Scan): Declare new method check_non_pic.
13403 Define new method symbol_needs_plt_entry.
13404 Declare new data member issued_non_pic_error_.
13405 (class Target_arm::Relocate): Declare new method
13406 should_apply_static_reloc.
13407 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13408 (Target_arm::Scan::check_non_pic): Define new method.
13409 (Target_arm::Scan::local): Handle a small subset of reloc types used
13410 by Android.
13411 (Target_arm::Scan::local): Same.
13412 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13413
13414 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13415
13416 * incremental.cc (Incremental_inputs::report_command_line): Filter
13417 out --incremental-* options.
13418
13419 2009-05-29 Doug Kwan <dougkwan@google.com>
13420
13421 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13422 template class.
13423 (class Target_arm): Update comment.
13424 (Target_arm::Target_arm): Initialize new data members GOT_,
13425 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13426 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13427 and Target_arm::rel_dyn_section.
13428 Declare new_enum Target_arm::Got_type.
13429 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13430 and DYNBSS_.
13431 Update commments for member do_dynsym_value.
13432 (Target_arm::got_size, Target_arm::plt_section,
13433 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13434 new methods inside class defintion.
13435 (Target_arm::got_section): Define new method.
13436 (Target_arm::rel_dyn_section): Same.
13437 (Output_data_plt_arm): New template class.
13438 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13439 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13440 (Output_data_plt_arm::add_entry): Same.
13441 (Output_data_plt_arm::first_plt_entry): Define new
13442 static data member for PLT instruction template.
13443 (Output_data_plt_arm::plt_entry): Same.
13444 (Output_data_plt_arm::do_write): Define new method.
13445 (Target_arm::make_plt_entry): Same.
13446 (Target_arm::do_finalize_sections): Same.
13447 (Target_arm::do_dynsym_value): Same.
13448
13449 2009-05-28 Doug Kwan <dougkwan@google.com>
13450
13451 * Makefile.am (TARGETSOURCES): Add arm.cc.
13452 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13453 * Makefile.in: Regenerate.
13454 * arm.cc: New file.
13455 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13456
13457 2009-05-26 Doug Kwan <dougkwan@google.com>
13458
13459 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13460 (General_options::check_excluded_libs): Strip off directories in
13461 archive name before matching like GNU ld does.
13462 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13463 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13464 (exclude_libs_test_LDFLAGS): Add linker option
13465 -Wl,--exclude-libs,libexclude_libs_test_3
13466 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13467 an explicit archive without using -l.
13468 (alt/libexclude_libs_test_3.a): New make rule.
13469 * testsuite/Makefile.in: Regenerate.
13470 * testsuite/exclude_libs_test.c : Declare lib3_default().
13471 (main): Call it.
13472 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13473 * exclude_libs_test_3.c: New file.
13474
13475 2009-05-26 Nick Clifton <nickc@redhat.com>
13476
13477 * po/id.po: New Indonesian translation.
13478 * po/gold.pot: Updated template file.
13479
13480 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13481
13482 * testsuite/Makefile.am: Add -ffunction-sections to compile
13483 gc_comdat_test files. Add -Wl,--gc-sections to build
13484 gc_comdat_test.
13485 * testsuite/Makefile.in: Regenerate.
13486 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13487
13488 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13489
13490 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13491 kept comdat section was garbage collected.
13492 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13493 * testsuite/Makefile.in: Regenerate.
13494 * testsuite/gc_comdat_test.sh: New file.
13495 * testsuite/gc_comdat_test_1.cc: New file.
13496 * testsuite/gc_comdat_test_2.cc: New file.
13497
13498 2009-05-19 Doug Kwan <dougkwan@google.com>
13499
13500 * archive.cc (Archive::Archive): Move constructor from archive.h
13501 to here. Initialize no_export_.
13502 (Archive::get_elf_object_for_member): Set no_export flag of object.
13503 * archive.h (Archive::Archive): Move constructor body to
13504 archive.cc.
13505 (Archive::no_export): New method.
13506 (Archive::no_export_): New field.
13507 * object.h (Object::Object): Initialize no_export_ to false.
13508 (Object::no_export, Object::set_no_export): New methods.
13509 (Object::no_export_): New field.
13510 * options.cc (General_options::parse_exclude_libs): New method.
13511 (General_options::check_excluded_libs) Same.
13512 * options.h (exclude_libs): New option.
13513 (General_options::check_excluded_libs): New method declaration.
13514 (General_options::excluded_libs_): New field.
13515 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13516 default or protected visibility if an object has no-export flag set.
13517 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13518 (check_SCRIPTS): Add exclude_libs_test.sh.
13519 (check_DATA): Add exclude_libs_test.syms.
13520 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13521 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13522 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13523 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13524 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13525 libexclude_libs_test_2.a): New rules.
13526 * testsuite/Makefile.in: Regenerate.
13527 * testsuite/exclude_libs_test.c: New file.
13528 * testsuite/exclude_libs_test.sh: Ditto.
13529 * testsuite/exclude_libs_test_1.c: Ditto.
13530 * testsuite/exclude_libs_test_2.c: Ditto.
13531
13532 2009-05-15 Ian Lance Taylor <iant@google.com>
13533
13534 * configure.ac: Check for declarations for cases where libiberty.h
13535 checks HAVE_DECL_xxx.
13536 * configure, config.in: Rebuild.
13537
13538 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13539
13540 * gold.h (Incremental_argument_list): Remove (invalid) forward
13541 declaration.
13542 * incremental.cc (Incremental_inputs::report_achive): New method.
13543 (Incremental_inputs::report_object): New method.
13544 (Incremental_inputs::report_script): New method.
13545 (Incremental_inputs::finalize_inputs): New method.
13546 (Incremental_inputs::finalize): Call finalize_inputs().
13547 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13548 Create inputs entries.
13549 * incremental.h (Incremental_input_type): New enum.
13550 (Incremental_inputs::Incremental_input): Initialize new fields.
13551 (Incremental_inputs::report_inputs): New method.
13552 (Incremental_inputs::report_achive): New method.
13553 (Incremental_inputs::report_object): New method.
13554 (Incremental_inputs::report_script): New method.
13555 (Incremental_inputs::finalize_inputs): New method.
13556 (Incremental_inputs::Input_info): New struct.
13557 (Incremental_inputs::Input_info_map): New typedef.
13558 (Incremental_inputs::lock_): New field.
13559 (Incremental_inputs::Inputs_): New field.
13560 (Incremental_inputs::Inputs_map): New field.
13561 * main.cc (main): Call Incremental_input::report_inputs.
13562 * options.h (Input_argument_list): Typedef moved from
13563 Input_arguments.
13564 (Input_file_group::Files): Remove, use ::Input_argument_list.
13565 (Input_file_group::Input_argument_list): Remove, use
13566 ::Input_argument_list.
13567 * plugin.cc (Plugin_manager::add_input_file): Add error in
13568 incremental build.
13569 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13570 functions.
13571 * script.cc (read_input_script): Call
13572 Incremental_input::report_script.
13573 * script.h (Script_info): New class.
13574
13575 2009-04-27 Ian Lance Taylor <iant@google.com>
13576
13577 * x86_64.cc (do_adjust_output_section): Set entsize to
13578 plt_entry_size.
13579
13580 2009-04-23 Elliott Hughes <enh@google.com>
13581
13582 * output.cc (Output_file::close): After short writes, continue
13583 writing from the correct offset in the buffer being written.
13584
13585 2009-04-23 Chris Demetriou <cgd@google.com>
13586
13587 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13588 * configure: Regenerate.
13589 * config.in: Regenerate.
13590 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13591 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13592
13593 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13594
13595 * incremental.cc (Incremental_inputs_header_data): Renamed from
13596 Incremental_input_header_data.
13597 (Incremental_inputs_header_data::data_size): New field.
13598 (Incremental_inputs_header_data::put_input_file_count): Renamed
13599 from input_file_count.
13600 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13601 from command_line_offset.
13602 (Incremental_inputs_header_data::put_reserved): Renamed from
13603 put_reserved.
13604 (Incremental_inputs_entry_data): Renamed from
13605 Incremental_input_entry_data.
13606 (Incremental_inputs_entry_data::data_size): New field.
13607 (Incremental_inputs::report_command_line): New method.
13608 (Incremental_inputs::finalize): New method.
13609 (Incremental_inputs::create_incremental_inputs_data): New method.
13610 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13611 * incremental.h: New file.
13612 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13613 (Layout::finalize): Create incremental inputs section in
13614 incremental builds.
13615 (Layout::create_incremental_info_sections): New method.
13616 * layout.h (Layout::incremental_inputs): New method.
13617 (Layout::create_incremental_info_sections): New method.
13618 (Layout::incremental_inputs_): New field.
13619 * main.cc (main): Notify Incremental_input of the command line.
13620
13621 2009-04-01 Ian Lance Taylor <iant@google.com>
13622 Mikolaj Zalewski <mikolajz@google.com>
13623
13624 * gold.h (reserve_unordered_map): Define, three versions, one for
13625 each version of Unordered_map.
13626 * layout.cc (Layout::Layout): Remove options parameter. Add
13627 number_of_input_files parameter. Don't initialize options_.
13628 Initialize number_of_input_files_ and resized_signatures_. Move
13629 sections_are_attached_.
13630 (Layout::layout_group): Reserve space for group_signatures_.
13631 (Layout::find_or_add_kept_section): Change name parameter to be a
13632 reference. Resize signatures_ map when it gets large enough.
13633 (Layout::layout_eh_frame): Use parameters->options() instead of
13634 this->options_.
13635 (Layout::make_output_section): Likewise.
13636 (Layout::attach_allocated_section_to_segment): Likewise.
13637 (Layout::finalize, Layout::create_executable_stack): Likewise.
13638 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13639 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13640 * layout.h (class Layout): Update declarations. Remove options_
13641 field. Add number_of_input_files_ and resized_signatures_
13642 fields. Move sections_are_attached_ field.
13643 * main.cc (main): Pass number of input files to Layout
13644 constructor. Don't pass options.
13645
13646 2009-03-30 Ian Lance Taylor <iant@google.com>
13647
13648 * ffsll.c (ffsll): Correct implementation.
13649
13650 2009-03-27 Ian Lance Taylor <iant@google.com>
13651
13652 * ffsll.c: New file.
13653 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13654 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13655 * ftruncate.c (ftruncate): Declare before definition.
13656 * mremap.c (mremap): Likewise.
13657 * pread.c (pread): Likewise.
13658 * configure, Makefile.in, config.in: Rebuild.
13659
13660 * mremap.c: New file.
13661 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13662 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13663 (mremap): Declare if HAVE_MREMAP is not defined.
13664 * configure, Makefile.in, config.in: Rebuild.
13665
13666 2009-03-27 Cary Coutant <ccoutant@google.com>
13667
13668 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13669 position independent.
13670 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13671 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13672
13673 2009-03-24 Cary Coutant <ccoutant@google.com>
13674
13675 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13676 an executable.
13677 (needs_dynamic_reloc): Likewise.
13678
13679 2009-03-24 Ian Lance Taylor <iant@google.com>
13680
13681 * yyscript.y (file_cmd): Recognize EXTERN.
13682 (extern_name_list, extern_name_list_body): New nonterminals.
13683 * script.cc (script_add_extern): Define.
13684 * script-c.h (script_add_extern): Declare.
13685
13686 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13687
13688 * object.cc (is_elf_object): Define.
13689 * object.h (is_elf_object): Declare.
13690 * archive.cc (Archive::get_elf_object_for_member): Call
13691 is_elf_object.
13692 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13693
13694 2009-03-24 Elliott Hughes <enh@google.com>
13695
13696 * output.cc (Output_file::map_anonymous): Define.
13697 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13698 try an anonymous one. Report the size if the mmap fails.
13699 * output.h (class Output_file): Declare map_anonymous.
13700
13701 2009-03-24 Ian Lance Taylor <iant@google.com>
13702
13703 * target-select.cc (instantiate_target): Don't acquire the lock if
13704 the instantiated_target_ field has already been set.
13705
13706 2009-03-23 Ian Lance Taylor <iant@google.com>
13707
13708 * gold-threads.h (class Initialize_lock): Define.
13709 * gold-threads.cc (class Initialize_lock_once): Define.
13710 (initialize_lock_control): New static variable.
13711 (initialize_lock_pointer): New static variable.
13712 (initialize_lock_once): New static function.
13713 (Initialize_lock::Initialize_lock): Define.
13714 (Initialize_lock::initialize): Define.
13715 * target-select.h: Include "gold-threads.h".
13716 (class Target_selector): Add lock_ and initialize_lock_ fields.
13717 Don't define instantiate_target, just declare it.
13718 * target-select.cc (Target_selector::Target_selector): Initialize
13719 new fields.
13720 (Target_selector::instantiate_target): Define.
13721 * descriptors.h: Include "gold-threads.h".
13722 (class Descriptors): Add initialize_lock_ field.
13723 * descriptors.cc (Descriptors::Descriptors): Initialize new
13724 field.
13725 (Descriptors::open): Use initialize_lock_ field
13726 * errors.h (class Errors): Add initialize_lock_ field.
13727 * errors.cc (Errors::Errors): Initialize new field.
13728 (Errors::initialize_lock): Use initialize_lock_ field.
13729 * powerpc.cc (class Target_selector_powerpc): Remove
13730 instantiated_target_ field. In do_recognize call
13731 instantiate_target rather than do_instantiate_target. In
13732 do_instantiate_target just allocate a new target.
13733 * sparc.cc (class Target_selector_sparc): Likewise.
13734
13735 * freebsd.h: New file.
13736 * i386.cc: Include "freebsd.h".
13737 (Target_i386): Derive from Target_freebsd rather than
13738 Sized_target.
13739 (Target_selector_i386): Derive from Target_selector_freebsd rather
13740 than Target_selector.
13741 * x86_64.cc: Include "freebsd.h".
13742 (Target_x86_64): Derive from Target_freebsd rather than
13743 Sized_target.
13744 (Target_selector_x86_64): Derive from Target_selector_freebsd
13745 rather than Target_selector.
13746 * target.h (class Target): Add adjust_elf_header and
13747 do_adjust_elf_header.
13748 * output.cc (Output_file_header:: do_sized_write): Call target
13749 adjust_elf_header routine.
13750 * configure.tgt: Set targ_osabi.
13751 * configure.ac: Define GOLD_DEFAULT_OSABI.
13752 * parameters.cc (Parameters::default_target): Pass
13753 GOLD_DEFAULT_OSABI to select_target.
13754 * target-select.h (class Target_selector): Make instantiate_target
13755 protected rather than private.
13756 * Makefile.am (HFILES): Add freebsd.h.
13757 * configure, Makefile.in, config.in: Rebuild.
13758
13759 * merge.cc (do_add_input_section): Correct pend value. Change
13760 message about last entry not being null terminated from error to
13761 warning.
13762
13763 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13764
13765 * incremental.cc: New file.
13766 * Makefile.am (CCFILES): Add incremental.cc.
13767 * Makefile.in: Rebuild.
13768
13769 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13770
13771 * layout.cc (Layout::output_section_name): Preserve names
13772 of '.note.' sections.
13773
13774 2009-03-19 Ian Lance Taylor <iant@google.com>
13775
13776 * descriptors.cc (Descriptors::open): Check that the options are
13777 valid before using them.
13778
13779 2009-03-18 Ian Lance Taylor <iant@google.com>
13780
13781 * script-sections.h: Include <list>.
13782 (class Script_sections): Change Sections_elements from std::vector
13783 to std::list. Typedef public Elements_iterator. Add
13784 orphan_section_placement_, data_segment_align_start_, and
13785 saw_data_segment_align_ fields. Remove data_segment_align_index_
13786 field.
13787 * script-sections.cc (class Orphan_section_placement): New class.
13788 (class Sections_element): Add virtual functions is_relro and
13789 orphan_section_init. Remove virtual function place_orphan_here.
13790 (class Output_section_definition): Add is_relro and
13791 orphan_section_init. Remove place_orphan_here.
13792 (class Orphan_output_section): Likewise.
13793 (Script_sections::Script_sections): Update for field changes.
13794 (Script_sections::data_segment_align): Set saw_data_segment_align_
13795 and data_segment_align_start_, not data_segment_align_index.
13796 (Script_sections::data_segment_relro_end): Check
13797 saw_data_segment_align_. Use data_segment_align_start_ rather
13798 than data_segment_align_index_.
13799 (Script_sections::place_orphan): Rewrite to use
13800 Orphan_section_placement.
13801
13802 2009-03-17 Ian Lance Taylor <iant@google.com>
13803
13804 * archive.cc (Archive::add_symbols): Check for a version attached
13805 to the symbol name in the archive map.
13806 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13807 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13808 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13809 (ver_test_11.a): New target.
13810 * testsuite/Makefile.in: Rebuild.
13811
13812 * configure.ac: Check for chsize and posix_fallocate. Replace
13813 ftruncate.
13814 * ftruncate.c: New file, from gnulib.
13815 * output.cc (posix_fallocate): Define dummy version if not
13816 HAVE_POSIX_FALLOCATE.
13817 (Output_file::map): Call posix_fallocate rather than lseek and
13818 write.
13819 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13820 * configure, Makefile.in, config.in: Rebuild.
13821
13822 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13823
13824 * layout.h (Layout::create_note): Add section_name parameter.
13825 * layout.cc (Layout::create_note): Likewise.
13826 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13827
13828 2009-03-17 Ian Lance Taylor <iant@google.com>
13829
13830 * descriptors.cc: Include "options.h".
13831 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13832 (Descriptors::open): Always use O_CLOEXEC when opening a new
13833 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13834 then set FD_CLOEXEC.
13835
13836 * sparc.cc (class Target_sparc): Add has_got_section.
13837 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13838 make sure we have a GOT section.
13839
13840 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13841 (Target_sparc::Scan::local): Likewise.
13842 (Target_sparc::Scan::global): Likewise.
13843 (Target_sparc::Relocate::relocate): Likewise.
13844 (Target_sparc::Relocate::relocate_tls): Likewise.
13845
13846 * symtab.cc (Symbol_table::define_default_version): New function,
13847 broken out of add_from_object.
13848 (Symbol_table::add_from_object): Call define_default_version.
13849 (Symbol_table::define_special_symbol): Add resolve_oldsym
13850 parameter. Change all callers. If the version for a symbol comes
13851 from a version script, resolve it with the symbol with the same
13852 name with no version. Also add the symbol without a version if
13853 appropriate.
13854 (do_define_in_output_data): If resolving with oldsym, don't delete
13855 sym.
13856 (do_define_in_output_segment): Likewise.
13857 (do_define_as_constant): Likewise.
13858 * symtab.h (class Symbol_table): Update declarations.
13859
13860 2009-03-13 Ian Lance Taylor <iant@google.com>
13861
13862 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13863 (Read_symbols::requeue): New function.
13864 (Read_symbols::do_read_symbols): If make_elf_object fails because
13865 the target type is not configured, and the file was searched for,
13866 issue a warning and retry with the next directory.
13867 (Add_symbols::run): If the file has an incompatible format, and
13868 it was searched for, requeue the Read_symbols task. On error,
13869 release the object.
13870 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13871 dirindex parameter to constructor. Change all callers. Declare
13872 incompatible_warning and requeue.
13873 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13874 input_argument_ and input_group_ fields. Add them to
13875 constructor. Change all callers.
13876 (class Read_script): Add dirindex_ field. Add it to constructor.
13877 Change all callers.
13878 * archive.cc (Archive::setup): Remove input_objects parameter.
13879 Change all callers.
13880 (Archive::get_file_and_offset): Likewise.
13881 (Archive::read_all_symbols): Likewise.
13882 (Archive::read_symbols): Likewise.
13883 (Archive::get_elf_object_for_member): Remove input_objects
13884 parameter. Add punconfigured parameter. Change all callers.
13885 (Archive::add_symbols): Change return type to bool. Check return
13886 value of include_member.
13887 (Archive::include_all_members): Likewise.
13888 (Archive::include_member): Change return type to bool. Return
13889 false if first included object has incompatible target. Set
13890 included_member_ field.
13891 (Add_archive_symbols::run): If add_symbols returns false, requeue
13892 Read_symbols task.
13893 * archive.h (class Archive): Add included_member_ field.
13894 Initialize it in constructor. Add input_file and searched_for
13895 methods. Update declarations.
13896 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13897 input_argument_ fields. Add them to constructor. Change all
13898 callers.
13899 * script.cc: Include "target-select.h".
13900 (class Parser_closure): Add skip_on_incompatible_target_ and
13901 found_incompatible_target_ fields. Add
13902 skip_on_incompatible_target parameter to constructor. Change all
13903 callers. Add methods skip_on_incompatible_target,
13904 clear_skip_on_incompatible_target, found_incompatible_target, and
13905 set_found_incompatible_target.
13906 (read_input_script): Add dirindex parameter. Change all callers.
13907 If parser finds an incompatible target, requeue Read_symbols
13908 task.
13909 (script_set_symbol): Clear skip_on_incompatible_target in
13910 closure.
13911 (script_add_assertion, script_parse_option): Likewise.
13912 (script_start_sections, script_add_phdr): Likewise.
13913 (script_check_output_format): New function.
13914 * script.h (read_input_script): Update declaration.
13915 * script-c.h (script_check_output_format): Declare.
13916 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13917 (ignore_cmd): Remove OUTPUT_FORMAT.
13918 * fileread.cc (Input_file::Input_file): Add explicit this.
13919 (Input_file::will_search_for): New function.
13920 (Input_file::open): Add pindex parameter. Change all callers.
13921 * fileread.h (class Input_file): Add input_file_argument method.
13922 Declare will_search_for. Update declarations.
13923 * object.cc (make_elf_object): Add punconfigured parameter.
13924 Change all callers.
13925 * object.h (class Object): Make input_file public. Add
13926 searched_for method.
13927 (make_elf_object): Update declaration.
13928 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13929 restart search.
13930 * dirsearch.h (class Dirsearch): Update declaration.
13931 * options.h (class General_options): Add --warn-search-mismatch.
13932 * parameters.cc (Parameters::is_compatible_target): New function.
13933 * parameters.h (class Parameters): Declare is_compatible_target.
13934 * workqueue.cc (Workqueue::add_blocker): New function.
13935 * workqueue.h (class Workqueue): Declare add_blocker.
13936
13937 * fileread.cc (Input_file::open): Remove options parameter.
13938 Change all callers.
13939 (Input_file::open_binary): Likewise.
13940 * script.cc (read_input_script): Likewise.
13941 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13942 options parameter from constructor. Change all callers.
13943 (class Read_script): Likewise.
13944 * fileread.h (class Input_file): Update declarations.
13945 * script.h (read_input_script): Update declaration.
13946
13947 2009-03-10 Nick Clifton <nickc@redhat.com>
13948
13949 * po/es.po: New Spanish translation.
13950
13951 2009-03-06 Cary Coutant <ccoutant@google.com>
13952
13953 * options.cc (parse_short_option): Keep dash_z from registering itself.
13954
13955 2009-03-03 Ian Lance Taylor <iant@google.com>
13956
13957 PR 9918
13958 * target-reloc.h (relocate_section): Pass output_section to
13959 relocate.
13960 * i386.cc (Target_i386::should_apply_static_reloc): Add
13961 output_section parameter. Change all callers.
13962 (Target_i386::Relocate::relocate): Add output_section parameter.
13963 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13964 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13965 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13966 * testsuite/two_file_shared.sh: New script.
13967 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13968 (check_DATA): Add two_file_shared.dbg.
13969 (two_file_shared.dbg): New target.
13970 * testsuite/Makefile.in: Rebuild.
13971
13972 2009-03-01 Ian Lance Taylor <iant@google.com>
13973
13974 * configure.ac: Check for byteswap.h.
13975 * configure: Rebuild.
13976 * config.in: Rebuild.
13977
13978 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13979
13980 * layout.cc (Layout::find_or_add_kept_section): New function.
13981 (Layout::add_comdat): Removed.
13982 * layout.h (struct Kept_section): Move out of class Layout.
13983 Remove trailing underscores from field names. Add group_sections
13984 field. Rename group_ field to is_group. Change all uses.
13985 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13986 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13987 comdat_groups_ field.
13988 (Sized_relobj::include_section_group): Use
13989 find_or_add_kept_section and Kept_section::group_sections.
13990 (Sized_relobj::include_linkonce_section): Likewise.
13991 * object.cc (class Sized_relobj): Don't define Comdat_group or
13992 Comdat_group_table. Remove find_comdat_group and
13993 add_comdat_group. Remove comdat_groups_ field.
13994 * plugin.cc (include_comdat_group): Use
13995 Layout::find_or_add_kept_section.
13996
13997 2009-02-28 Ian Lance Taylor <iant@google.com>
13998
13999 * README: --gc-sections and map files are now supported. Document
14000 some build requirements.
14001
14002 PR 6992
14003 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14004 relocatable link set the value of the section symbol to zero.
14005 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14006 relocatable link don't include the section address in the local
14007 symbol value.
14008
14009 2009-02-27 Ian Lance Taylor <iant@google.com>
14010
14011 PR 6811
14012 * options.h (class Search_directory): Add is_system_directory.
14013 (class General_options): Declare is_in_system_directory.
14014 * options.cc (get_relative_sysroot): Make static.
14015 (get_default_sysroot): Make static.
14016 (General_optoins::is_in_system_directory): New function.
14017 * fileread.cc (Input_file::is_in_system_directory): New function.
14018 * fileread.h (class Input_file): Declare is_in_system_directory.
14019 * object.h (class Object): Add is_in_system_directory.
14020 (class Input_objects): Remove system_library_directory_ field.
14021 * object.cc (Input_objects::add_object): Don't set
14022 system_library_directory_.
14023 (input_objects::found_in_system_library_directory): Remove.
14024 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14025 parameter. Change all callers.
14026 (Symbol_table::sized_write_globals): Likewise.
14027 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14028 Call Object::is_in_system_directory.
14029 * symtab.h (class Symbol_table): Update declarations.
14030
14031 PR 5990
14032 * descriptors.h (Open_descriptor): Add is_on_stack field.
14033 * descriptors.cc (Descriptors::open): If the descriptor is on the
14034 top of the stack, remove it. Initialize is_on_stack field.
14035 (Descriptors::release): Only add pod to stack if it is not on the
14036 stack already.
14037 (Descriptors::close_some_descriptor): Clear stack_next and
14038 is_on_stack fields.
14039
14040 PR 7091
14041 * output.cc (Output_section::find_starting_output_address): Rename
14042 from starting_output_address; add PADDR parameter; change return
14043 type.
14044 * output.h (class Output_section): Declare
14045 find_starting_output_address instead of starting_output_address.
14046 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14047 section symbol for which we can't find a merge section.
14048
14049 PR 9836
14050 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14051 hidden or internal, force the symbol to be local.
14052 * resolve.cc (Symbol::override_visibility): Define.
14053 (Symbol::override_base): Use override_visibility.
14054 (Symbol_table::resolve): Likewise.
14055 (Symbol::override_base_with_special): Likewise.
14056 (Symbol_table::override_with_special): If the visibility is hidden
14057 or internal, force the symbol to be local.
14058 * symtab.h (class Symbol): Add set_visibility and
14059 override_visibility.
14060 * testsuite/ver_test_1.sh: New file.
14061 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14062 (check_DATA): Add ver_test_1.syms.
14063 (ver_test_1.syms): New target.
14064 * testsuite/Makefile.in: Rebuild.
14065
14066 2009-02-25 Cary Coutant <ccoutant@google.com>
14067
14068 * layout.cc (Layout::choose_output_section): Don't rename sections
14069 when using a linker script that has a SECTIONS clause.
14070 * Makefile.in: Regenerate.
14071
14072 * testsuite/Makefile.am (script_test_5.sh): New test case.
14073 * testsuite/Makefile.in: Regenerate.
14074 * testsuite/script_test_5.cc: New file.
14075 * testsuite/script_test_5.sh: New file.
14076 * testsuite/script_test_5.t: New file.
14077
14078 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14079
14080 * archive.cc (Archive::include_member): Update calls to add_symbols.
14081 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14082 the Layout argument.
14083 * dynobj.h (do_add_symbols): Add the Layout argument.
14084 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14085 Layout argument.
14086 * object.h (Object::add_symbols): Add the Layout argument.
14087 (Object::do_add_symbols): Add the Layout argument.
14088 (Sized_relobj::do_add_symbols): Add the Layout argument.
14089 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14090 Unify the two versions.
14091 (Add_plugin_symbols): Remove.
14092 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14093 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14094 (Add_plugin_symbols): Remove.
14095 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14096 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14097 (Add_symbols::run): Make it work with Pulginobj.
14098
14099 2009-02-06 Ian Lance Taylor <iant@google.com>
14100
14101 * object.cc (Sized_relobj::do_layout): Make info message start
14102 with lower case letter.
14103
14104 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14105
14106 * binary.cc: Fix file comment.
14107
14108 * options.h (enum Incremental_disposition): Define.
14109 (class General_options): Add new options: --incremental,
14110 --incremental_changed, --incremental_unchanged,
14111 --incremental_unknown. Add incremental_disposition_ and
14112 implicit_incremental_ fields.
14113 (General_options::incremental_disposition): New function.
14114 (class Position_dependent_options): Add incremental_disposition
14115 option.
14116 (Position_dependent_options::copy_from_options): Set incremental
14117 dispositions.
14118 * options.cc (General_options::parse_incremental_changed): New
14119 function.
14120 (General_options::parse_incremental_unchanged): New function.
14121 (General_options::parse_incremental_unknown): New function.
14122 (General_options::General_options): Initialize new fields
14123 incremental_disposition_ and implicit_incremental_.
14124 (General_options::finalize): Check for uasge of --incremental-*
14125 without --incremental.
14126
14127 2009-02-06 Chris Demetriou <cgd@google.com>
14128
14129 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14130 pointer and to report location as the file name associated with
14131 the symbol.
14132 (gold_undefined_symbol_at_location): New function to replace the
14133 old gold_undefined_symbol functionality.
14134 * target-reloc.h (relocate_section): Update to use
14135 gold_undefined_symbol_at_location.
14136 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14137 Call gold_undefined_symbol function rather than gold_error.
14138 * errors.h (Errors::undefined_symbol): Take location as a
14139 string, rather than calculating it from a relocation.
14140 * errors.cc (Errors::fatal): Print "fatal error:" before the
14141 formatted message.
14142 (Errors::error, Errors::error_at_location): Print "error: "
14143 before the formatted message.
14144 (Errors::undefined_symbol): Take location as a string, rather
14145 than calculating it from a relocation.
14146 (gold_undefined_symbol_at_location): New function akin to
14147 old gold_undefined_symbol, calculates location from relocation.
14148 (gold_undefined_symbol): Change to take only a Symbol pointer
14149 and to report location as the file name associated with the symbol.
14150 * testsuite/debug_msg.sh: Update for changed error messages.
14151 * testsuite/undef_symbol.sh: Likewise.
14152
14153 2009-02-04 Duncan Sands <baldrick@free.fr>
14154
14155 PR 9812
14156 * reduced_debug_output.h
14157 (Output_reduced_debug_abbrev_section::failed): Use format for
14158 gold_warning.
14159 (Output_reduced_debug_info_section::faild): Likewise.
14160
14161 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14162
14163 * script.cc (Lazy_demangler): New class.
14164 (Version_script_info::get_symbol_version_helper): Demangle a
14165 symbol only once.
14166
14167 2009-01-29 Cary Coutant <ccoutant@google.com>
14168
14169 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14170 to __tls_get_addr.
14171 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14172
14173 2009-01-28 Ian Lance Taylor <iant@google.com>
14174
14175 * version.cc (version_string): Bump to 1.9.
14176
14177 * gold.h: Include <cstring> and <stdint.h>.
14178 * version.cc: Include <cstdio>.
14179 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14180 warning.
14181 * reduced_debug_output.cc (insert_into_vector): Rename from
14182 Insert_into_vector; change all callers. Use Swap_unaligned to
14183 avoid aliasing issue; remove union since it is unnecessary.
14184
14185 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14186
14187 * Makefile.am (CCFILES): Add gc.cc.
14188 (HFILES): Add gc.h.
14189 * Makefile.in: Regenerate.
14190 * gold.cc (Gc_runner): New class.
14191 (queue_initial_tasks): Call garbage collection related tasks
14192 when corresponding options are invoked.
14193 (queue_middle_gc_tasks): New function.
14194 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14195 processed early before laying out sections during garbage collection.
14196 * gold.h (queue_middle_gc_tasks): New function.
14197 (is_prefix_of): Move from "layout.cc".
14198 * i386.cc (Target_i386::gc_process_relocs): New function.
14199 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14200 * main.cc (main): Create object of class "Garbage_collection".
14201 * object.cc (Relobj::copy_symbols_data): New function.
14202 (Relobj::is_section_name_included): New function.
14203 (Sized_relobj::do_layout): Allow this function to be called twice
14204 during garbage collection and defer layout of section during the
14205 first call.
14206 * object.h (Relobj::get_symbols_data): New function.
14207 (Relobj::is_section_name_included): New function.
14208 (Relobj::copy_symbols_data): New function.
14209 (Relobj::set_symbols_data): New function.
14210 (Relobj::get_relocs_data): New function.
14211 (Relobj::set_relocs_data): New function.
14212 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14213 (Relobj::gc_process_relocs): New function.
14214 (Relobj::do_gc_process_relocs): New pure virtual function.
14215 (Relobj::sd_): New data member.
14216 (Sized_relobj::is_output_section_offset_invalid): New function.
14217 (Sized_relobj::do_gc_process_relocs): New function.
14218 * options.h (General_options::gc_sections): Modify to not be a no-op.
14219 (General_options::print_gc_sections): New option.
14220 * plugin.cc (Plugin_finish::run): Remove function call to
14221 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14222 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14223 * reloc.cc (Read_relocs::run): Add task to process relocs and
14224 determine unreferenced sections when doing garbage collection.
14225 (Gc_process_relocs): New class.
14226 (Sized_relobj::do_gc_process_relocs): New function.
14227 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14228 sections that are garbage collected.
14229 * reloc.h (Gc_process_relocs): New class.
14230 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14231 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14232 symbols whose corresponding sections are garbage collected.
14233 (Symbol_table::Symbol_table): Add new parameter for the garbage
14234 collection object.
14235 (Symbol_table::gc_mark_undef_symbols): New function.
14236 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14237 (Symbol_table::gc_mark_dyn_syms): New function.
14238 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14239 as garbage.
14240 (Symbol_table::add_from_object): Likewise.
14241 (Symbol_table::add_from_relobj): When building shared objects, do not
14242 treat externally visible symbols as garbage.
14243 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14244 table information for static and relocatable links.
14245 * symtab.h (Symbol_table::set_gc): New function.
14246 (Symbol_table::gc): New function.
14247 (Symbol_table::gc_mark_undef_symbols): New function.
14248 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14249 (Symbol_table::gc_mark_dyn_syms): New function.
14250 (Symbol_table::gc_): New data member.
14251 * target.h (Sized_target::gc_process_relocs): New pure virtual
14252 function.
14253 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14254 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14255
14256 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14257
14258 * options.h (General_options::gc_sections): Define as a no-op for now.
14259 (General_options::no_keep_memory): Ditto.
14260 (General_options::Bshareable): Define.
14261 * options.cc (General_options::finalize): Honor -Bshareable.
14262
14263 2009-01-20 Andreas Schwab <schwab@suse.de>
14264
14265 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14266 read the value in the contents, since we don't use it. Use the
14267 template endianness when writing.
14268 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14269
14270 2009-01-19 Andreas Schwab <schwab@suse.de>
14271
14272 * configure.tgt (powerpc64-*): Fix targ_obj.
14273
14274 2009-01-15 Ian Lance Taylor <iant@google.com>
14275
14276 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14277 local symbols when stripping all symbols.
14278
14279 2009-01-14 Cary Coutant <ccoutant@google.com>
14280
14281 * output.cc (Output_reloc): Add explicit instantiations.
14282
14283 2009-01-14 Cary Coutant <ccoutant@google.com>
14284
14285 * archive.cc (Archive::get_elf_object_for_member): Remove call
14286 to File_read::claim_for_plugin.
14287 * descriptors.cc (Descriptors::open): Remove reference to
14288 is_claimed.
14289 (Descriptors::claim_for_plugin): Remove.
14290 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14291 (Descriptors::is_claimed): Remove.
14292 (claim_descriptor_for_plugin): Remove.
14293 * fileread.cc (File_read::claim_for_plugin): Remove.
14294 * fileread.h (File_read::claim_for_plugin): Remove.
14295 (File_read::descriptor): Reopen descriptor if necessary.
14296 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14297 (Plugin_manager::all_symbols_read): Add task parameter. Change
14298 all callers.
14299 (Plugin_manager::get_input_file): New function.
14300 (Plugin_manager::release_input_file): New function.
14301 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14302 corresponding data member.
14303 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14304 and pass to base constructor. Change all callers.
14305 (get_input_file, release_input_file): New functions.
14306 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14307 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14308 (Plugin_manager::all_symbols_read): Add task parameter.
14309 (Plugin_manager::get_input_file): New function.
14310 (Plugin_manager::release_input_file): New function.
14311 (Plugin_manager::task_): New data member.
14312 (Pluginobj::Pluginobj): Add filesize parameter.
14313 (Pluginobj::filename): New function.
14314 (Pluginobj::descriptor): New function.
14315 (Pluginobj::filesize): New function.
14316 (Pluginobj::filesize_): New data member.
14317 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14318 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14319 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14320
14321 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14322 with archive libraries.
14323 * testsuite/Makefile.in: Regenerate.
14324 * testsuite/plugin_test.c (struct sym_info): New type.
14325 (get_input_file, release_input_file): New static variables.
14326 (onload): Capture new transfer vector entries.
14327 (claim_file_hook): Stop reading at end of file according to filesize.
14328 Factor out parsing of readelf output into separate function.
14329 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14330 APIs and get the source file name from the symbol table. Convert
14331 source file name to corresponding object file name. Print info
14332 message when adding new input files.
14333 (parse_readelf_line): New function.
14334 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14335 * testsuite/plugin_test_2.sh: Likewise.
14336 * testsuite/plugin_test_3.sh: Likewise.
14337 * testsuite/plugin_test_4.sh: New test case.
14338
14339 2009-01-07 Ian Lance Taylor <iant@google.com>
14340
14341 * version.cc (version_string): Bump to 1.8.
14342
14343 2008-12-23 Cary Coutant <ccoutant@google.com>
14344
14345 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14346 * plugin.cc (Plugin_manager::finish): Rename as
14347 layout_deferred_objects. Move cleanup to separate function.
14348 (Plugin_manager::cleanup): New function.
14349 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14350 separately.
14351 * plugin.h (Plugin_manager::finish): Rename as
14352 layout_deferred_objects.
14353 (Plugin_manager::cleanup): New function.
14354 (Plugin_manager::cleanup_done): New field.
14355
14356 2008-12-23 Cary Coutant <ccoutant@google.com>
14357
14358 * plugin.cc (is_visible_from_outside): New function.
14359 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14360 so we don't return "IR only" status for exported symbols or -r links.
14361
14362 * testsuite/Makefile.am (plugin_test_3): New test case.
14363 * testsuite/Makefile.in: Regenerate.
14364 * testsuite/plugin_test_3.sh: New file.
14365
14366 2008-12-22 Cary Coutant <ccoutant@google.com>
14367
14368 * object.cc (Sized_relobj::layout_section): New function.
14369 (Sized_relobj::do_layout): Defer layout of input sections until after
14370 plugin has provided replacement files.
14371 (Sized_relobj::do_layout_deferred_sections): New function.
14372 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14373 (Relobj::layout_deferred_sections): New function.
14374 (Relobj::do_layout_deferred_sections): New function.
14375 (Sized_relobj::do_layout_deferred_sections): New function.
14376 (Sized_relobj::layout_section): New function.
14377 (Sized_relobj::Deferred_layout): New structure.
14378 (Sized_relobj::deferred_layout_): New field.
14379 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14380 Change all callers. Layout deferred sections.
14381 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14382 references.
14383 (Plugin_hook::run): Move code from do_plugin_hook inline.
14384 (Plugin_hook::do_plugin_hook): Remove.
14385 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14386 (Plugin_manager::finish): Renamed, was cleanup.
14387 (Plugin_manager::should_defer_layout): New function.
14388 (Plugin_manager::add_deferred_layout_object): New function.
14389 (Plugin_manager::Deferred_layout_list): New type.
14390 (Plugin_manager::deferred_layout_objects_): New field.
14391 (Plugin_hook::do_plugin_hook): Remove.
14392
14393 2008-12-17 Ian Lance Taylor <iant@google.com>
14394
14395 * options.h (class General_options): Add --no case for
14396 --export-dynamic.
14397
14398 2008-12-16 Cary Coutant <ccoutant@google.com>
14399
14400 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14401 vector.
14402 (Plugin_manager::claim_file): Create plugin object even if
14403 plugin did not call the add_symbols callback.
14404 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14405 asking for more symbols than were added.
14406 * testsuite/Makefile.am (plugin_test_1): Add test case with
14407 no global symbols.
14408 (empty.syms): New target.
14409 * testsuite/Makefile.in: Regenerate.
14410 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14411 message. Don't call add_symbols if no globals.
14412 (all_symbols_read_hook): Don't provide replacement for empty
14413 claimed file.
14414
14415 2008-12-12 Ian Lance Taylor <iant@google.com>
14416
14417 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14418 r_type == 0 for a local symbol with r_sym == 0.
14419 (scan_relocatable_relocs): Pass r_sym to
14420 local_non_section_strategy.
14421 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14422 r_sym parameter.
14423
14424 * configure.ac: Update test for TLS descriptors: they are
14425 supported as of glibc 2.9.
14426 * configure: Rebuild.
14427
14428 2008-12-11 Ian Lance Taylor <iant@google.com>
14429
14430 PR 7091
14431 * target-reloc.h (Default_scan_relocatable_relocs): For each
14432 function, map r_type == 0 to RELOC_DISCARD.
14433
14434 2008-12-10 Cary Coutant <ccoutant@google.com>
14435
14436 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14437 object to override a kept COMDAT group from a plugin object.
14438
14439 2008-12-09 Ian Lance Taylor <iant@google.com>
14440
14441 PR 7088
14442 * yyscript.y (file_cmd): Handle INPUT.
14443
14444 * testsuite/initpri1.c: Change all declarations to be full
14445 prototypes by adding void, to avoid compiler warnings.
14446
14447 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14448
14449 * options.cc (General_options::parse_plugin_opt): New.
14450 (General_options::add_plugin): The argument now is just the filename.
14451 (General_options::add_plugin_option): New.
14452 * options.h (plugin_opt): New.
14453 (add_plugin): Change argument name.
14454 (add_plugin_option): New.
14455 * plugin.cc (Plugin::load): Don't parse the plugin option.
14456 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14457 (Plugin::add_option): New.
14458 (Plugin::args_): Change type.
14459 (Plugin::filename_): New.
14460 (Plugin_manager::add_plugin_option): New.
14461 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14462 * testsuite/Makefile.in: Regenerate.
14463
14464 2008-12-05 Cary Coutant <ccoutant@google.com>
14465
14466 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14467 Handle --strip-lto-sections option.
14468 * options.h (strip_lto_sections): New option.
14469
14470 2008-12-01 Cary Coutant <ccoutant@google.com>
14471
14472 * plugin.cc (ld_plugin_message): Change format parameter to const.
14473 Fix mismatch between new[] and delete.
14474
14475 2008-11-14 Cary Coutant <ccoutant@google.com>
14476
14477 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14478 instead of -1U.
14479
14480 2008-11-05 Craig Silverstein <csilvers@google.com>
14481
14482 * options.cc (General_options::parse_dynamic_list): New function.
14483 * options.h (General_options): New flags dynamic_list,
14484 dynamic_list_data, dynamic_list_cpp_new, and
14485 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14486 (General_options::in_dynamic_list): New function.
14487 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14488 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14489 (Lex::can_continue_name): Likewise.
14490 (yylex): Likewise.
14491 (read_script_file): New parameter script_options.
14492 (read_dynamic_list): New function.
14493 (Script_options::define_dynamic_list): New function.
14494 (dynamic_list_keyword_parsecodes): New variable.
14495 (dynamic_list_keywords): New variable.
14496 * script.h (Script_options::define_dynamic_list): New function
14497 prototype.
14498 (read_dynamic_list): New function prototype.
14499 * symtab.cc (strprefix): New macro.
14500 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14501 dynamic_list_data, dynamic_list_cpp_new, and
14502 dynamic_list_cpp_typeinfo.
14503 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14504 (dynamic_list_expr): New rule.
14505 (dynamic_list_nodes): Likewise.
14506 (dynamic_list_node): Likewise.
14507 * testsuite/Makefile.am (dynamic_list): New test.
14508 * testsuite/Makefile.in: Regenerated.
14509 * testsuite/dynamic_list.t: New file.
14510 * testsuite/dynamic_list.sh: New file.
14511
14512 2008-11-05 Craig Silverstein <csilvers@google.com>
14513
14514 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14515 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14516 (t11_last): Likewise.
14517 * testsuite/ver_test_6.c (main): Likewise.
14518
14519 2008-10-07 Cary Coutant <ccoutant@google.com>
14520
14521 * options.c (General_options::finalize): Add check for -static and
14522 -shared.
14523 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14524 is not empty.
14525
14526 2008-10-02 Cary Coutant <ccoutant@google.com>
14527
14528 * plugin.cc (make_sized_plugin_object): Fix conditional
14529 compilation to work when not all targets are enabled.
14530
14531 2008-09-29 Cary Coutant <ccoutant@google.com>
14532
14533 * archive.cc (Archive::get_file_and_offset): Use filename instead
14534 of name to get library path.
14535 (Archive::include_member): Unlock external member of a thin archive.
14536
14537 * testsuite/Makefile.am (TEST_AR): New variable.
14538 (thin_archive_test_1): New test.
14539 (thin_archive_test_2): New test.
14540 * testsuite/Makefile.in: Regenerate.
14541 * testsuite/thin_archive_main.cc: New file.
14542 * testsuite/thin_archive_test_1.cc: New file.
14543 * testsuite/thin_archive_test_2.cc: New file.
14544 * testsuite/thin_archive_test_3.cc: New file.
14545 * testsuite/thin_archive_test_4.cc: New file.
14546
14547 2008-09-29 Cary Coutant <ccoutant@google.com>
14548
14549 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14550 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14551 instead of -1U.
14552 (Sized_relobj::do_finalize_local_symbols): Likewise.
14553 (Sized_relobj::map_to_kept_section): Likewise.
14554 * object.h (Sized_relobj::invalid_address): New constant.
14555 (Sized_relobj::do_output_section_offset): Check for invalid_address
14556 and return -1ULL.
14557 * output.cc (Output_reloc::local_section_offset): Use constant
14558 invalid_address instead of -1U.
14559 (Output_reloc::get_address): Likewise.
14560 (Output_section::output_address): Change -1U to -1ULL.
14561 * output.h (Output_reloc::invalid_address): New constant.
14562 * reloc.cc (Sized_relobj::write_sections): Use constant
14563 invalid_address instead of -1U.
14564 (Sized_relobj::relocate_sections): Likewise.
14565 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14566 values for merge sections.
14567 * target-reloc.h (relocate_for_relocatable): Use constant
14568 invalid_address instead of -1U.
14569
14570 2008-09-19 Cary Coutant <ccoutant@google.com>
14571
14572 Add plugin functionality for link-time optimization (LTO).
14573 * configure.ac (plugins): Add --enable-plugins option.
14574 * configure: Regenerate.
14575 * config.in: Regenerate.
14576 * Makefile.am (LIBDL): New variable.
14577 (CCFILES): Add plugin.cc.
14578 (HFILES): Add plugin.h.
14579 (ldadd_var): Add LIBDL.
14580 * Makefile.in: Regenerate.
14581
14582 * archive.cc: Include "plugin.h".
14583 (Archive::setup): Don't preread archive symbols when using a plugin.
14584 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14585 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14586 files.
14587 (Archive::include_member): Add symbols from plugin objects.
14588 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14589 * descriptors.cc (Descriptors::open): Check for file descriptors
14590 abandoned by plugins.
14591 (Descriptors::claim_for_plugin): New function.
14592 * descriptors.h (Descriptors::claim_for_plugin): New function.
14593 (Open_descriptor::is_claimed): New field.
14594 (claim_descriptor_for_plugin): New function.
14595 * fileread.cc (File_read::claim_for_plugin): New function.
14596 * fileread.h (File_read::claim_for_plugin): New function.
14597 (File_read::descriptor): New function.
14598 * gold.cc: Include "plugin.h".
14599 (queue_initial_tasks): Add task to call plugin hooks for generating
14600 new object files.
14601 * main.cc: Include "plugin.h".
14602 (main): Load plugin libraries.
14603 * object.h (Pluginobj): Declare.
14604 (Object::pluginobj): New function.
14605 (Object::do_pluginobj): New function.
14606 (Object::set_target): New function.
14607 * options.cc: Include "plugin.h".
14608 (General_options::parse_plugin): New function.
14609 (General_options::General_options): Initialize plugins_ field.
14610 (General_options::add_plugin): New function.
14611 * options.h (Plugin_manager): Declare.
14612 (General_options): Add --plugin option.
14613 (General_options::has_plugins): New function.
14614 (General_options::plugins): New function.
14615 (General_options::add_plugin): New function.
14616 (General_options::plugins_): New field.
14617 * plugin.cc: New file.
14618 * plugin.h: New file.
14619 * readsyms.cc: Include "plugin.h".
14620 (Read_symbols::do_read_symbols): Check for archive before checking
14621 for ELF file. Call plugin hooks to claim files.
14622 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14623 from a real object file; force override when processing replacement
14624 files.
14625 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14626 (Symbol::init_base_object): Likewise.
14627 (Symbol::init_base_output_data): Likewise.
14628 (Symbol::init_base_output_segment): Likewise.
14629 (Symbol::init_base_constant): Likewise.
14630 (Symbol::init_base_undefined): Likewise.
14631 (Symbol::output_section): Assert that object is not a plugin.
14632 (Symbol_table::add_from_pluginobj): New function.
14633 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14634 undefined.
14635 (Symbol_table::sized_write_globals): Likewise.
14636 (Symbol_table::add_from_pluginobj): Instantiate template.
14637 * symtab.h (Sized_pluginobj): Declare.
14638 (Symbol::in_real_elf): New function.
14639 (Symbol::set_in_real_elf): New function.
14640 (Symbol::in_real_elf_): New field.
14641 (Symbol_table::add_from_pluginobj): New function.
14642
14643 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14644 (LIBDL): New variable.
14645 (LDADD): Add LIBDL.
14646 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14647 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14648 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14649 (MOSTLYCLEANFILES): Likewise.
14650 * testsuite/Makefile.in: Regenerate.
14651 * testsuite/plugin_test.c: New file.
14652 * testsuite/plugin_test_1.sh: New file.
14653 * testsuite/plugin_test_2.sh: New file.
14654
14655 2008-09-16 Ian Lance Taylor <iant@google.com>
14656
14657 * target-reloc.h (relocate_section): Check whether a symbol is
14658 defined by the ABI before reporting an undefined symbol error.
14659 * target.h (Target::is_defined_by_abi): Make parameter const.
14660 (Target::do_is_defined_by_abi): Likewise.
14661 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14662 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14663 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14664 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14665 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14666 * testsuite/Makefile.in: Rebuild.
14667
14668 * fileread.cc (make_view): Add casts to avoid warning.
14669
14670 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14671
14672 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14673 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14674
14675 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14676
14677 * options.h (General_options::output_is_executable): New.
14678 (General_options::output_is_pie): New.
14679 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14680 for shared libraries.
14681 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14682
14683 2008-09-11 Chris Demetriou <cgd@google.com>
14684
14685 * options.h (origin): New -z option.
14686 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14687 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14688 in DT_FLAGS_1.
14689
14690 2008-09-05 Cary Coutant <ccoutant@google.com>
14691
14692 * fileread.cc (File_read::make_view): Add check for attempt to map
14693 beyond end of file.
14694
14695 2008-09-05 Cary Coutant <ccoutant@google.com>
14696
14697 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14698 explicit instantiations.
14699
14700 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14701
14702 PR gold/6858
14703 * options.cc (General_options::finalize): Allow undefined symbols
14704 in shlibs if linking -shared.
14705
14706 PR gold/6859
14707 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14708 symbols as not needing a dynsym entry.
14709
14710 2008-08-20 Craig Silverstein <csilvers@google.com>
14711
14712 * fileread.cc (File_read::open): Do not lock the file unless it
14713 was successfully opened.
14714
14715 2008-08-14 Cary Coutant <ccoutant@google.com>
14716
14717 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14718 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14719 * testsuite/tls_test.cc (struct int128): 128-bit struct
14720 for testing TLS relocs with non-zero addend.
14721 (v12): New TLS variable.
14722 (t12): New test.
14723 (t_last): Add check for v12.
14724 * testsuite/tls_test.h (t12): New function.
14725 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14726
14727 2008-08-13 Ian Lance Taylor <iant@google.com>
14728
14729 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14730 set tls_segment_ or relro_segment_.
14731 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14732 when appropriate.
14733 * output.h (Output_section::clear_is_relro): New function.
14734 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14735 sections specially even when output_data_ is empty.
14736 (Output_segment::maximum_alignment): When first section is relro,
14737 only force alignment for PT_LOAD segments.
14738 * script.cc (script_data_segment_align): New function.
14739 (script_data_segment_relro_end): New function.
14740 * script-c.h (script_data_segment_align): Declare.
14741 (script_data_segment_relro_end): Declare.
14742 * script-sections.h (class Script_sections): Declare
14743 data_segment_align and data_segment_relro_end. Add fields
14744 segment_align_index_ and saw_relro_end_.
14745 * script-sections.cc (class Sections_element): Add set_is_relro
14746 virtual function. Add new bool* parameter to place_orphan_here.
14747 Add get_output_section virtual function.
14748 (class Output_section_definition): Add set_is_relro. Add new
14749 bool* parameter to place_orphan_here. Add get_output_section.
14750 Add is_relro_ field.
14751 (Output_section_definition::Output_section_definition): Initialize
14752 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14753 and is_relro_ fields.
14754 (Output_section_definition::place_orphan_here): Add is_relro
14755 parameter.
14756 (Output_section_definition::set_section_addresses): Set relro for
14757 output section.
14758 (Output_section_definition::alternate_constraint): Likewise.
14759 (class Orphan_output_section): Add new bool* parameter to
14760 place_orphan_here. Add get_output_section.
14761 (Orphan_output_section::place_orphan_here): Add is_relro
14762 parameter.
14763 (Script_sections::Script_sections): Initialize
14764 data_segment_align_index_ and saw_relro_end_.
14765 (Script_sections::data_segment_align): New function.
14766 (Script_sections::data_segment_relro_end): New function.
14767 (Script_sections::place_orphan): Set or clear is_relro.
14768 (Script_sections::set_section_addresses): Force alignment of first
14769 TLS section.
14770 * yyscript.y (exp): Call script_data_segment_align and
14771 script_data_segment_relro_end.
14772 * testsuite/relro_script_test.t: New file.
14773 * testsuite/relro_test.cc (using_script): Declare.
14774 (t1, t2): Test using_script.
14775 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14776 (relro_script_test_SOURCES): Define.
14777 (relro_script_test_DEPENDENCIES): Define.
14778 (relro_script_test_LDFLAGS): Define.
14779 (relro_script_test_LDADD): Define.
14780 (relro_script_test.so): New target.
14781 * testsuite/Makefile.in: Rebuild.
14782
14783 2008-08-06 Cary Coutant <ccoutant@google.com>
14784
14785 * archive.cc (Archive::total_archives, Archive::total_members)
14786 (Archive::total_members_loaded): New variables.
14787 (Archive::setup): Add parameter. Add option to preread
14788 archive symbols.
14789 (Archive::read_armap): Add counter.
14790 (Archive::get_file_and_offset): New function.
14791 (Archive::get_elf_object_for_member): New function.
14792 (Archive::read_all_symbols): New function.
14793 (Archive::read_symbols): New function.
14794 (Archive::add_symbols): Add counters.
14795 (Archive::include_all_members): Use armap to find members if it's
14796 already built.
14797 (Archive::include_member): Skip reading symbols if already read.
14798 Factored code into Archive::get_file_and_offset and
14799 Archive::get_elf_object_for_member. Changed call to
14800 Mapfile::report_include_archive_member.
14801 (Archive::print_stats): New function.
14802 * archive.h: Declare Object and Read_symbols_data classes.
14803 (Archive::Archive): Add initializers for new members.
14804 (Archive::setup): Add parameter.
14805 (Archive::print_stats): New function.
14806 (Archive::total_archives, Archive::total_members)
14807 (Archive::total_members_loaded): New variables.
14808 (Archive::get_file_and_offset): New function.
14809 (Archive::get_elf_object_for_member): New function.
14810 (Archive::read_all_symbols): New function.
14811 (Archive::read_symbols): New function.
14812 (Archive::Archive_member): New class.
14813 (Archive::members_): New member.
14814 (Archive::num_members_): New member.
14815 * main.cc: Include archive.h.
14816 (main): Call Archive::print_stats.
14817 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14818 archive parameter; member_name is now the fully-decorated name.
14819 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14820 * options.h: (General_options): Add --preread-archive-symbols option.
14821 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14822 Archive::setup.
14823
14824 2008-08-04 Ian Lance Taylor <iant@google.com>
14825
14826 * symtab.h (Symbol::use_plt_offset): New function.
14827 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14828 * powerpc.cc (Relocate::relocate): Likewise.
14829 * sparc.cc (Relocate::relocate): Likewise.
14830 * x86_64.cc (Relocate::relocate): Likewise.
14831 * testsuite/weak_plt.sh: New test.
14832 * testsuite/weak_plt_main.cc: New test.
14833 * testsuite/weak_plt_shared.cc: New test.
14834 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14835 (check_PROGRAMS): Add weak_plt.
14836 (check_DATA): Add weak_plt_shared.so.
14837 (weak_plt_main_pic.o, weak_plt): New targets.
14838 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14839 * testsuite/Makefile.in: Rebuild.
14840
14841 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14842 gcctestdir/ld.
14843 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14844 * testsuite/Makefile.in: Rebuild.
14845
14846 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14847
14848 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14849 * Makefile.in: Regenerate.
14850 * po/POTFILES.in: Regenerate.
14851
14852 2008-07-29 Ian Lance Taylor <iant@google.com>
14853
14854 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14855 symbols before other symbols.
14856 * testsuite/script_test_2.cc (test_addr): Declare.
14857 (test_addr_alias): Declare.
14858 (main): Check that test_addr and test_addr_alias have the right
14859 values.
14860 * testsuite/script_test_2.t: Define test_addr_alias and
14861 test_addr.
14862
14863 2008-07-24 Ian Lance Taylor <iant@google.com>
14864
14865 PR 5990
14866 * descriptors.cc: New file.
14867 * descriptors.h: New file.
14868 * gold-threads.h (class Hold_optional_lock): New class.
14869 * fileread.cc: Include "descriptors.h".
14870 (File_read::~File_read): Release descriptor rather than closing
14871 it.
14872 (File_read::open) [file]: Call open_descriptor rather than open.
14873 Set is_descriptor_opened_.
14874 (File_read::open) [memory]: Assert that descriptor is not open.
14875 (File_read::reopen_descriptor): New function.
14876 (File_read::release): Release descriptor.
14877 (File_read::do_read): Make non-const. Reopen descriptor.
14878 (File_read::read): Make non-const.
14879 (File_read::make_view): Reopen descriptor.
14880 (File_read::do_readv): Likewise.
14881 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14882 Update declarations.
14883 * layout.cc: Include "descriptors.h".
14884 (Layout::create_build_id): Use open_descriptor rather than open.
14885 * output.cc: Include "descriptors.h".
14886 (Output_file::open): Use open_descriptor rather than open.
14887 * archive.cc (Archive::const_iterator): Change Archive to be
14888 non-const.
14889 (Archive::begin, Archive::end): Make non-const.
14890 (Archive::count_members): Likewise.
14891 * archive.h (class Archive): Update declarations.
14892 * object.h (Object::read): Make non-const.
14893 * Makefile.am (CCFILES): Add descriptors.cc.
14894 (HFILES): Add descriptors.h.
14895 * Makefile.in: Rebuild.
14896
14897 PR 6716
14898 * gold.h: Always include <clocale>. Add Solaris workarounds
14899 following code in binutils/sysdep.h.
14900
14901 PR 6048
14902 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14903 this->eh_frame_hdr_ is NULL before using it.
14904
14905 * dynobj.cc (Versions::Versions): Update comment.
14906
14907 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14908 the base version name.
14909
14910 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14911 array size plus one.
14912 (Stringpool_template::set_string_offsets): Subtract one from key
14913 before using it as an array index.
14914 (Stringpool_template::get_offset_with_length): Likewise.
14915 (Stringpool_template::write_to_buffer): Likewise.
14916 * stringpool.h (Stringpool_template::get_offset_from_key):
14917 Likewise.
14918
14919 2008-07-23 Ian Lance Taylor <iant@google.com>
14920
14921 PR 6658
14922 * object.h (Merged_symbol_value::value): Do our best to handle a
14923 negative addend.
14924
14925 PR 6647
14926 * script.cc (Version_script_info::get_versions): Don't add empty
14927 version tag to return value.
14928 (Version_script_info::get_symbol_version_helper): Change return
14929 type to bool. Add pversion parameter. Change all callers.
14930 (script_register_vers_node): Don't require a non-NULL tag.
14931 * script.h (class Version_script_info): Update declarations.
14932 (Version_script_info::get_symbol_version): Change return type to
14933 bool. Add version parameter. Change all callers.
14934 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14935 handling. Handle an empty version from a version script.
14936 (Symbol_table::define_special_symbol): Likewise.
14937 * testsuite/ver_test_10.script: New file.
14938 * testsuite/ver_test_10.sh: New file.
14939 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14940 (check_DATA): Add ver_test_10.syms.
14941 (ver_test_10.syms, ver_test_10.so): New target.
14942 * testsuite/Makefile.in: Rebuild.
14943
14944 2008-07-23 Simon Baldwin <simonb@google.com>
14945
14946 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14947 to zero for undefined symbols from dynamic libraries.
14948
14949 2008-07-23 Ian Lance Taylor <iant@google.com>
14950
14951 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14952 Change all callers.
14953 * symtab.h (class Symbol_table): Update declaration.
14954 * testsuite/ver_test_9.cc: New file.
14955 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14956 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14957 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14958 (ver_test_9.so, ver_test_9.o): New targets.
14959 * testsuite/Makefile.in: Rebuild.
14960
14961 2008-07-22 Ian Lance Taylor <iant@google.com>
14962
14963 * options.h (class General_options): Define --check-sections.
14964 * layout.cc (Layout::set_segment_offsets): Handle
14965 --check-sections.
14966
14967 * options.h (class General_options): Define -n/--nmagic and
14968 -N/--omagic.
14969 * options.cc (General_options::finalize): For -n/--nmagic or
14970 -N/--omagic, set -static.
14971 * layout.cc (Layout::attach_allocated_section_to_segment): If
14972 -N/--omagic, don't put read-only and read-write sections in
14973 different segments.
14974 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14975 finding a read-only segment.
14976 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14977 don't set the minimum segment alignment to the common page size,
14978 and don't set the file offset to the address modulo the page size.
14979 * script-sections.cc (Script_sections::create_segments): If
14980 -n/--omagic, don't put read-only and read-write sections in
14981 different segments.
14982
14983 * cref.cc: New file.
14984 * cref.h: New file.
14985 * options.h (class General_options): Add --print-symbol-counts.
14986 * main.cc (main): Issue defined symbol report if requested.
14987 * archive.cc (Archive::interpret_header): Make into a const member
14988 function.
14989 (Archive::add_symbols): Call Input_objects::archive_start and
14990 archive_stop.
14991 (Archive::const_iterator): Define new class.
14992 (Archive::begin, Archive::end): New functions.
14993 (Archive::include_all_members): Rewrite to use iterator.
14994 (Archive::count_members): New function.
14995 * archive.h (class Archive): Update declarations.
14996 (Archive::filename): New function.
14997 * object.cc: Include "cref.h".
14998 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14999 (Sized_relobj::do_get_global_symbol_counts): New function.
15000 (Input_objects::add_object): Add object to cross-referencer.
15001 (Input_objects::archive_start): New function.
15002 (Input_objects::archive_stop): New function.
15003 (Input_objects::print_symbol_counts): New function.
15004 * object.h: Declare Cref and Archive.
15005 (Object::get_global_symbol_counts): New function.
15006 (Object::do_get_global_symbol_counts): New pure virtual function.
15007 (class Sized_relobj): Add defined_count_ field. Update
15008 declarations.
15009 (class Input_objects): Add cref_ field. Update constructor.
15010 Update declarations.
15011 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15012 defined_count_.
15013 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15014 symbol counts.
15015 (Sized_dynobj::do_get_global_symbol_counts): New function.
15016 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15017 defined_count_. Update declarations. Define Symbols typedef.
15018 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15019 parameter. Change all callers.
15020 (Symbol_table::add_from_dynobj): Add sympointers and defined
15021 parameters. Change all callers.
15022 * symtab.h (class Symbol_table): Update declarations.
15023 * Makefile.am (CCFILES): Add cref.cc.
15024 (HFILES): Add cref.h.
15025 * Makefile.in: Rebuild.
15026
15027 2008-07-22 Simon Baldwin <simonb@google.com>
15028
15029 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15030 to zero when writing undefined symbols.
15031
15032 2008-07-22 Ian Lance Taylor <iant@google.com>
15033
15034 * output.cc (Output_section::add_input_section): Don't try to
15035 merge empty merge sections.
15036
15037 2008-07-21 Craig Silverstein <csilvers@google.com>
15038
15039 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15040 Include symbol version in error message.
15041
15042 2008-07-20 Chris Demetriou <cgd@google.com>
15043
15044 * configure.ac (gold_cv_c_random_seed): New configured variable.
15045 (RANDOM_SEED_CFLAGS): New substituted variable.
15046 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15047 * configure: Rebuild.
15048 * Makefile.in: Likewise.
15049 * testsuite/Makefile.in: Likewise.
15050
15051 2008-07-18 Ian Lance Taylor <iant@google.com>
15052
15053 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15054 where we see NAME/NULL and NAME/VERSION as separate symbols.
15055 * testsuite/ver_test_main.cc (main): Call t4.
15056 (t4, t4_2a): Define.
15057 * testsuite/ver_test_2.cc (t4_2): Define.
15058 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15059 * testsuite/ver_test_4.cc (t4_2a): Define.
15060 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15061 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15062
15063 2008-07-17 Ian Lance Taylor <iant@google.com>
15064
15065 * dynobj.cc (Versions::add_def): If we give an error about a
15066 missing version, go ahead and create the version anyhow.
15067
15068 2008-07-10 Ian Lance Taylor <iant@google.com>
15069
15070 Handle output sections with more than 0x7fffffff bytes.
15071 * object.h (class Relobj): Change map_to_output_ to
15072 output_sections_, and just keep a section pointer. Change all
15073 uses. Move comdat group support to Sized_relobj.
15074 (Relobj::is_section_specially_mapped): Remove.
15075 (Relobj::output_section): Remove poff parameter. Change all
15076 callers.
15077 (Relobj::output_section_offset): New function.
15078 (Relobj::set_section_offset): Rewrite.
15079 (Relobj::map_to_output): Remove.
15080 (Relobj::output_sections): New function.
15081 (Relobj::do_output_section_offset): New pure virtual function.
15082 (Relobj::do_set_section_offset): Likewise.
15083 (class Sized_relobj): Add section_offsets_ field. Add comdat
15084 group support from Relobj. Update declarations.
15085 (Sized_relobj::get_output_section_offset): New function.
15086 (Sized_relobj::do_output_section_offset): New function.
15087 (Sized_relobj::do_set_section_offset): New function.
15088 * object.cc (Relobj::output_section_address): Remove.
15089 (Sized_relobj::Sized_relobj): Initialize new fields.
15090 (Sized_relobj::include_section_group): Cast find_kept_object to
15091 Sized_relobj.
15092 (Sized_relobj::include_linkonce_section): Likewise.
15093 (Sized_relobj::do_layout): Use separate arrays for output section
15094 and output offset.
15095 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15096 output_sections.
15097 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15098 output_sections and section_offsets.
15099 (Sized_relobj::write_local_symbols): Likewise.
15100 (map_to_kept_section): Compute output address directly.
15101 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15102 output_sections and section_offsets.
15103 (Sized_relobj::write_sections): Likewise.
15104 (Sized_relobj::relocate_sections): Likewise.
15105 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15106 * output.h (class Output_reloc): Update declarations. Change
15107 u2_.relobj to Sized_relobj*.
15108 (class Output_data_reloc): Change add functions to use
15109 Sized_relobj*.
15110 * output.cc (Output_reloc::Output_reloc): Change relobj to
15111 Sized_relobj*.
15112 (Output_reloc::local_section_offset): Change return type to
15113 Elf_Addr. Use get_output_section_offset.
15114 (Output_reloc::get_address): Likewise.
15115 (Output_section::is_input_address_mapped): Don't call
15116 is_section_specially_mapped.
15117 (Output_section::output_offset): Likewise.
15118 (Output_section::output_address): Likewise.
15119 (Output_section::starting_output_address): Likewise.
15120 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15121 parameter to Sized_relobj*.
15122 (Copy_relocs::need_copy_reloc): Likewise.
15123 (Copy_relocs::save): Likewise.
15124 * copy-relocs.h (class Copy_relocs): Update declarations.
15125 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15126 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15127 * target-reloc.h (relocate_for_relocatable): Change
15128 offset_in_output_section type to Elf_Addr. Change code that uses
15129 it as well.
15130 * layout.cc (Layout::layout): Always set *off.
15131 * mapfile.cc (Mapfile::print_input_section): Use
15132 output_section_offset.
15133 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15134 Sized_relobj*.
15135 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15136 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15137 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15138
15139 2008-07-03 Ian Lance Taylor <iant@google.com>
15140
15141 * layout.cc (Layout::include_section): Do not discard unrecognized
15142 SHT_STRTAB sections.
15143
15144 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15145
15146 * script.cc (Lex::can_continue_name): Make '?' allowable in
15147 version-script names.
15148 * testsuite/version_script.map: Change glob pattern to use '?'
15149
15150 2008-06-30 Manish Singh <yosh@gimp.org>
15151
15152 PR 6585
15153 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15154 Correct typo.
15155
15156 2008-06-30 Ian Lance Taylor <iant@google.com>
15157
15158 PR 6660
15159 PR 6682
15160 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15161 versions]: Don't try to read the value in the contents, since we
15162 don't use it. Use the template endianness when writing.
15163
15164 2008-06-25 Cary Coutant <ccoutant@google.com>
15165
15166 * fileread.cc (File_read::make_view): Assert on zero-length view.
15167 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15168 symbol table when there are no symbols to read.
15169
15170 2008-06-23 Craig Silverstein <csilvers@google.com>
15171
15172 * version.cc (version_string): Bump to 1.7
15173
15174 2008-06-18 Craig Silverstein <csilvers@google.com>
15175
15176 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15177 constant 0xFFFF to type Valtype.
15178 (Powerpc_relocate_functions::rel16_ha): Likewise.
15179
15180 2008-06-17 Ian Lance Taylor <iant@google.com>
15181
15182 * output.h (Output_section::Input_section): Initialize p2align_ to
15183 zero for Output_section_data constructors.
15184 (Output_section::Input_section::addralign): If not an input
15185 section, return the alignment of the Output_section_data.
15186 * testsuite/copy_test.cc: New file.
15187 * testsuite/copy_test_1.cc: New file.
15188 * testsuite/copy_test_2.cc: New file.
15189 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15190 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15191 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15192 (copy_test_1_pic.o, copy_test_1.so): New targets.
15193 (copy_test_2_pic.o, copy_test_2.so): New targets.
15194 * testsuite/Makefile.in: Rebuild.
15195
15196 * script-sections.cc (Script_sections::place_orphan): Initialize
15197 local variable exact.
15198
15199 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15200
15201 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15202
15203 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15204 David S. Miller <davem@davemloft.net>
15205
15206 * powerpc.cc: New file.
15207 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15208 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15209 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15210 * Makefile.in: Rebuild.
15211
15212 2008-06-09 Ian Lance Taylor <iant@google.com>
15213
15214 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15215 <exception>.
15216 (throwing, orig_terminate): New static variables.
15217 (terminate_handler): New static function.
15218 (t2): Set terminate handler.
15219
15220 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15221
15222 PR 6584
15223 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15224 alignment.
15225
15226 2008-05-30 Cary Coutant <ccoutant@google.com>
15227
15228 * archive.cc (Archive::include_all_members) Correct to step
15229 over symbol table and extended name table in thin archives.
15230
15231 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15232
15233 PR 6407
15234 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15235 calculation.
15236
15237 2008-05-28 Caleb Howe <cshowe@google.com>
15238
15239 * reduced_debug_output.cc: New file.
15240 * reduced_debug_output.h: New file.
15241 * options.h (class General_options): Add --strip-debug-non-line.
15242 * options.cc (General_options::finalize): Add strip_debug_non_line
15243 to the strip heirarchy.
15244 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15245 fields.
15246 * layout.cc: Include "reduced_debug_output.h".
15247 (Layout::Layout): Initialize new fields.
15248 (line_only_debug_sections): New static array.
15249 (is_lines_only_debug_sections): New static inline function.
15250 (Layout::include_section): Handle --strip-debug-non-line.
15251 (Layout::make_output_section): If --strip-debug-non-line, build
15252 new output sections for .debug_abbrev and .debug_info.
15253 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15254 gold. Warn about possible overflow.
15255 (read_signed_LEB_128): Likewise.
15256 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15257 (read_signed_LEB_128): Declare.
15258 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15259 (HFILES): Add reduced_debug_output.h.
15260 * Makefile.in: Rebuild.
15261
15262 2008-05-21 Ian Lance Taylor <iant@google.com>
15263
15264 * mapfile.cc: New file.
15265 * mapfile.h: New file.
15266 * options.h (class General_options): Add -M/--print-map and -Map.
15267 * options.cc (General_options::finalize): Make -M equivalent to
15268 -Map -.
15269 * main.cc: Include <cstdio> and "mapfile.h".
15270 (main): Open mapfile if requested.
15271 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15272 constructor. Change caller.
15273 (queue_initial_tasks): Add mapfile parameter. Change caller.
15274 (queue_middle_tasks): Likewise.
15275 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15276 declarations.
15277 * archive.cc: Include "mapfile.h".
15278 (Archive::add_symbols): Add mapfile parameter. Change all
15279 callers. Pass mapfile, symbol, and reason to include_member.
15280 (Archive::include_all_members): Add mapfile parameter. Change all
15281 callers.
15282 (Archive::include_member): Add mapfile, sym, and why parameters.
15283 Change all callers. Report inclusion to map file.
15284 * archive.h: Include "fileread.h".
15285 (class Archive): Update declarations.
15286 (Archive::file): New const method.
15287 (class Add_archive_symbols): Add mapfile_ field. Update
15288 constructor. Change all callers.
15289 * readsyms.h (class Read_symbols): Likewise.
15290 (class Finish_group): Likewise.
15291 (class Read_script): Likewise.
15292 * common.cc: Include "mapfile.h".
15293 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15294 all callers.
15295 (Symbol_table::do_allocate_commons): Likewise.
15296 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15297 symbol allocation to mapfile.
15298 * common.h (class Allocate_commons_task): Add mapfile_ field.
15299 Update constructor. Change all callers.
15300 * symtab.h (class Symbol_table): Update declarations.
15301 * layout.cc: Include "mapfile.h".
15302 (Layout_task_runner::run): Print information to mapfile.
15303 (Layout::create_gold_note): Change Output_data_fixed_space to
15304 Output_data_zero_fill.
15305 (Layout::create_build_id): Likewise.
15306 (Layout::print_to_mapfile): New function.
15307 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15308 constructor. Change caller.
15309 (class Layout): Declare print_to_mapfile.
15310 * output.cc (Output_section::Input_section::print_to_mapfile): New
15311 function.
15312 (Output_section::add_input_section): If producing a map, always
15313 add to input_sections_ list.
15314 (Output_section::do_print_to_mapfile): New function.
15315 (Output_segment::print_sections_to_mapfile): New function.
15316 (Output_segment::print_section_list_to_mapfile): New function.
15317 * output.h: Include "mapfile.h".
15318 (Output_data::print_to_mapfile): New function.
15319 (Output_data::do_print_to_mapfile): New virtual function.
15320 (Output_segment_headers::do_print_to_mapfile): New function.
15321 (Output_file_header::do_print_to_mapfile): New function.
15322 (Output_data_const::do_print_to_mapfile): New function.
15323 (class Output_data_const_buffer): Add map_name_ field. Update
15324 constructor. Change all callers. Add do_print_to_mapfile
15325 function.
15326 (class Output_data_fixed_space): Likewise.
15327 (class Output_data_space): Likewise.
15328 (class Output_data_zero_fill): New class.
15329 (Output_data_strtab::do_print_to_mapfile): New function.
15330 (Output_data_reloc_base::do_print_to_mapfile): New function.
15331 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15332 (Output_data_group::do_print_to_mapfile): New function.
15333 (Output_data_got::do_print_to_mapfile): New function.
15334 (Output_data_dynamic::do_print_to_mapfile): New function.
15335 (Output_symtab_xindex::do_print_to_mapfile): New function.
15336 (class Output_section): Declare do_print_to_mapflie. Declare
15337 print_to_mapfile in Input_section.
15338 (class Output_segment): Declare new functions.
15339 * object.h (Sized_relobj::symbol_count): New function.
15340 * script-sections.cc
15341 (Output_section_element_dot_assignment::set_section_addresses):
15342 Change Output_data_fixed_space to Output_data_zero_fill.
15343 (Output_data_expression::do_print_to_mapfile): New function.
15344 * script.cc (read_input_script): Add mapfile parameter. Change
15345 all callers.
15346 * script.h (read_input_script): Update declaration.
15347 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15348 (Eh_frame::do_print_to_mapfile): New function.
15349 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15350 (Output_merge_string::do_print_to_mapfile): New function.
15351 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15352 function.
15353 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15354 function.
15355 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15356 function.
15357 * Makefile.am (CCFILES): Add mapfile.cc.
15358 (HFILES): Add mapfile.h.
15359 * Makefile.in: Rebuild.
15360
15361 2008-05-19 Ian Lance Taylor <iant@google.com>
15362
15363 * options.h (class General_options): Add -z relro.
15364 * layout.cc (Layout::Layout): Initialize relro_segment_.
15365 (Layout::add_output_section_data): Return the output section.
15366 (Layout::make_output_section): Rcognize relro sections and mark
15367 them appropriately.
15368 (Layout::attach_allocated_section_to_segment): Put relro sections
15369 in a PT_GNU_RELRO segment.
15370 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15371 section as relro.
15372 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15373 PT_TLS segments.
15374 (Layout::linkonce_mapping): Map d.rel.ro.local to
15375 .data.rel.ro.local.
15376 (Layout::output_section_name): Us .data.rel.ro.local for any
15377 section which begins with that.
15378 * layout.h (class Layout): Update add_output_section_data
15379 declaration. Add relro_segment_ field.
15380 * output.cc (Output_section::Output_section): Initialize is_relro_
15381 and is_relro_local_ fields.
15382 (Output_segment::add_output_section): Group relro sections.
15383 (Output_segment::is_first_section_relro): New function.
15384 (Output_segment::maximum_alignment): If there is a relro section,
15385 align the segment to the common page size.
15386 (Output_segment::set_section_addresses): Track whether we are
15387 looking at relro sections. If the last section is a relro
15388 section, align to the common page size.
15389 (Output_segment::set_section_list_addresses): Add in_relro
15390 parameter. Change all callers. Align to the page size when
15391 moving from relro to non-relro section.
15392 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15393 segment.
15394 * output.h (class Output_section): Add is_relro_ and
15395 is_relro_local_ fields.
15396 (Output_section::is_relro): New function.
15397 (Output_section::set_is_relro): New function.
15398 (Output_section::is_relro_local): New function.
15399 (Output_section::set_is_relro_local): New function.
15400 (class Output_segment): Update declarations.
15401 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15402 * sparc.cc (Target_sparc::got_section): Likewise.
15403 * x86_64.cc (Target_x86_64::got_section): Likewise.
15404 * testsuite/relro_test_main.cc: New file.
15405 * testsuite/relro_test.cc: New file.
15406 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15407 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15408 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15409 (relro_test.so, relro_test_pic.o): New targets.
15410 * testsuite/Makefile.in: Rebuild.
15411
15412 2008-05-16 Ian Lance Taylor <iant@google.com>
15413
15414 * output.cc (Output_segment::add_output_section): Remove front
15415 parameter.
15416 * output.h (class Output_segment): Remove
15417 add_initial_output_section and overloaded add_output_section.
15418 Update declaration of remaining add_output_section.
15419 * layout.cc (Layout::create_interp): Call add_output_section
15420 rather than add_initial_output_section.
15421 (Layout::finish_dynamic_section): Likewise.
15422
15423 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15424 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15425 know the dynamic type.
15426 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15427 field. Initialize it in constructor.
15428 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15429 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15430 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15431 reloc.
15432
15433 * output.cc (Output_reloc::get_address): Change return type to
15434 Elf_Addr.
15435 * output.h (class Output_reloc): Update get_address declaration.
15436 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15437 for section addresses.
15438
15439 2008-05-09 Ian Lance Taylor <iant@google.com>
15440
15441 PR 6493
15442 * gold.cc (gold_nomem): Use return value of write.
15443
15444 2008-05-08 Ian Lance Taylor <iant@google.com>
15445
15446 * symtab.c (Symbol::init_base_output_data): Add version
15447 parameter. Change all callers.
15448 (Symbol::init_base_output_segment): Likewise.
15449 (Symbol::init_base_constant): Likewise.
15450 (Symbol::init_base_undefined): Likewise.
15451 (Sized_symbol::init_output_data): Likewise.
15452 (Sized_symbol::init_output_segment): Likewise.
15453 (Sized_symbol::init_constant): Likewise.
15454 (Sized_symbol::init_undefined): Likewise.
15455 (Symbol_table::do_define_in_output_data): If the new symbol has a
15456 version, mark it as the default.
15457 (Symbol_table::do_define_in_output_segment): Likewise.
15458 (Symbol_table::do_define_as_constant): Likewise.
15459 * symtab.h (class Symbol): Update declarations.
15460 (class Sized_symbol): Likewise.
15461 * resolve.cc (Symbol::override_version): New function.
15462 (Symbol::override_base): Call override_version.
15463 (Symbol::override_base_with_special): Likewise.
15464 * testsuite/ver_script_8.script: New file.
15465 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15466 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15467 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15468 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15469
15470 2008-05-06 Ian Lance Taylor <iant@google.com>
15471
15472 PR 6049
15473 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15474 functions.
15475 (class General_options): Remove existing --undefined, and add
15476 --no-undefined instead. Add new --undefined as synonym for -u.
15477 * archive.cc (Archive::add_symbols): Check whether symbol was
15478 named with -u.
15479 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15480 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15481 all uses. Add IS_UNDEFINED. Update declarations to split
15482 different versions of init_base. Declare init_base_undefined.
15483 (Symbol::is_defined): Handle IS_UNDEFINED.
15484 (Symbol::is_undefined): Likewise.
15485 (Symbol::is_weak_undefined): Call is_undefined.
15486 (Symbol::is_absolute): Handle IS_CONSTANT.
15487 (class Sized_symbol): Update declarations to split different
15488 versions of init. Declare init_undefined.
15489 (class Symbol_table): Declare new functions.
15490 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15491 Change all callers.
15492 (Symbol::init_base_output_data): Likewise.
15493 (Symbol::init_base_output_segment): Likewise.
15494 (Symbol::init_base_constant): Likewise.
15495 (Symbol::init_base_undefined): New function.
15496 (Sized_symbol::init_object): Rename from init. Change all
15497 callers.
15498 (Sized_symbol::init_output_data): Likewise.
15499 (Sized_symbol::init_output_segment): Likewise.
15500 (Sized_symbol::init_constant): Likewise.
15501 (Sized_symbol::init_undefined): New function.
15502 (Symbol_table::add_undefined_symbols_from_command_line): New
15503 function.
15504 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15505 function.
15506 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15507 (Symbol::output_section): Likewise.
15508 (Symbol::set_output_section): Likewise.
15509 (Symbol_table::sized_finalize_symbol): Likewise.
15510 (Symbol_table::sized_write_globals): Likewise.
15511 * resolve.cc (Symbol_table::should_override): Likewise.
15512 (Symbol::override_base_with_special): Likewise.
15513
15514 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15515 symbol, change it to have default visibility.
15516 * testsuite/protected_1.cc: New file.
15517 * testsuite/protected_2.cc: New file.
15518 * testsuite/protected_3.cc: New file.
15519 * testsuite/protected_main_1.cc: New file.
15520 * testsuite/protected_main_2.cc: New file.
15521 * testsuite/protected_main_3.cc: New file.
15522 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15523 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15524 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15525 (protected_1.so): New target.
15526 (protected_1_pic.o, protected_2_pic.o): New targets.
15527 (protected_3_pic.o): New target.
15528 (check_PROGRAMS): Add protected_2.
15529 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15530 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15531 * testsuite/Makefile.in: Rebuild.
15532
15533 * options.h (DEFINE_var): Add set_user_set_##varname__.
15534 (DEFINE_bool_alias): New macro.
15535 (class General_options): Define -Bstatic using DEFINE_bool_alias
15536 rather than DEFINE_special. Add --undefined as an alias for -z
15537 defs.
15538 * options.cc (General_options::parse_Bstatic): Remove.
15539
15540 * options.h (class General_options): Add --fatal-warnings.
15541 * main.cc (main): Implement --fatal-warnings.
15542 * errors.h (Errors::warning_count): New function.
15543
15544 * options.h (class General_options): Add -Bsymbolic-functions.
15545 * symtab.h (Symbol::is_preemptible): Check for
15546 -Bsymbolic-functions.
15547
15548 2008-05-05 Ian Lance Taylor <iant@google.com>
15549
15550 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15551 as noVARNAME rather than no-VARNAME.
15552 (class General_options): Add option -z combreloc.
15553 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15554 get_address.
15555 (Output_reloc::sort_before) [SHT_REL]: New function.
15556 (Output_reloc::sort_before) [SHT_RELA]: New function.
15557 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15558 Sort_relocs_comparison.
15559 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15560 parameter. Change all callers.
15561 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15562 sort_relocs parameter. Change all callers.
15563 * output.cc (Output_reloc::get_address): New function, broken out
15564 of write_rel.
15565 (Output_reloc::write_rel): Call it.
15566 (Output_reloc::compare): New function.
15567 (Output_data_reloc_base::do_write): Optionally sort relocs.
15568
15569 * configure.ac: If targ_extra_obj is set, link it in.
15570 * configure.tgt: Initialize all variables.
15571 (x86_64*): Set targ_extra_obj and targ_extra_size.
15572 * configure: Rebuild.
15573
15574 * object.cc (Sized_relobj::include_section_group): Adjust section
15575 indexes read from group data. Build vector to pass to
15576 layout_group.
15577 * layout.cc (Layout::layout_group): Add flags and shndxes
15578 parameters. Remove contents parameter. Change caller. Update
15579 explicit instantiations.
15580 * layout.h (class Layout): Update layout_group declaration.
15581 * output.cc (Output_data_group::Output_data_group): Add flags and
15582 input_shndxes parameters. Remove contents parameter. Change
15583 caller.
15584 (Output_data_group::do_write): Change input_sections_ to
15585 input_shndxes_.
15586 * output.h (class Output_data_group): Update constructor
15587 declaration. Rename input_sections_ to input_shndxes_.
15588 * testsuite/many_sections_test.cc: Add template.
15589
15590 2008-04-30 Cary Coutant <ccoutant@google.com>
15591
15592 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15593
15594 * layout.cc (Layout::include_section): Refactored check for debug
15595 info section.
15596 (Layout::add_comdat): Add new parameters. Change type
15597 of signature parameter. Add object and shndx to signatures table.
15598 (Layout::find_kept_object): New function.
15599 * layout.h: Include <cstring>.
15600 (Layout::is_debug_info_section): New function.
15601 (Layout::add_comdat): Add new parameters.
15602 (Layout::find_kept_object): New function.
15603 (Layout::Kept_section): New struct.
15604 (Layout::Signatures): Change type of map range.
15605 * object.cc (Relobj::output_section_address): New function.
15606 (Sized_relobj::include_section_group): Add new parameters. Change
15607 calls to Layout::add_comdat. Change to build table of kept comdat
15608 groups and table mapping discarded sections to kept sections.
15609 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15610 (Sized_relobj::do_layout): Change calls to include_section_group and
15611 include_linkonce_section.
15612 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15613 value to zero when section is discarded.
15614 (Sized_relobj::map_to_kept_section): New function.
15615 * object.h (Relobj::output_section_address): New function.
15616 (Relobj::Comdat_group): New type.
15617 (Relobj::find_comdat_group): New function.
15618 (Relobj::Comdat_group_table): New type.
15619 (Relobj::Kept_comdat_section): New type.
15620 (Relobj::Kept_comdat_section_table): New type.
15621 (Relobj::add_comdat_group): New function.
15622 (Relobj::set_kept_comdat_section): New function.
15623 (Relobj::get_kept_comdat_section): New function.
15624 (Relobj::comdat_groups_): New field.
15625 (Relobj::kept_comdat_sections_): New field.
15626 (Symbol_value::input_value): Update comment.
15627 (Sized_relobj::map_to_kept_section) New function.
15628 (Sized_relobj::include_linkonce_section): Add new parameter.
15629 * target-reloc.h (Comdat_behavior): New type.
15630 (get_comdat_behavior): New function.
15631 (relocate_section): Add code to map a discarded section to the
15632 corresponding kept section when applying a relocation.
15633
15634 2008-04-30 Craig Silverstein <csilvers@google.com>
15635
15636 * dwarf_reader.cc (next_generation_count): New static var.
15637 (Addr2line_cache_entry): New struct.
15638 (addr2line_cache): New static var.
15639 (Dwarf_line_info::one_addr2line): Added caching.
15640 (Dwarf_line_info::clear_addr2line_cache): New function.
15641 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15642 cache-size parameter.
15643 (Dwarf_line_info::one_addr2line_cache): New function.
15644 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15645 new cache-size argument to one_addr2line(), and clear cache.
15646
15647 2008-04-28 Cary Coutant <ccoutant@google.com>
15648
15649 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15650 R_386_PC8 relocations.
15651
15652 2008-04-23 Ian Lance Taylor <iant@google.com>
15653
15654 * object.cc (Sized_relobj::include_section_group): Check for
15655 invalid section group.
15656
15657 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15658 header size.
15659
15660 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15661 than read for file header.
15662 * archive.cc (Archive::include_member): Likewise.
15663
15664 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15665
15666 * aclocal.m4: Regenerate.
15667 * configure: Regenerate.
15668
15669 2008-04-19 Ian Lance Taylor <iant@google.com>
15670
15671 * version.cc (version_string): Bump to 1.6.
15672
15673 * testsuite/Makefile.am (many_sections_r_test): New target.
15674 (many_sections_r_test_SOURCES): Remove.
15675 (many_sections_r_test_DEPENDENCIES): Remove.
15676 (many_sections_r_test_LDFLAGS): Remove.
15677 (many_sections_r_test_LDADD): Remove.
15678
15679 * object.cc (Sized_relobj::do_add_symbols): Always pass
15680 local_symbol_count_ to add_from_relobj.
15681
15682 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15683 every thousand variables.
15684 * testsuite/Makefile.in: Rebuild.
15685
15686 * object.cc (Xindex::initialize_symtab_xindex): New function.
15687 (Xindex::read_symtab_xindex): New function.
15688 (Xindex::sym_xindex_to_shndx): New function.
15689 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15690 available.
15691 (Sized_relobj::do_initialize_xindex): New function.
15692 (Sized_relobj::do_read_symbols): Adjust section links.
15693 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15694 parameter. Change all callers.
15695 (Sized_relobj::include_section_group): Adjust section links and
15696 symbol section indexes.
15697 (Sized_relobj::do_layout): Adjust section links.
15698 (Sized_relobj::do_count_local_symbols): Adjust section links and
15699 symbol section indexes.
15700 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15701 ordinary and special symbols.
15702 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15703 dynsym_xindex parameters. Change all callers. Adjust section
15704 links. Use SHN_XINDEX when needed.
15705 (Sized_relobj::get_symbol_location_info): Adjust section links.
15706 Don't get fooled by special symbols.
15707 * object.h (class Xindex): Define.
15708 (class Object): Add xindex_ parameter. Declare virtual functoin
15709 do_initialize_xindex.
15710 (Object::adjust_sym_shndx): New function.
15711 (Object::set_xindex): New protected function.
15712 (class Symbol_value): Add is_ordinary_shndx_ field.
15713 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15714 (Symbol_value::value): Assert ordinary section.
15715 (Symbol_value::initialize_input_to_output_map): Likewise.
15716 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15717 Change all callers.
15718 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15719 all callers.
15720 (class Sized_relobj): Update declarations.
15721 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15722 parameter. Change all callers.
15723 (Sized_relobj::adjust_shndx): New function.
15724 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15725 field.
15726 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15727 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15728 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15729 (Sized_dynobj::read_dynsym_section): Adjust section links.
15730 (Sized_dynobj::read_dynamic): Likewise.
15731 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15732 section links.
15733 (Sized_dynobj::do_initialize_xindex): New function.
15734 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15735 do_initialize_xindex.
15736 (Sized_dynobj::adjust_shndx): New function.
15737 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15738 dynsym_xindex_ fields.
15739 (Layout::finalize): Add a call to set_section_indexes before
15740 creating the symtab sections.
15741 (Layout::set_section_indexes): Don't do anything if the section
15742 already has a section index.
15743 (Layout::create_symtab_sections): Add shnum parameter. Change
15744 caller. Create .symtab_shndx section if needed.
15745 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15746 caller.
15747 (Layout::allocated_output_section_count): New function.
15748 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15749 needed.
15750 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15751 fields. Update declarations.
15752 (Layout::symtab_xindex): New function.
15753 (Layout::dynsym_xindex): New function.
15754 (class Write_symbols_task): Add layout_ field.
15755 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15756 Change caller.
15757 * output.cc (Output_section_headers::Output_section_headers): Add
15758 shstrtab_section parameter. Change all callers.
15759 (Output_section_headers::do_sized_write): Store overflow values
15760 for section count and section string table section index in
15761 section header zero.
15762 (Output_file_header::do_sized_write): Check for overflow of
15763 section count and section string table section index.
15764 (Output_symtab_xindex::do_write): New function.
15765 (Output_symtab_xindex::endian_do_write): New function.
15766 * output.h (class Output_section_headers): Add shstrtab_section_.
15767 Update declarations.
15768 (class Output_symtab_xindex): Define.
15769 (Output_section::has_out_shndx): New function.
15770 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15771 field.
15772 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15773 Change all callers.
15774 (Sized_symbol::init): Likewise.
15775 (Symbol::output_section): Check for ordinary symbol.
15776 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15777 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15778 callers.
15779 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15780 Change all callers. Simplify handling of symbols from sections
15781 not included in the link.
15782 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15783 distinction.
15784 (Weak_alias_sorter::operator()): Assert that symbols are
15785 ordinary.
15786 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15787 distinction.
15788 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15789 parameters. Change all callers.
15790 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15791 symbol distinction. Use SHN_XINDEX when needed.
15792 (Symbol_table::write_section_symbol): Add symtab_xindex
15793 parameter. Change all callers.
15794 (Symbol_table::sized_write_section_symbol): Likewise. Use
15795 SHN_XINDEX when needed.
15796 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15797 declarations.
15798 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15799 (Symbol::is_defined): Check is_ordinary.
15800 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15801 (Symbol::is_absolute, Symbol::is_common): Likewise.
15802 (class Sized_symbol): Update declarations.
15803 (class Symbol_table): Update declarations.
15804 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15805 parameters. Change all callers.
15806 (Sized_symbol::override): Likewise.
15807 (Symbol_table::override): Likewise.
15808 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15809 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15810 is_ordinary, and orig_st_shndx parameters. Change all callers.
15811 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15812 to be in an ordinary section.
15813 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15814 object and is_ordinary parameters. Change all callers.
15815 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15816 Change all callers. Don't add undefined or non-ordinary symbols
15817 to reloc_map_.
15818 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15819 Change all callers.
15820 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15821 declarations.
15822 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15823 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15824 (Sized_relobj::relocate_sections): Likewise.
15825 * target-reloc.h (scan_relocs): Adjust section symbol index.
15826 (scan_relocatable_relocs): Likewise.
15827 * i386.cc (Scan::local): Check for ordinary symbols.
15828 * sparc.cc (Scan::local): Likewise.
15829 * x86_64.cc (Scan::local): Likewise.
15830 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15831 to symbol_section_and_value.
15832 * testsuite/many_sections_test.cc: New file.
15833 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15834 (check_PROGRAMS): Add many_sections_test.
15835 (many_sections_test_SOURCES): Define.
15836 (many_sections_test_DEPENDENCIES): Define.
15837 (many_sections_test_LDFLAGS): Define.
15838 (BUILT_SOURCES): Add many_sections_define.h.
15839 (many_sections_define.h): New target.
15840 (BUILT_SOURCES): Add many_sections_check.h.
15841 (many_sections_check.h): New target.
15842 (check_PROGRAMS): Add many_sections_r_test.
15843 (many_sections_r_test_SOURCES): Define.
15844 (many_sections_r_test_DEPENDENCIES): Define.
15845 (many_sections_r_test_LDFLAGS): Define.
15846 (many_sections_r_test_LDADD): Define.
15847 (many_sections_r_test.o): New target.
15848 * testsuite/Makefile.in: Rebuild.
15849
15850 2008-04-17 Cary Coutant <ccoutant@google.com>
15851
15852 * errors.cc (Errors::info): New function.
15853 (gold_info): New function.
15854 * errors.h (Errors::info): New function.
15855 * gold.h (gold_info): New function.
15856 * object.cc (Input_objects::add_object): Print trace output.
15857 * options.cc (options::parse_set): New function.
15858 (General_options::parse_wrap): Deleted.
15859 (General_options::General_options): Deleted initializer.
15860 * options.h (options::String_set): New typedef.
15861 (options::parse_set): New function.
15862 (DEFINE_set): New macro.
15863 (General_options::wrap): Changed to use DEFINE_set. Changed
15864 callers of any_wrap_symbols and is_wrap_symbol.
15865 (General_options::trace, General_options::trace_symbol):
15866 New options.
15867 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15868 (General_options::wrap_symbols_): Deleted.
15869 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15870
15871 2008-04-17 David S. Miller <davem@davemloft.net>
15872
15873 * options.cc (General_options::parse_V): New function.
15874 * options.h: Add entries for -V and -Qy.
15875
15876 2008-04-17 Ian Lance Taylor <iant@google.com>
15877
15878 * common.cc (Symbol_table::allocate_commons): Remove options
15879 parameter. Change caller.
15880 (Symbol_table::do_allocate_commons): Remove options parameter.
15881 Change caller. Just call do_allocate_commons_list twice.
15882 (Symbol_table::do_allocate_commons_list): New function, broken out
15883 of do_allocate_commons.
15884 * common.h (class Allocate_commons_task): Remove options_ field.
15885 Update constructor.
15886 * symtab.cc (Symbol_table::Symbol_table): Initialize
15887 tls_commons_.
15888 (Symbol_table::add_from_object): Put TLS common symbols on
15889 tls_commons_ list.
15890 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15891 which are IN_OUTPUT_DATA.
15892 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15893 allocate_commons and do_allocate_commons declarations. Declare
15894 do_allocate_commons_list.
15895 * gold.cc (queue_middle_tasks): Update creation of
15896 Allocate_commons_task to not pass options.
15897 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15898 (TLS_TEST_C_FLAGS): New variable.
15899 (tls_test_c_pic.o): New target.
15900 (tls_test_shared.so): Link in tls_test_c_pic.o.
15901 (tls_test_c_pic_ie.o): New target.
15902 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15903 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15904 (tls_test_c.o): New target.
15905 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15906 (tls_pic_test_LDADD): Likewise.
15907 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15908 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15909 (tls_test_c_gnu2.o): New target.
15910 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15911 tls_test_c_gnu2.o.
15912 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15913 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15914 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15915 * testsuite/tls_test.cc: Include "config.h".
15916 (t_last): Call t11_last.
15917 * testsuite/tls_test.h (t11, t11_last): Declare.
15918 * testsuite/tls_test_c.c: New file.
15919 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15920 * configure.ac: Check for OpenMP support.
15921 * configure, config.in, Makefile.in: Rebuild.
15922 * testsuite/Makefile.in: Rebuild.
15923
15924 2008-04-16 Cary Coutant <ccoutant@google.com>
15925
15926 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15927 (Target_i386::tls_base_symbol_defined_): New field.
15928 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15929 (Target_i386::Scan::global): Likewise.
15930 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15931 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15932 (Target_x86_64::tls_base_symbol_defined_): New field.
15933 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15934 (Target_x86_64::Scan::global): Likewise.
15935
15936 2008-04-16 Cary Coutant <ccoutant@google.com>
15937
15938 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15939 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15940 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15941 building shared libraries.
15942 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15943 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15944 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15945 * testsuite/Makefile.in: Rebuild.
15946 * testsuite/weak_undef.h: New file.
15947 * testsuite/weak_undef_file1.cc: Add extra test cases.
15948 * testsuite/weak_undef_file2.cc: Likewise.
15949 * testsuite/weak_undef_test.cc: Likewise.
15950
15951 2008-04-16 David S. Miller <davem@davemloft.net>
15952
15953 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15954 Add issued_non_pic_error_ field. Declare check_non_pic.
15955 (Target_sparc::Scan::check_non_pic): New function.
15956 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15957 (Target_sparc::Scan::global): Likewise.
15958
15959 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15960 * configure: Rebuild.
15961
15962 * options.h (DEFINE_enable): New macro.
15963 (new_dtags): New enable option.
15964 (initfirst, interpose, loadfltr, nodefaultlib,
15965 nodelete, nodlopen, nodump): New -z options.
15966 * layout.cc (Layout:finish_dynamic_section): If new
15967 dtags enabled, emit DT_RUNPATH. Also, emit a
15968 DT_FLAGS_1 containing any specified -z flags.
15969
15970 2008-04-16 Ian Lance Taylor <iant@google.com>
15971
15972 * copy-relocs.cc: New file.
15973 * copy-relocs.h: New file.
15974 * reloc.cc: Remove Copy_relocs code.
15975 * reloc.h: Likewise.
15976 * reloc-types.h (struct Reloc_types) [both versions]: Add
15977 get_reloc_addend_noerror.
15978 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15979 variants of add_global which take an addend which must be zero.
15980 * i386.cc: Include "copy-relocs.h".
15981 (class Target_i386): Change type of copy_relocs_ to variable,
15982 update initializer.
15983 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15984 Change all callers.
15985 (Target_i386::do_finalize_sections): Change handling of
15986 copy_relocs_.
15987 * sparc.cc: Include "copy-relocs.h".
15988 (class Target_sparc): Change type of copy_relocs_ to variable,
15989 update initializer.
15990 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15991 Change all callers.
15992 (Target_sparc::do_finalize_sections): Change handling of
15993 copy_relocs_.
15994 * x86_64.cc: Include "copy-relocs.h".
15995 (class Target_x86_64): Change type of copy_relocs_ to variable,
15996 update initializer.
15997 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15998 class. Change all callers.
15999 (Target_x86_64::do_finalize_sections): Change handling of
16000 copy_relocs_.
16001 * Makefile.am (CCFILES): Add copy-relocs.cc.
16002 (HFILES): Add copy-relocs.h.
16003
16004 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16005
16006 * testsuite/script_test_4.sh: Permit leading zeroes.
16007
16008 2008-04-15 Ian Lance Taylor <iant@google.com>
16009
16010 * script-sections.cc (Script_sections::create_segments): Use
16011 header_size_adjustment even when there is enough room for the
16012 headers.
16013 * testsuite/script_test_4.sh: New file.
16014 * testsuite/script_test_4.t: New file.
16015 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16016 (check_DATA): Add script_test_4.stdout.
16017 (MOSTLYCLEANFILES): Likewise.
16018 (script_test_4): New target.
16019 (script_test_4.stdout): New target.
16020 * testsuite/Makefile.in: Rebuild.
16021
16022 * sparc.cc: Add definitions for Output_data_plt_sparc class
16023 constants.
16024
16025 2008-04-14 David S. Miller <davem@davemloft.net>
16026
16027 * sparc.cc: New file.
16028 * Makefile.am (TARGETSOURCES): Add sparc.cc
16029 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16030 * configure.tgt: Document targ_extra_size and
16031 targ_extra_big_endian. Add entries for sparc-* and
16032 sparc64-*.
16033 * configure.ac: Handle targ_extra_size and
16034 targ_extra_big_endian.
16035 * Makefile.in: Rebuild.
16036 * configure: Likewise.
16037 * po/POTFILES.in: Likewise.
16038 * po/gold.pot: Likewise.
16039
16040 2008-04-14 Ian Lance Taylor <iant@google.com>
16041
16042 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16043 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16044 in the name/type/flags to section mapping. Don't call
16045 allocate_output_section.
16046 (Layout::choose_output_section): Change parameter from adjust_name
16047 to is_input_section. Don't permit input sections after sections
16048 are attached to segments. Don't call allocate_output_section.
16049 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16050 not write_enable_output_section.
16051 (Layout::make_output_section): Don't push to
16052 unattached_section_list_ nor call attach_to_segment. Call
16053 attach_section_to_segment if sections are attached.
16054 (Layout::attach_sections_to_segments): New function.
16055 (Layout::attach_section_to_segment): New function.
16056 (Layout::attach_allocated_section_to_segment): Rename from
16057 attach_to_segment. Remove flags parameter.
16058 (Layout::allocate_output_section): Remove function.
16059 (Layout::write_enable_output_section): Remove function.
16060 * layout.h (class Layout): Update for above changes. Add new
16061 field sections_are_attached_.
16062 * output.h (Output_section::update_flags_for_input_section): New
16063 function.
16064 * output.cc (Output_section::add_input_section): Call
16065 update_flags_for_input_section.
16066 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16067
16068 2008-04-11 Cary Coutant <ccoutant@google.com>
16069
16070 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16071 thought unnecessary.
16072 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16073
16074 2008-04-11 Ian Lance Taylor <iant@google.com>
16075
16076 * output.h (class Output_section_data): Remove inline definition
16077 of set_addralign.
16078 * output.cc (Output_section_data::set_addralign): New function.
16079
16080 2008-04-11 Cary Coutant <ccoutant@google.com>
16081
16082 Add support for TLS descriptors for i386 and x86_64.
16083 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16084 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16085 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16086 GOT_TYPE_TLS_DESC.
16087 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16088 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16089 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16090 relocations.
16091 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16092 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16093 Fix problem with initial-exec relocations.
16094 (Target_i386::Relocate::relocate_tls): Likewise.
16095 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16096 relaxation.
16097 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16098 support for section-plus-offset dynamic table entries.
16099 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16100 (Output_data_dynamic::Dynamic_entry): Add support for
16101 section-plus-offset dynamic table entries.
16102 (Output_data_dynamic::Classification): Likewise.
16103 (Output_data_dynamic::classification_): Renamed offset_.
16104 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16105 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16106 (Target_x86_64::make_plt_section): New function.
16107 (Target_x86_64::reserve_tlsdesc_entries): New function.
16108 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16109 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16110 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16111 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16112 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16113 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16114 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16115 add extra PLT entry for TLS descriptors.
16116 (Output_data_plt_x86_64::got_): New field.
16117 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16118 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16119 fields.
16120 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16121 descriptors.
16122 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16123 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16124 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16125 R_386_TLS_DESC_CALL relocations.
16126 (Target_x86_64::Scan::global): Likewise.
16127 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16128 for TLS descriptors.
16129 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16130 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16131 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16132 GD-to-IE relaxation.
16133 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16134 and TLS_DESCRIPTORS.
16135 * Makefile.in: Rebuild.
16136 * configure: Rebuild.
16137 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16138 (tls_test_shared2.so): New target.
16139 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16140 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16141 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16142 (tls_shared_gd_to_ie_test_LDADD): New variable.
16143 (tls_shared_gnu2_gd_to_ie_test): New target.
16144 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16145 New targets.
16146 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16147 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16148 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16149 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16150 (tls_shared_gnu2_test): New target.
16151 (tls_test_gnu2_shared.so): New target.
16152 (tls_shared_gnu2_test_SOURCES): New variable.
16153 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16154 (tls_shared_gnu2_test_LDFLAGS): New variable.
16155 (tls_shared_gnu2_test_LDADD): New variable.
16156 * testsuite/Makefile.in: Rebuild.
16157 * testsuite/Makefile.
16158
16159 2008-04-11 Ian Lance Taylor <iant@google.com>
16160
16161 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16162 justsyms.t.
16163 * testsuite/Makefile.in: Rebuild.
16164
16165 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16166 long.
16167 * testsuite/script_test_2.cc (main): Adjust test.
16168
16169 2008-04-11 David S. Miller <davem@davemloft.net>
16170 Ian Lance Taylor <iant@google.com>
16171
16172 * options.h (General_options): Add entries for '-Y' and
16173 '-relax'.
16174 * options.cc (General_options:finalize): If -Y was used, add those
16175 entries to the library path instead of the default "/lib" and
16176 "/usr/lib".
16177
16178 2008-04-11 David S. Miller <davem@davemloft.net>
16179
16180 * testsuite/justsyms.t: Start at 0x100.
16181 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16182 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16183 long.
16184 * testsuite/script_test_2.cc: Adjust string and section length
16185 checks.
16186
16187 2008-04-09 Ian Lance Taylor <iant@google.com>
16188
16189 PR gold/5996
16190 * script-sections.cc (Sections_element::allocate_to_segment): Add
16191 orphan parameter.
16192 (Output_section_definition::allocate_to_segment): Likewise.
16193 (Orphan_output_section::allocate_to_segment): Likewise.
16194 (Script_sections::attach_sections_using_phdrs_clause): Don't
16195 propagate non-PT_LOAD segments to orphan sections.
16196 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16197 readelf rather than objdump.
16198 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16199 .interp section and PT_INTERP segment are the same size.
16200 * testsuite/Makefile.in: Rebuild.
16201
16202 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16203 aliases for symbols defined in the same object.
16204 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16205 (weak_alias_test_SOURCES): New variable.
16206 (weak_alias_test_DEPENDENCIES): New variable.
16207 (weak_alias_test_LDFLAGS): New variable.
16208 (weak_alias_test_LDADD): New variable.
16209 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16210 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16211 (weak_alias_test_3.o): New target.
16212 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16213 * testsuite/weak_alias_test_main.cc: New file.
16214 * testsuite/weak_alias_test_1.cc: New file.
16215 * testsuite/weak_alias_test_2.cc: New file.
16216 * testsuite/weak_alias_test_3.cc: New file.
16217
16218 2008-04-08 Ian Lance Taylor <iant@google.com>
16219
16220 * options.h (class General_options): Add --noinhibit-exec option.
16221 * main.cc (main): Check --noinhibit-exec.
16222
16223 * options.h (class General_options): Define --wrap as a special
16224 option. Add wrap_symbols_ field.
16225 (General_options::any_wrap_symbols): New function.
16226 (General_options::is_wrap_symbol): New function.
16227 * options.cc (General_options::parse_wrap): New function.
16228 (General_options::General_options): Initialize wrap_symbols_.
16229 * symtab.cc (Symbol_table::wrap_symbol): New function.
16230 (Symbol_table::add_from_object): Handle --wrap.
16231 * symtab.h (class Symbol_table): Declare wrap_symbol.
16232 * target.h (Target::wrap_char): New function.
16233 (Target::Target_info): Add wrap_char field.
16234 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16235 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16236 * testsuite/testfile.cc (Target_test::test_target_info):
16237 Likewise.
16238
16239 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16240 there is one.
16241
16242 * layout.h (class Layout): Add added_eh_frame_data_ field.
16243 * layout.cc (Layout::Layout): Initialize new field.
16244 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16245 output section until we find a section we merged successfully.
16246 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16247 that the size be non-zero.
16248
16249 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16250 qualifier.
16251
16252 2008-04-08 Craig Silverstein <csilvers@google.com>
16253
16254 * configure.ac: Export new conditional variable HAVE_ZLIB.
16255 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16256 on HAVE_ZLIB.
16257 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16258 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16259
16260 2008-04-07 Ian Lance Taylor <iant@google.com>
16261
16262 * version.cc (version_string): Set to "1.5".
16263
16264 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16265 Add issued_non_pic_error_ field. Declare check_non_pic.
16266 (Target_x86_64::Scan::check_non_pic): New function.
16267 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16268 (Target_x86_64::Scan::global): Likewise.
16269
16270 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16271 addend parameter. Change caller. Handle merge sections.
16272 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16273 Address to Addend. Don't add in the result of
16274 local_section_offset, pass down the addend and use the returned
16275 value.
16276 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16277 Update declarations of local_section_offset and symbol_value.
16278 * testsuite/two_file_test_1.cc (t18): New function.
16279 * testsuite/two_file_test_2.cc (f18): New function.
16280 * testsuite/two_file_test_main.cc (main): Call t18.
16281 * testsuite/two_file_test.h (t18, f18): Declare.
16282
16283 * configure.ac: Don't test for objdump, c++filt, or readelf.
16284 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16285 conditionals.
16286 (TEST_READELF): New variable.
16287 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16288 (check_PROGRAMS): Add two_file_strip_test.
16289 (two_file_strip_test): New target.
16290 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16291 (two_file_same_shared_strip_test_SOURCES): New variable.
16292 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16293 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16294 (two_file_same_shared_strip_test_LDADD): New variable.
16295 (two_file_shared_strip.so): New target.
16296 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16297 (ver_test_5.syms, ver_test_7.syms): Likewise.
16298 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16299 (strip_test_3.stdout): Use TEST_OBJDUMP.
16300 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16301
16302 2008-04-04 Cary Coutant <ccoutant@google.com>
16303
16304 * symtab.h (Symbol::is_weak_undefined): New function.
16305 (Symbol::is_strong_undefined): New function.
16306 (Symbol::is_absolute): New function.
16307 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16308 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16309 absolute symbols.
16310 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16311 (weak_undef_test): New target.
16312 * testsuite/Makefile.in: Rebuild.
16313 * testsuite/weak_undef_file1.cc: New file.
16314 * testsuite/weak_undef_file2.cc: New file.
16315 * testsuite/weak_undef_test.cc: New file.
16316
16317 2008-04-03 Craig Silverstein <csilvers@google.com>
16318
16319 * compressed_output.h (class Output_compressed_section): Use
16320 unsigned buffer.
16321 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16322 add zlib header.
16323 (zlib_compressed_suffix): Removed.
16324 (Output_compressed_section::set_final_data_size): Use unsigned
16325 buffers.
16326 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16327 Fix linker invocation.
16328 (flagstest_o_specialfile_and_compress_debug_sections):
16329 Likewise.
16330 * testsuite/Makefile.in: Regenerated.
16331
16332 2008-04-02 David S. Miller <davem@davemloft.net>
16333
16334 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16335 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16336
16337 2008-04-02 Craig Silverstein <csilvers@google.com>
16338
16339 * TODO: New file.
16340
16341 2008-04-02 Ian Lance Taylor <iant@google.com>
16342
16343 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16344 parameters. Update for new key type to views_. Change all
16345 callers.
16346 (File_read::read): Adjust for byteshift in returned view.
16347 (File_read::add_view): New function, broken out of
16348 find_and_make_view.
16349 (File_read::make_view): New function, broken out of
16350 find_and_make_view.
16351 (File_read::find_or_make_view): Add offset and aligned
16352 parameters. Rewrite accordingly. Change all callers.
16353 (File_read::get_view): Add offset and aligned parameters. Adjust
16354 for byteshift in return value.
16355 (File_read::get_lasting_view): Likewise.
16356 * fileread.h (class File_read): Update declarations.
16357 (class File_read::View): Add byteshift_ field. Add byteshift to
16358 constructor. Add byteshift method.
16359 * archive.h (Archive::clear_uncached_views): New function.
16360 (Archive::get_view): Add aligned parameter. Change all callers.
16361 * object.h (Object::get_view): Add aligned parameter. Change all
16362 callers.
16363 (Object::get_lasting_view): Likewise.
16364
16365 * fileread.cc (File_read::release): Don't call clear_views if
16366 there are multiple objects.
16367 * fileread.h (File_read::clear_uncached_views): New function.
16368 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16369 on the archive.
16370
16371 2008-03-31 Cary Coutant <ccoutant@google.com>
16372
16373 Add thin archive support.
16374 * archive.cc (Archive::armagt): New const.
16375 (Archive::setup): Remove task parameter and calls to unlock.
16376 (Archive::unlock_nested_archives): New function.
16377 (Archive::read_header): Add nested_off parameter. Change
16378 all callers.
16379 (Archive::interpret_header): Likewise.
16380 (Archive::include_all_members): Change to handle thin
16381 archives.
16382 (Archive::include_member): Likewise.
16383 * archive.h (Archive::Archive): Add new parameters and
16384 initializers.
16385 (Archive::armagt): New const.
16386 (Archive::setup): Remove task parameter.
16387 (Archive::unlock_nested_archives): New function.
16388 (Archive::read_header): Add nested_off parameter.
16389 (Archive::interpret_header): Likewise.
16390 (Archive::Nested_archive_table): New typedef.
16391 (Archive::is_thin_archive_): New field.
16392 (Archive::nested_archives_): New field.
16393 (Archive::options_): New field.
16394 (Archive::dirpath_): New field.
16395 (Archive::task_): New field.
16396 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16397 for thin archives. Pass additional parameters to
16398 Archive::Archive. Unlock the archive file after calling
16399 Archive::setup.
16400
16401 2008-03-29 Ian Lance Taylor <iant@google.com>
16402
16403 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16404 version symbol to be local.
16405 * testsuite/ver_test_4.sh: New file.
16406 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16407 (check_DATA): Add ver_test_4.syms.
16408 (ver_test_4.syms): New target.
16409 * testsuite/Makefile.in: Rebuild.
16410
16411 * output.cc
16412 (Output_section::Input_section_sort_entry::has_priority): New
16413 function.
16414 (Output_section::Input_section_sort_entry::match_file_name): New
16415 function.
16416 (Output_section::Input_section_sort_entry::match_section_name):
16417 Remove.
16418 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16419 Remove.
16420 (Output_section::Input_section_sort_entry::match_section_file):
16421 Remove.
16422 (Output_section::Input_section_sort_compare::operator()): Rewrite
16423 using new Input_section_sort_entry functions. Sort crtbegin and
16424 crtend first. Sort sections with no priority before sections with
16425 a priority.
16426 * testsuite/initpri1.c (d3): Check j != 4.
16427 (cd5): New constructor/destructor function.
16428 (main): Check j != 2.
16429
16430 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16431 new symbol when resolving, don't call set_is_default.
16432 * testsuite/ver_test_7.cc: New file.
16433 * testsuite/ver_test_7.sh: New file.
16434 * testsuite/Makefile.am (ver_test_7.so): New target.
16435 (ver_test_7.o): New target.
16436 (check_SCRIPTS): Add ver_test_7.sh.
16437 (check_DATA): Add ver_test_7.syms.
16438 (ver_test_7.syms): New target.
16439
16440 2008-03-28 Ian Lance Taylor <iant@google.com>
16441
16442 * layout.cc (Layout::layout): If we see an input section with a
16443 name that needs sorting, set the must_sort flag for the output
16444 section.
16445 (Layout::make_output_section): If the name of the output section
16446 indicates that it might require sorting, set the may_sort flag.
16447 * output.h (Output_section::may_sort_attached_input_sections): New
16448 function.
16449 (Output_section::set_may_sort_attached_input_sections): New
16450 function.
16451 (Output_section::must_sort_attached_input_sections): New
16452 function.
16453 (Output_section::set_must_sort_attached_input_sections): New
16454 function.
16455 (class Output_section): Declare Input_section_sort_entry. Define
16456 Input_section_sort_compare. Declare
16457 sort_attached_input_sections. Add new fields:
16458 may_sort_attached_input_sections_,
16459 must_sort_attached_input_sections_,
16460 attached_input_sections_are_sorted_.
16461 * output.cc (Output_section::Output_section): Initialize new
16462 fields.
16463 (Output_section::add_input_section): Add an entry to
16464 input_sections_ if may_sort or must_sort are true.
16465 (Output_section::set_final_data_size): Call
16466 sort_attached_input_sections if necessary.
16467 (Output_section::Input_section_sort_entry): Define new class.
16468 (Output_section::Input_section_sort_compare::operator()): New
16469 function.
16470 (Output_section::sort_attached_input_sections): New function.
16471 * configure.ac: Check whether the compiler supports constructor
16472 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16473 * testsuite/initpri1.c: New file.
16474 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16475 CONSTRUCTOR_PRIORITY.
16476 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16477 (initpri1_LDFLAGS): New variable.
16478 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16479
16480 2008-03-27 Ian Lance Taylor <iant@google.com>
16481
16482 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16483 * testsuite/common_test_1.c: New file.
16484 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16485 (common_test_1_SOURCES): New variable.
16486 (common_test_1_DEPENDENCIES): New variable.
16487 (common_test_1_LDFLAGS): New variable.
16488
16489 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16490 and commons_ correctly when NAME/VERSION does not override
16491 NAME/NULL.
16492 * testsuite/ver_test_6.c: New file.
16493 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16494 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16495 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16496
16497 2008-03-26 Ian Lance Taylor <iant@google.com>
16498
16499 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16500 of an undefined symbol from a version script.
16501 * testsuite/Makefile.am (ver_test_5.so): New target.
16502 (ver_test_5.o): New target.
16503 (check_SCRIPTS): Add ver_test_5.sh.
16504 (check_DATA): Add ver_test_5.syms.
16505 (ver_test_5.syms): New target.
16506 * testsuite/ver_test_5.cc: New file.
16507 * testsuite/ver_test_5.script: New file.
16508 * testsuite/ver_test_5.sh: New file.
16509 * Makefile.in, testsuite/Makefile.in: Rebuild.
16510
16511 PR gold/5986
16512 Fix problems building gold with gcc 4.3.0.
16513 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16514 (gold_error_at_location, gold_warning_at_location): Use it.
16515 * configure.ac: Check whether we can compile and use a template
16516 function with a printf attribute.
16517 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16518 when jumping over bytes.
16519 * object.cc: Instantiate Object::read_section_data.
16520 * debug.h: Include <cstring>
16521 * dwarf_reader.cc: Include <algorithm>
16522 * main.cc: Include <cstring>.
16523 * options.cc: Include <cstring>.
16524 * output.cc: Include <cstring>.
16525 * script.cc: Include <cstring>.
16526 * script.h: Include <string>.
16527 * symtab.cc: Include <cstring> and <algorithm>.
16528 * target-select.cc: Include <cstring>.
16529 * version.cc: Include <string>.
16530 * testsuite/testmain.cc: Include <cstdlib>.
16531 * configure, config.in: Rebuild.
16532
16533 2008-03-25 Ian Lance Taylor <iant@google.com>
16534
16535 * options.cc: Include "../bfd/bfdver.h".
16536 (options::help): Print bug reporting address.
16537
16538 * version.cc (print_version): Adjust output for current value of
16539 BFD_VERSION_STRING.
16540
16541 * NEWS: New file.
16542
16543 * options.cc (options::help): Print list of supported targets.
16544 * target-select.h: Include <vector>.
16545 (class Target_selector): Make machine_, size_, and is_big_endian_
16546 fields const. Add bfd_name_ and instantiated_target_ fields.
16547 (Target_selector::Target_selector): Add bfd_name parameter.
16548 (Target_selector::recognize): Make non-virtual, call
16549 do_recognize.
16550 (Target_selector::recognize_by_name): Make non-virtual, call
16551 do_recognize_by_name.
16552 (Target_selector::supported_names): New function.
16553 (Target_selector::bfd_name): New function.
16554 (Target_selector::do_instantiate_target): New pure virtual
16555 function.
16556 (Target_selector::do_recognize): New virtual function.
16557 (Target_selector::do_recognize_by_name): New virtual function.
16558 (Target_selector::instantiate_target): New private function.
16559 (supported_target_names): Declare.
16560 * target-select.cc (Target_selector::Target_selector): Update for
16561 new parameter and fields.
16562 (select_target_by_name): Check that the name matches before
16563 calling recognize_by_name.
16564 (supported_target_names): New function.
16565 * i386.cc (class Target_selector_i386): Update Target_selector
16566 constructor call. Remove recognize and recognize_by_name. Add
16567 do_instantiate_target.
16568 * x86_64.cc (class Target_selector_x86_64): Likewise.
16569 * testsuite/testfile.cc (class Target_selector_test): Update for
16570 changes to Target_selector.
16571
16572 * README: Rewrite, with some notes on unsupported features.
16573
16574 2008-03-24 Cary Coutant <ccoutant@google.com>
16575
16576 * i386.cc (Target_i386::Got_type): New enum declaration.
16577 (Target_i386::Scan::local): Updated callers of Output_data_got
16578 member functions.
16579 (Target_i386::Scan::global): Likewise.
16580 (Target_i386::Relocate::relocate): Likewise.
16581 (Target_i386::Relocate::relocate_tls): Likewise.
16582 * object.h (Got_offset_list): New class.
16583 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16584 (Sized_relobj::local_got_offset): Likewise.
16585 (Sized_relobj::set_local_got_offset): Likewise.
16586 (Sized_relobj::local_has_tls_got_offset): Removed.
16587 (Sized_relobj::local_tls_got_offset): Removed.
16588 (Sized_relobj::set_local_tls_got_offset): Removed.
16589 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16590 * output.cc (Output_data_got::add_global): Added got_type parameter.
16591 (Output_data_got::add_global_with_rel): Likewise.
16592 (Output_data_got::add_global_with_rela): Likewise.
16593 (Output_data_got::add_global_pair_with_rel): New function.
16594 (Output_data_got::add_global_pair_with_rela): New function.
16595 (Output_data_got::add_local): Added got_type parameter.
16596 (Output_data_got::add_local_with_rel): Likewise.
16597 (Output_data_got::add_local_with_rela): Likewise.
16598 (Output_data_got::add_local_pair_with_rel): New function.
16599 (Output_data_got::add_local_pair_with_rela): New function.
16600 (Output_data_got::add_global_tls): Removed.
16601 (Output_data_got::add_global_tls_with_rel): Removed.
16602 (Output_data_got::add_global_tls_with_rela): Removed.
16603 (Output_data_got::add_local_tls): Removed.
16604 (Output_data_got::add_local_tls_with_rel): Removed.
16605 (Output_data_got::add_local_tls_with_rela): Removed.
16606 * output.h (Output_data_got::add_global): Added got_type parameter.
16607 (Output_data_got::add_global_with_rel): Likewise.
16608 (Output_data_got::add_global_with_rela): Likewise.
16609 (Output_data_got::add_global_pair_with_rel): New function.
16610 (Output_data_got::add_global_pair_with_rela): New function.
16611 (Output_data_got::add_local): Added got_type parameter.
16612 (Output_data_got::add_local_with_rel): Likewise.
16613 (Output_data_got::add_local_with_rela): Likewise.
16614 (Output_data_got::add_local_pair_with_rel): New function.
16615 (Output_data_got::add_local_pair_with_rela): New function.
16616 (Output_data_got::add_global_tls): Removed.
16617 (Output_data_got::add_global_tls_with_rel): Removed.
16618 (Output_data_got::add_global_tls_with_rela): Removed.
16619 (Output_data_got::add_local_tls): Removed.
16620 (Output_data_got::add_local_tls_with_rel): Removed.
16621 (Output_data_got::add_local_tls_with_rela): Removed.
16622 * resolve.cc (Symbol::override_base_with_special): Removed
16623 reference to has_got_offset_ field.
16624 * symtab.cc (Symbol::init_fields): Replaced initialization
16625 of got_offset_ with got_offsets_. Removed initialization
16626 of has_got_offset_
16627 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16628 (Symbol::got_offset): Likewise.
16629 (Symbol::set_got_offset): Likewise.
16630 (Symbol::has_tls_got_offset): Removed.
16631 (Symbol::tls_got_offset): Removed.
16632 (Symbol::set_tls_got_offset): Removed.
16633 (Symbol::got_offset_): Removed.
16634 (Symbol::tls_mod_got_offset_): Removed.
16635 (Symbol::tls_pair_got_offset_): Removed.
16636 (Symbol::got_offsets_): New field.
16637 (Symbol::has_got_offset): Removed.
16638 (Symbol::has_tls_mod_got_offset): Removed.
16639 (Symbol::has_tls_pair_got_offset): Removed.
16640 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16641 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16642 member functions.
16643 (Target_x86_64::Scan::global): Likewise.
16644 (Target_x86_64::Relocate::relocate): Likewise.
16645 (Target_x86_64::Relocate::relocate_tls): Likewise.
16646
16647 2008-03-25 Ben Elliston <bje@au.ibm.com>
16648
16649 * yyscript.y: Fix spelling error in comment.
16650
16651 2008-03-24 Ian Lance Taylor <iant@google.com>
16652
16653 * options.h (class General_options): Define build_id option.
16654 * layout.h (class Layout): Declare write_build_id, create_note,
16655 create_build_id. Add build_id_note_ member.
16656 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16657 "libiberty.h", "md5.h", "sha1.h".
16658 (Layout::Layout): Initialize eh_frame_data_,
16659 eh_frame_hdr_section_, and build_id_note_.
16660 (Layout::finalize): Call create_build_id.
16661 (Layout::create_note): New function, broken out of
16662 Layout::create_gold_note.
16663 (Layout::create_gold_note): Call create_note.
16664 (Layout::create_build_id): New function.
16665 (Layout::write_build_id): New function.
16666 (Close_task_runner::run): Call write_build_id.
16667
16668 * x86_64.cc: Correct license to GPLv3.
16669
16670 2008-03-23 Ian Lance Taylor <iant@google.com>
16671
16672 * options.cc: Include "demangle.h".
16673 (parse_optional_string): New function.
16674 (parse_long_option): Handle takes_optional_argument.
16675 (parse_short_option): Update dash_z initializer. Handle
16676 takes_optional_argument.
16677 (General_options::General_options): Initialize do_demangle_.
16678 (General_options::finalize): Set do_demangle_. Handle demangling
16679 style.
16680 * options.h (parse_optional_string): Declare.
16681 (struct One_option): Add optional_arg field. Update constructor.
16682 Update call constructor calls. Add takes_optional_argument
16683 function.
16684 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16685 (DEFINE_optional_string): Define.
16686 (General_options::demangle): Change from DEFINE_bool to
16687 DEFINE_optional_string.
16688 (General_options::no_demangle): New function.
16689 (General_options::do_demangle): New function.
16690 (General_options::set_do_demangle): New function.
16691 (General_options::execstack_status_): Move definition to end of
16692 class definition.
16693 (General_options::static_): Likewise.
16694 (General_options::do_demangle_): New field.
16695 * object.cc (big_endian>::get_symbol_location_info): Call
16696 Options::do_demangle, not Options::demangle.
16697 * symtab.cc (demangle): Likewise.
16698
16699 2008-03-22 Ian Lance Taylor <iant@google.com>
16700
16701 * gold.h: Include <cstddef> and <sys/types.h>
16702 * options.h: Include <cstring>.
16703
16704 2008-03-21 Ian Lance Taylor <iant@google.com>
16705
16706 * Added source code to GNU binutils.
16707 \f
16708 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16709
16710 Copying and distribution of this file, with or without modification,
16711 are permitted in any medium without royalty provided the copyright
16712 notice and this notice are preserved.
16713
16714 Local Variables:
16715 mode: change-log
16716 left-margin: 8
16717 fill-column: 74
16718 version-control: never
16719 End:
This page took 0.554633 seconds and 5 git commands to generate.