24a3952b03e8e83e826158afe83e6571ac0d95e1
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2015-02-03 Cary Coutant <ccoutant@google.com>
2 Peter Collingbourne <pcc@google.com>
3
4 PR gold/15660
5 * archive.cc (Thin_archive_object_unlocker): New class.
6 (Archive::include_member): Unlock external members of thin archives.
7 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
8 (plugin_test_2): Likewise.
9 (plugin_test_3): Likewise.
10 (plugin_test_4): Likewise.
11 (plugin_test_5): Likewise.
12 (plugin_test_6): Likewise.
13 (plugin_test_7): Likewise.
14 (plugin_test_8): Likewise.
15 (plugin_test_9): Likewise.
16 (plugin_test_10): Likewise.
17 (plugin_test_11): New test case.
18 * testsuite/Makefile.in: Regenerate.
19 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
20 file to decide whether to claim file.
21 (all_symbols_read_hook): Likewise.
22 * testsuite/plugin_test_1.sh: Adjust expected output.
23 * testsuite/plugin_test_2.sh: Likewise.
24 * testsuite/plugin_test_3.sh: Likewise.
25 * testsuite/plugin_test_6.sh: Likewise.
26 * testsuite/plugin_test_tls.sh: Likewise.
27 * testsuite/plugin_test_11.sh: New testcase.
28
29 2015-02-03 Cary Coutant <ccoutant@google.com>
30
31 * descriptors.cc (Descriptors::open): Set artificially-low limit for
32 file descriptors when debugging enabled. Add debug output.
33 (Descriptors::release): Add debug output.
34 (Descriptors::close_some_descriptor): Likewise.
35 (Descriptors::close_all): Likewise.
36 * fileread.cc (File_read::lock): Likewise.
37 (File_read::unlock): Likewise.
38
39 2015-02-02 Cary Coutant <ccoutant@google.com>
40
41 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
42 executable output file.
43
44 2015-01-22 Han Shen <shenhan@google.com>
45
46 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
47 (Target_arm::do_plt_address_for_global): New method.
48 (Target_arm::do_plt_address_for_local): New method.
49 (Target_arm::rel_irelative_section): New method.
50 (Target_arm::make_data_plt): Add more parameters for plt ctor.
51 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
52 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
53 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
54 (Target_arm::Scan::check_non_pic): Add ifunc support.
55 (Target_arm::Scan::local): Add ifunc support.
56 (Target_arm::Scan::global): Add ifunc support.
57 (Target_arm::make_plt_section): New method.
58 (Target_arm::make_plt_entry): Change to call to make_plt_section.
59 (Target_arm::make_local_ifunc_plt_entry): New method.
60 (Target_arm::got_irelative_): New member.
61 (Target_arm::rel_irelative_): New member.
62 (Target_arm::got_section): Add creation for got_irelative_.
63 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
64 (Target_arm::Relocate::relocate): Properly set local ifunc address.
65 (Target_arm::do_dynsym_value): Properly set global ifunc address.
66 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
67 (Output_data_plt_arm::IRelative_data): New type.
68 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
69 (Output_data_plt_arm::add_entry): Add more parameters.
70 (Output_data_plt_arm::add_relocation): New method.
71 (Output_data_plt_arm::add_local_ifunc_entry): New method.
72 (Output_data_plt_arm::rel_irelative): New method.
73 (Output_data_plt_arm::entry_count): Modified.
74 (Output_data_plt_arm::address_for_global): New method.
75 (Output_data_plt_arm::address_for_local): New method.
76 gold/
77 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
78 (Output_data_plt_arm::insert_irelative_data): New method.
79 (Output_data_plt_arm::irelative_rel_): New member.
80 (Output_data_plt_arm::got_): New member.
81 (Output_data_plt_arm::got_irelative_): New member.
82 (Output_data_plt_arm::irelative_count_): New member.
83 (Output_data_plt_arm::IRelative_data_vec): New typedef.
84 (Output_data_plt_arm::irelative_data_vec_): New member.
85 (Output_data_plt_arm::do_write): Write out irelative entries.
86 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
87 more parameters to ctor.
88 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
89 more parameters to ctor.
90 * output.h (Output_data_reloc::add_local_relative): New method.
91 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
92
93 2015-01-29 Alan Modra <amodra@gmail.com>
94
95 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
96 and GOT_TLSGD to LE optimization.
97
98 2015-01-28 Cary Coutant <ccoutant@google.com>
99
100 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
101 for undef TLS symbols.
102 (Target_x86_64::Relocate::relocate_tls): Likewise.
103 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
104
105 2015-01-25 Cary Coutant <ccoutant@google.com>
106
107 * output.cc (Output_segment::set_section_addresses): Fix calculation
108 of size of relro segment.
109
110 2015-01-22 Alan Modra <amodra@gmail.com>
111
112 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
113 condition for need of ifunc plt entry.
114 (Target_powerpc::Scan::global <got relocs>): Likewise.
115
116 2015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
117
118 * mips.cc (reloc_high): Add r_sym.
119 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
120 reloc_high constructor.
121 (Mips_relocate_functions::relgot16_local): Likewise.
122 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
123 r_type to decide whether LO16 matches HI16.
124 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
125 rello16 and relgot16_local.
126
127 2015-01-09 Cary Coutant <ccoutant@google.com>
128
129 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
130 unless alignment is larger than page size.
131
132 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
133 Cary Coutant <ccoutant@google.com>
134
135 PR gold/17729
136 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
137 (DEFAULT_TARGET_X32): Set for x32.
138 * x86_64.cc (cmp_insn_32): New.
139 (lea_r10_insn_32): Likewise.
140 (lea_r11_insn_32): Likewise.
141 (cmp_insn_64): Likewise.
142 (lea_r10_insn_64): Likewise.
143 (lea_r11_insn_64): Likewise.
144 (Target_x86_64<size>::do_calls_non_split): Handle x32.
145 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
146 (check_DATA): Add split_x32 files.
147 (split_x32_[1234n].o): New targets.
148 (split_x32_[124]): New targets.
149 (split_x32_[1234r].stdout): New targets.
150 * testsuite/split_x32.sh: New file.
151 * testsuite/split_x32_1.s: Likewise.
152 * testsuite/split_x32_2.s: Likewise.
153 * testsuite/split_x32_3.s: Likewise.
154 * testsuite/split_x32_4.s: Likewise.
155 * testsuite/split_x32_n.s: Likewise.
156 * configure: Regenerated.
157 * testsuite/Makefile.in: Likewise.
158
159 2015-01-06 H.J. Lu <hongjiu.lu@intel.com>
160
161 PR gold/17809
162 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
163 x32.
164
165 2015-01-02 Alan Modra <amodra@gmail.com>
166
167 * version.cc (print_version): Just print current year.
168 * dwp.cc (print_version): Likewise.
169
170 2015-01-01 Alan Modra <amodra@gmail.com>
171
172 Update year range in copyright notice of all files.
173
174 2014-12-25 Alan Modra <amodra@gmail.com>
175
176 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
177 new enums.
178 (Target_arm::merge_object_attributes, ): Likewise.
179
180 2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
181
182 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
183 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
184 AEABI_VFP_args_vfp to check that.
185 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
186 value and replace hardcoded values by enum values.
187
188 2014-12-22 Cary Coutant <ccoutant@google.com>
189
190 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
191
192 2014-12-20 H.J. Lu <hongjiu.lu@intel.com>
193
194 PR gold/14608
195 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
196 to "return i * i * 3;".
197
198 2014-12-16 Cary Coutant <ccoutant@google.com>
199
200 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
201 (Mapfile::print_output_data): Use current_data_size() to avoid
202 assert for sections requiring postprocessing; if address is not valid,
203 print 0.
204 (Mapfile::print_output_section): Use current_data_size(); print note
205 that addresses and sizes are before compression.
206
207 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
208
209 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
210 Cast current_group_size to unsigned long when reporting error.
211
212 2014-12-10 Jing Yu <jingyu@google.com>
213
214 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
215 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
216 Update error message.
217 (Target_aarch64::do_relax): Use absolute value of option
218 stub_group_size. Replace local variable with class member
219 stub_group_size_.
220
221 2014-12-04 Alan Modra <amodra@gmail.com>
222
223 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
224 addend of PLTREL24 reloc when not generating a plt stub. Make
225 max_branch_offset an "Address".
226 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
227 (Target_powerpc::Relocate::relocate): Likewise.
228
229 2014-12-04 Alan Modra <amodra@gmail.com>
230
231 PR 17670
232 * symtab.cc (Symbol::set_undefined): Remove assertion.
233 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
234 on symbols defined in discarded sections, instead return false.
235 Rearrange params, update all callers.
236 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
237 branches to syms in discarded sections.
238 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
239 undefined and flag as discarded.
240 (Target_powerpc::Relocate::relocate): Localize variable.
241
242 2014-12-03 H.J. Lu <hongjiu.lu@intel.com>
243
244 PR gold/17675
245 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
246 * testsuite/Makefile.in: Regenerated.
247
248 2014-12-03 Alan Modra <amodra@gmail.com>
249
250 PR 17566
251 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
252 when adding dynamic relocations against section symbols.
253
254 2014-12-01 Dimitry Ivanov <dimitry@google.com>
255
256 * layout.cc (Layout::finish_dynamic_section): When '-z global'
257 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
258 * options.h (General_options): New -z option (global).
259
260 2014-12-01 Cary Coutant <ccoutant@google.com>
261
262 PR gold/17578
263 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
264 is given.
265 (Layout::create_executable_stack_info): Warn when -z noexecstack is
266 given but some inputs require executable stack.
267
268 2014-11-26 Cary Coutant <ccoutant@google.com>
269
270 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
271 .debug_str_offsets; strip .debug_gnu_pubnames and
272 .debug_gnu_pubtypes.
273 (lines_only_debug_sections): Strip all four new sections.
274
275 2014-11-26 Jing Yu <jingyu@google.com>
276
277 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
278 register to be x0 when to relax TLSDESC_LD64_LO12.
279
280 2014-11-26 Alan Modra <amodra@gmail.com>
281
282 * powerpc.cc (struct Stub_table_owner): New.
283 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
284 unsigned int vector. Update all references.
285 (powerpc_relobj::set_stub_table): Take an unsigned int param
286 rather than a Stub_table. Update callers.
287 (Powerpc_relobj::clear_stub_table): New function.
288 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
289 stub_group_size_ vars.
290 (Target_powerpc::new_stub_table): Delete.
291 (max_branch_delta): New function, extracted from..
292 (Target_powerpc::Relocate::relocate): ..here..
293 (Target_powerpc::Branch_info::make_stub): ..and here. Return
294 status on whether stub created successfully.
295 (Stub_control::Stub_control): Add "no_size_errors" param. Move
296 default sizing to..
297 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
298 reduce on relax failure.
299 (Target_powerpc::group_sections): Add "no_size_errors" param.
300 Use stub_group_size_. Set up group info in a temp vector,
301 before building Stub_table vector. Account for input sections
302 possibly already converted to relaxed sections.
303 (Stub_table::init): Delete. Merge into..
304 (Stub_table::Stub_table): ..here.
305 (Stub_table::can_reach_stub): New function.
306 (Stub_table::add_plt_call_entry): Add "from" parameter and
307 return true iff stub could be reached.
308 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
309 param too.
310 (Stub_table::clear_stubs): Add "all" param.
311
312 2014-11-26 Alan Modra <amodra@gmail.com>
313
314 * powerpc.cc (Stub_control::set_output_and_owner): New function.
315 (Target_powerpc::group_sections): Use it.
316
317 2014-11-25 Cary Coutant <ccoutant@google.com>
318
319 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
320 (Binary_to_elf::write_symbol): Add st_size parameter.
321 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
322
323 2014-11-25 Cary Coutant <ccoutant@google.com>
324
325 PR gold/17639
326 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
327 (Sized_relobj_file::do_layout): Handle deferred sections properly
328 during GC pass 1. Don't add reloc sections to deferred list twice.
329 * object.h (Sized_relobj_file::is_deferred_layout): New function.
330 (Sized_relobj_file::is_deferred_layout_): New data member.
331
332 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
333
334 PR gold/17619
335 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
336 Check PC-relative offset overflow in PLT entry.
337
338 2014-11-21 Alan Modra <amodra@gmail.com>
339
340 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
341 for undefined weaks.
342
343 2014-11-20 Alan Modra <amodra@gmail.com>
344
345 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
346 from --stub-group-size parameter divided by 1024.
347 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
348 template parameter. Update all uses.
349 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
350 has_stub_value. Set for long branches. Don't report overflow for
351 branch to undefined weak symbols. Print info message on
352 overflowing branch to stub.
353
354 2014-11-20 Alan Modra <amodra@gmail.com>
355
356 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
357
358 2014-11-13 H.J. Lu <hongjiu.lu@intel.com>
359
360 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
361 entry for R_X86_64_GOTPLT64.
362 (Target_x86_64<size>::Relocate::relocate): Update comments for
363 R_X86_64_GOTPLT64.
364
365 2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
366
367 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
368 * plugin.h: add lock definition
369
370 2014-10-29 Han Shen <shenhan@google.com>
371 Jing Yu <jingyu@google.com>
372
373 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
374 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
375 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
376 Symbol::TLS_REF.
377 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
378 method.
379 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
380 (Target_aarch64::tls_ld_to_le): New method.
381 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
382 for 64bit targets.
383 (Output_data_plt_aarch64::irelative_rel_): New data member.
384 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
385 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
386 (Output_data_plt_aarch64::add_relocation): New method.
387 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
388 offset. Add got_irelative size to got size.
389 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
390 type string with the new typename.
391 (AArch64_relocate_functions::update_adr): Replace parameter x with
392 immed.
393 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
394 (AArch64_relocate_functions::reloc_common): New method.
395 (AArch64_relocate_funcsions::rela_general): Extract common part out
396 into reloc_common method.
397 (AArch64_relocate_functions::rela_general): Likewise.
398 (AArch64_relocate_functions::pcrela_general): Likewise.
399 (AArch64_relocate_functions::adr): New method.
400 (AArch64_relocate_functions::adrp): Calculate immed before calling
401 update_adr.
402 (AArch64_relocate_functions::adrp): Likewise.
403 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
404 comparing x to 0. Calculate immed from ~x when x < 0.
405 (Target_aarch64::optimize_tls_reloc): Add new cases for
406 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
407 TLSLD_MOVW_DTPREL_G0_NC.
408 (Target_aarch64::possible_function_pointer_reloc): Implement this
409 method.
410 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
411 comment.
412 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
413 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
414 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
415 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
416 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
417 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
418 (Target_aarch64::make_plt_entry): Call add_entry with two more
419 parameters.
420 (Target_aarch64::make_local_ifunc_plt_entry): New method.
421 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
422 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
423 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
424 (Target_aarch64::Relocate::relocate_tls): Add cases for
425 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
426 TLSLD_MOVW_DTPREL_G0_NC.
427 * testsuite/icf_safe_so_test.cc: Correct test comment.
428 * testsuite/icf_safe_test.sh: Add AArch64 arch.
429
430 2014-10-22 Alan Modra <amodra@gmail.com>
431
432 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
433 thread_starter.
434
435 2014-10-18 Andreas Schwab <schwab@linux-m68k.org>
436
437 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
438
439 2014-10-17 Cary Coutant <ccoutant@google.com>
440
441 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
442 Add "typename" keyword.
443
444 2014-10-15 Han Shen <shenhan@google.com>
445 Jing Yu <jingyu@google.com>
446
447 Patch for gold aarch64 backend to support relaxation.
448 * aarch64-reloc.def: Change format.
449 * aarch64.cc (class Reloc_stub): New class.
450 (class Stub_table): New class.
451 (class AArch64_relobj): New class.
452 (class AArch64_input_section): New class.
453 (class AArch64_output_section): New class.
454 (Target_aarch64::new_stub_table): New method.
455 (Target_aarch64::new_aarch64_input_section): New method.
456 (Target_aarch64::find_aarch64_input_section): New method.
457 (Target_aarch64::scan_section_for_stubs): New method.
458 (Target_aarch64::scan_reloc_section_for_stubs): New method.
459 (Target_aarch64::relocate_stub): New method.
460 (Target_aarch64::current_target): New method.
461 (Target_aarch64::do_make_elf_object): New method.
462 (Target_aarch64::do_may_relax): New method.
463 (Target_aarch64::do_relax): New method.
464 (Target_aarch64::group_sections): New method.
465 (Target_aarch64::scan_reloc_for_stub): New method.
466 (Target_aarch64::do_make_output_section): New method.
467 (Target_aarch64::stub_tables_): New data member.
468 (Target_aarch64::aarch64_input_section_map_): New data member.
469 (AArch64_relocate_functions::maybe_apply_stub): New method.
470
471 2014-09-30 Cary Coutant <ccoutant@google.com>
472
473 PR gold/17432
474 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
475
476 2014-09-30 Kito Cheng <kito@0xlab.org>
477
478 PR gold/13597
479 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
480 hash table before sysv-style hash table.
481
482 2014-09-29 Sriraman Tallam <tmsriram@google.com>
483
484 * options.h (--pic-executable): Add negative to alias to -no-pie.
485
486 2014-09-26 Cary Coutant <ccoutant@google.com>
487
488 PR gold/16773
489 * object.cc (Sized_relobj_file): Compute value of section symbols
490 for TLS sections the same as TLS symbols.
491
492 2014-09-25 Cary Coutant <ccoutant@google.com>
493
494 PR gold/17432
495 * resolve.cc (Symbol_table::resolve): Override common placeholder
496 symbols, but adjust sizes.
497 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
498 symbols to common lists.
499
500 2014-09-24 Alan Modra <amodra@gmail.com>
501
502 * po/POTFILES.in: Regenerate.
503
504 2014-09-23 Taiju Tsuiki <tzik@google.com>
505 Cary Coutant <ccoutant@google.com>
506
507 PR gold/14860
508 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
509 on input_sections_blocker.
510 * layout.cc (Write_sections_task::locks): Unblock
511 input_sections_blocker_.
512 * layout.h (Write_sections_task::Write_sections_task): Add
513 input_sections_blocker.
514 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
515 to DEPENDENCIES.
516 * testsuite/Makefile.in: Regenerate.
517
518 2014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
519
520 * testsuite/Makefile.am (plugin_test_10): New test.
521 * testsuite/Makefile.in: Regenerate
522 * testsuite/plugin_common_test_2.c (c1): Align to 8.
523 * testsuite/plugin_test_10.sh: New file.
524
525 2014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
526
527 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
528 * resolve.cc (Symbol_table::resolve): Don't override common symbols
529 during the replacement phase.
530
531 2014-09-17 Han Shen <shenhan@google.com>
532 Jing Yu <jingyu@google.com>
533
534 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
535 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
536 * aarch64.cc (Target_aarch64): Add data members
537 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
538 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
539 constructor.
540 (Target_aarch64::do_reloc_symbol_index): New method.
541 (Target_aarch64::do_reloc_addend): New method.
542 (Target_aarch64::add_tlsdesc_info): New method.
543 (Target_aarch64::do_dynsym_value): New method.
544 (Target_aarch64::do_make_data_plt): Add new parameters: got,
545 got_irelative. Pass them to Output_data_plt_aarch64_standard.
546 (Target_aarch64::make_data_plt): Add new parameters: got,
547 got_irelative. Pass them to do_make_data_plt.
548 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
549 (Target_aarch64::Relocate:tls_gd_to_le): New method.
550 (Target_aarch64::Relocate:tls_ie_to_le): New method.
551 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
552 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
553 (Target_aarch64::got_tlsdesc_section): New method.
554 (Target_aarch64::make_local_ifunc_plt_entry): New method.
555 (Target_aarch64::define_tls_base_symbol): New method.
556 (Target_aarch64::reserve_tlsdesc_entries): New method.
557 (Target_aarch64::got_mod_index_entry): New method.
558 (Target_aarch64::rela_tlsdesc_section): New method.
559 (Target_aarch64::rela_irelative_section): New method.
560 (Target_aarch64::Tlsdesc_info): New struct.
561 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
562 relocations and tlsdesc relocations.
563 (Target_aarch64::optimize_tls_reloc): Implement method.
564 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
565 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
566 in constructor.
567 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
568 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
569 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
570 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
571 (Output_data_plt_aarch64::rela_tlsdesc): New method.
572 (Output_data_plt_aarch64::rela_irelative): New method.
573 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
574 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
575 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
576 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
577 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
578 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
579 (Output_data_plt_aarch64_standard): New member variables:
580 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
581 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
582 New parameter: got, got_irelative.
583 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
584 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
585 (Output_data_plt_aarch64::do_write): Replace got_address with
586 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
587 (AArch64_relocate_functions::update_movnz): New method.
588 (AArch64_relocate_functions): Correct format.
589 (AArch64_relocate_functions::movnz): New method.
590 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
591 before the switch. Add new cases to switch.
592 Check ie_to_le relaxation on tlsie relocations. Add code handling
593 tlsgd tlsdesc cases.
594 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
595 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
596 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
597 Call reloc_name_in_error_message to print unsupported reloc.
598 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
599 make_data_plt.
600 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
601 relocs. Fill in some more dynamic tags.
602 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
603 Skip call tls_get_addr when tlsgd is relaxed.
604 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
605 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
606 tlsdesc->ie relaxation.
607
608 2014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
609
610 * mips.cc (Target_mips_nacl): New class.
611 (Target_selector_mips_nacl): New class.
612 (target_selector_mips32): Rename from target_selector_mips32be and use
613 Target_selector_mips_nacl instead of Target_selector_mips.
614 (target_selector_mips32el): Rename from target_selector_mips32 and use
615 Target_selector_mips_nacl instead of Target_selector_mips.
616 (target_selector_mips64): Rename from target_selector_mips64be and use
617 Target_selector_mips_nacl instead of Target_selector_mips.
618 (target_selector_mips64el): Rename from target_selector_mips64 and use
619 Target_selector_mips_nacl instead of Target_selector_mips.
620 (Target_mips::mips_info): Add const attribute.
621
622 2014-09-02 Cary Coutant <ccoutant@google.com>
623
624 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
625 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
626 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
627 (Sized_incr_dynobj::do_section_name): Likewise.
628 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
629 (Sized_incr_dynobj::do_section_name): Likewise.
630 * object.h (Object::section_name): Likewise.
631 (Object::do_section_name): Likewise.
632 (Sized_relobj_file::do_section_name): Likewise.
633 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
634 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
635
636 2014-09-02 Cary Coutant <ccoutant@google.com>
637
638 PR gold/17005
639 * ehframe.cc (Fde::write): Add output_offset parameter.
640 (Cie::write): Likewise.
641 (Eh_frame::set_final_data_size): Account for offset within output
642 section.
643 (Eh_frame::do_sized_write): Likewise.
644 * ehframe.h (Fde::write): Add output_offset parameter.
645 (Cie::write): Likewise.
646 * output.cc (Output_section::Input_section_sort_entry): Remove
647 section_has_name_; add output_section_name parameter. Use
648 output section name for non-input sections.
649 (Output_section::Input_section_sort_entry::section_has_name): Remove.
650 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
651 (Output_section::Input_section_sort_compare): Remove logic for
652 sections without names.
653 (Output_section::Input_section_sort_init_fini_compare): Likewise.
654 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
655 Likewise.
656 (Output_section::Input_section_sort_section_name_compare): Likewise.
657
658 2014-08-29 Han Shen <shenhan@google.com>
659 Jing Yu <jingyu@google.com>
660
661 * aarch64-reloc-property.cc
662 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
663 reference reloc property in the table.
664 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
665 3 other entries.
666 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
667 2 new overloaded methods.
668 (Output_data_got_aarch64::do_write): Add code to write out
669 static relocs.
670 (class Output_data_got_aarch64::Static_reloc): New class to wrap
671 static relocs.
672 (Output_data_got_aarch64::static_relocs): New vector to
673 hold static relocs.
674 (Target_aarch64::TCB_SIZE): New const static memeber.
675 (Target_aarch64::tcb_size): New method.
676 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
677 (Target_aarch64::Relocate::relocate_tls): New method.
678 (Target_aarch64::Scan::local): Add code handling new reloc types.
679 (Target_aarch64::Scan::global): Add code handling new reloc types.
680
681 2014-08-13 Sriraman Tallam <tmsriram@google.com>
682
683 * options.h (-no-pie): Add option.
684
685 2014-08-08 Jing Yu <jingyu@google.com>
686 Han Shen <shenhan@google.com>
687
688 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
689 (DEFFILES): add aarch64-reloc.def.
690 (TARGETSOURCES): Add aarch64-reloc-property.cc.
691 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
692 * Makefile.in: Regenerate.
693 * aarch64-reloc-property.cc: New file.
694 * aarch64-reloc-property.h: New file.
695 * aarch64-reloc.def: New file.
696 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
697 with tab to make the format consistent.
698 (Output_data_got_aarch64::symbol_table_): New method.
699 (Target_aarch64::do_plt_address_for_global): New method.
700 (Target_aarch64::do_plt_address_for_local): New method.
701 (Target_aarch64::do_select_as_default_target): New method.
702 (Target_aarch64::do_make_data_plt): New method.
703 (Target_aarch64::make_data_plt): New method.
704 (Output_data_plt_aarch64::has_irelative_section): New method.
705 (Output_data_plt_aarch64::address_for_global): New method.
706 (Output_data_plt_aarch64::address_for_local): New method.
707 (Output_data_plt_aarch64::irelative_rel_): New parameter.
708 (Output_data_plt_aarch64::add_entry): Implement contents.
709 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
710 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
711 the got_pov entry to plt0.
712 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
713 Implement contents.
714 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
715 (AArch64_howto): New struct.
716 (aarch64_howto[]): New static const array.
717 (AArch64_relocate_functions): New class.
718 (Target_aarch64::Scan::get_reference_flags): Remove method.
719 (Target_aarch64::Scan::local): Implement to support a few relocations.
720 (Target_aarch64::Scan::global): Implement to support a few relocations.
721 (Target_aarch64::make_plt_section): Implement contents.
722 (Target_aarch64::make_plt_entry): Implement contents.
723 (Target_aarch64::do_finalize_sections): Implement contents.
724 (Target_aarch64::Relocate::relocate): Implement a few relocations.
725 (Target_aarch64::relocate_section): Implement contents.
726
727 2014-08-06 Alan Modra <amodra@gmail.com>
728
729 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
730
731 2014-08-06 Alan Modra <amodra@gmail.com>
732
733 PR 13227
734 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
735
736 2014-07-21 Sriraman Tallam <tmsriram@google.com>
737
738 * object.cc (Relobj::is_section_name_included): Add
739 ".rodata.nptl_version" to not garbage collect this section.
740
741 2014-07-08 Cary Coutant <ccoutant@google.com>
742
743 * expression.cc (struct Expression::Expression_eval_info): Add
744 new fields type_pointer, vis_pointer, and nonvis_pointer.
745 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
746 nonvis_pointer parameters. Adjust all calls.
747 (Symbol_expression::value): Update type, visibility, and nonvis bits
748 in caller.
749 * script.cc (Symbol_assignment::sized_finalize): Update type,
750 visibility, and remaining st_other bits for new symbol.
751 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
752 vis_pointer, and nonvis_pointer parameters.
753 * symtab.h (Symbol::set_type): New method.
754
755 * testsuite/Makefile.am (defsym_test): New test.
756 * testsuite/Makefile.in: Regenerate.
757 * testsuite/defsym_test.c: New file.
758 * testsuite/defsym_test.sh: New file.
759
760 2014-07-08 Cary Coutant <ccoutant@google.com>
761
762 PR gold/15639
763 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
764 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
765 (Sized_dynobj::base_read_symbols): ...new method.
766 * object.h (Sized_relobj_file::base_read_symbols): New method.
767 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
768 (Sized_relobj_file::base_read_symbols): ...new method.
769 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
770 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
771 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
772
773 2014-07-04 Alan Modra <amodra@gmail.com>
774
775 * po/POTFILES.in: Regenerate.
776
777 2014-07-02 Jing Yu <jingyu@google.com>
778
779 * aarch64.cc: New file
780 * Makefile.am (TARGETSOURCES): Add aarch64.cc
781 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
782 * Makefile.in: Regenerate.
783 * configure.tgt: Add entries for aarch64*.
784 * configure.ac: Likewise.
785 * configure: Likewise.
786
787 2014-06-27 Alan Modra <amodra@gmail.com>
788
789 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
790
791 2014-06-24 Cary Coutant <ccoutant@google.com>
792
793 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
794 sections.
795 (Dwo_file::sized_read_unit_index): Likewise.
796
797 2014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
798
799 * mips.cc: New file.
800 * Makefile.am (TARGETSOURCES): Add mips.cc
801 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
802 * configure.tgt: Add entries for mips*.
803 * configure.ac: Likewise.
804 * Makefile.in: Regenerate.
805 * configure: Likewise.
806
807 2014-06-09 Cary Coutant <ccoutant@google.com>
808
809 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
810 unit_length is within section bounds.
811
812 2014-06-09 Cary Coutant <ccoutant@google.com>
813
814 PR gold/16980
815 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
816 map.
817
818 2014-06-07 Alan Modra <amodra@gmail.com>
819
820 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
821
822 2014-06-06 Cary Coutant <ccoutant@google.com>
823
824 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
825 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
826 (Dwarf_pubnames_table::read_header): Likewise.
827 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
828 .debug_gnu_pubtypes.
829
830 2014-06-05 Joel Brobecker <brobecker@adacore.com>
831
832 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
833 * Makefile.in, configure: Regenerate.
834
835 2014-06-03 Alan Modra <amodra@gmail.com>
836
837 * powerpc.cc (addis_12_2): Define.
838 (Stub_table::do_write): Support fusion on ELFv2 stubs.
839
840 2014-06-03 Alan Modra <amodra@gmail.com>
841
842 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
843 st_other output.
844
845 2014-06-02 Alan Modra <amodra@gmail.com>
846
847 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
848 Only ignore relocs on ELFv1.
849 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
850
851 2014-05-30 Cary Coutant <ccoutant@google.com>
852
853 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
854 * testsuite/Makefile.in: Regenerate.
855 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
856
857 2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
858
859 PR gold/16945
860 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
861 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
862
863 2014-05-15 Alan Modra <amodra@gmail.com>
864
865 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
866 Compare FDE contents with DW_CFA_nop rather than 0.
867
868 2014-05-13 Sriraman Tallam <tmsriram@google.com>
869
870 * symtab.h (may_need_copy_reloc): Remove check for position independent
871 code.
872 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
873 position independence before pc absolute may_need_copy_reloc call.
874 Add check for executable output befor pc relative may_need_copy_reloc
875 call.
876 * i386.cc: Ditto.
877 * arm.cc: Ditto.
878 * sparc.cc: Ditto.
879 * tilegx.cc: Ditto.
880 * powerpc.cc: Add check for no position independence before
881 may_need_copy_reloc calls.
882 * testsuite/pie_copyrelocs_test.cc: New file.
883 * testsuite/pie_copyrelocs_shared_test.cc: New file.
884 * Makefile.am (pie_copyrelocs_test): New test.
885 * Makefile.in: Regenerate.
886
887 2014-05-08 Martin Liška <mliska@suse.cz>
888
889 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
890
891 2014-05-06 Cary Coutant <ccoutant@google.com>
892
893 PR gold/16900
894 * i386.cc (Output_data_got_plt_i386): New class.
895 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
896 parameter. Change all callers.
897 (Output_data_plt_i386::layout_): Remove.
898 (Output_data_plt_i386::got_plt_): Change type.
899 (Target_i386::got_plt_): Change type. Change all references.
900 (Target_i386::got_section): Create instance of new class.
901 (Output_data_got_plt_i386::do_write): New function.
902 * x86_64.cc (Output_data_got_plt_x86_64): New class.
903 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
904 parameter. Change all callers.
905 (Output_data_plt_x86_64::layout_): Remove.
906 (Output_data_plt_x86_64::got_plt_): Change type.
907 (Target_x86_64::got_plt_): Change type. Change all references.
908 (Target_x86_64::got_section): Create instance of new class.
909 (Output_data_got_plt_x86_64::do_write): New function.
910 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
911 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
912 class.
913
914 2014-05-05 Cary Coutant <ccoutant@google.com>
915
916 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
917 if we have pubnames/pubtypes.
918
919 2014-05-02 Cary Coutant <ccoutant@google.com>
920
921 * defstd.cc (in_segment): Define __ehdr_start here...
922 * layout.cc (Layout::finalize): ...Instead of here. Set the
923 output segment when known.
924 * resolve.cc (Symbol::override_base_with_special): Remember
925 the original binding.
926 * symtab.cc (Symbol::set_output_segment): New function.
927 (Symbol::set_undefined): New function.
928 * symtab.h (Symbol::is_weak_undefined): Check original undef
929 binding.
930 (Symbol::is_strong_undefined): New function.
931 (Symbol::set_output_segment): New function.
932 (Symbol::set_undefined): New function.
933 * target-reloc.h (is_strong_undefined): Remove.
934 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
935 Check for hidden undefs.
936 (relocate_section): Call Symbol::is_strong_undefined.
937
938 * testsuite/Makefile.am (ehdr_start_test_1)
939 (ehdr_start_test_2, ehdr_start_test_3)
940 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
941 * testsuite/Makefile.in: Regenerate.
942 * testsuite/ehdr_start_def.cc: New source file.
943 * testsuite/ehdr_start_test.cc: New source file.
944 * testsuite/ehdr_start_test.t: New linker script.
945 * testsuite/ehdr_start_test_4.sh: New shell script.
946
947 2014-04-23 Cary Coutant <ccoutant@google.com>
948
949 PR gold/16870
950 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
951
952 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
953
954 * layout.cc (Layout::include_section): Allow a target to decide
955 whether to include a section.
956 * target.h (Target::should_include_section): New function.
957 (Target::do_should_include_section): New function.
958
959 2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
960
961 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
962 inline into ...
963 (Copy_relocs::emit): ... here.
964 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
965 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
966 (Copy_reloc_entry::entries_): Change from private to protected.
967
968 2014-04-02 Sriraman Tallam <tmsriram@google.com>
969
970 * icf.cc (get_section_contents): Replace copies of reloc
971 vectors with const references.
972
973 2014-04-02 Cary Coutant <ccoutant@google.com>
974
975 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
976 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
977 * configure: Regenerate.
978 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
979 -fno-use-linker-plugin.
980 (LINK1, CXXLINK1): Add it to the link command.
981 * testsuite/Makefile.in: Regenerate.
982
983 2014-03-12 Alan Modra <amodra@gmail.com>
984
985 * Makefile.in: Regenerate.
986
987 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
988
989 * symtab.h (Symbol::set_nonvis): New function.
990
991 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
992
993 * symtab.cc (Sized_symbol<32>::init_output_data):
994 Instantiate the template.
995 (Sized_symbol<64>::init_output_data): Likewise.
996
997 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
998
999 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1000 adjust dynamic symbol value.
1001 * target.h (Target::adjust_dyn_symbol): New function.
1002 (Target::do_adjust_dyn_symbol): New function.
1003
1004 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1005
1006 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1007 Get the value of DYNAMIC_CUSTOM dynamic entry.
1008 * output.h (Output_data_dynamic::add_custom): New function.
1009 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1010 dynamic entry.
1011 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1012 * target.h (Target::dynamic_tag_custom_value): New function.
1013 (Target::do_dynamic_tag_custom_value): New function.
1014
1015 2014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1016
1017 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1018 dynsym indexes.
1019 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1020 (Target::do_has_custom_set_dynsym_indexes): New function.
1021 (Target::set_dynsym_indexes): New function.
1022 (Target::do_set_dynsym_indexes): New function.
1023
1024 2014-03-07 Alan Modra <amodra@gmail.com>
1025
1026 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1027 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1028 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1029 (Powerpc_relocate_functions::has_overflow_bitfield,
1030 overflowed): Use the above.
1031 (Target_powerpc::Relocate::relocate): Correct overflow checking
1032 for a number of relocations. Modify overflow test for 16-bit
1033 fields in instructions to signed/unsigned according to whether
1034 the field takes a signed or unsigned value.
1035
1036 2014-03-05 Alan Modra <amodra@gmail.com>
1037
1038 Update copyright years.
1039
1040 2014-03-05 Alan Modra <amodra@gmail.com>
1041
1042 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1043 R_PPC64_ADDR64_LOCAL.
1044 (Target_powerpc::Relocate::relocate): Likewise.
1045
1046 2014-03-03 Alan Modra <amodra@gmail.com>
1047
1048 * dwp.cc (print_version): Update copyright year to current.
1049
1050 2014-02-10 Alan Modra <amodra@gmail.com>
1051
1052 * po/gold.pot: Regenerate.
1053
1054 2014-02-06 Cary Coutant <ccoutant@google.com>
1055
1056 Fix problem where -u is ignored when a weak undef is seen.
1057
1058 * archive.cc (Library_base::should_include_member): Reorder
1059 code to check for -u option if a weak undef has already been seen.
1060 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1061 * testsuite/Makefile.in: Regenerate.
1062 * testsuite/weak_undef_file3.cc: New file.
1063 * testsuite/weak_undef_file4.cc: New file.
1064 * testsuite/weak_undef_test_2.cc: New file.
1065
1066 2014-02-05 Cary Coutant <ccoutant@google.com>
1067
1068 Fix issues with gold undefined symbol diagnostics.
1069
1070 PR binutils/15435
1071 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1072 check to here.
1073 * target-reloc.h (is_strong_undefined): New function.
1074 (relocate_section): Move undef vtable symbol check from here.
1075 Check for is_strong_undefined.
1076
1077 2014-02-05 Cary Coutant <ccoutant@google.com>
1078
1079 Fix problems with the --dynamic-list option.
1080
1081 PR gold/13577
1082 * options.cc (General_options::parse_dynamic_list):
1083 Set have_dynamic_list_.
1084 (General_options::General_options): Initialize have_dynamic_list_.
1085 (General_options::finalize): Turn off -Bsymbolic and
1086 -Bsymbolic-functions if --dynamic-list provided.
1087 * options.h (General_options::have_dynamic_list): New function.
1088 (General_options::have_dynamic_list_): New data member.
1089 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1090 correctly.
1091
1092 PR gold/16530
1093 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1094 in --dynamic-list, mark it.
1095
1096 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1097 (dynamic_list_2): New test case.
1098 * testsuite/Makefile.in: Regenerate.
1099 * testsuite/dynamic_list_2.cc: New file.
1100 * testsuite/dynamic_list_2.t: New file.
1101 * testsuite/dynamic_list_lib1.cc: New file.
1102 * testsuite/dynamic_list_lib2.cc: New file.
1103 * testsuite/gc_dynamic_list_test.c: New file.
1104 * testsuite/gc_dynamic_list_test.sh: New file.
1105 * testsuite/gc_dynamic_list_test.t: New file.
1106
1107 2014-01-28 Cary Coutant <ccoutant@google.com>
1108
1109 Add .gdb_index version 7 support.
1110
1111 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1112 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1113 debug sections.
1114 (Dwarf_ranges_table::read_ranges_table): Likewise.
1115 (Dwarf_pubnames_table::read_section): Check for GNU-style
1116 sections, and for compressed debug sections.
1117 (Dwarf_pubnames_table::read_header): Compute end address of table.
1118 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1119 for end of list by offset, not by offset == 0.
1120 (Dwarf_info_reader::do_read_string_table): Check for compressed
1121 debug sections.
1122 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1123 Initialize new data members.
1124 (Dwarf_pubnames_table::next_name): return flag_byte.
1125 (Dwarf_pubnames_table::end_of_table_): New data member.
1126 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1127 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1128 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1129 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1130 read skeleton type unit DIEs.
1131 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1132 (Gdb_index::do_write): Write flag_byte.
1133 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1134 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1135 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1136 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1137
1138 2014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1139
1140 * version.cc (print_version): Update copyright year to 2014.
1141
1142 2013-12-19 Dimitry Andric <dimitry@andric.com>
1143
1144 * stringpool.cc (Stringpool_template::reserve): Add
1145 HAVE_UNORDERED_MAP case.
1146 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1147
1148 2013-12-18 Cary Coutant <ccoutant@google.com>
1149
1150 * configure.ac: Check for <unordered_set> and <unordered_map>.
1151 * config.in: Regenerate.
1152 * configure: Regenerate.
1153 * system.h: Use <unordered_set> and <unordered_map> if available.
1154
1155 2013-12-10 Roland McGrath <mcgrathr@google.com>
1156
1157 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1158 with $(INSTALL_PROGRAM_ENV).
1159 * Makefile.in: Regenerate.
1160
1161 2013-11-22 Cary Coutant <ccoutant@google.com>
1162
1163 * configure.ac: Add check for which library is needed for
1164 dlopen.
1165 * configure: Regenerate.
1166
1167 2013-11-22 Cary Coutant <ccoutant@google.com>
1168
1169 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1170 assembler.
1171 * testsuite/Makefile.in: Regenerate.
1172
1173 2013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1174
1175 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1176 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1177 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1178 (Target_x86_64<size>::Scan::local): Likewise.
1179 (Target_x86_64<size>::Scan::global): Likewise.
1180 (Target_x86_64<size>::Relocate::relocate): Likewise.
1181 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1182 Likewise.
1183 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1184 R_X86_64_PC32_BND.
1185
1186 * testsuite/Makefile.am (check_PROGRAMS): Add
1187 exception_x86_64_bnd_test.
1188 (exception_x86_64_bnd_test_SOURCES): New macro.
1189 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1190 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1191 (exception_x86_64_bnd_test_LDADD): Likewise.
1192 (exception_x86_64_bnd_1.o): New rule.
1193 (exception_x86_64_bnd_2.o): Likewise.
1194 * testsuite/Makefile.in: Regenerated.
1195
1196 2013-11-15 Alan Modra <amodra@gmail.com>
1197
1198 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1199 accessor.
1200 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1201 Only call ppc64_local_entry_offset for 64-bit. Restrict
1202 symval_for_branch lookup to ELFv1.
1203 (Stub_table::add_plt_call_entry): Use unsigned int off.
1204 (Output_data_glink::Address, invalid_address): New.
1205 (Output_data_glink::add_eh_frame): Move out of line. Add
1206 support for ELFv2.
1207 (Output_data_glink::add_global_entry, find_global_entry,
1208 global_entry_address): New functions.
1209 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1210 ge_size): New variables.
1211 (Output_data_glink::set_final_data_size): Add global entry
1212 stub sizing.
1213 (Output_data_glink::do_write): Write global entry stubs.
1214 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1215 parameter. Return true for ELFv2. Adjust callers.
1216 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1217 ELFv1. Similarly for ifunc and dynamic relocation processing
1218 specific to ELFv1. Recognize that symbols are defined on
1219 their plt entries for ELFv2.
1220 (Target_powerpc::symval_for_branch): Assert if called for
1221 ELFv2 or ppc32.
1222 (Target_powerpc::Relocate::relocate): Use global entry plt
1223 stub for symbol value if such exists on ELFv2.
1224 (Target_powerpc::Relocate::relocate): Don't call
1225 symval_for_branch when ELFv2. Do adjust for local entry
1226 offset when ELFv2.
1227 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1228 plt stub for ELFv2.
1229 (Target_powerpc::do_plt_address_for_global): Similarly.
1230
1231 2013-11-14 Cary Coutant <ccoutant@google.com>
1232
1233 Revert patch -- this did not fix the problem, and there is
1234 no race there.
1235
1236 2013-11-14 Cary Coutant <ccoutant@google.com>
1237
1238 PR gold/14860
1239 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1240 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1241 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1242 updating fde_offsets_.
1243 (Eh_frame_hdr::lock_): New data member.
1244
1245 2013-11-14 Cary Coutant <ccoutant@google.com>
1246
1247 * dwp.cc (Dwo_file_entry): New type.
1248 (File_list): Use Dwo_file_entry.
1249 (Dwo_file::verify): New function.
1250 (Dwo_file::verify_dwo_list): New function.
1251 (Dwo_file::sized_verify_dwo_list): New function.
1252 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1253 list.
1254 (Dwp_options): New enum type.
1255 (dwp_options): Add --verify-only.
1256 (usage): Likewise.
1257 (main): Likewise.
1258 * dwp.h (gold_info): Add declaration.
1259
1260 2013-11-14 Cary Coutant <ccoutant@google.com>
1261
1262 PR gold/14860
1263 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1264 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1265 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1266 updating fde_offsets_.
1267 (Eh_frame_hdr::lock_): New data member.
1268
1269 2013-11-06 Cary Coutant <ccoutant@google.com>
1270
1271 PR gold/15758
1272 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1273 before reloc sections.
1274
1275 2013-11-04 Alan Modra <amodra@gmail.com>
1276
1277 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1278 (Symbol::needs_dynamic_reloc): Test new flag.
1279 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1280 (Target_powerpc::Scan::get_reference_flags): Add target param.
1281 Return FUNC_DESC_ABI for 64-bit ELFv1.
1282 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1283 call.
1284 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1285 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1286
1287 2013-10-31 Cary Coutant <ccoutant@google.com>
1288
1289 Restore support for dwp v2 DWARF package file format.
1290
1291 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1292 tu_length parameter. Adjust all callers.
1293 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1294 * dwp.cc: Include dwarf.h.
1295 (Section_bounds): New struct type.
1296 (Unit_set): New struct type.
1297 (Dwo_file::Dwo_file): Initialize new data member.
1298 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1299 Combine and rename to...
1300 (Dwo_file::read_unit_index): ...this.
1301 (Dwo_file::sized_read_compunit_index)
1302 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1303 (Dwo_file::sized_read_unit_index): ...this.
1304 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1305 parameters; add section_id parameter.
1306 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1307 (Dwo_file::add_unit_set): ...this.
1308 (Dwo_file::shndx_map_): Remove.
1309 (Dwo_file::sect_offsets_): New data member.
1310 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1311 (Dwp_output_file::add_section): Rename to...
1312 (Dwp_output_file::add_contribution): ...this.
1313 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1314 (Dwp_output_file::add_tu_set): Likewise.
1315 (Dwp_output_file::Contribution): New type.
1316 (Dwp_output_file::Section::contributions): New data member.
1317 (Dwp_output_file::Cu_or_tu_set): Remove.
1318 (Dwp_output_file::Section::Section): New ctor.
1319 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1320 (Dwp_output_file::Dwp_index::Section_table): New type.
1321 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1322 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1323 parameter.
1324 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1325 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1326 (Dwp_output_file::Dwp_index::section_table): New member function.
1327 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1328 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1329 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1330 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1331 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1332 (Dwp_output_file::Dwp_index::section_table_): New data member.
1333 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1334 (Dwp_output_file::add_output_section): New member function.
1335 (Dwp_output_file::write_new_section): New member function.
1336 (Dwp_output_file::write_contributions): New member function.
1337 (Dwp_output_file::section_id_map_): New data member.
1338 (class Dwo_id_info_reader): Remove.
1339 (class Unit_reader): New class.
1340 (get_dwarf_section_name): New function.
1341 (Dwo_file::read_executable): Adjust initializations of class data.
1342 (Dwo_file::read): Add support for v2 package file format.
1343 (Dwo_file::read_unit_index): Likewise.
1344 (Dwo_file::sized_read_unit_index): Likewise.
1345 (Dwo_file::copy_section): Likewise.
1346 (Dwo_file::add_unit_set): Likewise.
1347 (Dwp_output_file::add_output_section): Likewise.
1348 (Dwp_output_file::add_contribution): Likewise.
1349 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1350 for empty slot.
1351 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1352 file format.
1353 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1354 slot.
1355 (Dwp_output_file::initialize): Remove unused function.
1356 (Dwp_output_file::finalize): Add support for v2 package file format.
1357 (Dwp_output_file::write_index): Likewise.
1358 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1359 function prototype.
1360
1361 2013-10-31 Cary Coutant <ccoutant@google.com>
1362
1363 * configure.ac: Fix check for -fmerge-constants.
1364 * configure.ac: Regenerate.
1365
1366 2013-10-30 Roland McGrath <mcgrathr@google.com>
1367
1368 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1369 Correct 9-byte nop sequence to match what the assembler generates.
1370
1371 2013-10-30 Alan Modra <amodra@gmail.com>
1372
1373 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1374 ppc64_local_entry_offset, ppc64_local_entry_offset,
1375 do_read_symbols): New functions.
1376 (Powerpc_relobj::e_flags_, st_other_): New vars.
1377 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1378 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1379 (Powerpc_relobj::e_flags_): New var.
1380 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1381 and adjust for ELFv2.
1382 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1383 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1384 (Powerpc_dynobj::do_find_special_sections): Likewise.
1385 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1386 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1387 to ELFv2 local entry.
1388 (Target_powerpc::do_relax): No thread safe barriers needed for
1389 ELFv2.
1390 (Output_data_plt_powerpc::initial_plt_entry_size_,
1391 plt_entry_size): Delete. Replace all uses with
1392 first_plt_entry_offset() and plt_entry_size().
1393 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1394 reserved_size parm. Update callers.
1395 (Output_data_plt_powerpc::entry_count): Update.
1396 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1397 and use Target_powerpc::first_plt_entry_offset().
1398 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1399 rename to plt_entry_size.
1400 (Output_data_plt_powerpc::add_ifunc_entry,
1401 add_local_ifunc_entry): Adjust reloc for ELFv2.
1402 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1403 (glink_eh_frame_fde_64v2): New.
1404 (Stub_table::plt_call_size): Support ELFv2 sizing.
1405 (Output_data_glink::add_eh_frame): Use the new FDE.
1406 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1407 (Stub_table::do_write): Write ELFv2 stubs and glink.
1408 (Target_powerpc::Relocate::relocate): Replaces nop after call
1409 with ld 2,24(1) and adjust local offset destination for ELFv2.
1410
1411 2013-10-30 Alan Modra <amodra@gmail.com>
1412
1413 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1414 (Target_powerpc::Scan::global, local): Likewise.
1415 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1416 on all ppc64 @h and @ha relocs.
1417
1418 2013-10-14 Alan Modra <amodra@gmail.com>
1419
1420 * output.h (Output_data_got::add_constant): Tidy.
1421 (Output_data_got::add_constant_pair): New function.
1422 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1423 methods used so as to first call reserve_ent().
1424
1425 2013-10-11 Roland McGrath <mcgrathr@google.com>
1426
1427 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1428 add_got_entry and add_got_entry_pair.
1429
1430 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1431 (HAVE_PUBNAMES): Likewise.
1432 * configure: Regenerate.
1433
1434 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1435 * testsuite/Makefile.in: Regenerate.
1436
1437 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1438 Remove const from declaration.
1439 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1440 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1441 * output.h (Output_file_header): Remove const from member target_
1442 and corresponding constructor argument.
1443 * output.cc (Output_file_header::Output_file_header): Update prototype.
1444 (Output_file_header::do_sized_write): Use this->target_ in place
1445 of parameters()->target().
1446
1447 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1448
1449 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1450 * configure: Regenerate.
1451 * Makefile.in: Regenerate.
1452 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1453 * testsuite/merge_string_literals_2.c: Likewise.
1454 * testsuite/Makefile.am
1455 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1456 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1457 literal -fmerge-constants.
1458 * testsuite/Makefile.in: Regenerate.
1459
1460 * i386.cc (Target_i386): Remove unused member dynbss_.
1461 * arm.cc (Target_arm): Likewise.
1462 * powerpc.cc (Target_powerpc): Likewise.
1463 * sparc.cc (Target_sparc): Likewise.
1464 * tilegx.cc (Target_tilegx): Likewise.
1465 * x86_64.cc (Target_x86_64): Likewise.
1466 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1467 type_signature_, type_offset_.
1468 * plugin.h (Plugin_hook): Remove unused member layout_.
1469 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1470 mapfile_.
1471 (Read_member): Remove unused members input_objects_, symtab_,
1472 mapfile_, layout_.
1473 (Check_library): Remove unused member symtab_.
1474 * archive.h (Lib_group): Remove unused member lib_.
1475 * archive.cc (Lib_group::Lib_group): Update initializer.
1476 * incremental.h (Incremental_binary): Remove unused member target_.
1477 (Incremental_script_entry): Removed unused member script_.
1478 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1479 * icf.h (Icf): Remove unused member num_tracked_relocs.
1480
1481 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1482 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1483 its only use.
1484 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1485
1486 * archive.h: Use struct rather than class for forward declaration
1487 of Read_symbols_data.
1488
1489 2013-10-07 Cary Coutant <ccoutant@google.com>
1490
1491 PR gold/16010
1492 * testsuite/Makefile.am (icf_test): Fix dependencies.
1493 (icf_safe_test): Likewise.
1494 (icf_safe_so_test): Likewise.
1495 (large_symbol_alignment): Add empty _LDADD rule.
1496 * testsuite/Makefile.in: Regenerate.
1497
1498 2013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1499
1500 PR gold/15927
1501 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1502 relocation for R_X86_64_32 on x32.
1503
1504 2013-08-27 Roland McGrath <mcgrathr@google.com>
1505
1506 * output.cc (Output_segment::set_section_addresses): Take new
1507 Target* argument. If target->isolate_execinstr() and the segment
1508 is executable and starts at a target->abi_pagesize() boundary,
1509 pad its end out to a target->abi_pagesize() boundary with code fill.
1510 * output.h (Output_segment::set_section_addresses): Update decl.
1511 * layout.h (Layout::check_output_data_for_reset_values): Take new
1512 argument RELAX_OUTPUTS.
1513 (Layout): New member relax_output_list_.
1514 (Layout::add_relax_output): New method.
1515 * layout.cc (Layout::Layout): Update constructor.
1516 (Layout::reset_relax_output): New method.
1517 (Layout::clean_up_after_relaxation): Call it.
1518 (Layout::prepare_for_relaxation): Update caller.
1519 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1520 Call reset_relax_output before re-processing segments for
1521 isolate_execinstr case.
1522 (Layout::write_data): Handle relax_output_list_.
1523 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1524 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1525
1526 2013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1527
1528 PR binutils/15834
1529 * object.h: Fix typos.
1530
1531 2013-08-16 Roland McGrath <mcgrathr@google.com>
1532
1533 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1534 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1535
1536 2013-08-07 Cary Coutant <ccoutant@google.com>
1537
1538 Revert support for v2 DWP files:
1539
1540 2013-03-01 Cary Coutant <ccoutant@google.com>
1541
1542 Add dwp support for v2 DWARF package file format.
1543 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1544 tu_length parameter. Adjust all callers.
1545 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1546 * dwp.cc: Include dwarf.h.
1547 (Section_bounds): New struct type.
1548 (Unit_set): New struct type.
1549 (Dwo_file::Dwo_file): Initialize new data member.
1550 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1551 Combine and rename to...
1552 (Dwo_file::read_unit_index): ...this.
1553 (Dwo_file::sized_read_compunit_index)
1554 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1555 (Dwo_file::sized_read_unit_index): ...this.
1556 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1557 parameters; add section_id parameter.
1558 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1559 (Dwo_file::add_unit_set): ...this.
1560 (Dwo_file::shndx_map_): Remove.
1561 (Dwo_file::sect_offsets_): New data member.
1562 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1563 (Dwp_output_file::add_section): Rename to...
1564 (Dwp_output_file::add_contribution): ...this.
1565 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1566 (Dwp_output_file::add_tu_set): Likewise.
1567 (Dwp_output_file::Contribution): New type.
1568 (Dwp_output_file::Section::contributions): New data member.
1569 (Dwp_output_file::Cu_or_tu_set): Remove.
1570 (Dwp_output_file::Section::Section): New ctor.
1571 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1572 (Dwp_output_file::Dwp_index::Section_table): New type.
1573 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1574 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1575 parameter.
1576 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1577 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1578 (Dwp_output_file::Dwp_index::section_table): New member function.
1579 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1580 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1581 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1582 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1583 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1584 (Dwp_output_file::Dwp_index::section_table_): New data member.
1585 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1586 (Dwp_output_file::add_output_section): New member function.
1587 (Dwp_output_file::write_new_section): New member function.
1588 (Dwp_output_file::write_contributions): New member function.
1589 (Dwp_output_file::section_id_map_): New data member.
1590 (class Dwo_id_info_reader): Remove.
1591 (class Unit_reader): New class.
1592 (get_dwarf_section_name): New function.
1593 (Dwo_file::read_executable): Adjust initializations of class data.
1594 (Dwo_file::read): Add support for v2 package file format.
1595 (Dwo_file::read_unit_index): Likewise.
1596 (Dwo_file::sized_read_unit_index): Likewise.
1597 (Dwo_file::copy_section): Likewise.
1598 (Dwo_file::add_unit_set): Likewise.
1599 (Dwp_output_file::add_output_section): Likewise.
1600 (Dwp_output_file::add_contribution): Likewise.
1601 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1602 for empty slot.
1603 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1604 file format.
1605 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1606 slot.
1607 (Dwp_output_file::initialize): Remove unused function.
1608 (Dwp_output_file::finalize): Add support for v2 package file format.
1609 (Dwp_output_file::write_index): Likewise.
1610 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1611 function prototype.
1612
1613 2013-07-31 Cary Coutant <ccoutant@google.com>
1614
1615 * object.cc (Sized_relobj::do_output_section_address): New function.
1616 (Sized_relobj): Instantiate explicitly.
1617 * object.h (Object::output_section_address): New function.
1618 (Object::do_output_section_address): New function.
1619 (Sized_relobj::do_output_section_address): New function.
1620 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1621
1622 2013-07-30 Cary Coutant <ccoutant@google.com>
1623 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1624
1625 * parameters.cc (Parameters::entry): Return target-specific entry
1626 symbol name.
1627 * target.h (Target::entry_symbol_name): New function.
1628 (Target_info::entry_symbol_name): New data member.
1629
1630 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1631 * i386.cc (Target_i386::i386_info): Likewise.
1632 (Target_i386_nacl::i386_nacl_info): Likewise.
1633 * sparc.cc (Target_sparc::sparc_info): Likewise.
1634 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1635 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1636 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1637 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1638
1639 2013-07-22 Sterling Augustine <saugustine@google.com>
1640
1641 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1642 Convert parameter shndx to local variable. Add parameters symtab
1643 and symtab_size. Scan over section names. Find relocation
1644 section corresponding to current section. Create and initialize
1645 reloc_mapper_ and reloc_type_.
1646 (Dwarf_pubnames_table::read_header): Add assertion. Change
1647 unit_length to off_t. Initialize member unit_length_. Fill in field
1648 cu_offset_.
1649 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1650 Initialize new fields unit_length_ and cu_offset_.
1651 (Dwarf_pubnames_table::read_section): Update prototype.
1652 (Dwarf_pubnames_table::cu_offset): New member function.
1653 (Dwarf_pubnames_table::subsection_size): Likewise.
1654 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1655 New fields.
1656 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1657 member functions public.
1658 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1659 Update comment. Rework logic. Move repeated parts to...
1660 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1661 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1662 pubtypes_table_, and stmt_list_offset.
1663 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1664 Gdb_index::find_pubtype_offset,
1665 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1666 (Gdb_index::pubnames_read): Update prototype and rework logic.
1667 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1668 Forward declare.
1669 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1670 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1671 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1672 Gdb_index::map_pubtable_to_dies):
1673 Declare functions.
1674 (Gdb_index::pubnames_read): Update declaration.
1675 (Gdb_index::Pubname_offset_map): New type.
1676 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1677 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1678 Gdb_index::stmt_list_offset): Declare.
1679 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1680 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1681 Gdb_index::pubtypes_offset_): Remove.
1682
1683 2013-07-19 Roland McGrath <mcgrathr@google.com>
1684
1685 * options.h (General_options): Add -Trodata-segment option.
1686 * parameters.cc (Parameters::check_rodata_segment): New function.
1687 (Parameters::set_target_once): Call it.
1688 * parameters.h (Parameters): Declare it (private member function).
1689 * layout.cc (load_seg_unusable_for_headers): New function, broken
1690 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1691 then validate rodata segment rather than text segment.
1692 (relaxation_loop_body): Call that.
1693 (is_text_segment): New function. Don't admit a non-executable
1694 segment if TARGET->isolate_execinstr().
1695 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1696
1697 2013-07-15 Shawn Landden <shawnlandden@gmail.com>
1698
1699 PR gold/15070
1700 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1701 * nacl.h (Sniff_file::View::View): Request aligned view.
1702
1703 2013-07-11 Cary Coutant <ccoutant@google.com>
1704
1705 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1706 correct BRLT entry size.
1707
1708 2013-07-03 Alan Modra <amodra@gmail.com>
1709
1710 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1711 comment.
1712
1713 2013-07-01 Cary Coutant <ccoutant@google.com>
1714
1715 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1716 reloc_type_.
1717 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1718 (Dwarf_ranges_table::lookup_reloc): New function.
1719 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1720 reloc_type_.
1721 (Dwarf_ranges_table::lookup_reloc): New function.
1722 (Dwarf_ranges_table::reloc_type_): New data member.
1723
1724 2013-06-27 Jing Yu <jingyu@google.com>
1725
1726 PR gold/15662
1727 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1728 function.
1729 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1730 (Target_powerpc::do_relax): Call the above.
1731
1732 2013-06-27 Cary Coutant <ccoutant@google.com>
1733
1734 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1735 on garbage collected .opd section.
1736
1737 2013-06-27 Alan Modra <amodra@gmail.com>
1738
1739 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1740 is non-zero.
1741 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1742 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1743
1744 2013-06-14 Cary Coutant <ccoutant@google.com>
1745
1746 * resolve.cc (Symbol::override_base): Don't override st_type
1747 from plugin placeholder symbols.
1748 (Symbol_table::resolve): Likewise.
1749 (Symbol_table::should_override): Don't complain about TLS mismatch
1750 if the TO symbol is a plugin placeholder.
1751 * testsuite/Makefile.am (plugin_test_tls): New test.
1752 * testsuite/Makefile.in: Regenerate.
1753 * testsuite/plugin_test_tls.sh: New test script.
1754 * testsuite/two_file_test_2_tls.cc: New test source.
1755 * testsuite/two_file_test_tls.cc: New test source.
1756
1757 2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1758
1759 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1760 the maximum segment alignment is larger than the page size.
1761 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1762 correctly aligns the symbols with large alignemnt.
1763 * testsuite/Makefile.in: Regenerate.
1764 * testsuite/large_symbol_alignment.cc: New file.
1765
1766 2013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1767 Sriraman Tallam <tmsriram@google.com>
1768
1769 * options.h (sort_section): New option.
1770 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1771 Rename from Input_section_sort_section_name_special_ordering_compare.
1772 (Input_section_sort_section_name_compare): New struct.
1773 * output.cc (Output_section::Input_section_sort_section_name_compare::
1774 operator()): New function.
1775 (Output_section::sort_attached_input_sections): Use new sort function
1776 for .text if --sort-section=name is specified.
1777 * layout.cc (Layout::make_output_section):
1778 Add sorting by name when --sort-section=name is specified.
1779 * testsuite/Makefile.am (text_section_grouping): Test option
1780 --sort-section=name.
1781 * testsuite/Makefile.in: Regenerate.
1782 * testsuite/section_sorting_name.cc: New file.
1783 * testsuite/section_sorting_name.sh: New file.
1784
1785 2013-05-21 Cary Coutant <ccoutant@google.com>
1786
1787 * symtab.h (Symbol::is_cxx_vtable): New function.
1788 * target-reloc.h (relocate_section): Check for vtable symbol.
1789 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1790 * testsuite/Makefile.in: Regenerate.
1791 * testsuite/missing_key_func.cc: New test source.
1792 * testsuite/missing_key_func.sh: New test script.
1793
1794 2013-05-21 Cary Coutant <ccoutant@google.com>
1795
1796 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1797 type of enclosing symbol.
1798 (Relocate_info::location): Check symbol type when describing symbol.
1799 * object.h (Symbol_location_info): Remove unused line_number;
1800 add enclosing_symbol_type.
1801 * testsuite/debug_msg.sh: Adjust expected output.
1802
1803 2013-05-13 Cary Coutant <ccoutant@google.com>
1804
1805 * configure.ac: Export DEFAULT_TARGET.
1806 * configure: Regenerate.
1807 * Makefile.in: Regenerate.
1808 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1809 * testsuite/Makefile.in: Regenerate.
1810 * testsuite/debug_msg.sh: Delete duplicate tests.
1811 Don't check undef_int error message match for powerpc where the
1812 source file and line number aren't available.
1813
1814 2013-05-10 Roland McGrath <mcgrathr@google.com>
1815
1816 * options.h (General_options): Add --rosegment-gap option.
1817 * options.cc (finalize): --rosegment-gap implies --rosegment.
1818 * layout.cc (set_segment_offsets): Let user option override
1819 target->rosegment_gap().
1820
1821 2013-05-10 Roland McGrath <mcgrathr@google.com>
1822
1823 * options.h (General_options): Remove leading space from help
1824 messages for -nostdlib and --rosegment.
1825
1826 2013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1827
1828 PR ld/15365
1829 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1830
1831 2013-05-03 Alan Modra <amodra@gmail.com>
1832
1833 * merge.cc (Output_merge_string::do_add_input_section): Correct
1834 scan for number of strings. Rename vars to avoid shadowing.
1835 Include missing terminator in input_size_.
1836
1837 2013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1838
1839 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1840 Restore empty string handling.
1841
1842 2013-05-01 Cary Coutant <ccoutant@google.com>
1843
1844 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1845 uninitialized warning.
1846
1847 2013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1848
1849 * output.cc (Output_section::add_merge_input_section): Allow
1850 to merge sections if the alignment is more than character size.
1851 * merge.h (Output_merge_string::Output_merge_string): Remove
1852 assert.
1853 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1854 only not-null strings. Check the alignment of strings.
1855 * stringpool.h
1856 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1857 alignment as the argument.
1858 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1859 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1860 Align non-zero length strings according to the addralign_.
1861 (Stringpool_template<Stringpool_char>::set_string_offsets):
1862 Updating offsets according to the given alignment.
1863 * testsuite/Makefile.am (text_section_grouping): Test if string
1864 literals are getting merged.
1865 * testsuite/Makefile.in: Regenerate.
1866 * testsuite/merge_string_literals_1.c: New file.
1867 * testsuite/merge_string_literals_2.c: Ditto.
1868 * testsuite/merge_string_literals.sh: Ditto.
1869
1870 2013-04-26 Ian Lance Taylor <iant@google.com>
1871
1872 * target-reloc.h (relocate_section): If the reloc offset is out of
1873 range, pass VIEW as NULL to relocate.relocate.
1874 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1875 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1876 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1877 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1878 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1879 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1880
1881 2013-04-26 Geoff Pike <gpike@chromium.org>
1882
1883 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1884 * layout.cc (Hash_task): New class.
1885 (Layout::queue_build_id_tasks): New function.
1886 (Layout::write_build_id): Handle single-thread portion of build ID
1887 computation. (In some cases, all of it is single-threaded.) Replace
1888 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1889 functionality in fewer lines of code.
1890 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1891 * options.h (General_options): make "--build-id" default to tree
1892 rather than sha1. Add two new options related to --build-id=tree:
1893 --build-id-chunk-size-for-treehash and
1894 --build-id-min-file-size-for-treehash.
1895 * Makefile.am: add testing of --build-id=tree and related new options
1896 (these tests will be invoked by "make check").
1897 * Makefile.in: Regenerate.
1898
1899 2013-04-25 Alan Modra <amodra@gmail.com>
1900
1901 * configure.tgt: Add powerpcle and powerpc64le.
1902
1903 2013-04-22 Alan Modra <amodra@gmail.com>
1904
1905 PR gold/15355
1906 * layout.cc (Layout::segment_precedes): Allow more than one
1907 segment with the same type and flags.
1908
1909 2013-04-15 Cary Coutant <ccoutant@google.com>
1910
1911 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1912 allocate space in file for BSS sections.
1913
1914 2013-04-15 Cary Coutant <ccoutant@google.com>
1915
1916 * script-sections.cc (Orphan_output_section): Reset address
1917 to zero after each orphaned section for relocatable links.
1918
1919 2013-04-15 Cary Coutant <ccoutant@google.com>
1920
1921 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1922 section starting address for relocatable link.
1923 * testsuite/Makefile.am (script_test_11): New test.
1924 * testsuite/Makefile.in: Regenerate.
1925 * testsuite/script_test_11.c: New source file.
1926 * testsuite/script_test_11.t: New linker script.
1927
1928 2013-04-13 Alan Modra <amodra@gmail.com>
1929
1930 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1931 owner when sections are not adjacent and exceed group size.
1932 (Target_powerpc::group_sections): Handle corner case.
1933 (Target_powerpc::Branch_info::make_stub): Handle case where
1934 stub table doesn't exist due to branches in non-exec sections.
1935 (Target_powerpc::Relocate::relocate): Likewise.
1936
1937 2013-04-11 Alan Modra <amodra@gmail.com>
1938
1939 PR gold/15354
1940 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1941 .branch_lt to match bfd ld. Adjust comments throughout file.
1942
1943 2013-04-04 Ian Lance Taylor <iant@google.com>
1944
1945 GCC PR c++/56840
1946 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1947 sections before checking whether they are included in the link.
1948
1949 2013-03-29 Sriraman Tallam <tmsriram@google.com>
1950
1951 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1952 object before calling the plugin claim_file handler. Pass the elf
1953 object of the archive to the plugin. Delete the elf object if the
1954 plugin claims the file.
1955
1956 2013-03-21 Alan Modra <amodra@gmail.com>
1957
1958 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1959 segment when omagic.
1960
1961 2013-03-21 Alan Modra <amodra@gmail.com>
1962
1963 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1964 comparison warning.
1965 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1966 uninitialized" warning.
1967
1968 2013-03-20 Alan Modra <amodra@gmail.com>
1969
1970 * symtab.h (Symbol::clear_version): New function.
1971 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1972 is_needed by weak references. Clear version for symbols defined
1973 in as-needed objects that are not needed.
1974
1975 2013-03-15 Alan Modra <amodra@gmail.com>
1976
1977 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1978 static and public. Add report_err param. Return false for data refs.
1979 (Target_powerpc::rela_dyn_section): New overloaded function.
1980 (Target_powerpc::plt_, iplt_): Elucidate.
1981 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1982 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1983 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1984 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1985 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1986 push_branch and make_plt_entry for ifunc syms when
1987 reloc_needs_plt_for_ifunc.
1988 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1989 for ifunc unless reloc_needs_plt_for_ifunc.
1990
1991 2013-03-15 Alan Modra <amodra@gmail.com>
1992
1993 * gc.h (gc_process_relocs): Don't look through function descriptors.
1994 * icf.cc (get_section_contents): Do so here instead.
1995
1996 2013-03-13 Alan Modra <amodra@gmail.com>
1997
1998 * powerpc.cc (is_branch_reloc): Forward declare.
1999 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2000 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2001 false for 64-bit, true for 32-bit non-branch relocs.
2002 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2003 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2004 nm output.
2005 (icf_safe_test): Generate linker map file as well as nm output.
2006 (icf_safe_so_test): Likewise.
2007 * testsuite/Makefile.in: Regenerate.
2008 * testsuite/icf_test.sh: Parse linker map file to determine
2009 section folding.
2010 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2011 * testsuite/icf_safe_so_test.sh: Likewise.
2012 (X86_32_or_ARM_specific_safe_fold): Merge into..
2013 (arch_specific_safe_fold): ..this.
2014 (X86_64_specific_safe_fold): Delete unused function.
2015
2016 2013-03-12 Alan Modra <amodra@gmail.com>
2017
2018 * gc.h (gc_process_relocs): Look through function descriptors
2019 to determine shndx, symvalue and addend used by ICF. Tidy
2020 variable duplication.
2021
2022 2013-03-11 Alan Modra <amodra@gmail.com>
2023
2024 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2025 * layout.cc (Layout_task_runner::run): ..to here.
2026 * symtab.h (struct Symbol_location): Extract from..
2027 (class Symbol_table): ..here.
2028 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2029 * target.h (class Target): Add function_location and
2030 do_function_location functions.
2031 (class Sized_target): Add do_function_location.
2032 * object.h (class Sized_relobj_file): Move find_shdr..
2033 (class Object): ..to here.
2034 * object.cc: Likewise. Update to suit. Instantiate.
2035 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2036 * powerpc.cc (class Powerpc_dynobj): New.
2037 (Target_powerpc::do_function_location): New function.
2038 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2039 (Powerpc_dynobj::do_read_symbols): New function.
2040 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2041
2042 2013-03-08 Ian Lance Taylor <iant@google.com>
2043
2044 * options.cc (General_options::string_to_object_format): Accept
2045 "default".
2046
2047 2013-03-08 Alan Modra <amodra@gmail.com>
2048
2049 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2050 pointer to Post_fde.
2051 (struct Post_fde): Move definition to here..
2052 * ehframe.cc (struct Post_fde): ..from here.
2053 (Cie::write): Don't alloc Post_fde.
2054 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2055
2056 2013-03-07 Alan Modra <amodra@gmail.com>
2057
2058 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2059 relocation referencing .LC0.
2060 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2061
2062 2013-03-07 Alan Modra <amodra@gmail.com>
2063
2064 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2065 always_inline. Add assembly for powerpc to avoid GOT.
2066
2067 2013-03-07 Alan Modra <amodra@gmail.com>
2068
2069 * testsuite/script_test_10.sh: Don't test .bss section
2070 header number.
2071
2072 2013-03-06 Alan Modra <amodra@gmail.com>
2073
2074 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2075 (Target_powerpc::symval_for_branch): Add symtab param. Update
2076 all callers. Handle folded sections.
2077 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2078 to Powerpc_relobj.
2079 (Global_symbol_visitor_opd::operator()): Likewise.
2080
2081 2013-03-04 Alan Modra <amodra@gmail.com>
2082
2083 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2084 * testsuite/Makefile.in: Regenerate.
2085
2086 2013-03-01 Cary Coutant <ccoutant@google.com>
2087
2088 Add dwp support for v2 DWARF package file format.
2089 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2090 tu_length parameter. Adjust all callers.
2091 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2092 * dwp.cc: Include dwarf.h.
2093 (Section_bounds): New struct type.
2094 (Unit_set): New struct type.
2095 (Dwo_file::Dwo_file): Initialize new data member.
2096 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2097 Combine and rename to...
2098 (Dwo_file::read_unit_index): ...this.
2099 (Dwo_file::sized_read_compunit_index)
2100 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2101 (Dwo_file::sized_read_unit_index): ...this.
2102 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2103 parameters; add section_id parameter.
2104 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2105 (Dwo_file::add_unit_set): ...this.
2106 (Dwo_file::shndx_map_): Remove.
2107 (Dwo_file::sect_offsets_): New data member.
2108 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2109 (Dwp_output_file::add_section): Rename to...
2110 (Dwp_output_file::add_contribution): ...this.
2111 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2112 (Dwp_output_file::add_tu_set): Likewise.
2113 (Dwp_output_file::Contribution): New type.
2114 (Dwp_output_file::Section::contributions): New data member.
2115 (Dwp_output_file::Cu_or_tu_set): Remove.
2116 (Dwp_output_file::Section::Section): New ctor.
2117 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2118 (Dwp_output_file::Dwp_index::Section_table): New type.
2119 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2120 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2121 parameter.
2122 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2123 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2124 (Dwp_output_file::Dwp_index::section_table): New member function.
2125 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2126 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2127 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2128 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2129 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2130 (Dwp_output_file::Dwp_index::section_table_): New data member.
2131 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2132 (Dwp_output_file::add_output_section): New member function.
2133 (Dwp_output_file::write_new_section): New member function.
2134 (Dwp_output_file::write_contributions): New member function.
2135 (Dwp_output_file::section_id_map_): New data member.
2136 (class Dwo_id_info_reader): Remove.
2137 (class Unit_reader): New class.
2138 (get_dwarf_section_name): New function.
2139 (Dwo_file::read_executable): Adjust initializations of class data.
2140 (Dwo_file::read): Add support for v2 package file format.
2141 (Dwo_file::read_unit_index): Likewise.
2142 (Dwo_file::sized_read_unit_index): Likewise.
2143 (Dwo_file::copy_section): Likewise.
2144 (Dwo_file::add_unit_set): Likewise.
2145 (Dwp_output_file::add_output_section): Likewise.
2146 (Dwp_output_file::add_contribution): Likewise.
2147 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2148 for empty slot.
2149 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2150 file format.
2151 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2152 slot.
2153 (Dwp_output_file::initialize): Remove unused function.
2154 (Dwp_output_file::finalize): Add support for v2 package file format.
2155 (Dwp_output_file::write_index): Likewise.
2156 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2157 function prototype.
2158
2159 2013-03-01 Cary Coutant <ccoutant@google.com>
2160
2161 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2162 function into class definition in header file.
2163 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2164 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2165 New function.
2166 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2167
2168 2013-02-28 Alan Modra <amodra@gmail.com>
2169
2170 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2171 * target.cc (Target::do_plt_fde_location): New function.
2172 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2173 accessor function, and constructor param.
2174 (struct Post_fde, Post_fdes): Declare.
2175 (Cie::write): Add post_fdes param.
2176 * ehframe.cc (Fde::write): Use plt_fde_location.
2177 (struct Post_fde): Define.
2178 (Cie::write): Stash FDEs added post merge mapping.
2179 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2180 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2181 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2182 other FDEs.
2183 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2184 (Target_powerpc::has_glink): New function.
2185 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2186 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2187 glink_eh_frame_fde_32, default_fde): New data.
2188 (Stub_table::eh_frame_added_): New var.
2189 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2190 Make const.
2191 (Stub_table::add_eh_frame): New function.
2192 (Output_data_glink::add_eh_frame): New function.
2193 (Target_powerpc::make_glink_section): Call add_eh_frame.
2194
2195 2013-02-15 Ian Lance Taylor <iant@google.com>
2196
2197 * options.h (DEFINE_uint64_alias): Define.
2198 (class General_options): Add -Ttext-segment as an alias for
2199 -Ttext.
2200
2201 2013-02-15 Alan Modra <amodra@gmail.com>
2202
2203 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2204 (Stub_table::do_write): ..here, two places.
2205 (Stub_table::plt_call_size): Use it here too.
2206
2207 2013-02-11 Ian Lance Taylor <iant@google.com>
2208
2209 * descriptors.cc (Descriptors::close_all): New function.
2210 * descriptors.h (class Descriptors): Declare close_all.
2211 (close_all_descriptors): New inline function.
2212 * plugin.cc: Include "descriptors.h".
2213 (Plugin_manager::cleanup): Call close_all_descriptors.
2214
2215 2013-02-06 Alan Modra <amodra@gmail.com>
2216
2217 * README: Update coding style link.
2218
2219 2013-01-28 Cary Coutant <ccoutant@google.com>
2220
2221 * dwp.cc (File_list): New typedef.
2222 (Dwo_name_info_reader): New class.
2223 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2224 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2225 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2226 (Dwo_file::read_executable): New function.
2227 (Dwo_file::read): Move common setup code to ...
2228 (Dwo_file::make_object): ... here.
2229 (dwp_options): Add --exec/-e.
2230 (usage): Likewise.
2231 (main): Likewise.
2232
2233 2013-01-24 Sriraman Tallam <tmsriram@google.com>
2234
2235 * layout.cc (Layout::layout): Check for option text_reorder.
2236 (Layout::make_output_section): Ditto.
2237 * options.h (text_reorder): New option.
2238 * output.cc (Input_section_sort_compare): Remove special ordering
2239 of section names.
2240 (Output_section::
2241 Input_section_sort_section_name_special_ordering_compare::
2242 operator()): New function.
2243 (Output_section::sort_attached_input_sections): Use new sort function
2244 for .text.
2245 * output.h (Input_section_sort_section_name_special_ordering_compare):
2246 New struct.
2247 * testsuite/Makefile.am (text_section_grouping): Test option
2248 --no-text-reorder
2249 * testsuite/Makefile.in: Regenerate.
2250 * testsuite/text_section_grouping.sh: Check order of functions without
2251 default text reordering.
2252
2253 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2254
2255 * options.h (General_options): Change default to true for new_dtags.
2256
2257 2013-01-18 Mike Frysinger <vapier@gentoo.org>
2258
2259 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2260 when enable_new_dtags is false. Only add DT_RUNPATH when
2261 enable_new_dtags is true.
2262
2263 2013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2264
2265 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2266 used in declaration and definition consistent.
2267 (Target_powerpc::symval_for_branch): Ditto.
2268
2269 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2270
2271 * testsuite/plugin_final_layout.cc: Fix comment.
2272
2273 2013-01-16 Sriraman Tallam <tmsriram@google.com>
2274
2275 * layout.cc (Layout::layout): Do not do default sorting for
2276 text sections when section ordering is specified.
2277 (make_output_section): Ditto.
2278 * testsuite/plugin_final_layout.cc: Name the function sections
2279 to catch reordering issues.
2280
2281 2013-01-15 Alan Modra <amodra@gmail.com>
2282
2283 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2284 plt-thread-safe.
2285
2286 2013-01-15 Alan Modra <amodra@gmail.com>
2287
2288 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2289 * testsuite/Makefile.in: Regenerate.
2290
2291 2013-01-14 Alan Modra <amodra@gmail.com>
2292
2293 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2294 * testsuite/Makefile.in: Regenerate.
2295
2296 2013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2297
2298 PR bfd/14430
2299 Fix mingw gold build with plugins enabled
2300 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2301 * configure.ac: Export DLOPEN_LIBS and add headers check.
2302 * plugin.cc: Handle non-dlfcn case.
2303 * Makefile.in: Regenerate.
2304 * config.in: Regenerate.
2305 * configure: Regenerate.
2306 * testsuite/Makefile.in: Regenerate.
2307
2308 2013-01-09 Sriraman Tallam <tmsriram@google.com>
2309
2310 * output.h (sort_attached_input_sections): Change to be public.
2311 * script-sections.cc
2312 (Output_section_definition::set_section_addresses): Sort
2313 attached input sections according to section order before linker
2314 script assigns section addresses.
2315 (Orphan_output_section::set_section_addresses): Sort
2316 attached input sections according to section order before linker
2317 script assigns section addresses.
2318 * Makefile.am (final_layout.sh): Use a simple linker script to
2319 check if section ordering still works.
2320 * Makefile.in: Regenerate.
2321
2322 2013-01-09 Ben Cheng <bccheng@google.com>
2323
2324 * arm.cc (Target_arm::attributes_accept_div): New function.
2325 (Target_arm::attributes_forbid_div): New function.
2326 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2327 attribute using the same new functions as what bfd/elf32_arm.c
2328 does.
2329
2330 2013-01-07 Cary Coutant <ccoutant@google.com>
2331
2332 PR gold/14993
2333 * output.cc (Output_section::add_input_section): For incremental
2334 updates, don't track input sections that are allocated from patch
2335 space.
2336
2337 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2338 Ian Lance Taylor <iant@google.com>
2339
2340 PR gold/14897
2341 * configure.ac (--enable-ld): Removed.
2342 (install_as_default): Set to yes only for --enable-gold=default
2343 or --disable-ld.
2344 * configure: Regenerated.
2345
2346 2013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2347
2348 * options.h (General_options): Add -fuse-ld= for GCC linker
2349 option compatibility.
2350
2351 2013-01-04 Cary Coutant <ccoutant@google.com>
2352
2353 * configure.ac: Fix typo restoring CXXFLAGS.
2354 * configure: Regenerate.
2355
2356 2013-01-04 Cary Coutant <ccoutant@google.com>
2357
2358 * testsuite/Makefile.am (CXXLINK_S): New macro.
2359 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2360 * testsuite/Makefile.in: Regenerate.
2361
2362 2013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2363
2364 * version.cc (print_version): Update copyright year to 2013.
2365
2366 2012-12-20 Ian Lance Taylor <iant@google.com>
2367
2368 * layout.cc (Layout::special_ordering_of_input_section): New
2369 function.
2370 (Layout::layout): If input section requires special ordering, must
2371 sort input sections.
2372 (Layout::make_output_section): May sort .text input sections.
2373 (Layout::is_section_name_prefix_grouped): Remove.
2374 * layout.h (class Layout): Declare
2375 special_ordering_of_input_section. Don't declare
2376 is_section_name_prefix_grouped.
2377 * output.cc (Output_section::add_input_section): Revert last
2378 change.
2379 (Output_section::Input_section_sort::match_file_name): Don't crash
2380 if called on output section data.
2381 (Output_section::Input_section_sort_compare): Sort based on
2382 special ordering.
2383 (Output_section::Input_section_sort_section_order_index_compare):
2384 Revert last patch.
2385 (Output_section::sort_attached_input_sections): Likewise.
2386
2387 2012-12-18 Sriraman Tallam <tmsriram@google.com>
2388
2389 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
2390 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2391 * output.cc (Output_section::add_input_section): Check if section
2392 name contains special prefix. Keep input sections to sort such
2393 sections.
2394 (Output_section::Input_section_sort_section_order_index_compare
2395 ::operator()): Group sections according to prefixes.
2396 (Output_section::sort_attached_input_sections): Add condition to
2397 Input_section_entry constructor call.
2398 * testsuite/Makefile.am (text_section_grouping): New test.
2399 * testsuite/Makefile.in: Regenerate.
2400 * testsuite/text_section_grouping.cc: New file.
2401 * testsuite/text_section_grouping.sh: New file.
2402
2403 2012-12-17 Nick Clifton <nickc@redhat.com>
2404
2405 * Makefile.am: Add copyright notice.
2406 * NEWS: Likewise.
2407 * README: Likewise.
2408 * configure.ac: Likewise.
2409 * ftruncate.c: Likewise.
2410 * Makefile.in: Regenerate.
2411
2412 2012-12-14 Cary Coutant <ccoutant@google.com>
2413
2414 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2415 --no-as-needed flag.
2416 (exception_separate_shared_12_test): Likewise.
2417 (incremental_copy_test): Likewise.
2418 * testsuite/Makefile.in: Regenerate.
2419
2420 2012-12-14 Cary Coutant <ccoutant@google.com>
2421
2422 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2423 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2424
2425 2012-12-12 Alan Modra <amodra@gmail.com>
2426
2427 * powerpc.cc (class Track_tls): New.
2428 (class Relocate, class Scan): Inherit Track_tls.
2429 (Target_powerpc::Scan::local, global): Track tls optimization
2430 and avoid creating plt entry for __tls_get_addr if all uses
2431 are optimized away.
2432 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2433
2434 2012-12-12 Alan Modra <amodra@gmail.com>
2435
2436 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2437 Replace no_toc_optimize with toc_optimize.
2438 * output.h (Output_section::input_sections): Provide non-const variant.
2439 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2440 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2441 accessors.
2442 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2443 (class Sort_toc_sections): New.
2444 (Target_powerpc::do_finalize_sections): Sort toc sections.
2445 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2446
2447 2012-12-10 Roland McGrath <mcgrathr@google.com>
2448
2449 * testsuite/binary_unittest.cc (read_all): New function.
2450 (Sized_binary_test): Use it instead of ::read.
2451 * fileread.cc (do_read): Don't assume pread always reads the whole
2452 amount in a single call.
2453
2454 2012-12-10 Alan Modra <amodra@gmail.com>
2455
2456 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2457 Set EM_PPC64 or EM_PPC here.
2458 (Target_selector_powerpc::do_recognize): Delete.
2459
2460 2012-12-10 Alan Modra <amodra@gmail.com>
2461
2462 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2463 stub_table_.
2464 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2465
2466 2012-12-07 Roland McGrath <mcgrathr@google.com>
2467
2468 * testsuite/binary_unittest.cc (Sized_binary_test):
2469 Use open_descriptor rather than ::open.
2470
2471 2012-12-07 Alan Modra <amodra@gmail.com>
2472
2473 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2474 typedef and invalid_address constant.
2475 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2476 instantiate constants.
2477
2478 2012-12-06 Roland McGrath <mcgrathr@google.com>
2479
2480 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2481 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2482 * aclocal.m4: Regenerate.
2483 * configure: Regenerate.
2484 * Makefile.in: Regenerate.
2485 * testsuite/Makefile.in: Regenerate.
2486
2487 2012-12-07 Alan Modra <amodra@gmail.com>
2488
2489 * options.h (General_options): Add no_toc_optimize.
2490 * powerpc.cc (ok_lo_toc_insn): New function.
2491 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2492
2493 2012-12-06 Alan Modra <amodra@gmail.com>
2494
2495 * options.h (General_options): Add plt_align, plt_static_chain,
2496 plt_thread_safe. Update stub_group_size help text.
2497 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2498 for new plt_thread_safe_ var.
2499 (use_plt_offset): Correct comments.
2500 (Target_powerpc::do_relax): Look for thread creation symbols to
2501 determine default plt_thread_safe value. Clear plt call stubs
2502 as well as branch stubs each iteration.
2503 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2504 insn constants.
2505 (l, hi, ha, write_insn): Move earlier.
2506 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2507 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2508 plt stubs too.
2509 (Stub_table::update_size): Adjust.
2510 (Stub_table::prev_size, set_prev_size): Delete.
2511 (Stub_table::stub_align): Let --plt-align affect result.
2512 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2513 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2514 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2515 (Stub_table::do_write): Support more stub variants.
2516
2517 2012-12-04 Alan Modra <amodra@gmail.com>
2518
2519 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2520 (Target_powerpc::do_define_standard_symbols): New function.
2521
2522 2012-12-03 Alan Modra <amodra@gmail.com>
2523
2524 * output.h: Formatting, whitespace.
2525
2526 2012-12-03 Alan Modra <amodra@gmail.com>
2527
2528 * layout.h (Layout::get_executable_sections): Declare.
2529 * layout.cc (Layout::get_executable_sections): New function.
2530 * arm.cc (Target_arm::group_sections): Use it.
2531 (Arm_output_section::group_sections): Delete now redundant test.
2532 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2533 param to handle relative relocs.
2534 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2535 (Output_data_reloc::add_absolute): Adjust.
2536 (Output_data_reloc::add_relative): New function.
2537 (Output_data::reset_data_size): New function.
2538 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2539 (Output_section::set_addralign): New function.
2540 (Output_section::checkpoint_set_addralign): New function.
2541 (Output_section::clear_section_offsets_need_adjustment): New function.
2542 (Output_section::input_sections): Make public.
2543 * powerpc.cc (class Output_data_brlt_powerpc): New.
2544 (class Stub_table, class Stub_control): New.
2545 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2546 stub_table_, set_stub_table, stub_table): New vectors and accessor
2547 functions.
2548 (Target_powerpc::do_may_relax, do_relax, push_branch,
2549 new_stub_table, stub_tables, brlt_section, group_sections,
2550 add_branch_lookup_table, find_branch_lookup_table,
2551 write_branch_lookup_table, make_brlt_section): New functions.
2552 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2553 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2554 branch_info_): New vars.
2555 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2556 make call stubs here.
2557 (Output_data_glink): Remove all call stub handling from this class.
2558 (Target_powerpc::Scan::local, global): Save interesting branch
2559 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2560 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2561 functions on final link.
2562 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2563 Handle long branch destinations too.
2564 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2565 do_plt_address_for_local): Adjust lookup of plt call stubs.
2566
2567 2012-11-30 Alan Modra <amodra@gmail.com>
2568
2569 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2570 relocs against protected symbols when building 32-bit shared libs.
2571
2572 2012-11-30 Alan Modra <amodra@gmail.com>
2573
2574 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2575 param. Call got_section() to make .got. Update all callers
2576 and their callers and so on.
2577
2578 2012-11-30 Alan Modra <amodra@gmail.com>
2579
2580 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2581 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2582 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2583 value if it already exists.
2584
2585 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2586
2587 PR gold/14858
2588 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2589
2590 2012-11-14 Roland McGrath <mcgrathr@google.com>
2591
2592 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2593 than bfc instruction for data sandboxing.
2594
2595 2012-11-08 Alan Modra <amodra@gmail.com>
2596
2597 * po/POTFILES.in: Regenerate.
2598
2599 2012-11-05 Alan Modra <amodra@gmail.com>
2600
2601 * configure.ac: Apply 2012-09-10 change to config.in here.
2602 * configure: Regenerate.
2603
2604 2012-11-05 Alan Modra <amodra@gmail.com>
2605
2606 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2607 (struct Opd_ent): Use "Address" rather than "Offset".
2608 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2609 (Target_powerpc::got_section): Make public.
2610 (Target_powerpc::scan_relocs): Move code setting symbols..
2611 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2612 Create _SDA_BASE_ only when referenced.
2613
2614 2012-11-02 Roland McGrath <mcgrathr@google.com>
2615
2616 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2617 from last change.
2618
2619 2012-11-01 Roland McGrath <mcgrathr@google.com>
2620
2621 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2622 for offset_in_output_section parameter.
2623 (Sized_target::relocate_special_relocatable): Likewise.
2624 * arm.cc (Target_arm::relocate_relocs): Likewise.
2625 (Target_arm::relocate_special_relocatable): Likewise.
2626 * i386.cc (Target_i386::relocate_relocs): Likewise.
2627 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2628 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2629 * target-reloc.h (relocate_relocs): Likewise.
2630 * testsuite/testfile.cc (Target_test): Likewise.
2631 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2632 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2633
2634 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2635 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2636
2637 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2638 parameter, which is unused in the [!F_SETFD] case.
2639
2640 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2641 SYMNDX to off_t before comparing it to this->data_size().
2642 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2643 * incremental.cc (Output_section_incremental_inputs::do_write):
2644 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2645
2646 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2647
2648 2012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2649
2650 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2651 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2652 in EABI_VER5.
2653
2654 2012-10-29 Cary Coutant <ccoutant@google.com>
2655
2656 * dwp.cc (usage): Add file and exit status parameters;
2657 add --help and --version options.
2658 (print_version): New function.
2659 (main): Add --help and --version options.
2660
2661 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2662
2663 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2664 final_layout_sequence.txt.
2665 * testsuite/Makefile.in: Regenerated.
2666
2667 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2668
2669 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2670 COMPILE generated by automake.
2671 (LINK1): Likewise.
2672 (CXXCOMPILE1): Likewise.
2673 (CXXLINK1): Likewise.
2674 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2675 (LINK): Likewise.
2676 (CXXCOMPILE): Likewise.
2677 (CXXLINK): Likewise.
2678 * testsuite/Makefile.in: Regenerated.
2679
2680 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2681
2682 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2683 on bad fwrite return.
2684
2685 2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2686
2687 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2688 on val.
2689
2690 2012-10-23 Cary Coutant <ccoutant@google.com>
2691
2692 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2693 * testsuite/Makefile.in: Regenerate.
2694 * testsuite/dwp_test.h: New source file.
2695 * testsuite/dwp_test_1.cc: New source file.
2696 * testsuite/dwp_test_1.s: New source file.
2697 * testsuite/dwp_test_1.sh: New source file.
2698 * testsuite/dwp_test_1b.cc: New source file.
2699 * testsuite/dwp_test_1b.s: New source file.
2700 * testsuite/dwp_test_2.cc: New source file.
2701 * testsuite/dwp_test_2.s: New source file.
2702 * testsuite/dwp_test_2.sh: New source file.
2703 * testsuite/dwp_test_main.cc: New source file.
2704 * testsuite/dwp_test_main.s: New source file.
2705
2706 2012-10-23 Cary Coutant <ccoutant@google.com>
2707
2708 * dwp.h: New header file.
2709 * dwp.cc: New source file.
2710 * gold.h: Move shared declarations to system.h.
2711 * system.h: New header file.
2712 * Makefile.am: Add dwp.
2713 * Makefile.in: Regenerate.
2714
2715 2012-10-23 Cary Coutant <ccoutant@google.com>
2716
2717 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2718 Dwarf_info_reader::read_from_pointer.
2719 (Dwarf_pubnames_table::read_header): Likewise.
2720 (Dwarf_pubnames_table::next_name): Likewise.
2721 (Dwarf_die::read_attributes): Likewise.
2722 (Dwarf_die::skip_attributes): Likewise.
2723 (Dwarf_info_reader::read_from_pointer): New function template.
2724 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2725 (Dwarf_pubnames_table): Likewise.
2726 (Dwarf_info_reader::read_from_pointer): New function template.
2727 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2728 Dwarf_pubnames_table ctor.
2729
2730 2012-10-23 Cary Coutant <ccoutant@google.com>
2731
2732 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2733 abbrev_shndx.
2734 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2735 abbrev_shndx_.
2736 (Dwarf_info_reader::set_abbrev_shndx): New method.
2737 (Dwarf_info_reader::abbrev_shndx_): New data member.
2738
2739 2012-10-23 Cary Coutant <ccoutant@google.com>
2740
2741 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2742 from object, not parameters.
2743 (Dwarf_info_reader::parse): Likewise.
2744 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2745 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2746 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2747 methods.
2748
2749 2012-10-23 Cary Coutant <ccoutant@google.com>
2750
2751 * fileread.cc (Input_file::Input_file): New constructor.
2752 * fileread.h (class Input_file): Add new constructor.
2753
2754 2012-10-18 Alan Modra <amodra@gmail.com>
2755
2756 PR gold/14727
2757 * object.cc (Relobj::is_section_name_included): Also match
2758 .sdata personality section.
2759
2760 2012-10-18 Alan Modra <amodra@gmail.com>
2761
2762 * target-reloc.h (class Default_comdat_behavior): New, package up..
2763 (get_comdat_behaviour): ..this.
2764 (relocate_section): Add Relocate_comdat_behavior template arg,
2765 adjust code to suit.
2766 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2767 (Target_arm::scan_reloc_section): Likewise.
2768 * i386.cc (Target_i386::relocate_section): Likewise.
2769 * sparc.cc (Target_sparc::relocate_section): Likewise.
2770 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2771 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2772 * powerpc.cc (class Relocate_comdat_behavior): New.
2773 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2774 gold::relocate_section with new template arg.
2775
2776 2012-10-18 Alan Modra <amodra@gmail.com>
2777
2778 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2779 dynamic relocs for GOT_TPREL got entries, without symbol if
2780 resolving locally.
2781 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2782 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2783 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2784
2785 2012-10-17 Alan Modra <amodra@gmail.com>
2786
2787 PR gold/14726
2788 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2789
2790 2012-10-16 Sriraman Tallam <tmsriram@google.com>
2791
2792 * layout.cc (Layout::include_section): Keep sections marked
2793 SHF_EXCLUDE when doing relocatable links.
2794
2795 2012-10-16 Alan Modra <amodra@gmail.com>
2796
2797 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2798 (Target_powerpc::do_finalize_sections): Call it.
2799 (Output_data_save_res): New class and supporting functions.
2800 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2801 normal symbols defined in object files.
2802
2803 2012-10-12 Alan Modra <amodra@gmail.com>
2804
2805 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2806 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2807 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2808 section if scan_opd_relocs not yet called.
2809 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2810
2811 2012-10-12 Alan Modra <amodra@gmail.com>
2812
2813 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2814 add_local_ifunc_entry): Revert last change.
2815 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2816
2817 2012-10-05 Alan Modra <amodra@gmail.com>
2818
2819 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2820 do_plt_address_for_global): New functions.
2821 (Output_data_got_powerpc::do_write): Don't segfault when linking
2822 statically.
2823 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2824 add_local_ifunc_entry): Return true on adding entry..
2825 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2826 glink->add_entry call. Remove unused symtab param. Adjust calls.
2827 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2828 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2829 set up symbols here.
2830 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2831 syms here. Do so even when no .iplt. Don't segfault when linking
2832 statically.
2833 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2834 new variants without reloc param.
2835 (Glink_sym_ent::Glink_sym_ent): Likewise.
2836 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2837 reloc when refs will resolve to plt call stub.
2838 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2839 R_PPC_PLTREL24 to resolve locally.
2840 (Target_powerpc::Scan::global): Correct ifunc handling.
2841 (Target_powerpc::Relocate::relocate): Correct local sym glink
2842 lookup. Don't destroy "value" when we have a plt call stub,
2843 and when checking plt call validity.
2844 (Target_powerpc::do_dynsym_value): Simplify.
2845
2846 2012-10-05 Alan Modra <amodra@gmail.com>
2847
2848 * i386.cc (Output_data_plt_i386::address_for_global,
2849 address_for_local): Add plt offset to returned value. Adjust uses.
2850 * sparc.cc (Output_data_plt_sparc::address_for_global,
2851 address_for_local): Likewise.
2852 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2853 address_for_local): Likewise.
2854 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2855 address_for_local): Likewise.
2856 * target.h (Target::plt_address_for_global, plt_address_for_local):
2857 Update comment.
2858 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2859 (Output_data_got::Got_entry::write): Nor here.
2860 * output.h: Comment fix.
2861
2862 2012-10-02 Jiong Wang <jiwang@tilera.com>
2863
2864 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2865 global_offset_table_ value for larget got.
2866 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2867
2868 2012-09-29 Alan Modra <amodra@gmail.com>
2869
2870 * powerpc.cc (Target_powerpc::iplt_): New output section.
2871 (Target_powerpc::iplt_section, make_iplt_section,
2872 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2873 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2874 Target_powerpc::plt_entry_count): Count iplt entries too.
2875 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2876 reloc section in constructor. New params.
2877 (Target_powerpc::make_plt_section): Create reloc section here instead.
2878 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2879 functions.
2880 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2881 (Output_data_glink::add_entry, find_entry): New functions to
2882 deal with local syms.
2883 (Glink_sym_ent): Add support for local syms.
2884 (Output_data_glink::do_write): Handle ifunc plt entries.
2885 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2886 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2887 (Target_powerpc::Relocate::relocate): Likewise.
2888 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2889
2890 2012-09-25 Alan Modra <amodra@gmail.com>
2891
2892 * object.h (Sized_relobj_file::adjust_local_symbol,
2893 do_adjust_local_symbol): New functions.
2894 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2895 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2896 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2897 and irregular opd entry spacing.
2898 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2899 (Global_symbol_visitor_opd): New functor.
2900 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2901 on deleted opd entries.
2902
2903 2012-09-15 Jiong Wang <jiwang@tilera.com>
2904
2905 * tilegx.cc: New file.
2906 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2907 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2908 * configure.tgt: Add entries for tilegx*.
2909 * configure.ac: Likewise.
2910 * Makefile.in: Rebuild.
2911 * configure: Likewise.
2912 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2913 tilegx.
2914
2915 2012-09-13 Alan Modra <amodra@gmail.com>
2916
2917 * target-reloc.h (scan_relocs): Call scan.local for relocs
2918 against symbols in discarded sections. Pass is_discarded
2919 param.
2920 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2921 Add is_discarded param.
2922 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2923 is_discarded to flag opd entry as discarded. Don't emit dyn
2924 relocs on such entries.
2925 (Target_powerpc::Scan::global): Similarly detect and handle
2926 such opd entries.
2927 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2928 opd_ent_. Update all uses.
2929 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2930 (Target_powerpc::relocate_section): Zero out discarded opd
2931 entry relocs.
2932
2933 2012-09-12 Ian Lance Taylor <iant@google.com>
2934
2935 PR gold/14570
2936 * output.cc: Rename Output_data_got template parameter from size
2937 to got_size for all functions. Compile all variants of
2938 Output_data_got.
2939 (Output_data_got::Got_entry::write): Correct use of size for
2940 symbol value. Use local_is_tls rather than casting to
2941 Sized_relobj_file.
2942 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2943 (class Sized_relobj_file): Add do_local_is_tls.
2944 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2945
2946 2012-09-11 Alan Modra <amodra@gmail.com>
2947
2948 PR gold/14566
2949 * layout.cc (Layout::set_segment_offsets): When using
2950 common-page-size alignment, ensure we are on a new max-page-size
2951 page.
2952 * output.cc (Output_segment::set_section_addresses): Use
2953 abi_pagesize, not common_pagesize for relro boundary.
2954 (Output_segment::set_offset): Likewise.
2955
2956 2012-09-11 Alan Modra <amodra@gmail.com>
2957
2958 * output.h (Output_data_got::add_global_tls, add_local_tls,
2959 add_local_tls_pair): New functions.
2960 (Output_data_got::add_local_pair_with_rel): Remove second
2961 reloc param. Expand comment.
2962 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2963 use_plt_or_tls_offset_, similarly for constructor param.
2964 (Output_data_got::Got_entry::write): Add got_index param.
2965 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2966 add_local_tls_pair): New functions.
2967 (Output_data_got::Got_entry::write): Handle tls symbols
2968 with use_plt_or_tls_offset_ set specially.
2969 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2970 (Output_data_got::do_write): Replace iterator with index, pass
2971 index to entry write function.
2972 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2973 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2974 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2975 call.
2976 * i386.cc (Target_i386::Scan::local): Likewise.
2977 * sparc.cc (Target_sparc::Scan::local): Likewise.
2978 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2979 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2980 do_tls_offset_for_global): New functions.
2981 (Target_powerpc::Scan::local): Correct TLS relocations and got
2982 entry values.
2983 (Target_powerpc::Scan::global): Don't emit unnecessary
2984 dynamic relocations on TLS GOT entries.
2985
2986 2012-09-10 Matthias Klose <doko@ubuntu.com>
2987
2988 * config.in: Disable sanity check for kfreebsd.
2989
2990 2012-09-10 Sterling Augustine <saugustine@google.com>
2991
2992 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2993 (Gdb_index::pubtypes_read): New parameter.
2994 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2995 to calls.
2996 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2997 pubtypes_object_.
2998
2999 2012-09-09 Alan Modra <amodra@gmail.com>
3000
3001 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3002 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3003 * gc.h (gc_process_relocs): Call target gc_add_reference.
3004 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3005 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3006 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3007 unnecessary cast.
3008 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3009 to cater for when we don't need code offset. Update use.
3010 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3011 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3012 set_opd_valid): New functions.
3013 (Target_powerpc::do_gc_add_reference): New function.
3014 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3015 stashed refs.
3016 (Target_powerpc::do_gc_mark_symbol): New function.
3017
3018 2012-09-06 Cary Coutant <ccoutant@google.com>
3019
3020 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3021 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3022 (Dwarf_die::skip_attributes): Likewise.
3023 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3024 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3025 (main): Call it.
3026 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3027
3028 2012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3029
3030 * testsuite/script_test_3.t: Add .got.plt output section
3031 statement.
3032 * testsuite/script_test_4.t: Likewise.
3033
3034 2012-09-05 Alan Modra <amodra@gmail.com>
3035
3036 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3037 update all uses and lose "enum" when using type.
3038
3039 2012-09-05 Alan Modra <amodra@gmail.com>
3040
3041 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3042 * configure: Regenerate.
3043 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3044 (plugin_final_layout.stdout): Likewise.
3045 (memory_test): Set page sizes to 0x1000.
3046 * testsuite/Makefile.in: Regenerate.
3047 * testsuite/discard_locals_test.sh: Add FIXME comment.
3048 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3049 * testsuite/pr14265.t: Add .got output section statement.
3050 * testsuite/script_test_2.t: Likewise.
3051 * testsuite/script_test_3.t: Likewise.
3052 * testsuite/script_test_4.t: Likewise.
3053 * testsuite/script_test_5.t: Likewise.
3054 * testsuite/script_test_6.t: Likewise.
3055 * testsuite/script_test_7.t: Likewise.
3056 * testsuite/script_test_9.t: Likewise.
3057
3058 2012-09-05 Alan Modra <amodra@gmail.com>
3059
3060 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3061 (Powerpc_relocate_functions::Status): New typedef.
3062 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3063 (Target_powerpc::Scan::local): Handle REL64.
3064 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3065 for REL32 and REL64.
3066 (Target_powerpc::symval_for_branch): New function, extracted from..
3067 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3068 checks. Report overflow errors.
3069
3070 2012-09-05 Alan Modra <amodra@gmail.com>
3071
3072 * object.h (Sized_relobj_file::emit_relocs): Delete.
3073 (Sized_relobj_file::emit_relocs_reltype): Delete.
3074 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3075 relocate_relocs for --emit-relocs.
3076 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3077 * output.h: Update comment.
3078 (Output_segment::first_section): New function.
3079 (Output_segment::first_section_load_address): Use first_section.
3080 * output.cc (Output_segment::first_section): New function extracted..
3081 (Output_segment::first_section_load_address): ..from here. Delete.
3082 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3083 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3084 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3085 adjust call to target.h function.
3086 * i386.cc (Target_i386): Likewise.
3087 * sparc.cc (Target_sparc): Likewise.
3088 * x86_64.cc (Target_x86_64): Likewise.
3089 * powerpc.cc (Target_powerpc): Likewise.
3090 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3091 first tls section has section symbol for optimised local dynamic
3092 output relocs.
3093 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3094 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3095 optimised tls code.
3096 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3097 Rename to relocate_relocs. Update error message.
3098
3099 2012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3100
3101 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3102 --just-symbols.
3103
3104 2012-08-31 Alan Modra <amodra@gmail.com>
3105
3106 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3107 (Powerpc_relobj::toc_base_offset): New stub function.
3108 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3109 got_mod_index_offset to tlsld_got_offset. Update all refs.
3110 (Target_powerpc::Relocate::enum skip_tls): New.
3111 (Target_powerpc::call_tls_get_addr_): New var.
3112 (Target_powerpc::is_branch_reloc): Move to file scope.
3113 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3114 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3115 New functions.
3116 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3117 (powerpc_info): Correct common_pagesize for ppc64.
3118 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3119 (Powerpc_relocate_functions): Add overflow check enums and functions.
3120 Add non-shift version of rela, rela_ua. Delete all rel public
3121 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3122 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3123 addr16_ha3, addr14 functions.
3124 (Output_data_got_powerpc::add_constant_pair): New function.
3125 (Output_data_got_powerpc::got_base_offset): Likewise.
3126 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3127 (instruction constants): Sort, add some more.
3128 (Output_data_glink::do_write): Add and use Address typedef. Use
3129 object->toc_base_offset() stub for 64-bit.
3130 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3131 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3132 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3133 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3134 Always treat .opd relocs as against locally defined symbol.
3135 Correct condition for RELATIVE relocs.
3136 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3137 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3138 for 32-bit syms with a plt entry. Correct ppc64 toc base
3139 calculations. Handle TLS relocs, and more. Add overflow
3140 checking and adjust for Powerpc_relocate_functions changes.
3141 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3142 Reinstate --emit-relocs code with FIXME.
3143
3144 2012-08-30 Alan Modra <amodra@gmail.com>
3145
3146 * layout.cc (Layout::set_segment_offsets): Set p_align to
3147 abi_pagesize, not common_pagesize.
3148 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3149 to determine whether file header can go in segment.
3150
3151 2012-08-30 Alan Modra <amodra@gmail.com>
3152
3153 * output.h (Output_reloc::Output_reloc <output section>): Add
3154 is_relative param. Adjust calls.
3155 (Output_reloc::add_output_section_relative): New functions.
3156 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3157 is_relative.
3158 (Output_reloc::symbol_value): Handle SECTION_CODE.
3159
3160 2012-08-24 Sriraman Tallam <tmsriram@google.com>
3161
3162 * gold.cc (queue_middle_tasks): Call layout again when unique
3163 segments for sections is desired.
3164 * layout.cc (Layout::Layout): Initialize new members.
3165 (Layout::get_output_section_flags): New function.
3166 (Layout::choose_output_section): Call get_output_section_flags.
3167 (Layout::layout): Make output section for mapping to a unique segment.
3168 (Layout::insert_section_segment_map): New function.
3169 (Layout::attach_allocated_section_to_segment): Make unique segment for
3170 output sections marked so.
3171 (Layout::segment_precedes): Check for unique segments when sorting.
3172 * layout.h (Layout::Unique_segment_info): New struct.
3173 (Layout::Section_segment_map): New typedef.
3174 (Layout::insert_section_segment_map): New function.
3175 (Layout::get_output_section_flags): New function.
3176 (Layout::is_unique_segment_for_sections_specified): New function.
3177 (Layout::set_unique_segment_for_sections_specified): New function.
3178 (Layout::unique_segment_for_sections_specified_): New member.
3179 (Layout::section_segment_map_): New member.
3180 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3181 Rename is_gc_pass_one to is_pass_one.
3182 Rename is_gc_pass_two to is_pass_two.
3183 Rename is_gc_or_icf to is_two_pass.
3184 Check for which pass based on whether symbols data is present.
3185 Make it two pass when unique segments for sections is desired.
3186 * output.cc (Output_section::Output_section): Initialize new
3187 members.
3188 * output.h (Output_section::is_unique_segment): New function.
3189 (Output_section::set_is_unique_segment): New function.
3190 (Output_section::is_unique_segment_): New member.
3191 (Output_section::extra_segment_flags): New function.
3192 (Output_section::set_extra_segment_flags): New function.
3193 (Output_section::extra_segment_flags_): New member.
3194 (Output_section::segment_alignment): New function.
3195 (Output_section::set_segment_alignment): New function.
3196 (Output_section::segment_alignment_): New member.
3197 (Output_segment::Output_segment): Initialize is_unique_segment_.
3198 (Output_segment::is_unique_segment): New function.
3199 (Output_segment::set_is_unique_segment): New function.
3200 (Output_segment::is_unique_segment_): New member.
3201 * plugin.cc (allow_unique_segment_for_sections): New function.
3202 (unique_segment_for_sections): New function.
3203 (Plugin::load): Add new functions to transfer vector.
3204 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3205 * Makefile.in: Regenerate.
3206 * testsuite/plugin_final_layout.sh: Check if unique segment
3207 functionality works.
3208 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3209 are available.
3210 (allow_unique_segment_for_sections): New global.
3211 (unique_segment_for_sections): New global.
3212 (claim_file_hook): Call allow_unique_segment_for_sections.
3213 (all_symbols_read_hook): Call unique_segment_for_sections.
3214
3215 2012-08-22 Cary Coutant <ccoutant@google.com>
3216
3217 * layout.cc (Layout::include_section): Don't assert on GROUP
3218 sections with --emit-relocs.
3219
3220 2012-08-21 Cary Coutant <ccoutant@google.com>
3221
3222 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3223 if --export-dynamic-symbol names an undef symbol.
3224
3225 2012-08-18 Alan Modra <amodra@gmail.com>
3226
3227 * powerpc.cc: Formatting and white space.
3228 (Powerpc_relobj): Rename got2_section_ to special_.
3229 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3230 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3231 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3232 (Target_powerpc): Add Address typedef and invalid_address. Use
3233 throughout.
3234 (Target_powerpc::is_branch_reloc): New function.
3235 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3236 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3237 for dst_mask, value and addend.
3238 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3239 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3240 (Output_data_glink::do_write): Correct toc base. Don't try to use
3241 uint16_t for 24-bit offset. Use get_output_section_offset and
3242 check return.
3243 (Target_powerpc::Scan::local): Handle more relocs.
3244 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3245 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3246 Plug in toc restoring insn after plt calls. Translate branches
3247 to function descriptor symbols to corresponding entry point.
3248 (Target_powerpc::relocate_for_relocatable): Check return from
3249 get_output_section_offset.
3250 * symtab.h: Comment typo.
3251
3252 2012-08-14 Ian Lance Taylor <iant@google.com>
3253
3254 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3255 unsupported_relocal_local to call unsupported_reloc_global.
3256
3257 2012-08-14 Nick Clifton <nickc@redhat.com>
3258
3259 PR ld/14265
3260 * script-sections.cc (Sections_element::output_section_name): Add
3261 keep return parameter.
3262 (Output_section_element::match_name): Add keep return parameter.
3263 Return the value of the keep_ member.
3264 * script-sections.h (class Output_section): Update
3265 output_section_name prototype.
3266 * layout.cc (Layout::keep_input_section): New public member
3267 function.
3268 (Layout::choose_output_section): Pass keep parameter to
3269 output_section_name.
3270 * layout.h (class Layout): Add keep_input_section.
3271 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3272 sections.
3273 * testsuite/Makefile.am: Add a test.
3274 * testsuite/Makefile.in: Regenerate.
3275 * testsuite/pr14265.c: Source file for the test.
3276 * testsuite/pr14265.t: Linker script for the test.
3277 * testsuite/pr14265.sh: Shell script for the test.
3278
3279 2012-08-14 Alan Modra <amodra@gmail.com>
3280
3281 * target.h (Target::output_section_name): New function.
3282 (Target::do_output_section_name): New function.
3283 * layout.cc (Layout::choose_output_section): Call the above.
3284 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3285
3286 2012-08-14 Alan Modra <amodra@gmail.com>
3287
3288 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3289 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3290 for replace_constant call.
3291 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3292 (Output_data_glink::do_print_to_mapfile): New function.
3293 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3294 (Target_powerpc::Relocate::relocate): Likewise.
3295
3296 2012-08-14 Alan Modra <amodra@gmail.com>
3297
3298 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3299 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3300 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3301 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3302 all references to shndx_. Handle special case for R_PPC_PLTREL24
3303 here.
3304 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3305 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3306 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3307 here.
3308 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3309 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3310
3311 2012-08-12 Alan Modra <amodra@gmail.com>
3312
3313 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3314 (glink insn constants): Use uint32_t.
3315 (Output_data_glink::add_entry): Use insert, not [] operator.
3316
3317 2012-08-11 Alan Modra <amodra@gmail.com>
3318
3319 * object.h (Sized_relobj_file::find_shdr): New function.
3320 (Sized_relobj_file::find_special_sections): New function.
3321 * object.cc (Sized_relobj_file::find_shdr): New function.
3322 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3323 (Sized_relobj_file::find_special_sections): New function, split out..
3324 (Sized_relobj_file::do_read_symbols): ..from here.
3325 * output.h (Output_data_got::replace_constant): New function.
3326 (Output_data_got::num_entries): New function.
3327 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3328 (Output_data_got::got_offset): Protected rather than private.
3329 (Output_data_got::replace_got_entry): New function.
3330 * output.cc (Output_data_got::replace_got_entry): New function.
3331 * powerpc.cc (class Powerpc_relobj): New.
3332 (class Powerpc_relocate_functions): Delete all psymval variants or
3333 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3334 Implement _ha functions using corresponding _hi function.
3335 (Powerpc_relobj::find_special_sections): New function.
3336 (Target_powerpc::do_make_elf_object): New function.
3337 (class Output_data_got_powerpc): New.
3338 (class Output_data_glink): New.
3339 (class Powerpc_scan_relocatable_reloc): New.
3340 Many more changes througout file.
3341
3342 2012-08-09 Nick Clifton <nickc@redhat.com>
3343
3344 * po/vi.po: Updated Vietnamese translation.
3345
3346 2012-08-07 Ian Lance Taylor <iant@google.com>
3347
3348 * layout.cc (Layout::add_target_dynamic_tags): If
3349 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3350 plt_rel.
3351
3352 2012-07-30 Nick Clifton <nickc@redhat.com>
3353
3354 * po/gold.pot: Updated template.
3355 * po/es.po: Updated Spanish translation.
3356
3357 2012-07-18 Cary Coutant <ccoutant@google.com>
3358
3359 PR gold/14344
3360 * configure.ac: Add check for -gpubnames support.
3361 * configure: Regenerate.
3362 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3363 support; force -gno-pubnames.
3364 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3365 support.
3366 (gdb_index_test_4): New test.
3367 * testsuite/Makefile.in: Regenerate.
3368 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3369 * testsuite/gdb_index_test_2.sh: Likewise.
3370 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3371 * testsuite/gdb_index_test_4.sh: New script.
3372 * testsuite/gdb_index_test_comm.sh: New script with common code;
3373 don't look for space after colon.
3374
3375 2012-07-16 Sriraman Tallam <tmsriram@google.com>
3376
3377 * gold.cc (queue_middle_tasks): Update function order only after
3378 deferred objects due to plugins are processed.
3379
3380 2012-07-11 Ian Lance Taylor <iant@google.com>
3381
3382 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3383 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3384 (Target_arm::scan_reloc_for_stub): Likewise.
3385 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3386 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3387 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3388 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3389 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3390
3391 2012-07-10 Dodji Seketeli <dodji@redhat.com>
3392 Ian Lance Taylor <iant@google.com>
3393
3394 PR gold/14309
3395 * configure.ac: Test whether std::tr1::hash<off_t> works.
3396 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3397 needed.
3398 * output.h (class Output_fill): Add virtual destructor.
3399 * configure, config.in: Rebuild.
3400
3401 2012-06-22 Roland McGrath <mcgrathr@google.com>
3402
3403 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3404
3405 2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3406
3407 * plugin.cc (Plugin::load): Handle position independent executables.
3408
3409 2012-06-06 Cary Coutant <ccoutant@google.com>
3410
3411 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3412 add .debug_macro.
3413 (lines_only_debug_sections): Likewise.
3414 (gdb_fast_lookup_sections): New static array.
3415 (is_gdb_debug_section): Rename formal parameter.
3416 (is_lines_only_debug_section): Likewise.
3417 (is_gdb_fast_lookup_section): New function.
3418 (Layout::include_section): Check for ".zdebug_" prefix; pass
3419 section name suffix to is_gdb_debug_section, et al.; check for
3420 fast-lookup sections when building .gdb_index.
3421 * options.h (--strip-debug-gdb): Update GDB version number.
3422
3423 2012-06-06 Cary Coutant <ccoutant@google.com>
3424
3425 * configure.ac: Add check for fallocate.
3426 * configure: Regenerate.
3427 * config.in: Regenerate.
3428
3429 * options.h (class General_options): Add --mmap-output-file and
3430 --posix-fallocate options.
3431 * output.cc: (posix_fallocate): Remove; replace with...
3432 (gold_fallocate): New function.
3433 (Output_file::map_no_anonymous): Call gold_fallocate.
3434 (Output_file::map): Check --mmap-output-file option.
3435
3436 2012-06-05 Jing Yu <jingyu@google.com>
3437
3438 * gold.h (textdomain): Add do {} to empty while(0).
3439 (bindtextdomain): Likewise.
3440
3441 2012-06-04 Cary Coutant <ccoutant@google.com>
3442
3443 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3444 has_dynsym_index.
3445
3446 2012-05-25 Sriraman Tallam <tmsriram@google.com>
3447
3448 * symtab.cc (Symbol_table::define_special_symbol):
3449 Initialize *poldsym to prevent uninitialized variable errors.
3450
3451 2012-05-23 Cary Coutant <ccoutant@google.com>
3452
3453 * layout.cc (Layout::section_name_mapping): Add rules to handle
3454 exact match on .data.rel.ro.local or .data.rel.ro.
3455 (Layout::output_section_name): Check for exact matches.
3456
3457 2012-05-23 Cary Coutant <ccoutant@google.com>
3458
3459 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3460 more carefully.
3461
3462 2012-05-22 Cary Coutant <ccoutant@google.com>
3463
3464 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3465 object before exporting symbol.
3466
3467 2012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3468
3469 * testsuite/tls_test.cc: Include "config.h" first.
3470 * testsuite/tls_test_c.c: Likewise.
3471
3472 2012-05-17 Daniel Richard G. <skunk@iskunk.org>
3473 Nick Clifton <nickc@redhat.com>
3474
3475 PR 14072
3476 * configure.in: Add check that sysdep.h has been included before
3477 any system header files.
3478 * configure: Regenerate.
3479 * config.in: Regenerate.
3480
3481 2012-05-14 Cary Coutant <ccoutant@google.com>
3482
3483 * layout.cc (Layout::make_output_section): Mark .tdata section
3484 as RELRO.
3485 * testsuite/relro_test.cc: Add a TLS variable.
3486
3487 2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3488
3489 PR gold/14091
3490 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3491 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3492 R_X86_64_64.
3493
3494 2012-05-08 Cary Coutant <ccoutant@google.com>
3495
3496 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3497 (lines_only_debug_sections): Likewise.
3498
3499 2012-05-02 Roland McGrath <mcgrathr@google.com>
3500
3501 * nacl.cc: New file.
3502 * nacl.h: New file.
3503 * Makefile.am (CCFILES, HFILES): Add them.
3504 * Makefile.in: Regenerate.
3505 * i386.cc (Output_data_plt_i386_nacl): New class.
3506 (Output_data_plt_i386_nacl_exec): New class.
3507 (Output_data_plt_i386_nacl_dyn): New class.
3508 (Target_i386_nacl): New class.
3509 (Target_selector_i386_nacl): New class.
3510 (target_selector_i386): Use it instead of Target_selector_i386.
3511 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3512 (Target_x86_64_nacl): New class.
3513 (Target_selector_x86_64_nacl): New class.
3514 (target_selector_x86_64, target_selector_x32): Use it instead of
3515 Target_selector_x86_64.
3516 * arm.cc (Output_data_plt_arm_nacl): New class.
3517 (Target_arm_nacl): New class.
3518 (Target_selector_arm_nacl): New class.
3519 (target_selector_arm, target_selector_armbe): Use it instead of
3520 Target_selector_arm.
3521
3522 * target-select.cc (select_target): Take new Input_file* and off_t
3523 arguments, pass them on to recognize method of selector.
3524 * object.cc (make_elf_sized_object): Update caller.
3525 * parameters.cc (parameters_force_valid_target): Likewise.
3526 * incremental.cc (make_sized_incremental_binary): Likewise.
3527 * target-select.h: Update decl.
3528 (Target_selector::recognize): Take new Input_file* argument,
3529 pass it on to do_recognize.
3530 (Target_selector::do_recognize): Take new Input_file* argument.
3531 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3532 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3533 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3534 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3535
3536 * target.h (Target::Target_info): New members isolate_execinstr
3537 and rosegment_gap.
3538 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3539 * arm.cc (Target_arm::arm_info): Update initializer.
3540 * i386.cc (Target_i386::i386_info): Likewise.
3541 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3542 * sparc.cc (Target_sparc::sparc_info): Likewise.
3543 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3544 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3545 * layout.cc (Layout::attach_allocated_section_to_segment):
3546 Take new const Target* argument. If target->isolate_execinstr(), act
3547 like --rosegment.
3548 (Layout::find_first_load_seg): Take new const Target* argument;
3549 if target->isolate_execinstr(), reject PF_X segments.
3550 (Layout::relaxation_loop_body): Update caller.
3551 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3552 reset file offset to zero when we hit LOAD_SEG, and then do a second
3553 loop over the segments before LOAD_SEG to reassign offsets after
3554 addresses have been determined. Handle target->rosegment_gap().
3555 (Layout::attach_section_to_segment): Take new const Target* argument;
3556 pass it to attach_allocated_section_to_segment.
3557 (Layout::make_output_section): Update caller.
3558 (Layout::attach_sections_to_segments): Take new const Target* argument;
3559 pass it to attach_section_to_segment.
3560 * gold.cc (queue_middle_tasks): Update caller.
3561 * layout.h (Layout): Update method decls with new arguments.
3562
3563 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3564 Target_info pointer to use.
3565 (Target_arm::do_make_data_plt): New virtual method.
3566 (Target_arm::make_data_plt): New method that calls it.
3567 (Target_arm::make_plt_entry): Use it.
3568 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3569 for the section alignment.
3570 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3571 method.
3572 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3573 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3574 method.
3575 (Output_data_plt_arm::get_plt_entry_size): Call it.
3576 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3577 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3578 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3579 method.
3580 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3581 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3582 method instead of sizeof(plt_entry).
3583 (Output_data_plt_arm::add_entry): Likewise.
3584 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3585 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3586 than static method.
3587 (Target_arm::plt_entry_size): Likewise.
3588 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3589 Move to ...
3590 (Output_data_plt_arm_standard): ... here, new class.
3591 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3592 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3593 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3594
3595 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3596 Take additional argument for the PLT entry size.
3597 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3598 Use get_plt_entry_size method rather than plt_entry_size variable.
3599 (Output_data_plt_x86_64::reserve_slot): Likewise.
3600 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3601 (Output_data_plt_x86_64::add_entry): Likewise.
3602 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3603 (Output_data_plt_x86_64::address_for_global): Likewise.
3604 (Output_data_plt_x86_64::address_for_local): Likewise.
3605 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3606 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3607 Make method non-static.
3608 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3609 method.
3610 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3611 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3612 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3613 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3614 virtual method.
3615 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3616 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3617 virtual method.
3618 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3619 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3620 virtual method.
3621 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3622 (Output_data_plt_x86_64::plt_entry_size)
3623 (Output_data_plt_x86_64::first_plt_entry)
3624 (Output_data_plt_x86_64::plt_entry)
3625 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3626 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3627 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3628 (Output_data_plt_x86_64_standard): ... here, new class.
3629 (Target_x86_64::Target_x86_64): Take optional argument for the
3630 Target_info pointer to use.
3631 (Target_x86_64::do_make_data_plt): New virtual method.
3632 (Target_x86_64::make_data_plt): New method to call it.
3633 (Target_x86_64::init_got_plt_for_update): Use that.
3634 Call this->plt_->add_eh_frame method here.
3635 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3636 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3637 rather than static method.
3638 (Target_x86_64::plt_entry_size): Likewise.
3639 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3640 rather than plt_entry_size variable. Move guts of PLT filling to...
3641 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3642 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3643 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3644
3645 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3646 additional argument for the section alignment.
3647 Don't do add_eh_frame_for_plt here.
3648 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3649 non-static. Use get_plt_entry_size method rather than plt_entry_size
3650 variable.
3651 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3652 method.
3653 (Output_data_plt_i386::get_plt_entry_size): Call it.
3654 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3655 (Output_data_plt_i386::add_eh_frame): New method to call it.
3656 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3657 method.
3658 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3659 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3660 method.
3661 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3662 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3663 method instead of plt_entry_size.
3664 (Output_data_plt_i386::plt_entry_size)
3665 (Output_data_plt_i386::plt_eh_frame_fde_size)
3666 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3667 (Output_data_plt_i386_standard): ... here, new class.
3668 (Output_data_plt_i386_exec): New class.
3669 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3670 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3671 (Output_data_plt_i386::exec_plt_entry): Move to ...
3672 (Output_data_plt_i386_exec::plt_entry): ... here.
3673 (Output_data_plt_i386_dyn): New class.
3674 (Output_data_plt_i386::first_plt_entry): Move to ...
3675 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3676 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3677 (Output_data_plt_i386_dyn::plt_entry): ... here.
3678 (Target_i386::Target_i386): Take optional argument for the Target_info
3679 pointer to use.
3680 (Target_i386::do_make_data_plt): New virtual method.
3681 (Target_i386::make_data_plt): New method to call it.
3682 (Target_i386::make_plt_section): Use that.
3683 Call this->plt_->add_eh_frame method here.
3684 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3685 rather than plt_entry_size variable.
3686 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3687 (Output_data_plt_i386::address_for_local): Likewise.
3688 (Output_data_plt_i386::do_write): Likewise.
3689 Move guts of PLT filling to...
3690 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3691 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3692 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3693 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3694
3695 2012-05-01 Cary Coutant <ccoutant@google.com>
3696
3697 * dwarf_reader.cc (Dwarf_die::read_attributes)
3698 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3699 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3700 * reduced_debug_output.cc
3701 (Output_reduced_debug_info_section::get_die_end): Remove
3702 DW_FORM_GNU_ref_index. Add default case.
3703
3704 2012-04-26 Mark Wielaard <mjw@redhat.com>
3705
3706 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3707 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3708 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3709 DW_AT_high_pc as offset from DW_AT_low_pc.
3710
3711 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3712 * testsuite/Makefile.in: Regenerate.
3713 * testsuite/gdb_index_test_3.c: New test source file.
3714 * testsuite/gdb_index_test_3.sh: New test source file.
3715
3716 2012-04-25 Ian Lance Taylor <iant@google.com>
3717
3718 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3719 pointer.
3720 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3721 as a class, not a struct.
3722 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3723 (Target_arm::apply_cortex_a8_workaround): Likewise.
3724 * gc.h: Declare Reloc_types as a struct, not a class.
3725 * object.h: Declare Symbols_data as a struct.
3726 * reloc.h: Declare Read_relocs_data as a struct.
3727 * target.h: Declare Relocate_info as a struct.
3728
3729 2012-04-24 David S. Miller <davem@davemloft.net>
3730
3731 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3732 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3733 and R_SPARC_WPLT30.
3734
3735 2012-04-24 Cary Coutant <ccoutant@google.com>
3736
3737 * incremental-dump.cc (find_input_containing_global): Replace
3738 magic number with symbolic constant.
3739 (dump_incremental_inputs): Update version number.
3740 * incremental.cc (Output_section_incremental_inputs): Update version
3741 number; import symbolic constants from Incremental_inputs_reader.
3742 (Incremental_inputs::create_data_sections): Align relocations
3743 section correctly for 64-bit targets.
3744 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3745 constants; add padding.
3746 (Output_section_incremental_inputs::write_header): Add assert for
3747 header_size.
3748 (Output_section_incremental_inputs::write_input_files): Add assert
3749 for input_entry_size.
3750 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3751 add assert for object_info_size, input_section_entry_size,
3752 global_sym_entry_size.
3753 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3754 for data structure sizes; use them.
3755 (Incremental_input_entry_reader): Import symbolic constants from
3756 Incremental_inputs_reader; use them.
3757
3758 2012-04-23 David S. Miller <davem@davemloft.net>
3759
3760 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3761 and elf_flags_set_.
3762 (Target_sparc::Target_sparc): Initialize new fields.
3763 (Target_sparc::do_make_elf_object): New function.
3764 (Target_sparc::do_adjust_elf_header): New function.
3765
3766 2012-04-23 Cary Coutant <ccoutant@google.com>
3767
3768 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3769 CU range table of gdb index.
3770
3771 2012-04-20 David S. Miller <davem@davemloft.net>
3772
3773 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3774 instead of false.
3775
3776 2012-04-16 David S. Miller <davem@davemloft.net>
3777
3778 * sparc.cc (Target_sparc::got_address): New function.
3779 (Sparc_relocate_functions::gdop_hix22): New function.
3780 (Sparc_relocate_functions::gdop_lox10): New function.
3781 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3782 relocs.
3783 (Target_sparc::Scan::local): Likewise if the global symbol is not
3784 preemptible and is not IFUNC.
3785 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3786 transformations for local and non-preemptible non-IFUNC global
3787 symbols.
3788
3789 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3790 writing out 64-bit part of ranges.
3791
3792 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3793 -fpic and -fpie respectively.
3794 * Makefile.in: Regenerate.
3795
3796 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3797 (Target_sparc::Target_sparc): Initialize new field.
3798 (Target_sparc::do_plt_section_for_global): New function.
3799 (Target_sparc::do_plt_section_for_local): New function.
3800 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3801 (Target_sparc::make_plt_section): New function, broken out of
3802 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3803 (Target_sparc::make_plt_entry): Call make_plt_section.
3804 (Target_sparc::make_local_ifunc_plt_entry): New function.
3805 (Target_sparc::rela_ifunc_section): New function.
3806 (Target_sparc::plt_section): Remove const.
3807 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3808 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3809 and ifunc_count_ fields.
3810 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3811 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3812 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3813 (Output_data_plt_sparc::rela_ifunc): New function.
3814 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3815 (Output_data_plt_sparc::has_ifunc_section): New function.
3816 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3817 (Output_data_plt_sparc::address_for_global): New function.
3818 (Output_data_plt_sparc::address_for_local): New function.
3819 (Output_data_plt_sparc::plt_index_to_offset): New function.
3820 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3821 and entry_count.
3822 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3823 entry_count.
3824 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3825 R_SPARC_JMP_IREL to switch.
3826 (Target_sparc::Scan::check_non_pic): Likewise.
3827 (Target_sparc::Scan::local): Handle IFUNC symbols.
3828 (Target_sparc::Scan::local): Likewise.
3829 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3830 and plt_address_for_local.
3831 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3832 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3833
3834 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3835 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3836 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3837 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3838 global relocs too.
3839 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3840 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3841 calls.
3842 * sparc.cc (Target_sparc::Scan::global): Likewise.
3843 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3844
3845 2012-04-16 Cary Coutant <ccoutant@google.com>
3846
3847 * archive.cc (Library_base::should_include_member): Check for
3848 --export-dynamic-symbol.
3849 * options.h (class General_options): Add --export-dynamic-symbol.
3850 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3851 --export-dynamic-symbol.
3852 (Symbol_table::gc_mark_undef_symbols): Likewise.
3853 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3854
3855 2012-04-12 David S. Miller <davem@davemloft.net>
3856
3857 * sparc.cc (Reloc::wdisp10): New relocation method.
3858 (Reloc::h34): Likewise.
3859 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3860 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3861 R_SPARC_WDISP10.
3862 (Target_sparc::Scan::local): Likewise.
3863 (Target_sparc::Scan::global): Likewise.
3864 (Target_sparc::Relocate::relocate): Likewise.
3865
3866 2012-04-09 Cary Coutant <ccoutant@google.com>
3867
3868 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3869 low_pc == 0.
3870
3871 2012-04-06 Ian Lance Taylor <iant@google.com>
3872
3873 * timer.cc: #include <unistd.h>.
3874
3875 2012-04-06 Roland McGrath <mcgrathr@google.com>
3876
3877 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3878 * config.in: Regenerate.
3879 * configure: Regenerate.
3880
3881 2012-04-05 Nick Clifton <nickc@redhat.com>
3882
3883 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3884 (AM_LC_MESSAGES): Add.
3885 * aclocal.m4: Regenerate.
3886 * config.in: Regenerate.
3887 * configure: Regenerate.
3888
3889 2012-03-21 Cary Coutant <ccoutant@google.com>
3890
3891 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3892 * Makefile.in: Regenerate.
3893 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3894 (Sized_elf_reloc_mapper::symbol_section): New function.
3895 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3896 (make_elf_reloc_mapper): New function.
3897 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3898 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3899 (Dwarf_abbrev_table::do_get_abbrev): New function.
3900 (Dwarf_ranges_table::read_ranges_table): New function.
3901 (Dwarf_ranges_table::read_range_list): New function.
3902 (Dwarf_pubnames_table::read_section): New function.
3903 (Dwarf_pubnames_table::read_header): New function.
3904 (Dwarf_pubnames_table::next_name): New function.
3905 (Dwarf_die::Dwarf_die): New function.
3906 (Dwarf_die::read_attributes): New function.
3907 (Dwarf_die::skip_attributes): New function.
3908 (Dwarf_die::set_name): New function.
3909 (Dwarf_die::set_linkage_name): New function.
3910 (Dwarf_die::attribute): New function.
3911 (Dwarf_die::string_attribute): New function.
3912 (Dwarf_die::int_attribute): New function.
3913 (Dwarf_die::uint_attribute): New function.
3914 (Dwarf_die::ref_attribute): New function.
3915 (Dwarf_die::child_offset): New function.
3916 (Dwarf_die::sibling_offset): New function.
3917 (Dwarf_info_reader::check_buffer): New function.
3918 (Dwarf_info_reader::parse): New function.
3919 (Dwarf_info_reader::do_parse): New function.
3920 (Dwarf_info_reader::do_read_string_table): New function.
3921 (Dwarf_info_reader::lookup_reloc): New function.
3922 (Dwarf_info_reader::get_string): New function.
3923 (Dwarf_info_reader::visit_compilation_unit): New function.
3924 (Dwarf_info_reader::visit_type_unit): New function.
3925 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3926 Sized_elf_reloc_mapper.
3927 (Sized_dwarf_line_info::symbol_section): Remove function.
3928 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3929 (Sized_dwarf_line_info::read_line_mappings): Remove object
3930 parameter, adjust callers.
3931 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3932 * dwarf_reader.h: Include <sys/types.h>.
3933 (class Track_relocs): Remove forward declaration.
3934 (class Elf_reloc_mapper): New class.
3935 (class Sized_elf_reloc_mapper): New class.
3936 (class Dwarf_abbrev_table): New class.
3937 (class Dwarf_range_list): New class.
3938 (class Dwarf_ranges_table): New class.
3939 (class Dwarf_pubnames_table): New class.
3940 (class Dwarf_die): New class.
3941 (class Dwarf_info_reader): New class.
3942 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3943 (Sized_dwarf_line_info::symbol_section): Remove member function.
3944 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3945 base class.
3946 * gdb-index.cc: New source file.
3947 * gdb-index.h: New source file.
3948 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3949 and .debug_types sections, call Layout::add_to_gdb_index.
3950 (Sized_relobj_incr::do_section_name): Implement.
3951 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3952 return type; Implement.
3953 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3954 return type.
3955 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3956 parameter list and return type.
3957 (Sized_incr_dynobj::do_section_contents): Likewise.
3958 * layout.cc: Include gdb-index.h.
3959 (Layout::Layout): Initialize gdb_index_data_.
3960 (Layout::init_fixed_output_section): Check for .gdb_index section.
3961 (Layout::add_to_gdb_index): New function. Instantiate.
3962 * layout.h: Add forward declaration for class Gdb_index.
3963 (Layout::add_to_gdb_index): New member function.
3964 (Layout::gdb_index_data_): New data member.
3965 * main.cc: Include gdb-index.h.
3966 (main): Print statistics for gdb index.
3967 * object.cc (Object::section_contents): Move code into
3968 do_section_contents.
3969 (need_decompressed_section): Check for sections needed when building
3970 gdb index.
3971 (build_compressed_section_map): Likewise.
3972 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3973 gdb index.
3974 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3975 sections; call Layout::add_to_gdb_index.
3976 (Sized_relobj_file::do_decompressed_section_contents): Call
3977 do_section_contents directly.
3978 * object.h (Object::do_section_contents): Adjust parameter list and
3979 return type.
3980 (Object::do_decompressed_section_contents): Call do_section_contents
3981 directly.
3982 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3983 return type.
3984 * options.h (class General_options): Add --gdb-index option.
3985 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3986 list and return type.
3987 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3988 * reloc.h (Track_relocs::checkpoint): New function.
3989 (Track_relocs::reset): New function.
3990
3991 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3992 New test cases.
3993 * testsuite/Makefile.in: Regenerate.
3994 * testsuite/gdb_index_test.cc: New test source file.
3995 * testsuite/gdb_index_test_1.sh: New test source file.
3996 * testsuite/gdb_index_test_2.sh: New test source file.
3997
3998 2012-03-19 Doug Kwan <dougkwan@google.com>
3999
4000 * arm.cc (Target_arm::do_define_standard_symbols): New method.
4001 (Target_arm::do_finalize_sections): Remove code which defines
4002 __exidx_start and __exidx_end. Make symbol table parameter
4003 anonymous as it is not used.
4004 * gold.cc (queue_middle_tasks): Call target hook to define any
4005 target-specific symbols.
4006 * target.h (Target::define_standard_symbols): New method.
4007 (Target::do_define_standard_symbols): Same.
4008 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4009 * testsuite/Makefile.in: Regenerate.
4010 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4011 and __exidx_end.
4012 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4013 relocations are generated for __exidx_start and __exidx_end.
4014
4015 2012-03-16 Doug Kwan <dougkwan@google.com>
4016
4017 * testsuite/Makefile.am: Disable test initpri3b.
4018 * testsuite/Makefile.in: Regenerate.
4019
4020 2012-03-15 Doug Kwan <dougkwan@google.com>
4021
4022 * arm.cc (Target_arm::got_section): Make .got section read-only
4023 if -z now is given.
4024
4025 2012-03-15 Ian Lance Taylor <iant@google.com>
4026
4027 PR gold/13850
4028 * layout.cc (Layout::make_output_section): Correctly mark
4029 SHT_INIT_ARRAY, et. al., as relro.
4030
4031 2012-03-14 Doug Kwan <dougkwan@google.com>
4032
4033 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4034 dynamic relocations for protected symbols in shared objects.
4035
4036 2012-03-13 Ian Lance Taylor <iant@google.com>
4037
4038 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4039 keep the larger alignment.
4040
4041 2012-03-12 Cary Coutant <ccoutant@google.com>
4042
4043 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4044 handling of DW_LNE_define_file.
4045
4046 2012-03-12 Cary Coutant <ccoutant@google.com>
4047
4048 * reduced_debug_output.cc
4049 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4050 codes to switch.
4051
4052 2012-02-29 Cary Coutant <ccoutant@google.com>
4053
4054 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4055
4056 2012-02-29 Cary Coutant <ccoutant@google.com>
4057
4058 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4059 Call Object::decompressed_section_contents.
4060 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4061 New dtor.
4062 (Sized_dwarf_line_info::buffer_start_): New data member.
4063 * merge.cc (Output_merge_data::do_add_input_section): Call
4064 Object::decompressed_section_contents.
4065 (Output_merge_string::do_add_input_section): Likewise.
4066 * object.cc (need_decompressed_section): New function.
4067 (build_compressed_section_map): Decompress sections needed later.
4068 (Sized_relobj_file::do_decompressed_section_contents): New function.
4069 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4070 * object.h (Object::decompressed_section_contents): New function.
4071 (Object::discard_decompressed_sections): New function.
4072 (Object::do_decompressed_section_contents): New function.
4073 (Object::do_discard_decompressed_sections): New function.
4074 (Compressed_section_info): New type.
4075 (Compressed_section_map): Include decompressed section contents.
4076 (Sized_relobj_file::do_decompressed_section_contents): New function.
4077 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4078
4079 2012-02-16 Cary Coutant <ccoutant@google.com>
4080
4081 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4082 * testsuite/Makefile.in: Regenerate.
4083
4084 2012-02-14 Cary Coutant <ccoutant@google.com>
4085
4086 * options.cc (General_options::finalize): Disallow -pie and -static.
4087
4088 2012-02-03 Doug Kwan <dougkwan@google.com>
4089
4090 * arm.cc (Arm_relocate_functions::abs8,
4091 Arm_relocate_functions::abs16): Use
4092 Bits::has_signed_unsigned_overflow32.
4093 (Arm_relocate_functions::thm_abs8): Correct range of
4094 overflow check.
4095 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4096 in assertions.
4097
4098 2012-02-02 Doug Kwan <dougkwan@google.com>
4099
4100 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4101 position independent outputs, not just shared objects.
4102
4103 2012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4104
4105 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4106 * configure: Regenerated.
4107
4108 2012-01-27 Ian Lance Taylor <iant@google.com>
4109
4110 * reloc.h (Bits): New class with static functions, copied from
4111 namespace utils in arm.cc.
4112 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4113 instead.
4114
4115 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4116
4117 * incremental.cc (write_info_blocks): Correct relocation offset.
4118
4119 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4120
4121 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4122 (Relocate::tls_gd_to_le): Likewise.
4123
4124 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4125
4126 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4127
4128 2012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4129
4130 * configure.ac: Check if -mcmodel=medium works.
4131 * configure: Regenerated.
4132
4133 2012-01-24 Cary Coutant <ccoutant@google.com>
4134
4135 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4136 definition and ...
4137 (read_unsigned_LEB_128_x): ... this new function.
4138 (read_signed_LEB_128): Replaced with inline definition and ...
4139 (read_signed_LEB_128_x): ... this new function.
4140 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4141 (read_unsigned_LEB_128): Add inline definition.
4142 (read_signed_LEB_128_x): New function.
4143 (read_signed_LEB_128): Add inline definition.
4144 * testsuite/Makefile.am (leb128_unittest): New unit test.
4145 * testsuite/Makefile.in: Regenerate.
4146 * testsuite/leb128_unittest.cc: New unit test.
4147
4148 2012-01-23 Ian Lance Taylor <iant@google.com>
4149
4150 PR gold/13617
4151 * i386.cc (Target_i386::do_code_fill): When using a jmp
4152 instruction, pad with nop instructions.
4153 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4154
4155 2012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4156
4157 * x86_64.cc (gc_process_relocs): Add typename on types used in
4158 template.
4159 (scan_relocs): Likewise.
4160 (relocate_section): Likewise.
4161 (apply_relocation): Likewise.
4162
4163 2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4164
4165 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4166 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4167 under x32.
4168
4169 2012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4170
4171 * x86_64.cc: Initial support for x32.
4172
4173 2012-01-03 Cary Coutant <ccoutant@google.com>
4174
4175 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4176 Use abstract base class for GOT.
4177 * gold/output.h (class Output_data_got_base): New abstract base class.
4178 (class Output_data_got): Derive from new base class, adjust ctors.
4179 (Output_data_got::reserve_slot): Make virtual; rename to
4180 do_reserve_slot; Adjust callers.
4181 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4182 pointer to abstract base class.
4183 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4184
4185 2011-12-18 Ian Lance Taylor <iant@google.com>
4186
4187 * object.h (Relobj::local_symbol_value): New function.
4188 (Relobj::local_plt_offset): New function.
4189 (Relobj::local_has_got_offset): New function.
4190 (Relobj::local_got_offset): New function.
4191 (Relobj::set_local_got_offset): New function.
4192 (Relobj::do_local_symbol_value): New pure virtual function.
4193 (Relobj::do_local_plt_offset): Likewise.
4194 (Relobj::do_local_has_got_offset): Likewise.
4195 (Relobj::do_local_got_offset): Likewise.
4196 (Relobj::do_set_local_got_offset): Likewise.
4197 (Sized_relobj::do_local_has_got_offset): Rename from
4198 local_has_got_offset.
4199 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4200 (Sized_relobj::do_set_local_got_offset): Rename from
4201 set_local_got_offset.
4202 (Sized_relobj_file::do_local_plt_offset): Rename from
4203 local_plt_offset.
4204 (Sized_relobj_file::do_local_symbol_value): New function.
4205 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4206 local_plt_offset.
4207 * output.cc (Output_data_got::Got_entry::write): Change object to
4208 Relobj. Use local_symbol_value.
4209 (Output_data_got::add_global_with_rel): Change rel_dyn to
4210 Output_data_reloc_generic*. Use add_global_generic.
4211 (Output_data_got::add_global_with_rela): Remove. Change all
4212 callers to use add_global_with_rel.
4213 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4214 Output_data_reloc_generic*. Use add_global_generic.
4215 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4216 callers to use add_global_pair_with_rel.
4217 (Output_data_got::add_local): Change object to Relobj*.
4218 (Output_data_got::add_local_plt): Likewise.
4219 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4220 change rel_dyn to Output_data_reloc_generic*. Use
4221 add_local_generic.
4222 (Output_data_got::add_local_with_rela): Remove. Change all
4223 callers to use all_local_with_rel.
4224 (Output_data_got::add_local_pair_with_rel): Change object to
4225 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4226 add_output_section_generic.
4227 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4228 callers to use add_local_pair_with_rel.
4229 (Output_data_got::reserve_local): Change object to Relobj*.
4230 * output.h: (class Output_data_reloc_generic): Add pure virtual
4231 declarations for add_global_generic, add_local_generic,
4232 add_output_section_generic.
4233 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4234 functions for Output_data_reloc_generic. Update declarations for
4235 changes listed in output.cc.
4236 (class Output_data_got): Change template parameter to got_size.
4237 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4238 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4239 function.
4240 (Sized_relobj_incr::do_local_plt_offset): New function.
4241 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4242 add_global_generic.
4243
4244 2011-12-17 Cary Coutant <ccoutant@google.com>
4245
4246 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4247 * resolve.cc (Symbol_table::resolve): Likewise.
4248 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4249 arrays.
4250 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4251
4252 2011-12-16 Ian Lance Taylor <iant@google.com>
4253
4254 * output.h (Output_data_reloc_generic::add): Only call
4255 add_dynamic_reloc if this is a dynamic reloc section.
4256
4257 2011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4258
4259 PR gold/13505
4260 * target-reloc.h (apply_relocation): Replace <64, false> with
4261 <size, big_endian>.
4262
4263 2011-11-25 Nick Clifton <nickc@redhat.com>
4264
4265 * po/it.po: New Italian translation.
4266
4267 2011-11-17 Sterling Augustine <saugustine@google.com>
4268
4269 * script.cc (script_include_directive): Implement.
4270 (read_script_file): New local variables name and search_path. Update
4271 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4272 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4273 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4274
4275 2011-11-11 Sterling Augustine <saugustine@google.com>
4276
4277 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4278 (file_or_sections_cmd): Likewise.
4279
4280 2011-11-11 Doug Kwan <dougkwan@google.com>
4281
4282 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4283 if --just-symbols is given.
4284
4285 2011-11-10 Doug Kwan <dougkwan@google.com>
4286
4287 PR gold/13362
4288 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4289 when processing data relocs.
4290 * reloc.h (Relocate_functions::rel_unaligned): New method.
4291 (Relocate_functions::pcrel_unaligned): Ditto.
4292 (Relocate_functions::rel32_unaligned): Ditto.
4293 (Relocate_functions::pcrel32_unaligned): Ditto.
4294
4295 2011-11-09 Doug Kwan <dougkwan@google.com>
4296
4297 PR gold/13362
4298 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4299 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4300 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4301 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4302 (Relocate_functions::rel_unaligned): New.
4303 (Relocate_functions::rel32_unaligned): New.
4304 * target-reloc.h (relocate_for_relocatable): Add code to handle
4305 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4306 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4307 arm_unaligned_reloc_r): New targets.
4308 * testsuite/Makefile.in: Regenerate.
4309 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4310 linking.
4311
4312 2011-11-02 Ian Lance Taylor <iant@google.com>
4313
4314 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4315 NATIVE_LINKER.
4316 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4317 * options.cc (General_options::finalize): Use library search path
4318 from configure script if specified. If not native and no sysroot,
4319 only search TOOLLIBDIR.
4320 * options.h (Search_directory::Search_directory): Change name to
4321 const std::string&.
4322 (General_options::add_to_library_path_with_sysroot): Change arg to
4323 const std::string&.
4324 * configure, Makefile.in, config.in: Rebuild.
4325
4326 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4327
4328 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4329 we are working around the ARM1176 Erratum.
4330 * options.h (General_options::fix_arm1176): Add option.
4331 * testsuite/Makefile.am: Add testcases, and keep current ones
4332 working.
4333 * testsuite/Makefile.in: Regenerate.
4334 * testsuite/arm_fix_1176.s: New file.
4335 * testsuite/arm_fix_1176.sh: Likewise.
4336
4337 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4338
4339 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4340 may_use_blx_.
4341 (Target_arm::may_use_blx): Remove method.
4342 (Target_arm::set_may_use_blx): Likewise.
4343 (Target_arm::may_use_v4t_interworking): New method.
4344 (Target_arm::may_use_v5t_interworking): Likewise.
4345 (Target_arm::may_use_blx_): Remove member variable.
4346 (Arm_relocate_functions::arm_branch_common): Check for v5T
4347 interworking.
4348 (Arm_relocate_functions::thumb_branch_common): Likewise.
4349 (Reloc_stub::stub_type_for_reloc): Likewise.
4350 (Target_arm::do_finalize_sections): Correct interworking checks.
4351 * testsuite/Makefile.am: Add new tests.
4352 * testsuite/Makefile.in: Regenerate.
4353 * testsuite/arm_farcall_arm_arm.s: New test.
4354 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4355 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4356 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4357 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4358 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4359 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4360 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4361
4362 2011-10-31 Cary Coutant <ccoutant@google.com>
4363
4364 PR gold/13023
4365 * expression.cc (Expression::eval_with_dot): Add
4366 is_section_dot_assignment parameter.
4367 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4368 absolute and assigning to dot within a section.
4369 * script-sections.cc
4370 (Output_section_element_assignment::set_section_addresses): Pass
4371 dot_section to set_if_absolute.
4372 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4373 as is_section_dot_assignment flag to eval_with_dot.
4374 (Output_section_element_dot_assignment::set_section_addresses):
4375 Likewise.
4376 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4377 parameter. Also set value if relative to dot_section; set the
4378 symbol's output_section.
4379 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4380 parameter. Adjust all callers.
4381 (Expression::eval_maybe_dot): Likewise.
4382 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4383 Adjust all callers.
4384 * testsuite/script_test_2.t: Test assignment of an absolute value
4385 to dot within an output section element.
4386
4387 2011-10-31 Cary Coutant <ccoutant@google.com>
4388
4389 * options.h (class General_options): Add --[no-]gnu-unique options.
4390 * symtab.cc (Symbol_table::sized_write_globals): Convert
4391 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4392
4393 2011-10-31 Cary Coutant <ccoutant@google.com>
4394
4395 PR gold/13359
4396 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4397 unnecessary assertion.
4398 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4399
4400 2011-10-31 Sriraman Tallam <tmsriram@google.com>
4401
4402 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4403 gc_mark_symbol.
4404 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4405 gc_mark_symbol.
4406 Change to just keep the section associated with symbol.
4407 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4408 they are externally visible and --export-dynamic is turned on.
4409 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4410
4411 2011-10-19 Ian Lance Taylor <iant@google.com>
4412
4413 PR gold/13163
4414 * script-sections.cc
4415 (Output_section_element_dot_assignment::needs_output_section): New
4416 function.
4417
4418 2011-10-19 Ian Lance Taylor <iant@google.com>
4419
4420 PR gold/13204
4421 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4422 --section-start option was seen.
4423 * options.h (General_options::any_section_start): New function.
4424
4425 2011-10-18 David S. Miller <davem@davemloft.net>
4426
4427 PR binutils/13301
4428 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4429 member to track relocation locations that have moved during TLS
4430 reloc optimizations.
4431 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4432 (Target_sparc::Relocate::relocate): Adjust view down by 4
4433 bytes if it matches reloc_adjust_addr_.
4434 (Target_sparc::Relocate::relocate_tls): Always move the
4435 __tls_get_addr call delay slot instruction forward 4 bytes when
4436 performing relaxation.
4437
4438 2011-10-18 Cary Coutant <ccoutant@google.com>
4439
4440 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4441 (Output_file::map_no_anonymous): Check for non-zero
4442 return code from posix_fallocate.
4443
4444 2011-10-17 Cary Coutant <ccoutant@google.com>
4445
4446 PR gold/13245
4447 * plugin.cc (is_visible_from_outside): Check for symbols
4448 referenced from dynamic objects.
4449 * resolve.cc (Symbol_table::resolve): Don't count references
4450 from dynamic objects as references from real ELF files.
4451 * testsuite/plugin_test_2.sh: Adjust expected result.
4452
4453 2011-10-17 Cary Coutant <ccoutant@google.com>
4454
4455 * gold.cc: Include timer.h.
4456 (queue_middle_tasks): Stamp time.
4457 (queue_final_tasks): Likewise.
4458 * main.cc (main): Store timer in parameters. Print timers
4459 for each pass.
4460 * parameters.cc (Parameters::Parameters): Initialize timer_.
4461 (Parameters::set_timer): New function.
4462 (set_parameters_timer): New function.
4463 * parameters.h (Parameters::set_timer): New function.
4464 (Parameters::timer): New function.
4465 (Parameters::timer_): New data member.
4466 (set_parameters_timer): New function.
4467 * timer.cc (Timer::stamp): New function.
4468 (Timer::get_pass_time): New function.
4469 * timer.h (Timer::stamp): New function.
4470 (Timer::get_pass_time): New function.
4471 (Timer::pass_times_): New data member.
4472
4473 2011-10-17 Cary Coutant <ccoutant@google.com>
4474
4475 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4476 task for members of lib groups.
4477
4478 2011-10-17 Cary Coutant <ccoutant@google.com>
4479
4480 PR gold/13288
4481 * fileread.cc (File_read::find_view): Add assert.
4482 (File_read::make_view): Move bounds check (replace with assert)...
4483 (File_read::find_or_make_view): ... to here.
4484
4485 2011-10-12 Cary Coutant <ccoutant@google.com>
4486
4487 * output.cc (Output_file::open_base_file): Handle case where
4488 ::read returns less than requested size.
4489
4490 2011-10-10 Cary Coutant <ccoutant@google.com>
4491
4492 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
4493 Initialize defined_count_.
4494 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4495 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4496 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4497 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4498 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4499 * incremental.h (Sized_relobj_incr::defined_count_): New data
4500 member.
4501 (Sized_incr_dynobj::defined_count_): New data member.
4502 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
4503 Return zeroes instead of internal error.
4504
4505 2011-10-10 Cary Coutant <ccoutant@google.com>
4506
4507 PR gold/13249
4508 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
4509 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4510 * output.h (class Output_reloc): Add use_plt_offset flag.
4511 (Output_reloc::type_): Adjust size of bit field.
4512 (Output_reloc::use_plt_offset_): New bit field.
4513 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4514 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4515 flag. Adjust all callers.
4516 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
4517 creating RELATIVE relocations.
4518
4519 2011-10-10 Nick Clifton <nickc@redhat.com>
4520
4521 * po/es.po: Updated Spanish translation.
4522 * po/fi.po: Updated Finnish translation.
4523
4524 2011-10-03 Diego Novillo <dnovillo@google.com>
4525
4526 * options.cc (parse_uint): Fix dereference of RETVAL.
4527
4528 2011-09-29 Sriraman Tallam <tmsriram@google.com>
4529
4530 * layout.h (section_order_map_): New member.
4531 (get_section_order_map): New member function.
4532 * output.cc (Output_section::add_input_section): Check for patterns
4533 only when --section-ordering-file is specified.
4534 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4535 output_sections have been formed.
4536 * layout.cc (Layout_Layout): Initialize section_order_map_.
4537 * plugin.cc (update_section_order): Store order in order_map. Do not
4538 update the order.
4539 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4540 * testsuite/Makefile.in: Regenerate.
4541 * testsuite/plugin_section_order.c: New file.
4542 * testsuite/plugin_final_layout.cc: New file.
4543 * testsuite/plugin_final_layout.sh: New file.
4544
4545 2011-09-29 Cary Coutant <ccoutant@google.com>
4546
4547 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4548 Check for NULL.
4549 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
4550 symbols during incremental update.
4551 (Symbol_table::add_from_dynobj): Likewise.
4552
4553 2011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4554 Ian Lance Taylor <iant@google.com>
4555
4556 * symtab.cc (Symbol_table::define_special_symbol): Always
4557 canonicalize version string.
4558
4559 2011-09-26 Cary Coutant <ccoutant@google.com>
4560
4561 * gold.cc (queue_initial_tasks): Move option checks ...
4562 * options.cc (General_options::finalize): ... to here. Disable
4563 some options; make others fatal.
4564
4565 2011-09-26 Cary Coutant <ccoutant@google.com>
4566
4567 gcc PR lto/47247
4568 * plugin.cc (get_symbols_v2): New function.
4569 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4570 (is_referenced_from_outside): New function.
4571 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4572 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4573 (get_symbols): Pass version parameter.
4574 (get_symbols_v2): New function.
4575 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4576 parameter.
4577 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4578 (onload): Add LDPT_GET_SYMBOLS_V2.
4579 (all_symbols_read_hook): Use get_symbols_v2; check for
4580 LDPR_PREVAILING_DEF_IRONLY_EXP.
4581 * testsuite/plugin_test_3.sh: Update expected results.
4582
4583 2011-09-23 Simon Baldwin <simonb@google.com>
4584
4585 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4586 configuration options.
4587 * configure: Regenerate.
4588 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4589 * Makefile.in: Regenerate.
4590 * testsuite/Makefile.in: Regenerate.
4591
4592 2011-09-19 Sriraman Tallam <tmsriram@google.com>
4593
4594 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4595
4596 2011-09-19 Cary Coutant <ccoutant@google.com>
4597
4598 * incremental.cc (can_incremental_update): Fix typo in comment.
4599 * incremental.h (can_incremental_update): Likewise.
4600
4601 2011-09-18 Cary Coutant <ccoutant@google.com>
4602
4603 * incremental.cc (can_incremental_update): New function.
4604 * incremental.h (can_incremental_update): New function.
4605 * layout.cc (Layout::init_fixed_output_section): Call it.
4606 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4607 * object.cc (Sized_relobj_file::do_layout): Call
4608 can_incremental_update.
4609
4610 2011-09-13 Cary Coutant <ccoutant@google.com>
4611
4612 * configure.ac: Check for glibc support for gnu_indirect_function
4613 support with static linking, setting automake conditional
4614 IFUNC_STATIC.
4615 * Makefile.in: Regenerate.
4616 * configure: Regenerate.
4617
4618 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4619 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4620 for IFUNC_STATIC.
4621 * testsuite/Makefile.in: Regenerate.
4622
4623 2011-09-13 Cary Coutant <ccoutant@google.com>
4624
4625 * incremental.cc (Sized_relobj_incr::do_layout): Call
4626 report_comdat_group for kept comdat sections.
4627 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4628 * testsuite/Makefile.in: Regenerate.
4629 * testsuite/incr_comdat_test_1.cc: New source file.
4630 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4631 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4632 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4633
4634 2011-09-13 Ian Lance Taylor <iant@google.com>
4635
4636 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4637 variable external_symbols_offset.
4638
4639 2011-09-12 Ian Lance Taylor <iant@google.com>
4640
4641 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4642 triggered if object has no symbols.
4643
4644 2011-09-09 David S. Miller <davem@davemloft.net>
4645
4646 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4647 (Output_fill_debug_line::do_write): Likewise.
4648
4649 2011-08-29 Cary Coutant <ccoutant@google.com>
4650
4651 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4652 casts to match formatting specs.
4653 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4654
4655 2011-08-26 Cary Coutant <ccoutant@google.com>
4656
4657 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4658 remaining hole size when allocating.
4659 (Layout::make_output_section): Set fill methods for debug sections.
4660 * layout.h (Free_list::Free_list_node): Move from private to
4661 public.
4662 (Free_list::set_min_hole_size): New function.
4663 (Free_list::begin, Free_list::end): New functions.
4664 (Free_list::min_hole_): New data member.
4665 * output.cc: Include dwarf.h.
4666 (Output_fill_debug_info::do_minimum_hole_size): New function.
4667 (Output_fill_debug_info::do_write): New function.
4668 (Output_fill_debug_line::do_minimum_hole_size): New function.
4669 (Output_fill_debug_line::do_write): New function.
4670 (Output_section::Output_section): Initialize new data member.
4671 (Output_section::set_final_data_size): Ensure patch space is larger
4672 than minimum hole size.
4673 (Output_section::do_write): Fill holes in debug sections.
4674 * output.h (Output_fill): New class.
4675 (Output_fill_debug_info): New class.
4676 (Output_fill_debug_line): New class.
4677 (Output_section::set_free_space_fill): New function.
4678 (Output_section::free_space_fill_): New data member.
4679 * testsuite/Makefile.am (incremental_test_3): Add
4680 --incremental-patch option.
4681 (incremental_test_4): Likewise.
4682 (incremental_test_5): Likewise.
4683 (incremental_test_6): Likewise.
4684 (incremental_copy_test): Likewise.
4685 (incremental_common_test_1): Likewise.
4686 * testsuite/Makefile.in: Regenerate.
4687
4688 2011-08-26 Nick Clifton <nickc@redhat.com>
4689
4690 * po/es.po: Updated Spanish translation.
4691
4692 2011-08-01 Cary Coutant <ccoutant@google.com>
4693
4694 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4695 * gold/testsuite/Makefile.in: Regenerate.
4696 * gold/testsuite/justsyms_exec.c: New source file.
4697 * gold/testsuite/justsyms_lib.c: New source file.
4698
4699 2011-08-01 Cary Coutant <ccoutant@google.com>
4700
4701 * layout.cc (Layout::set_segment_offsets): Don't realign text
4702 segment if -Ttext was specified.
4703 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4704 file type.
4705 * object.h (Sized_relobj_file::e_type): New function.
4706 (Sized_relobj_file::e_type_): New data member.
4707 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4708 base address for ET_EXEC files.
4709 * target.cc (Target::do_make_elf_object_implementation): Allow
4710 ET_EXEC files with --just-symbols option.
4711
4712 2011-07-28 Cary Coutant <ccoutant@google.com>
4713
4714 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4715 Add thread_number parameter.
4716 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4717 * workqueue-threads.cc
4718 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4719 current thread if its thread number is greater than desired thread
4720 count.
4721 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4722 Add thread_number parameter.
4723 (Workqueue::should_cancel_thread): Likewise.
4724 (Workqueue::find_runnable_or_wait): Pass thread_number to
4725 should_cancel_thread.
4726 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4727 parameter.
4728
4729 2011-07-22 Sriraman Tallam <tmsriram@google.com>
4730
4731 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4732 only after checking if it cannot be forced local.
4733 * symtab.h (is_externally_visible): Check if the symbol is not forced
4734 local.
4735
4736 2011-07-15 Ian Lance Taylor <iant@google.com>
4737
4738 * options.h (class General_options): Add --print-output-format.
4739 Move -EL next to -EB, for better --help output.
4740 * target-select.cc: Include <cstdio>, "options.h", and
4741 "parameters.h".
4742 (Target_selector::do_target_bfd_name): New function.
4743 (print_output_format): New function.
4744 * target-select.h (class Target_selector): Update declarations.
4745 (Target_selector::target_bfd_name): New function.
4746 (print_output_format): Declare.
4747 * main.cc: Include "target-select.h".
4748 (main): Handle --print-output-format.
4749 * gold.cc: Include "target-select.h".
4750 (queue_initial_tasks): Handle --print-output-format when there are
4751 no input files.
4752 * parameters.cc (parameters_force_valid_target): Give a better
4753 error message if -EB/-EL does not match target.
4754 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4755 function.
4756
4757 2011-07-15 Ian Lance Taylor <iant@google.com>
4758
4759 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4760 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4761 (Output_data_plt_i386::do_write): Write address of .dynamic
4762 section to first entry in .got.plt section.
4763 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4764 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4765 Initialize layout_.
4766 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4767 section to first entry in .got.plt section.
4768 * layout.h (Layout::dynamic_section): New function.
4769
4770 2011-07-13 Sriraman Tallam <tmsriram@google.com>
4771
4772 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4773 to claim_file call.
4774 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4775 input_section_position_, and input_section_glob_.
4776 (read_layout_from_file): Call function section_ordering_specified.
4777 * layout.h (is_section_ordering_specified): New function.
4778 (section_ordering_specified): New function.
4779 (section_ordering_specified_): New boolean member.
4780 * main.cc(main): Call load_plugins after layout object is defined.
4781 * output.cc (Output_section::add_input_section): Use
4782 function section_ordering_specified to check if section ordering is
4783 needed.
4784 * output.cc (Output_section::add_relaxed_input_section): Use
4785 function section_ordering_specified to check if section ordering is
4786 needed.
4787 (Output_section::update_section_layout): New function.
4788 (Output_section::sort_attached_input_sections): Check if input section
4789 must be reordered.
4790 * output.h (Output_section::update_section_layout): New function.
4791 * plugin.cc (get_section_count): New function.
4792 (get_section_type): New function.
4793 (get_section_name): New function.
4794 (get_section_contents): New function.
4795 (update_section_order): New function.
4796 (allow_section_ordering): New function.
4797 (Plugin::load): Add the new interfaces to the transfer vector.
4798 (Plugin_manager::load_plugins): New parameter.
4799 (Plugin_manager::all_symbols_read): New parameter.
4800 (Plugin_manager::claim_file): New parameter. Save the elf object for
4801 unclaimed objects.
4802 (Plugin_manager::get_elf_object): New function.
4803 (Plugin_manager::get_view): Change to directly use the bool to check
4804 if get_view is called from claim_file_hook.
4805 * plugin.h (input_objects): New function
4806 (Plugin__manager::load_plugins): New parameter.
4807 (Plugin_manager::claim_file): New parameter.
4808 (Plugin_manager::get_elf_object): New function.
4809 (Plugin_manager::in_claim_file_handler): New function.
4810 (Plugin_manager::in_claim_file_handler_): New member.
4811 (layout): New function.
4812 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4813 handler with an extra parameter. Make the elf object before calling
4814 claim_file handler.
4815 * testsuite/plugin_test.c (get_section_count): New function pointer.
4816 (get_section_type): New function pointer.
4817 (get_section_name): New function pointer.
4818 (get_section_contents): New function pointer.
4819 (update_section_order): New function pointer.
4820 (allow_section_ordering): New function pointer.
4821 (onload): Check if the new interfaces exist.
4822
4823 2011-07-13 Ian Lance Taylor <iant@google.com>
4824
4825 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4826 relro section.
4827 * x86_64.cc (Target_x86_64::got_section): Likewise.
4828 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4829 (relro_now_test_SOURCES): New variable.
4830 (relro_now_test_DEPENDENCIES): New variable.
4831 (relro_now_test_LDFLAGS): New variable.
4832 (relro_now_test_LDADD): New variable.
4833 (relro_now_test.so): New target.
4834 * testsuite/Makefile.in: Rebuild.
4835
4836 2011-07-12 Ian Lance Taylor <iant@google.com>
4837
4838 PR gold/12980
4839 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4840 GLOB_DAT relocation rather than a RELATIVE relocation for a
4841 protected symbol when creating a shared library.
4842 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4843 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4844 * testsuite/protected_main_1.cc (main): Test that protected
4845 function has same address.
4846
4847 2011-07-11 Ian Lance Taylor <iant@google.com>
4848
4849 PR gold/12979
4850 * options.h (class General_options): Add -Bgroup.
4851 * options.cc (General_options::finalize): If -Bgroup is set,
4852 default to --unresolved-symbols=report-all.
4853 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4854 * target-reloc.h (issue_undefined_symbol_error): Handle
4855 --unresolved-symbols=report-all.
4856
4857 2011-07-08 Ian Lance Taylor <iant@google.com>
4858
4859 PR gold/11985
4860 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4861 if linker script discards key sections.
4862 (Layout::create_dynamic_symtab): Likewise.
4863 (Layout::assign_local_dynsym_offsets): Likewise.
4864 (Layout::sized_create_version_sections): Likewise.
4865 (Layout::create_interp): Likewise.
4866 (Layout::finish_dynamic_section): Likewise.
4867 (Layout::set_dynamic_symbol_size): Likewise.
4868
4869 2011-07-08 Ian Lance Taylor <iant@google.com>
4870
4871 PR gold/12386
4872 * options.h (class General_options): Add --unresolved-symbols.
4873 * target-reloc.h (issue_undefined_symbol_error): Check
4874 --unresolved-symbols. Add comments.
4875
4876 2011-07-08 Ian Lance Taylor <iant@google.com>
4877
4878 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4879 expression more complex.
4880
4881 2011-07-08 Ian Lance Taylor <iant@google.com>
4882
4883 PR gold/11317
4884 * target-reloc.h (issue_undefined_symbol_error): New inline
4885 function, broken out of relocate_section.
4886 (relocate_section): Call issue_undefined_symbol_error.
4887 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4888 there is no TLS segment if we are about to issue an undefined
4889 symbol error.
4890 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4891
4892 2011-07-08 Ian Lance Taylor <iant@google.com>
4893
4894 PR gold/12279
4895 * resolve.cc (Symbol_table::should_override): Add fromtype
4896 parameter. Change all callers. Give error when linking together
4897 TLS and non-TLS symbol.
4898 (Symbol_table::should_override_with_special): Add fromtype
4899 parameter. Change all callers.
4900 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4901 there is no TLS segment if we have reported some errors.
4902 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4903
4904 2011-07-08 Ian Lance Taylor <iant@google.com>
4905
4906 PR gold/12372
4907 * target.h (Target::plt_address_for_global): New function.
4908 (Target::plt_address_for_local): New function.
4909 (Target::plt_section_for_global): Remove.
4910 (Target::plt_section_for_local): Remove.
4911 (Target::do_plt_address_for_global): New virtual function.
4912 (Target::do_plt_address_for_local): New virtual function.
4913 (Target::do_plt_section_for_global): Remove.
4914 (Target::do_plt_section_for_local): Remove.
4915 (Target::register_global_plt_entry): Add Symbol_table and Layout
4916 parameters.
4917 * output.cc (Output_data_got::Got_entry::write): Use
4918 plt_address_for_global and plt_address_for_local.
4919 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4920 address of output section.
4921 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4922 got_irelative_, and irelative_count_ fields. Update
4923 declarations.
4924 (Output_data_plt_i386::has_irelative_section): New function.
4925 (Output_data_plt_i386::entry_count): Add irelative_count_.
4926 (Output_data_plt_i386::set_final_data_size): Likewise.
4927 (class Target_i386): Add got_irelative_ and rel_irelative_
4928 fields. Update declarations.
4929 (Target_i386::Target_i386): Initialize new fields.
4930 (Target_i386::do_plt_address_for_global): New function replacing
4931 do_plt_section_for_global.
4932 (Target_i386::do_plt_address_for_local): New function replacing
4933 do_plt_section_for_local.
4934 (Target_i386::got_section): Create got_irelative_.
4935 (Target_i386::rel_irelative_section): New function.
4936 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4937 fields. Don't define __rel_iplt_{start,end}.
4938 (Output_data_plt_i386::add_entry): Add symtab and layout
4939 parameters. Change all callers. Use different PLT and GOT for
4940 IFUNC symbols.
4941 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4942 layout parameters. Change all callers. Use different PLT and
4943 GOT.
4944 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4945 (Output_data_plt_i386::rel_irelative): New function.
4946 (Output_data_plt_i386::address_for_global): New function.
4947 (Output_data_plt_i386::address_for_local): New function.
4948 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4949 IRELATIVE GOT when changing IFUNC GOT entries.
4950 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4951 reloc.
4952 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4953 if we didn't create an IRELATIVE GOT.
4954 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4955 plt_address_for_local.
4956 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4957 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4958 got_irelative_, and irelative_count_ fields. Update
4959 declarations.
4960 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4961 Initialize new fields. Remove symtab parameter. Change all
4962 callers.
4963 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4964 irelative_count_.
4965 (Output_data_plt_x86_64::has_irelative_section): New function.
4966 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4967 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4968 fields. Update declarations.
4969 (Target_x86_64::Target_x86_64): Initialize new fields.
4970 (Target_x86_64::do_plt_address_for_global): New function replacing
4971 do_plt_section_for_global.
4972 (Target_x86_64::do_plt_address_for_local): New function replacing
4973 do_plt_section_for_local.
4974 (Target_x86_64::got_section): Create got_irelative_.
4975 (Target_x86_64::rela_irelative_section): New function.
4976 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4977 all callers. Don't create __rel_iplt_{start,end}.
4978 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4979 parameters. Change all callers. Use different PLT and GOT for
4980 IFUNC symbols.
4981 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4982 layout parameters. Change all callers. Use different PLT and
4983 GOT.
4984 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4985 parameters. Change all callers. Use different PLT and GOT for
4986 IFUNC symbols.
4987 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4988 (Output_data_plt_x86_64::rela_irelative): New function.
4989 (Output_data_plt_x86_64::address_for_global): New function.
4990 (Output_data_plt_x86_64::address_for_local): New function.
4991 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4992 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4993 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4994 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4995 parameters.
4996 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4997 reloc.
4998 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4999 symbols if we didn't create an IRELATIVE GOT.
5000 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5001 plt_address_for_local.
5002 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5003 * testsuite/ifuncvar1.c: New test file.
5004 * testsuite/ifuncvar2.c: New test file.
5005 * testsuite/ifuncvar3.c: New test file.
5006 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5007 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5008 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5009 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5010 * testsuite/Makefile.in: Rebuild.
5011
5012 2011-07-07 Cary Coutant <ccoutant@google.com>
5013
5014 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5015 (two_file_test_1_ndebug.o): Likewise.
5016 (two_file_test_1b_ndebug.o): Likewise.
5017 (two_file_test_2_ndebug.o): Likewise.
5018 (two_file_test_main_ndebug.o): Likewise.
5019 (incremental_test_2): Link with no-debug versions.
5020
5021 2011-07-06 Cary Coutant <ccoutant@google.com>
5022
5023 * gold/incremental.cc
5024 (Output_section_incremental_inputs::write_info_blocks): Check for
5025 hidden and internal symbols.
5026
5027 2011-07-06 Cary Coutant <ccoutant@google.com>
5028
5029 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5030 Check disposition for startup file.
5031 (Incremental_inputs::report_command_line): Ignore
5032 --incremental-startup-unchanged option.
5033 * options.cc (General_options::parse_incremental_startup_unchanged):
5034 New function.
5035 (General_options::General_options): Initialize new data member.
5036 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5037 (General_options): Add --incremental-startup-unchanged option.
5038 (General_options::incremental_startup_disposition): New function.
5039 (General_options::incremental_startup_disposition_): New data member.
5040
5041 2011-07-06 Cary Coutant <ccoutant@google.com>
5042
5043 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5044 input file index to Script_info ctor.
5045 (Sized_incremental_binary::do_file_has_changed): Find the
5046 command-line argument for files named in scripts.
5047 * incremental.h (Script_info::Script_info): New ctor
5048 with input file index.
5049 (Script_info::input_file_index): New function.
5050 (Script_info::input_file_index_): New data member.
5051 (Incremental_binary::get_library): Add const.
5052 (Incremental_binary::get_script_info): Add const.
5053 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5054 * testsuite/Makefile.am (incremental_test_5): New test case.
5055 (incremental_test_6): New test case.
5056 * testsuite/Makefile.in: Regenerate.
5057
5058 2011-07-06 Cary Coutant <ccoutant@google.com>
5059
5060 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5061 debug output when command lines differ.
5062
5063 2011-07-06 Cary Coutant <ccoutant@google.com>
5064
5065 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5066 --incremental-patch option.
5067 * layout.cc (Free_list::allocate): Extend allocation beyond original
5068 end if enabled.
5069 (Layout::make_output_section): Mark sections that should get
5070 patch space.
5071 * options.cc (parse_percent): New function.
5072 * options.h (parse_percent): New function.
5073 (DEFINE_percent): New macro.
5074 (General_options): Add --incremental-patch option.
5075 * output.cc (Output_section::Output_section): Initialize new data
5076 members.
5077 (Output_section::add_input_section): Print section name when out
5078 of patch space.
5079 (Output_section::add_output_section_data): Likewise.
5080 (Output_section::set_final_data_size): Add patch space when
5081 doing --incremental-full.
5082 (Output_section::do_reset_address_and_file_offset): Remove patch
5083 space.
5084 (Output_segment::set_section_list_addresses): Print debug output
5085 only if --incremental-update.
5086 * output.h (Output_section::set_is_patch_space_allowed): New function.
5087 (Output_section::is_patch_space_allowed_): New data member.
5088 (Output_section::patch_space_): New data member.
5089 * parameters.cc (Parameters::incremental_full): New function.
5090 * parameters.h (Parameters::incremental_full): New function
5091 * testsuite/Makefile.am (incremental_test_2): Add test for
5092 --incremental-patch option.
5093 * testsuite/Makefile.in: Regenerate.
5094 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5095 (t18): Remove function body.
5096
5097 2011-07-05 Doug Kwan <dougkwan@google.com>
5098
5099 PR gold/12771
5100 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5101 Arm_Address type for relocation result.
5102 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5103 overflow check.
5104 (Arm_relocate_functions::abs32): Use unaligned access.
5105 (Arm_relocate_functions::rel32): Ditto.
5106 (Arm_relocate_functions::prel31): Ditto.
5107 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5108 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5109 static data relocations.
5110 * testsuite/Makefile.in: Regnerate.
5111 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5112
5113 2011-07-05 Ian Lance Taylor <iant@google.com>
5114
5115 PR gold/12392
5116 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5117 symbols if necessary.
5118 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5119
5120 2011-07-05 Ian Lance Taylor <iant@google.com>
5121
5122 PR gold/12952
5123 * resolve.cc (Symbol::override_base_with_special): Simply override
5124 version with special symbol version, ignoring previous version.
5125
5126 2011-07-05 Ian Lance Taylor <iant@google.com>
5127
5128 * object.cc (Sized_relobj_file::include_section_group): Add
5129 information to comment about signature location.
5130
5131 2011-07-02 Ian Lance Taylor <iant@google.com>
5132
5133 PR gold/12957
5134 * options.h (class General_options): Add -f and -F.
5135 * options.cc (General_options::finalize): Fatal error if -f/-F
5136 are used without -shared.
5137 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5138
5139 2011-07-02 Ian Lance Taylor <iant@google.com>
5140
5141 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5142
5143 2011-07-01 Ian Lance Taylor <iant@google.com>
5144
5145 PR gold/12525
5146 PR gold/12952
5147 * resolve.cc (Symbol::override_base_with_special): Don't override
5148 the version if the overriding symbol has a different name.
5149 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5150 all callers. If we give an error about an undefined version,
5151 define the base version if necessary.
5152 * dynobj.h (class Versions): Update declaration.
5153 * testsuite/weak_alias_test_5.cc: New file.
5154 * testsuite/weak_alias_test.script: New file.
5155 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5156 and versioned_alias have the right value, and call t2.
5157 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5158 weak_alias_test_5.so.
5159 (weak_alias_test_LDADD): Likewise.
5160 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5161 * testsuite/Makefile.in: Rebuild.
5162
5163 2011-07-01 Ian Lance Taylor <iant@google.com>
5164
5165 PR gold/12525
5166 * options.h (class General_options): Support -z notext.
5167 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5168 -Wl,-z,notext.
5169 (two_file_shared_nonpic.so): Likewise.
5170 (two_file_shared_mixed.so): Likewise.
5171 (two_file_shared_mixed_1.so): Likewise.
5172 (weak_undef_lib_nonpic.so): Likewise.
5173 (alt/weak_undef_lib_nonpic.so): Likewise.
5174 (tls_test_shared_nonpic.so): Likewise.
5175 * testsuite/Makefile.in: Rebuild.
5176
5177 2011-07-01 Ian Lance Taylor <iant@google.com>
5178
5179 PR gold/12525
5180 * configure.ac: Test whether static linking works, setting
5181 the automake conditional HAVE_STATIC.
5182 * testsuite/Makefile.am: Disable tests using -static if
5183 HAVE_STATIC is not true.
5184 * configure, testsuite/Makefile.in: Rebuild.
5185
5186 2011-07-01 Ian Lance Taylor <iant@google.com>
5187
5188 PR gold/12525
5189 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5190 Assert if we see DW_EH_PE_indirect.
5191 * target.h (Target::ehframe_datarel_base): New function.
5192 (Target::do_ehframe_datarel_base): New target function.
5193 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5194 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5195 function.
5196
5197 2011-07-01 Ian Lance Taylor <iant@google.com>
5198
5199 PR gold/12571
5200 * options.h (class General_options): Add
5201 --ld-generated-unwind-info.
5202 * ehframe.cc (Fde::write): Add address parameter. Change all
5203 callers. If associated with PLT, fill in address and size.
5204 (Cie::set_output_offset): Only add merge mapping if there is an
5205 object.
5206 (Cie::write): Add address parameter. Change all callers.
5207 (Eh_frame::add_ehframe_for_plt): New function.
5208 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5209 input_offset_ fields into union u_, with new plt field.
5210 (Fde::Fde): Adjust for new union field.
5211 (Fde::Fde) [Output_data version]: New constructor.
5212 (Fde::add_mapping): Only add merge mapping if there is an object.
5213 (class Cie): Update declarations.
5214 (class Eh_frame): Declare add_ehframe_for_plt.
5215 * layout.cc (Layout::layout_eh_frame): Break out code into
5216 make_eh_frame_section, and call it.
5217 (Layout::make_eh_frame_section): New function.
5218 (Layout::add_eh_frame_for_plt): New function.
5219 * layout.h (class Layout): Update declarations.
5220 * merge.cc (Merge_map::add_mapping): Add assertion.
5221 * i386.cc: Include "dwarf.h".
5222 (class Output_data_plt_i386): Make first_plt_entry,
5223 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5224 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5225 and plt_eh_frame_fde.
5226 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5227 boundary. Call add_eh_frame_for_plt if appropriate.
5228 * x86_64.cc: Include "dwarf.h".
5229 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5230 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5231 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5232 and plt_eh_frame_fde.
5233 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5234 appropriate.
5235
5236 2011-06-29 Ian Lance Taylor <iant@google.com>
5237
5238 PR gold/12629
5239 * object.cc (Sized_relobj_file::layout_section): Change shdr
5240 parameter to be const.
5241 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5242 out of do_layout.
5243 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5244 appropriate. Call layout_eh_frame_section.
5245 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5246 sections.
5247 * object.h (class Sized_relobj_file): Update declarations.
5248
5249 2011-06-29 Ian Lance Taylor <iant@google.com>
5250
5251 PR gold/12652
5252 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5253 modifier.
5254 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5255
5256 2011-06-29 Ian Lance Taylor <iant@google.com>
5257
5258 PR gold/12675
5259 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5260 SHT_X86_64_UNWIND.
5261 * layout.cc (Layout::layout_eh_frame): Likewise.
5262
5263 2011-06-29 Ian Lance Taylor <iant@google.com>
5264
5265 PR gold/12695
5266 * layout.cc (Layout::symtab_section_shndx): New function.
5267 * layout.h (class Layout): Declare symtab_section_shndx.
5268 * output.cc (Output_section::write_header): Call it.
5269
5270 2011-06-29 Ian Lance Taylor <iant@google.com>
5271
5272 PR gold/12818
5273 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5274 symbols which are not used in a relocation.
5275
5276 2011-06-28 Ian Lance Taylor <iant@google.com>
5277
5278 PR gold/12898
5279 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5280 script create indistinguishable segments.
5281 (Layout::set_segment_offsets): Use stable_sort when sorting
5282 segments. Pass this to Compare_segments constructor.
5283 * layout.h (class Layout): Make segment_precedes non-static.
5284 (class Compare_segments): Change from struct to class. Add
5285 layout_ field. Add constructor.
5286 * script-sections.cc
5287 (Script_sections::attach_sections_using_phdrs_clause): Rename
5288 local orphan to is_orphan. Don't report failure to put empty
5289 section in segment. On attachment failure, report name of
5290 section, and attach to first PT_LOAD segment.
5291
5292 2011-06-28 Ian Lance Taylor <iant@google.com>
5293
5294 PR gold/12934
5295 * target-select.cc (Target_selector::Target_selector): Add
5296 emulation parameter. Change all callers.
5297 (select_target_by_bfd_name): Rename from select_target_by_name.
5298 Change all callers.
5299 (select_target_by_emulation): New function.
5300 (supported_emulation_names): New function.
5301 * target-select.h (class Target_selector): Add emulation_ field.
5302 Update declarations.
5303 (Target_selector::recognize_by_bfd_name): Rename from
5304 recognize_by_name. Change all callers.
5305 (Target_selector::supported_bfd_names): Rename from
5306 supported_names. Change all callers.
5307 (Target_selector::recognize_by_emulation): New function.
5308 (Target_selector::supported_emulations): New function.
5309 (Target_selector::emulation): New function.
5310 (Target_selector::do_recognize_by_bfd_name): Rename from
5311 do_recognize_by_name. Change all callers.
5312 (Target_selector::do_supported_bfd_names): Rename from
5313 do_supported_names. Change all callers.
5314 (Target_selector::do_recognize_by_emulation): New function.
5315 (Target_selector::do_supported_emulations): New function.
5316 (select_target_by_bfd_name): Change name in declaration.
5317 (select_target_by_emulation): Declare.
5318 (supported_emulation_names): Declare.
5319 * parameters.cc (parameters_force_valid_target): Try to find
5320 target based on emulation from -m option.
5321 * options.h (class General_options): Change doc string for -m.
5322 * options.cc (help): Print emulations.
5323 (General_options::parse_V): Likewise.
5324 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5325 Add emulation parameter. Change all callers.
5326
5327 2011-06-28 Ian Lance Taylor <iant@google.com>
5328
5329 * target.h (class Target): Add osabi_ field.
5330 (Target::osabi): New function.
5331 (Target::set_osabi): New function.
5332 (Target::Target): Initialize osabi_.
5333 (Target::do_adjust_elf_header): Make pure virtual.
5334 (Sized_target::do_adjust_elf_header): Declare.
5335 * target.cc (Sized_target::do_adjust_elf_header): New function.
5336 (class Sized_target): Instantiate all versions.
5337 * freebsd.h (class Target_freebsd): Remove.
5338 (Target_selector_freebsd::do_recognize): Call set_osabi on
5339 Target.
5340 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5341 (Target_selector_freebsd::set_osabi): Remove.
5342 * i386.cc (class Target_i386): Inherit from Sized_target rather
5343 than Target_freebsd.
5344 * x86_64.cc (class Target_x86_64): Likewise.
5345
5346 2011-06-28 Ian Lance Taylor <iant@google.com>
5347
5348 * target.h (Target::can_check_for_function_pointers): Rewrite.
5349 Make non-virtual.
5350 (Target::can_icf_inline_merge_sections): Likewise.
5351 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5352 (Target::Target_info): Add can_icf_inline_merge_sections field.
5353 (Target::do_can_check_for_function_pointers): New virtual
5354 function.
5355 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5356 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5357 from can_check_for_function_pointers, move in file.
5358 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5359 section_may_have_icf_unsafe_poineters, move in file.
5360 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5361 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5362 Rename from can_check_for_function_pointers, move in file.
5363 (Target_i386::can_icf_inline_merge_sections): Remove.
5364 (Target_i386::i386_info): Initialize
5365 can_icf_inline_merge_sections.
5366 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5367 Initialize can_icf_inline_merge_sections.
5368 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5369 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5370 Rename from can_check_for_function_pointers, move in file.
5371 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5372 (Target_x86_64::x86_64_info): Initialize
5373 can_icf_inline_merge_sections.
5374 * testsuite/testfile.cc (Target_test::test_target_info):
5375 Likewise.
5376 * icf.cc (get_section_contents): Correct formatting.
5377
5378 2011-06-27 Ian Lance Taylor <iant@google.com>
5379
5380 * symtab.cc (Symbol::versioned_name): New function.
5381 (Symbol_table::add_to_final_symtab): Use versioned_name when
5382 appropriate.
5383 (Symbol_table::sized_write_symbol): Likewise.
5384 * symtab.h (class Symbol): Declare versioned_name.
5385 * stringpool.h (class Stringpool_template): Add variant of add
5386 which takes a std::basic_string.
5387 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5388 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5389 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5390 (ver_test_12.o): New target.
5391 * testsuite/Makefile.in: Rebuild.
5392
5393 2011-06-27 Doug Kwan <dougkwan@google.com>
5394
5395 * arm.cc (Arm_relocate_functions::thm_jump8,
5396 Arm_relocate_functions::thm_jump11): Use a wider signed
5397 type to compute offset.
5398 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5399 arm_thm_jump8.
5400 * testsuite/Makefile.in: Regenerate.
5401 * testsuite/arm_branch_in_range.sh: Check test results of
5402 arm_thm_jump11 and arm_thm_jump8.
5403 * testsuite/arm_thm_jump11.s: New test source file.
5404 * testsuite/arm_thm_jump11.t: New linker script.
5405 * testsuite/arm_thm_jump8.s: New test source file.
5406 * testsuite/arm_thm_jump8.t: New linker script.
5407
5408 2011-06-24 Ian Lance Taylor <iant@google.com>
5409
5410 * layout.cc: Include "object.h".
5411 (ctors_sections_in_init_array): New static variable.
5412 (Layout::is_ctors_in_init_array): New function.
5413 (Layout::layout): Add entry to ctors_sections_in_init_array if
5414 appropriate.
5415 * layout.h (class Layout): Declare is_ctors_in_init_array.
5416 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5417 is_ctors_reverse_view is set.
5418 (Sized_relobj_file::write_sections): Add layout parameter. Change
5419 all callers. Set is_ctors_reverse_view field of View_size.
5420 (Sized_relobj_file::reverse_words): New function.
5421 * object.h (Sized_relobj_file::View_size): Add
5422 is_ctors_reverse_view field.
5423 (class Sized_relobj_file): Update declarations.
5424 * testsuite/initpri3.c: New test.
5425 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5426 initpri3b.
5427 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5428 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5429 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5430 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5431 * testsuite/Makefile.in: Rebuild.
5432
5433 2011-06-24 Cary Coutant <ccoutant@google.com>
5434
5435 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5436 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5437 (debug_msg_cdebug.err): New targets.
5438 * testsuite/Makefile.in: Regenerate.
5439 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5440 Fix checks for link with shared library.
5441
5442 2011-06-24 Doug Kwan <dougkwan@google.com>
5443
5444 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5445 skip empty text sections.
5446 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5447
5448 2011-06-22 Ian Lance Taylor <iant@google.com>
5449
5450 PR gold/12910
5451 * options.h (class General_options): Add --ctors-in-init-array.
5452 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5453 friends as SHT_PROGBITS for merging sections.
5454 (Layout::layout): Remove special handling of .init_array and
5455 friends. Don't sort if doing relocatable link. Sort for .ctors
5456 and .dtors if ctors_in_init_array.
5457 (Layout::make_output_section): Force correct section types for
5458 .init_array and friends. Don't sort if doing relocatable link,
5459 Don't sort .ctors and .dtors if ctors_in_init_array.
5460 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5461 (Layout::output_section_name): Add relobj parameter. Change all
5462 callers. Handle .ctors. and .dtors. in code rather than table.
5463 Handle .ctors and .dtors if ctors_in_init_array.
5464 (Layout::match_file_name): New function, moved from output.cc.
5465 * layout.h (class Layout): Update declarations.
5466 * output.cc: Include "layout.h".
5467 (Input_section_sort_entry::get_priority): New function.
5468 (Input_section_sort_entry::match_file_name): Just call
5469 Layout::match_file_name.
5470 (Output_section::Input_section_sort_init_fini_compare::operator()):
5471 Handle .ctors and .dtors. Sort by explicit priority rather than
5472 by name.
5473 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5474 * testsuite/initpri2.c: New test.
5475 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5476 (check_PROGRAMS): Add initpri2.
5477 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5478 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5479 * configure, testsuite/Makefile.in: Rebuild.
5480
5481 2011-06-19 Ian Lance Taylor <iant@google.com>
5482
5483 PR gold/12880
5484 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5485 .interp section to a PT_INTERP segment even if we have seen a
5486 --dynamic-linker option. Don't do it if we have seen a PHDRS
5487 clause in a linker script.
5488 (Layout::finalize): Don't create a .interp section if we've
5489 already create a PT_INTERP segment.
5490 (Layout::create_interp): Always call choose_output_section (revert
5491 patch of 2011-06-17). Don't create PT_INTERP segment.
5492 * script-sections.cc
5493 (Script_sections::create_note_and_tls_segments): Add a .interp
5494 section to a PT_INTERP segment even if we have seen a
5495 --dynamic-linker option.
5496
5497 2011-06-18 Ian Lance Taylor <iant@google.com>
5498
5499 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5500 merely because a non-PT_LOAD segment has a dynamic reloc.
5501
5502 2011-06-18 Ian Lance Taylor <iant@google.com>
5503
5504 * layout.cc (Layout::finish_dynamic_section): Don't create
5505 DT_FLAGS entry if not needed.
5506
5507 2011-06-18 Ian Lance Taylor <iant@google.com>
5508
5509 PR gold/12745
5510 * layout.cc (Layout::layout_eh_frame): Correct handling of
5511 writable .eh_frame section.
5512
5513 2011-06-17 Ian Lance Taylor <iant@google.com>
5514
5515 PR gold/12893
5516 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5517 symbol is redefined with the exact same object and value.
5518
5519 2011-06-17 Ian Lance Taylor <iant@google.com>
5520
5521 PR gold/12880
5522 * layout.h (class Layout): Add interp_segment_ field.
5523 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5524 (Layout::attach_allocated_section_to_segment): If making shared
5525 library, put .interp section in PT_INTERP segment.
5526 (Layout::finalize): Also call create_interp if -dynamic-linker
5527 option was used.
5528 (Layout::create_interp): Assert that there is no PT_INTERP
5529 segment. If not using a SECTIONS clause, use make_output_section.
5530 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5531 * script-sections.cc
5532 (Script_sections::create_note_and_tls_segments): If making shared
5533 library, put .interp section in PT_INTERP segment.
5534
5535 2011-06-17 Ian Lance Taylor <iant@google.com>
5536
5537 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5538 when making a shared library.
5539
5540 2011-06-17 Ian Lance Taylor <iant@google.com>
5541
5542 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5543 parameter. Change all callers. Don't issue warning about PC32
5544 against locally defined symbol.
5545
5546 2011-06-16 Ian Lance Taylor <iant@google.com>
5547
5548 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5549 occurs in same object.
5550
5551 2011-06-14 Alan Modra <amodra@gmail.com>
5552
5553 * po/POTFILES.in: Regenerate.
5554
5555 2011-06-09 Ian Lance Taylor <iant@google.com>
5556
5557 * script-sections.cc
5558 (Orphan_output_section::set_section_addresses): For a relocatable
5559 link set address to 0.
5560
5561 2011-06-09 Cary Coutant <ccoutant@google.com>
5562
5563 PR gold/12804
5564 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5565 used with --compress-debug-sections.
5566 * gold/object.cc (Sized_relobj_file::do_layout): Report
5567 uncompressed size of compressed input sections.
5568
5569 2011-06-08 Cary Coutant <ccoutant@google.com>
5570
5571 PR gold/12804
5572 * testsuite/two_file_test_2_v1.cc: Change initialization of
5573 v2 to keep it in .data.
5574
5575 2011-06-07 Cary Coutant <ccoutant@google.com>
5576
5577 * common.cc (Symbol_table::do_allocate_commons_list): Call
5578 gold_fallback.
5579 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5580 (Errors::fallback): New function.
5581 (gold_fallback): New function.
5582 * errors.h (Errors::fallback): New function.
5583 * gold.cc (gold_exit): Change status parameter to enum; adjust
5584 all callers.
5585 (queue_initial_tasks): Call gold_fallback.
5586 * gold.h: Include cstdlib.
5587 (Exit_status): New enum type.
5588 (gold_exit): Change status parameter to enum.
5589 (gold_fallback): New function.
5590 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5591 (Layout::create_symtab_sections): Likewise.
5592 (Layout::create_shdrs): Likewise.
5593 * main.cc (main): Adjust call to gold_exit.
5594 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5595 (Output_data_got::add_got_entry_pair): Likewise.
5596 (Output_section::add_input_section): Likewise.
5597 (Output_section::add_output_section_data): Likewise.
5598 (Output_segment::set_section_list_addresses): Likewise.
5599 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5600
5601 2011-06-07 Cary Coutant <ccoutant@google.com>
5602
5603 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5604 for incremental links.
5605 * output.cc (Output_segment::set_section_list_addresses): Remove
5606 FIXME and test for TLS or BSS.
5607
5608 2011-06-07 Cary Coutant <ccoutant@google.com>
5609
5610 * testsuite/Makefile.am: Add incremental_copy_test,
5611 incremental_common_test_1.
5612 * testsuite/Makefile.in: Regenerate.
5613 * testsuite/common_test_1_v1.c: New source file.
5614 * testsuite/common_test_1_v2.c: New source file.
5615 * testsuite/copy_test_v1.cc: New source file.
5616
5617 2011-06-07 Cary Coutant <ccoutant@google.com>
5618
5619 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5620 update, allocate common from bss section's free list.
5621 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5622 linker-defined symbols.
5623 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5624 Skip GOT and PLT entries that are no longer referenced.
5625 (Output_section_incremental_inputs::write_info_blocks): Mark
5626 linker-defined symbols.
5627 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5628 * output.cc (Output_section::allocate): New function.
5629 * output.h (Output_section::allocate): New function.
5630 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5631 linker-defined symbols.
5632 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5633 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5634 (Symbol::init_base_output_data): Likewise.
5635 (Symbol::init_base_output_segment): Likewise.
5636 (Symbol::init_base_constant): Likewise.
5637 (Sized_symbol::init_output_data): Likewise.
5638 (Sized_symbol::init_output_segment): Likewise.
5639 (Sized_symbol::init_constant): Likewise.
5640 (Symbol_table::do_define_in_output_data): Likewise.
5641 (Symbol_table::do_define_in_output_segment): Likewise.
5642 (Symbol_table::do_define_as_constant): Likewise.
5643 * symtab.h (Symbol::is_predefined): New function.
5644 (Symbol::init_base_output_data): Add is_predefined parameter.
5645 (Symbol::init_base_output_segment): Likewise.
5646 (Symbol::init_base_constant): Likewise.
5647 (Symbol::is_predefined_): New data member.
5648 (Sized_symbol::init_output_data): Add is_predefined parameter.
5649 (Sized_symbol::init_output_segment): Likewise.
5650 (Sized_symbol::init_constant): Likewise.
5651 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5652
5653 2011-06-07 Cary Coutant <ccoutant@google.com>
5654
5655 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5656 instead of emit_copy_reloc.
5657 (Copy_relocs::emit_copy_reloc): Refactor.
5658 (Copy_relocs::make_copy_reloc): New function.
5659 (Copy_relocs::add_copy_reloc): Remove.
5660 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5661 section.
5662 (Copy_relocs::make_copy_reloc): New function.
5663 (Copy_relocs::add_copy_reloc): Remove.
5664 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5665 unchanged input files.
5666 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5667 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5668 Reserve BSS space for COPY relocations.
5669 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5670 (Output_section_incremental_inputs::write_info_blocks): Record
5671 whether a symbol is copied from a shared object.
5672 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5673 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5674 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5675 (Incremental_input_entry_reader::get_output_symbol_index): Add
5676 is_copy parameter.
5677 (Incremental_binary::emit_copy_relocs): New function.
5678 (Incremental_binary::do_emit_copy_relocs): New function.
5679 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5680 new data member.
5681 (Sized_incremental_binary::add_copy_reloc): New function.
5682 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5683 (Sized_incremental_binary::Copy_reloc): New struct.
5684 (Sized_incremental_binary::Copy_relocs): New typedef.
5685 (Sized_incremental_binary::copy_relocs_): New data member.
5686 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5687 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5688 * target.h (Sized_target::emit_copy_reloc): New function.
5689 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5690
5691 2011-06-02 Cary Coutant <ccoutant@google.com>
5692
5693 PR gold/12163
5694 * gold/archive.cc (Archive::Archive): Initialize new data member.
5695 (Archive::include_all_members): Return if archive has already been
5696 included.
5697 * gold/archive.h (Archive::include_all_members_): New data member.
5698
5699 2011-06-02 Nick Clifton <nickc@redhat.com>
5700
5701 * dynobj.h: Fix spelling mistake in comment.
5702 * output.cc: Likewise.
5703
5704 2011-05-31 Doug Kwan <dougkwan@google.com>
5705 Asier Llano
5706
5707 PR gold/12826
5708 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
5709 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5710 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5711 redundant arm_exidx_test.so.
5712 * testsuite/Makefile.in: Regenerate.
5713 (check_SCRIPTS): Add pr12826.sh
5714 (check_DATA): Add pr12826.stdout
5715 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5716 * testsuite/pr12826.sh: New file.
5717 * testsuite/pr12826_1.s: Ditto.
5718 * testsuite/pr12826_1.s: Ditto.
5719
5720 2011-05-30 Ian Lance Taylor <iant@google.com>
5721
5722 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5723 sections.
5724
5725 2011-05-29 Ian Lance Taylor <iant@google.com>
5726
5727 PR gold/12804
5728 * testsuite/Makefile.am: Use different file name for two_file_test
5729 temporary file for each incremental test.
5730 * testsuite/Makefile.in: Rebuild.
5731
5732 2011-05-29 Ian Lance Taylor <iant@google.com>
5733
5734 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5735 binary input file is empty.
5736
5737 2011-05-27 Ian Lance Taylor <iant@google.com>
5738
5739 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5740 (ver_test_9.so): Likewise.
5741 * testsuite/Makefile.in: Rebuild.
5742
5743 2011-05-26 Cary Coutant <ccoutant@google.com>
5744
5745 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5746 * incremental.cc (Incremental_inputs::report_input_section): Fix
5747 comment, indentation.
5748 (Incremental_inputs::report_comdat_group): New function.
5749 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5750 of data for incremental input file entry.
5751 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5752 group count, COMDAT group signatures.
5753 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5754 an unchanged input file.
5755 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5756 Initialize new data member.
5757 (Incremental_object_entry::add_comdat_group): New function.
5758 (Incremental_object_entry::get_comdat_group_count): New function.
5759 (Incremental_object_entry::get_comdat_signature_key): New function.
5760 (Incremental_object_entry::groups_): New data member.
5761 (Incremental_inputs::report_comdat_group): New function.
5762 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5763 data for incremental input file entry.
5764 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5765 (Incremental_input_entry_reader::get_input_section): Adjust size of
5766 data for incremental input file entry.
5767 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5768 (Incremental_input_entry_reader::get_comdat_group_signature): New
5769 function.
5770 * object.cc (Sized_relobj::include_section_group): Report kept
5771 COMDAT groups for incremental links.
5772
5773 2011-05-24 David Meyer <pdox@google.com>
5774
5775 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5776 with name parameter. Add found_name parameter.
5777 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5778 * dirsearch.h (class Dirsearch): Update declaration.
5779
5780 2011-05-24 Ian Lance Taylor <iant@google.com>
5781
5782 * archive.cc (Library_base::should_include_member): Pull in object
5783 from archive if it defines the entry symbol.
5784 * parameters.cc (Parameters::entry): New function.
5785 * parameters.h (class Parameters): Declare entry.
5786 * output.h (class Output_file_header): Remove entry_ field.
5787 * output.cc (Output_file_header::Output_file_header): Remove entry
5788 parameter. Change all callers.
5789 (Output_file_header::entry): Use parameters->entry.
5790 * gold.cc (queue_middle_tasks): Likewise.
5791 * plugin.cc (Plugin_hook::run): Likewise.
5792
5793 2011-05-24 Cary Coutant <ccoutant@google.com>
5794
5795 * gold.cc (queue_initial_tasks): Pass incremental base filename
5796 to Output_file::open_base_file; don't print error message.
5797 * incremental-dump.cc (main): Adjust call to
5798 Output_file::open_for_modification.
5799 * incremental-dump.cc (main): Likewise.
5800 * incremental.cc (Incremental_inputs::report_command_line):
5801 Ignore --incremental-base option when comparing command lines.
5802 Ignore parameter when given as separate argument.
5803 * options.h (class General_options): Add --incremental-base.
5804 * output.cc (Output_file::Output_file):
5805 (Output_file::open_base_file): Add base_name and writable parameters;
5806 read base file into new file; print error message here.
5807 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5808 callers.
5809 * output.h (Output_file::open_for_modification): Rename to...
5810 (Output_file::open_base_file): ...this; add base_name and
5811 writable parameters; adjust all callers.
5812 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5813 callers.
5814 * testsuite/Makefile.am (incremental_test_4): Test
5815 --incremental-base.
5816 * testsuite/Makefile.in: Regenerate.
5817
5818 2011-05-24 Cary Coutant <ccoutant@google.com>
5819
5820 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5821 incremental_test_4.
5822 * testsuite/Makefile.in: Regenerate.
5823 * testsuite/two_file_test_1_v1.cc: New test source file.
5824 * testsuite/two_file_test_1b_v1.cc: New test source file.
5825 * testsuite/two_file_test_2_v1.cc: New test source file.
5826
5827 2011-05-24 Cary Coutant <ccoutant@google.com>
5828
5829 * dynobj.h (Dynobj::do_dynobj): New function.
5830 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5831 flag and soname for shared objects.
5832 * incremental.cc (Incremental_inputs::report_object): Make
5833 either Incremental_object_entry or Incremental_dynobj_entry; add
5834 soname to string table.
5835 (Incremental_inputs::report_input_section): Add assertion.
5836 (Output_section_incremental_inputs::set_final_data_size): Adjust
5837 type of input file entry for shared libraries; adjust size of
5838 shared library info entry.
5839 (Output_section_incremental_inputs::write_input_files): Write
5840 as_needed flag for shared libraries.
5841 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5842 of input file entry for shared libraries; write soname.
5843 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5844 soname from incremental info.
5845 * incremental.h (enum Incremental_input_flags): Add
5846 INCREMENTAL_INPUT_AS_NEEDED.
5847 (Incremental_input_entry::Incremental_input_entry): Initialize new
5848 data member.
5849 (Incremental_input_entry::set_as_needed): New function.
5850 (Incremental_input_entry::as_needed): New function.
5851 (Incremental_input_entry::do_dynobj_entry): New function.
5852 (Incremental_input_entry::as_needed_): New data member.
5853 (Incremental_object_entry::Incremental_object_entry): Don't check
5854 for shared library.
5855 (Incremental_object_entry::do_type): Likewise.
5856 (class Incremental_dynobj_entry): New class.
5857 (Incremental_input_entry_reader::as_needed): New function.
5858 (Incremental_input_entry_reader::get_soname): New function.
5859 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5860 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5861 size of shared library info entry.
5862 * layout.cc (Layout::finish_dynamic_section): Don't test for
5863 incremental link when adding DT_NEEDED entries.
5864 * object.h (Object::Object): Initialize new data member.
5865 (Object::dynobj): New function.
5866 (Object::set_as_needed): New function.
5867 (Object::as_needed): New function.
5868 (Object::do_dynobj): New function.
5869 (Object::as_needed_): New data member.
5870
5871 2011-05-24 Cary Coutant <ccoutant@google.com>
5872
5873 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5874 info; adjust display of GOT entries.
5875 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5876 vector of input objects; remove file_status_.
5877 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5878 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5879 got_plt reader; call target hooks to reserve GOT entries.
5880 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5881 of input file info header and GOT info entry.
5882 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5883 relocation info.
5884 (Got_plt_view_info::got_descriptor): Remove.
5885 (Got_plt_view_info::sym_index): New data member.
5886 (Got_plt_view_info::input_index): New data member.
5887 (Local_got_offset_visitor::visit): Write input file index.
5888 (Global_got_offset_visitor::visit): Write 0 for input file index.
5889 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5890 with sym_index and input_index.
5891 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5892 incremental info GOT entry; replace got_descriptor with input_index.
5893 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5894 map from input file index to object.
5895 (Sized_relobj_incr::do_layout): Replace direct data member reference
5896 with accessor function.
5897 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5898 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5899 Adjust size of input file info header.
5900 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5901 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5902 (Incremental_input_entry_reader::get_input_section): Adjust size of
5903 input file info header.
5904 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5905 of incremental info GOT entry.
5906 (Incremental_got_plt_reader::get_got_desc): Remove.
5907 (Incremental_got_plt_reader::get_got_symndx): New function.
5908 (Incremental_got_plt_reader::get_got_input_index): New function.
5909 (Sized_incremental_binary::Sized_incremental_binary): Remove
5910 file_status_; add input_objects_.
5911 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5912 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5913 (Sized_incremental_binary::file_is_unchanged): Remove.
5914 (Sized_incremental_binary::set_input_object): New function.
5915 (Sized_incremental_binary::input_object): New function.
5916 (Sized_incremental_binary::file_status_): Remove.
5917 (Sized_incremental_binary::input_objects_): New data member.
5918 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5919 references.
5920 (Sized_relobj_incr::invalid_address): Move to base class.
5921 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5922 class.
5923 (Sized_relobj_incr::do_output_section_offset): Likewise.
5924 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5925 (Sized_relobj_incr::section_offsets_): Likewise.
5926 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5927 function.
5928 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5929 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5930 with accessor function.
5931 (Sized_relobj_file::do_layout): Likewise.
5932 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5933 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5934 (Sized_relobj_file::compute_final_local_value): Replace refs to
5935 section_offsets_ with accessor function.
5936 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5937 * object.h (Relobj::Relobj): Initialize new data members.
5938 (Relobj::add_dyn_reloc): New function.
5939 (Relobj::first_dyn_reloc): New function.
5940 (Relobj::dyn_reloc_count): New function.
5941 (Relobj::first_dyn_reloc_): New data member.
5942 (Relobj::dyn_reloc_count_): New data member.
5943 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5944 references.
5945 (Sized_relobj::Address): New typedef.
5946 (Sized_relobj::invalid_address): Move here from child class.
5947 (Sized_relobj::Sized_relobj): Initialize new data members.
5948 (Sized_relobj::sized_relobj): New function.
5949 (Sized_relobj::is_output_section_offset_invalid): Move here from
5950 child class.
5951 (Sized_relobj::get_output_section_offset): Likewise.
5952 (Sized_relobj::local_has_got_offset): Likewise.
5953 (Sized_relobj::local_got_offset): Likewise.
5954 (Sized_relobj::set_local_got_offset): Likewise.
5955 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5956 (Sized_relobj::clear_got_offsets): New function.
5957 (Sized_relobj::section_offsets): Move here from child class.
5958 (Sized_relobj::do_output_section_offset): Likewise.
5959 (Sized_relobj::do_set_section_offset): Likewise.
5960 (Sized_relobj::Local_got_offsets): Likewise.
5961 (Sized_relobj::local_got_offsets_): Likewise.
5962 (Sized_relobj::section_offsets_): Likewise.
5963 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5964 references.
5965 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5966 class.
5967 (Sized_relobj_file::sized_relobj): New function
5968 (Sized_relobj_file::local_has_got_offset): Move to base class.
5969 (Sized_relobj_file::local_got_offset): Likewise.
5970 (Sized_relobj_file::set_local_got_offset): Likewise.
5971 (Sized_relobj_file::get_output_section_offset): Likewise.
5972 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5973 (Sized_relobj_file::do_output_section_offset): Likewise.
5974 (Sized_relobj_file::do_set_section_offset): Likewise.
5975 (Sized_relobj_file::Local_got_offsets): Likewise.
5976 (Sized_relobj_file::local_got_offsets_): Likewise.
5977 (Sized_relobj_file::section_offsets_): Likewise.
5978 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5979 (all constructors).
5980 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5981 (Output_reloc::get_symbol_index): Likewise.
5982 (Output_reloc::local_section_offset): Likewise.
5983 (Output_reloc::get_address): Likewise.
5984 (Output_reloc::symbol_value): Likewise.
5985 (Output_data_got::reserve_slot): Move to class definition.
5986 (Output_data_got::reserve_local): New function.
5987 (Output_data_got::reserve_slot_for_global): Remove.
5988 (Output_data_got::reserve_global): New function.
5989 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5990 (all constructors, two instantiations).
5991 (Output_reloc::get_relobj): New function (two instantiations).
5992 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5993 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5994 (Output_data_reloc::add_global): Adjust type of relobj.
5995 (Output_data_reloc::add_global_relative): Likewise.
5996 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5997 (Output_data_reloc::add_local): Likewise.
5998 (Output_data_reloc::add_local_relative): Likewise.
5999 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6000 (Output_data_reloc::add_local_section): Likewise.
6001 (Output_data_reloc::add_output_section): Likewise.
6002 (Output_data_reloc::add_absolute): Likewise.
6003 (Output_data_reloc::add_target_specific): Likewise.
6004 (Output_data_got::reserve_slot): Move definition here.
6005 (Output_data_got::reserve_local): New function.
6006 (Output_data_got::reserve_global): New function.
6007 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6008 section_offsets_ with accessor function.
6009 (Sized_relobj_file::write_sections): Likewise.
6010 (Sized_relobj_file::do_relocate_sections): Likewise.
6011 * target.h (Sized_target::reserve_local_got_entry): New function.
6012 (Sized_target::reserve_global_got_entry): New function.
6013 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6014 (Target_x86_64::reserve_global_got_entry): New function.
6015 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6016
6017 2011-05-23 Cary Coutant <ccoutant@google.com>
6018
6019 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6020 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6021 bit when checking got_type.
6022 * incremental.cc (Sized_incremental_binary::setup_readers):
6023 Store symbol table and string table locations; initialize bit vector
6024 of file status flags.
6025 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6026 unchanged files.
6027 (Sized_incremental_binary::do_process_got_plt): New function.
6028 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6029 (Output_section_incremental_inputs::set_final_data_size): Record
6030 file index for each input file.
6031 (Output_section_incremental_inputs::write_got_plt): Store file index
6032 instead of input entry offset for each GOT entry.
6033 * incremental.h
6034 (Incremental_input_entry::Incremental_input_entry): Initialize new
6035 data member.
6036 (Incremental_input_entry::set_offset): Store file index.
6037 (Incremental_input_entry::get_file_index): New function.
6038 (Incremental_input_entry::file_index_): New data member.
6039 (Incremental_binary::process_got_plt): New function.
6040 (Incremental_binary::do_process_got_plt): New function.
6041 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6042 data members.
6043 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6044 (Sized_incremental_binary::set_file_is_unchanged): New function.
6045 (Sized_incremental_binary::file_is_unchanged): New function.
6046 (Sized_incremental_binary::do_process_got_plt): New function.
6047 (Sized_incremental_binary::file_status_): New data member.
6048 (Sized_incremental_binary::main_symtab_loc_): New data member.
6049 (Sized_incremental_binary::main_strtab_loc_): New data member.
6050 * output.cc (Output_data_got::Got_entry::write): Add case
6051 RESERVED_CODE.
6052 (Output_data_got::add_global): Call add_got_entry.
6053 (Output_data_got::add_global_plt): Likewise.
6054 (Output_data_got::add_global_with_rel): Likewise.
6055 (Output_data_got::add_global_with_rela): Likewise.
6056 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6057 (Output_data_got::add_global_pair_with_rela): Likewise.
6058 (Output_data_got::add_local): Call add_got_entry.
6059 (Output_data_got::add_local_plt): Likewise.
6060 (Output_data_got::add_local_with_rel): Likewise.
6061 (Output_data_got::add_local_with_rela): Likewise.
6062 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6063 (Output_data_got::add_local_pair_with_rela): Likewise.
6064 (Output_data_got::reserve_slot): New function.
6065 (Output_data_got::reserve_slot_for_global): New function.
6066 (Output_data_got::add_got_entry): New function.
6067 (Output_data_got::add_got_entry_pair): New function.
6068 (Output_section::add_output_section_data): Edit FIXME.
6069 * output.h
6070 (Output_section_data_build::Output_section_data_build): New
6071 constructor with size parameter.
6072 (Output_data_space::Output_data_space): Likewise.
6073 (Output_data_got::Output_data_got): Initialize new data member; new
6074 constructor with size parameter.
6075 (Output_data_got::add_constant): Call add_got_entry.
6076 (Output_data_got::reserve_slot): New function.
6077 (Output_data_got::reserve_slot_for_global): New function.
6078 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6079 (Output_data_got::add_got_entry): New function.
6080 (Output_data_got::add_got_entry_pair): New function.
6081 (Output_data_got::free_list_): New data member.
6082 * target.h (Sized_target::init_got_plt_for_update): New function.
6083 (Sized_target::register_global_plt_entry): New function.
6084 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6085 Initialize new data member; call init; add constructor with PLT count.
6086 (Output_data_plt_x86_64::init): New function.
6087 (Output_data_plt_x86_64::add_relocation): New function.
6088 (Output_data_plt_x86_64::reserve_slot): New function.
6089 (Output_data_plt_x86_64::free_list_): New data member.
6090 (Target_x86_64::init_got_plt_for_update): New function.
6091 (Target_x86_64::register_global_plt_entry): New function.
6092 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6093 incremental updates.
6094 (Output_data_plt_x86_64::add_relocation): New function.
6095 * testsuite/object_unittest.cc (Object_test): Set default options.
6096
6097 2011-05-16 Ian Lance Taylor <iant@google.com>
6098
6099 * options.h (class General_options): Make -i a synonym for -r.
6100
6101 2011-05-16 Ian Lance Taylor <iant@google.com>
6102
6103 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6104
6105 2011-05-10 Cary Coutant <ccoutant@google.com>
6106
6107 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6108 strip_all (-s).
6109
6110 2011-05-06 Ian Lance Taylor <iant@google.com>
6111
6112 * layout.cc (Layout::layout): If the output section flags change,
6113 update the ordering.
6114
6115 2011-04-25 Cary Coutant <ccoutant@google.com>
6116
6117 * incremental-dump.cc (dump_incremental_inputs): Print local
6118 symbol info for each input file.
6119 * incremental.cc
6120 (Output_section_incremental_inputs::set_final_data_size): Add local
6121 symbol info to input file entries in incremental info.
6122 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6123 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6124 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6125 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6126 implementation.
6127 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6128 (Sized_incr_relobj::do_relocate): Write the local symbols.
6129 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6130 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6131 Adjust size of input file header.
6132 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6133 (Incremental_inputs_reader::get_local_symbol_count): New function.
6134 (Incremental_inputs_reader::get_input_section): Adjust size of input
6135 file header.
6136 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6137 (Sized_incr_relobj::This): New typedef.
6138 (Sized_incr_relobj::sym_size): New const data member.
6139 (Sized_incr_relobj::Local_symbol): New struct.
6140 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6141 (Sized_incr_relobj::do_local_symbol_offset): New function.
6142 (Sized_incr_relobj::local_symbol_count_): New data member.
6143 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6144 (Sized_incr_relobj::local_symbol_index_): New data member.
6145 (Sized_incr_relobj::local_symbol_offset_): New data member.
6146 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6147 (Sized_incr_relobj::local_symbols_): New data member.
6148 * object.h (Relobj::output_local_symbol_count): New function.
6149 (Relobj::local_symbol_offset): New function.
6150 (Relobj::do_output_local_symbol_count): New function.
6151 (Relobj::do_local_symbol_offset): New function.
6152 (Sized_relobj::do_output_local_symbol_count): New function.
6153 (Sized_relobj::do_local_symbol_offset): New function.
6154
6155 2011-04-22 Vladimir Simonov <sv@sw.ru>
6156
6157 * descriptors.cc (set_close_on_exec): New function.
6158 (Descriptors::open): Use set_close_on_exec.
6159 * output.cc (S_ISLNK): Define if not defined.
6160
6161 2011-04-22 Cary Coutant <ccoutant@google.com>
6162
6163 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6164 global symbol map.
6165 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6166 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6167 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6168 relocations.
6169 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6170 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6171 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6172 * incremental.h
6173 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6174 function.
6175 (Incremental_binary::apply_incremental_relocs): New function.
6176 (Incremental_binary::do_apply_incremental_relocs): New function.
6177 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6178 data member.
6179 (Sized_incremental_binary::add_global_symbol): New function.
6180 (Sized_incremental_binary::global_symbol): New function.
6181 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6182 (Sized_incremental_binary::symbol_map_): New data member.
6183 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6184 * target.h (Sized_target::apply_relocation): New function.
6185 * target-reloc.h (apply_relocation): New function.
6186 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6187
6188 2011-04-22 Doug Kwan <dougkwan@google.com>
6189
6190 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6191 flag of a SHT_ARM_EXIDX section.
6192 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6193 * testsuite/Makefile.in: Regenerate.
6194 * testsuite/arm_exidx_test.s: New file.
6195 * testsuite/arm_exidx_test.sh: Same.
6196
6197 2011-04-20 Cary Coutant <ccoutant@google.com>
6198
6199 PR gold/12689
6200 * archive.h (Incremental_archive_entry::Archive_member):
6201 Initialize arg_serial_ (second constructor).
6202
6203 2011-04-17 Ian Lance Taylor <iant@google.com>
6204
6205 * object.cc (Relocate_info::location): Simplify location string.
6206 * errors.cc (Errors::error_at_location): Don't print program
6207 name.
6208 (Errors::warning_at_location): Likewise.
6209 (Errors::undefined_symbol): Likewise.
6210 * testsuite/debug_msg.sh: Update accordingly.
6211
6212 2011-04-14 Cary Coutant <ccoutant@google.com>
6213
6214 * gold/layout.cc (Layout::symtab_section_offset): New function.
6215 * gold/layout.h (Layout::symtab_section_offset): New function.
6216 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6217
6218 2011-04-12 Ian Lance Taylor <iant@google.com>
6219
6220 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6221 with MREMAP_MAYMOVE.
6222 * output.h (class Output_file): Add map_is_allocated_ field.
6223 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6224 not available, provide stubs. If mremap is not available, #define
6225 it to gold_mremap.
6226 (MREMAP_MAYMOVE): Define if not defined.
6227 (Output_file::Output_file): Initialize map_is_allocated_.
6228 (Output_file::resize): Check map_is_allocated_.
6229 (Output_file::map_anonymous): If mmap fails, use malloc.
6230 (Output_file::unmap): Don't do anything for an anonymous map.
6231 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6232 is not available, provide stubs.
6233 (File_read::View::~View): Use free rather than delete[].
6234 (File_read::make_view): Use malloc rather than new[]. If mmap
6235 fails, use malloc.
6236 (File_read::find_or_make_view): Use malloc rather than new[].
6237 * gold.h: Remove HAVE_REMAP code.
6238 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6239 exists. Rename mremap to gold_mremap. If mmap is not available
6240 don't do anything.
6241 * configure, config.in: Rebuild.
6242
6243 2011-04-11 Ian Lance Taylor <iant@google.com>
6244
6245 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6246 initialize local variable v.
6247
6248 2011-04-11 Cary Coutant <ccoutant@google.com>
6249
6250 * archive.cc (Archive::include_member): Adjust call to
6251 report_object.
6252 (Add_archive_symbols::run): Track argument serial numbers.
6253 (Lib_group::include_member): Likewise.
6254 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6255 * archive.h (Incremental_archive_entry::Archive_member):
6256 Initialize arg_serial_.
6257 (Archive_member::arg_serial_): New data member.
6258 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6259 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6260 incremental link.
6261 (Sized_dynobj::do_for_all_local_got_entries): New function.
6262 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6263 function.
6264 * fileread.cc (get_mtime): New function.
6265 * fileread.h (get_mtime): New function.
6266 * gold.cc (queue_initial_tasks): Check for incremental update.
6267 (process_incremental_input): New function.
6268 (queue_middle_tasks): Don't force valid target for incremental
6269 update.
6270 * incremental-dump.cc (find_input_containing_global): Adjust
6271 size of symbol info entry.
6272 (dump_incremental_inputs): Dump argument serial number and
6273 in_system_directory flag; bias shndx by 1; print symbol names
6274 when dumping per-file symbol lists; use new symbol info readers.
6275 * incremental.cc
6276 (Output_section_incremental_inputs:update_data_size): New function.
6277 (Sized_incremental_binary::setup_readers): Setup input readers
6278 for each input file; build maps for files added from libraries
6279 and scripts.
6280 (Sized_incremental_binary::check_input_args): New function.
6281 (Sized_incremental_binary::do_check_inputs): Build map of argument
6282 serial numbers to input arguments.
6283 (Sized_incremental_binary::do_file_has_changed): Rename
6284 do_file_is_unchanged to this; compare file modification times.
6285 (Sized_incremental_binary::do_init_layout): New function.
6286 (Sized_incremental_binary::do_reserve_layout): New function.
6287 (Sized_incremental_binary::do_get_input_reader): Remove.
6288 (Sized_incremental_binary::get_symtab_view): New function.
6289 (Incremental_checker::can_incrementally_link_output_file): Remove.
6290 (Incremental_inputs::report_command_line): Exclude --debug options.
6291 (Incremental_inputs::report_archive_begin): Add parameter; track
6292 argument serial numbers; don't put input file entry for archive
6293 before archive members.
6294 (Incremental_inputs::report_archive_end): Put input file entry
6295 for archive after archive members.
6296 (Incremental_inputs::report_object): Add parameter; track argument
6297 serial numbers and in_system_directory flag.
6298 (Incremental_inputs::report_script): Add parameter; track argument
6299 serial numbers.
6300 (Output_section_incremental_inputs::set_final_data_size): Adjust
6301 size of symbol info entry; check for forwarding symbols.
6302 (Output_section_incremental_inputs::write_input_files): Write
6303 in_system_directory flag and argument serial number.
6304 (Output_section_incremental_inputs::write_info_blocks): Map section
6305 indices between incremental info and original input file; store
6306 input section index for each symbol.
6307 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6308 change operator() to visit().
6309 (class Global_got_offset_visitor): Likewise.
6310 (class Global_symbol_visitor_got_plt):
6311 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6312 classes.
6313 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6314 (Sized_incr_relobj::do_read_symbols): New function.
6315 (Sized_incr_relobj::do_layout): New function.
6316 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6317 (Sized_incr_relobj::do_add_symbols): New function.
6318 (Sized_incr_relobj::do_should_include_member): New function.
6319 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6320 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6321 (Sized_incr_relobj::do_section_size): New function.
6322 (Sized_incr_relobj::do_section_name): New function.
6323 (Sized_incr_relobj::do_section_contents): New function.
6324 (Sized_incr_relobj::do_section_flags): New function.
6325 (Sized_incr_relobj::do_section_entsize): New function.
6326 (Sized_incr_relobj::do_section_address): New function.
6327 (Sized_incr_relobj::do_section_type): New function.
6328 (Sized_incr_relobj::do_section_link): New function.
6329 (Sized_incr_relobj::do_section_info): New function.
6330 (Sized_incr_relobj::do_section_addralign): New function.
6331 (Sized_incr_relobj::do_initialize_xindex): New function.
6332 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6333 (Sized_incr_relobj::do_read_relocs): New function.
6334 (Sized_incr_relobj::do_gc_process_relocs): New function.
6335 (Sized_incr_relobj::do_scan_relocs): New function.
6336 (Sized_incr_relobj::do_count_local_symbols): New function.
6337 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6338 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6339 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6340 (Sized_incr_relobj::do_relocate): New function.
6341 (Sized_incr_relobj::do_set_section_offset): New function.
6342 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6343 (Sized_incr_dynobj::do_read_symbols): New function.
6344 (Sized_incr_dynobj::do_layout): New function.
6345 (Sized_incr_dynobj::do_add_symbols): New function.
6346 (Sized_incr_dynobj::do_should_include_member): New function.
6347 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6348 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6349 (Sized_incr_dynobj::do_section_size): New function.
6350 (Sized_incr_dynobj::do_section_name): New function.
6351 (Sized_incr_dynobj::do_section_contents): New function.
6352 (Sized_incr_dynobj::do_section_flags): New function.
6353 (Sized_incr_dynobj::do_section_entsize): New function.
6354 (Sized_incr_dynobj::do_section_address): New function.
6355 (Sized_incr_dynobj::do_section_type): New function.
6356 (Sized_incr_dynobj::do_section_link): New function.
6357 (Sized_incr_dynobj::do_section_info): New function.
6358 (Sized_incr_dynobj::do_section_addralign): New function.
6359 (Sized_incr_dynobj::do_initialize_xindex): New function.
6360 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6361 (make_sized_incremental_object): New function.
6362 (Incremental_library::copy_unused_symbols): New function.
6363 (Incremental_library::do_for_all_unused_symbols): New function.
6364 * incremental.h (enum Incremental_input_flags): New type.
6365 (class Incremental_checker): Remove.
6366 (Incremental_input_entry::Incremental_input_entry): Add argument
6367 serial number.
6368 (Incremental_input_entry::arg_serial): New function.
6369 (Incremental_input_entry::set_is_in_system_directory): New function.
6370 (Incremental_input_entry::is_in_system_directory): New function.
6371 (Incremental_input_entry::arg_serial_): New data member.
6372 (Incremental_input_entry::is_in_system_directory_): New data member.
6373 (class Script_info): Move here from script.h.
6374 (Script_info::Script_info): Add filename parameter.
6375 (Script_info::filename): New function.
6376 (Script_info::filename_): New data member.
6377 (Incremental_script_entry::Incremental_script_entry): Add argument
6378 serial number.
6379 (Incremental_object_entry::Incremental_object_entry): Likewise.
6380 (Incremental_object_entry::add_input_section): Build list of input
6381 sections with map to original shndx.
6382 (Incremental_object_entry::get_input_section_index): New function.
6383 (Incremental_object_entry::shndx_): New data member.
6384 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6385 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6386 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6387 serial number.
6388 (Incremental_inputs::report_archive_begin): Likewise.
6389 (Incremental_inputs::report_object): Likewise.
6390 (Incremental_inputs::report_script): Likewise.
6391 (class Incremental_global_symbol_reader): New class.
6392 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6393 and store flags and input file type.
6394 (Incremental_input_entry_reader::arg_serial): New function.
6395 (Incremental_input_entry_reader::type): Extract type from flags.
6396 (Incremental_input_entry_reader::is_in_system_directory): New function.
6397 (Incremental_input_entry_reader::get_input_section_count): Call
6398 accessor function for type.
6399 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6400 function for type; adjust size of global symbol entry.
6401 (Incremental_input_entry_reader::get_global_symbol_count): Call
6402 accessor function for type.
6403 (Incremental_input_entry_reader::get_object_count): Likewise.
6404 (Incremental_input_entry_reader::get_object_offset): Likewise.
6405 (Incremental_input_entry_reader::get_member_count): Likewise.
6406 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6407 (Incremental_input_entry_reader::get_member_offset): Likewise.
6408 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6409 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6410 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6411 (Incremental_input_entry_reader::get_global_symbol_reader): New
6412 function.
6413 (Incremental_input_entry_reader::get_output_symbol_index): New
6414 function.
6415 (Incremental_input_entry_reader::type_): Remove.
6416 (Incremental_input_entry_reader::flags_): New data member.
6417 (Incremental_inputs_reader::input_file_offset): New function.
6418 (Incremental_inputs_reader::input_file_index): New function.
6419 (Incremental_inputs_reader::input_file): Call input_file_offset.
6420 (Incremental_inputs_reader::input_file_at_offset): New function.
6421 (Incremental_relocs_reader::get_r_type): Reformat.
6422 (Incremental_relocs_reader::get_r_shndx): Reformat.
6423 (Incremental_relocs_reader::get_r_offset): Reformat.
6424 (Incremental_relocs_reader::data): New function.
6425 (Incremental_binary::Incremental_binary): Initialize new data members.
6426 (Incremental_binary::check_inputs): Add cmdline parameter.
6427 (Incremental_binary::file_is_unchanged): Remove.
6428 (Input_reader::arg_serial): New function.
6429 (Input_reader::get_unused_symbol_count): New function.
6430 (Input_reader::get_unused_symbol): New function.
6431 (Input_reader::do_arg_serial): New function.
6432 (Input_reader::do_get_unused_symbol_count): New function.
6433 (Input_reader::do_get_unused_symbol): New function.
6434 (Incremental_binary::input_file_count): New function.
6435 (Incremental_binary::get_input_reader): Change signature to use
6436 index instead of filename.
6437 (Incremental_binary::file_has_changed): New function.
6438 (Incremental_binary::get_input_argument): New function.
6439 (Incremental_binary::get_library): New function.
6440 (Incremental_binary::get_script_info): New function.
6441 (Incremental_binary::init_layout): New function.
6442 (Incremental_binary::reserve_layout): New function.
6443 (Incremental_binary::output_file): New function.
6444 (Incremental_binary::do_check_inputs): New function.
6445 (Incremental_binary::do_file_is_unchanged): Remove.
6446 (Incremental_binary::do_file_has_changed): New function.
6447 (Incremental_binary::do_init_layout): New function.
6448 (Incremental_binary::do_reserve_layout): New function.
6449 (Incremental_binary::do_input_file_count): New function.
6450 (Incremental_binary::do_get_input_reader): Change signature.
6451 (Incremental_binary::input_args_map_): New data member.
6452 (Incremental_binary::library_map_): New data member.
6453 (Incremental_binary::script_map_): New data member.
6454 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6455 new data members.
6456 (Sized_incremental_binary::output_section): New function.
6457 (Sized_incremental_binary::inputs_reader): Add const.
6458 (Sized_incremental_binary::symtab_reader): Add const.
6459 (Sized_incremental_binary::relocs_reader): Add const.
6460 (Sized_incremental_binary::got_plt_reader): Add const.
6461 (Sized_incremental_binary::get_symtab_view): New function.
6462 (Sized_incremental_binary::Inputs_reader): New typedef.
6463 (Sized_incremental_binary::Input_entry_reader): New typedef.
6464 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6465 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6466 (Sized_incremental_binary::do_file_has_changed): New function.
6467 (Sized_incremental_binary::do_init_layout): New function.
6468 (Sized_incremental_binary::do_reserve_layout): New function.
6469 (Sized_input_reader::Inputs_reader): Remove.
6470 (Sized_input_reader::Input_entry_reader): Remove.
6471 (Sized_input_reader::do_arg_serial): New function.
6472 (Sized_input_reader::do_get_unused_symbol_count): New function.
6473 (Sized_input_reader::do_get_unused_symbol): New function.
6474 (Sized_incremental_binary::do_input_file_count): New function.
6475 (Sized_incremental_binary::do_get_input_reader): Change signature;
6476 use index instead of filename.
6477 (Sized_incremental_binary::section_map_): New data member.
6478 (Sized_incremental_binary::input_entry_readers_): New data member.
6479 (class Sized_incr_relobj): New class.
6480 (class Sized_incr_dynobj): New class.
6481 (make_sized_incremental_object): New function.
6482 (class Incremental_library): New class.
6483 * layout.cc (Free_list::num_lists): New static data member.
6484 (Free_list::num_nodes): New static data member.
6485 (Free_list::num_removes): New static data member.
6486 (Free_list::num_remove_visits): New static data member.
6487 (Free_list::num_allocates): New static data member.
6488 (Free_list::num_allocate_visits): New static data member.
6489 (Free_list::init): New function.
6490 (Free_list::remove): New function.
6491 (Free_list::allocate): New function.
6492 (Free_list::dump): New function.
6493 (Free_list::print_stats): New function.
6494 (Layout_task_runner::run): Resize output file for incremental updates.
6495 (Layout::Layout): Initialize new data members.
6496 (Layout::set_incremental_base): New function.
6497 (Layout::init_fixed_output_section): New function.
6498 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6499 incremental updates.
6500 (Layout::create_gold_note): Do not create gold note section for
6501 incremental updates.
6502 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6503 for incremental updates.
6504 (Layout::set_section_offsets): For incremental updates, allocate space
6505 from free list.
6506 (Layout::create_symtab_sections): Layout with offsets relative to
6507 start of section; for incremental updates, allocate space from free
6508 list.
6509 (Layout::create_shdrs): For incremental updates, allocate space from
6510 free list.
6511 (Layout::finish_dynamic_section): For incremental updates, do not
6512 check --as-needed (fixed in subsequent patch).
6513 * layout.h (class Free_list): New class.
6514 (Layout::set_incremental_base): New function.
6515 (Layout::incremental_base): New function.
6516 (Layout::init_fixed_output_section): New function.
6517 (Layout::allocate): New function.
6518 (Layout::incremental_base_): New data member.
6519 (Layout::free_list_): New data member.
6520 * main.cc (main): Print Free_list statistics.
6521 * object.cc (Relobj::finalize_incremental_relocs): Add
6522 clear_counts parameter; clear counts only when clear_counts is set.
6523 (Sized_relobj::Sized_relobj): Initialize new base class.
6524 (Sized_relobj::do_layout): Don't report special sections.
6525 (Sized_relobj::do_for_all_local_got_entries): New function.
6526 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6527 symtab_off to all symbol table offsets.
6528 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6529 * object.h (class Got_offset_list): Move to top of file.
6530 (Object::Object): Allow case where input_file == NULL.
6531 (Object::~Object): Likewise.
6532 (Object::input_file): Assert that input_file != NULL.
6533 (Object::lock): Allow case where input_file == NULL.
6534 (Object::unlock): Likewise.
6535 (Object::is_locked): Likewise.
6536 (Object::token): Likewise.
6537 (Object::release): Likewise.
6538 (Object::is_incremental): New function.
6539 (Object::get_mtime): New function.
6540 (Object::for_all_local_got_entries): New function.
6541 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6542 (Object::set_is_in_system_directory): New function.
6543 (Object::is_in_system_directory): New function.
6544 (Object::do_is_incremental): New function.
6545 (Object::do_get_mtime): New function.
6546 (Object::do_for_all_local_got_entries): New function.
6547 (Object::is_in_system_directory_): New data member.
6548 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6549 (class Sized_relobj_base): New class.
6550 (class Sized_relobj): Derive from Sized_relobj_base.
6551 (class Sized_relobj::Symbols): Redeclare from base class.
6552 (class Sized_relobj::local_got_offset_list): Remove.
6553 (class Sized_relobj::Output_sections): Redeclare from base class.
6554 (class Sized_relobj::do_for_all_local_got_entries): New function.
6555 (class Sized_relobj::write_local_symbols): Add offset parameter.
6556 (class Sized_relobj::local_symbol_offset_): Update comment.
6557 (class Sized_relobj::local_dynsym_offset_): Update comment.
6558 * options.cc (Input_arguments::add_file): Remove const.
6559 * options.h (Input_file_argument::Input_file_argument):
6560 Initialize arg_serial_ (all constructors).
6561 (Input_file_argument::set_arg_serial): New function.
6562 (Input_file_argument::arg_serial): New function.
6563 (Input_file_argument::arg_serial_): New data member.
6564 (Input_arguments::Input_arguments): Initialize file_count_.
6565 (Input_arguments::add_file): Remove const.
6566 (Input_arguments::number_of_input_files): New function.
6567 (Input_arguments::file_count_): New data member.
6568 (Command_line::number_of_input_files): Call
6569 Input_arguments::number_of_input_files.
6570 * output.cc (Output_segment_headers::Output_segment_headers):
6571 Set current size.
6572 (Output_section::Input_section::current_data_size): New function.
6573 (Output_section::Output_section): Initialize new data members.
6574 (Output_section::add_input_section): Don't do merge sections for
6575 an incremental link; allocate space from free list for an
6576 incremental update.
6577 (Output_section::add_output_section_data): Allocate space from
6578 free list for an incremental update.
6579 (Output_section::update_data_size): New function.
6580 (Output_section::set_fixed_layout): New function.
6581 (Output_section::reserve): New function.
6582 (Output_segment::set_section_addresses): Remove const.
6583 (Output_segment::set_section_list_addresses): Remove const; allocate
6584 space from free list for an incremental update.
6585 (Output_segment::set_offset): Adjust size of RELRO segment for an
6586 incremental update.
6587 * output.h (Output_data::current_data_size): Move here from
6588 child classes.
6589 (Output_data::pre_finalize_data_size): New function.
6590 (Output_data::update_data_size): New function.
6591 (Output_section_headers::update_data_size): new function.
6592 (Output_section_data_build::current_data_size): Move to Output_data.
6593 (Output_data_strtab::update_data_size): New function.
6594 (Output_section::current_data_size): Move to Output_data.
6595 (Output_section::set_fixed_layout): New function.
6596 (Output_section::has_fixed_layout): New function.
6597 (Output_section::reserve): New function.
6598 (Output_section::update_data_size): New function.
6599 (Output_section::has_fixed_layout_): New data member.
6600 (Output_section::free_list_): New data member.
6601 (Output_segment::set_section_addresses): Remove const.
6602 (Output_segment::set_section_list_addresses): Remove const.
6603 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6604 New function.
6605 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6606 New function.
6607 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6608 parameter when calling Add_symbols constructor; store argument
6609 serial number for members of a lib group.
6610 (Add_symbols::locks): Allow case where token == NULL.
6611 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6612 (Read_member::~Read_member): New function.
6613 (Read_member::is_runnable): New function.
6614 (Read_member::locks): New function.
6615 (Read_member::run): New function.
6616 (Check_script::~Check_script): New function.
6617 (Check_script::is_runnable): New function.
6618 (Check_script::locks): New function.
6619 (Check_script::run): New function.
6620 (Check_library::~Check_library): New function.
6621 (Check_library::is_runnable): New function.
6622 (Check_library::locks): New function.
6623 (Check_library::run): New function.
6624 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6625 (Add_symbols::library_): New data member.
6626 (class Read_member): New class.
6627 (class Check_script): New class.
6628 (class Check_library): New class.
6629 * reloc.cc (Read_relocs::is_runnable): Allow case where
6630 token == NULL.
6631 (Read_relocs::locks): Likewise.
6632 (Scan_relocs::locks): Likewise.
6633 (Relocate_task::locks): Likewise.
6634 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6635 to clear counters.
6636 (Sized_relobj::incremental_relocs_scan): Fix comment.
6637 (Sized_relobj::do_relocate): Pass output file offset to
6638 write_local_symbols.
6639 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6640 from class declaration.
6641 * script.cc (read_input_script): Allocate Script_info; pass
6642 argument serial number to report_script.
6643 * script.h (class Script_info): Move to incremental.h.
6644 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6645 * symtab.h (Symbol_table::add_from_incrobj): New function.
6646 (Symbol_table::set_file_offset): New function.
6647
6648 2011-04-05 Cary Coutant <ccoutant@google.com>
6649
6650 * incremental-dump.cc (dump_incremental_inputs): Change signature
6651 to take a Sized_incremental_binary; change caller. Use readers
6652 in Sized_incremental_binary.
6653 * incremental.cc
6654 (Sized_incremental_binary::find_incremental_inputs_sections):
6655 Rename do_find_incremental_inputs_sections to this.
6656 (Sized_incremental_binary::setup_readers): New function.
6657 (Sized_incremental_binary::do_check_inputs): Check
6658 has_incremental_info_ flag; move setup code to setup_readers;
6659 use input readers.
6660 (Sized_incremental_binary::do_file_is_unchanged): New function.
6661 (Sized_incremental_binary::do_get_input_reader): New function.
6662 * incremental.h (class Incremental_binary): Move to end of file.
6663 (Incremental_binary::file_is_unchanged): New function.
6664 (Incremental_binary::do_file_is_unchanged): New function.
6665 (Incremental_binary::Input_reader): New class.
6666 (Incremental_binary::get_input_reader): New function.
6667 (class Sized_incremental_binary): Move to end of file.
6668 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6669 input section reader classes.
6670 (Sized_incremental_binary::has_incremental_info): New function.
6671 (Sized_incremental_binary::inputs_reader): New function.
6672 (Sized_incremental_binary::symtab_reader): New function.
6673 (Sized_incremental_binary::relocs_reader): New function.
6674 (Sized_incremental_binary::got_plt_reader): New function.
6675 (Sized_incremental_binary::do_file_is_unchanged): New function.
6676 (Sized_incremental_binary::Sized_input_reader): New class.
6677 (Sized_incremental_binary::get_input_reader): New function.
6678 (Sized_incremental_binary::find_incremental_inputs_sections):
6679 Rename do_find_incremental_inputs_sections to this.
6680 (Sized_incremental_binary::setup_readers): New function.
6681 (Sized_incremental_binary::has_incremental_info_): New data member.
6682 (Sized_incremental_binary::inputs_reader_): New data member.
6683 (Sized_incremental_binary::symtab_reader_): New data member.
6684 (Sized_incremental_binary::relocs_reader_): New data member.
6685 (Sized_incremental_binary::got_plt_reader_): New data member.
6686 (Sized_incremental_binary::current_input_file_): New data member.
6687
6688 2011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6689
6690 PR gold/12640
6691 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6692 violation.
6693
6694 2011-03-30 Cary Coutant <ccoutant@google.com>
6695
6696 * archive.cc (Archive::include_member): Adjust call to report_object.
6697 (Add_archive_symbols::run): Add script_info to call to
6698 report_archive_begin.
6699 (Lib_group::include_member): Adjust call to report_object.
6700 (Add_lib_group_symbols::run): Adjust call to report_object.
6701 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6702 blocks. Add object count for script input files.
6703 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6704 script_info parameter; change all callers.
6705 (Incremental_inputs::report_object): Add script_info parameter;
6706 change all callers.
6707 (Incremental_inputs::report_script): Store backpointer to
6708 incremental info entry.
6709 (Output_section_incremental_inputs::set_final_data_size): Record
6710 additional information for scripts.
6711 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6712 * incremental.h (Incremental_script_entry::add_object): New function.
6713 (Incremental_script_entry::get_object_count): New function.
6714 (Incremental_script_entry::get_object): New function.
6715 (Incremental_script_entry::objects_): New data member; adjust
6716 constructor.
6717 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6718 (Incremental_inputs::report_object): Add script_info parameter.
6719 (Incremental_inputs_reader::get_object_count): New function.
6720 (Incremental_inputs_reader::get_object_offset): New function.
6721 * options.cc (Input_arguments::add_file): Return reference to
6722 new input argument.
6723 * options.h (Input_argument::set_script_info): New function.
6724 (Input_argument::script_info): New function.
6725 (Input_argument::script_info_): New data member; adjust all
6726 constructors.
6727 (Input_file_group::add_file): Return reference to new input argument.
6728 (Input_file_lib::add_file): Likewise.
6729 (Input_arguments::add_file): Likewise.
6730 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6731 * script.cc (Parser_closure::Parser_closure): Add script_info
6732 parameter; adjust all callers.
6733 (Parser_closure::script_info): New function.
6734 (Parser_closure::script_info_): New data member.
6735 (read_input_script): Report scripts earlier to incremental info.
6736 (script_add_file): Set script_info in Input_argument.
6737 (script_add_library): Likewise.
6738 * script.h (Script_options::Script_info): Rewrite class.
6739
6740 2011-03-29 Cary Coutant <ccoutant@google.com>
6741
6742 * archive.cc (Library_base::should_include_member): Move
6743 method here from class Archive.
6744 (Archive::Archive): Initialize base class.
6745 (Archive::should_include_member): Move to base class.
6746 (Archive::do_for_all_unused_symbols): New function.
6747 (Add_archive_symbols::run): Remove redundant access to
6748 incremental_inputs.
6749 (Lib_group::Lib_group): Initialize base class.
6750 (Lib_group::do_filename): New function.
6751 (Lib_group::include_member): Pass pointer to Lib_group to
6752 report_object.
6753 (Lib_group::do_for_all_unused_symbols): New function.
6754 (Add_lib_group_symbols::run): Report archive information for
6755 incremental links.
6756 * archive.h (class Library_base): New base class.
6757 (class Archive): Derive from Library_base.
6758 (Archive::filename): Move to base class.
6759 (Archive::set_incremental_info): Likewise.
6760 (Archive::incremental_info): Likewise.
6761 (Archive::Should_include): Likewise.
6762 (Archive::should_include_member): Likewise.
6763 (Archive::Armap_entry): Remove.
6764 (Archive::Unused_symbol_iterator): Remove.
6765 (Archive::unused_symbols_begin): Remove.
6766 (Archive::unused_symbols_end): Remove.
6767 (Archive::do_filename): New function.
6768 (Archive::do_get_mtime): New function.
6769 (Archive::do_for_all_unused_symbols): New function.
6770 (Archive::task_): Move to base class.
6771 (Archive::incremental_info_): Likewise.
6772 (class Lib_group): Derive from Library_base.
6773 (Lib_group::do_filename): New function.
6774 (Lib_group::do_get_mtime): New function.
6775 (Lib_group::do_for_all_unused_symbols): New function.
6776 (Lib_group::task_): Move to base class.
6777 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6778 function.
6779 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6780 function.
6781 * incremental.cc (Incremental_inputs::report_archive_begin):
6782 Use Library_base; call library's get_mtime; add incremental inputs
6783 entry before members.
6784 (class Unused_symbol_visitor): New class.
6785 (Incremental_inputs::report_archive_end): Use Library_base; use
6786 visitor class to record unused symbols; don't add incremental inputs
6787 entry after members.
6788 (Incremental_inputs::report_object): Use Library_base.
6789 * incremental.h
6790 (Incremental_archive_entry::Incremental_archive_entry): Remove
6791 unused Archive parameter.
6792 (Incremental_inputs::report_archive_begin): Use Library_base.
6793 (Incremental_inputs::report_archive_end): Likewise.
6794 (Incremental_inputs::report_object): Likewise.
6795 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6796 function.
6797 * object.h (Object::for_all_global_symbols): New function.
6798 (Object::do_for_all_global_symbols): New function.
6799 (Sized_relobj::do_for_all_global_symbols): New function.
6800 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6801 function.
6802 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6803 function.
6804
6805 2011-03-27 Ian Lance Taylor <iant@google.com>
6806
6807 * archive.cc (Archive::interpret_header): Return -1 if something
6808 goes wrong. Change callers accordingly.
6809
6810 2011-03-25 Cary Coutant <ccoutant@google.com>
6811
6812 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6813 * testsuite/Makefile.in: Regenerate.
6814
6815 2011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
6816
6817 * plugin.cc (get_view): New.
6818 (Plugin::load): Pass get_view to the plugin.
6819 (Plugin_manager::get_view): New.
6820
6821 2011-03-21 Ian Lance Taylor <iant@google.com>
6822
6823 * testsuite/final_layout.sh: Rewrite to not use dc.
6824 * testsuite/relro_test.sh: Fail if dc is not present.
6825
6826 2011-03-21 Sriraman Tallam <tmsriram@google.com>
6827
6828 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6829 Change == to -eq.
6830 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6831 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6832 Change == to -eq.
6833 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6834 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6835
6836 2011-03-14 Ian Lance Taylor <iant@google.com>
6837
6838 * script-sections.cc (Sort_output_sections::script_compare):
6839 Rename from is_before, change return type.
6840 (Sort_output_sections::operator()): Adjust accordingly.
6841
6842 2011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6843
6844 PR gold/12572
6845 * testsuite/odr_violation2.cc: Add comment to make all error line
6846 numbers double digits.
6847 * testsuite/debug_msg.sh: Adjust expected errors.
6848
6849 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6850
6851 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6852 but mark earlier ones as non-canonical
6853 (offset_to_iterator): Update search target and example
6854 (do_addr2line): Return extra lines in a vector*
6855 (format_file_lineno): Extract from do_addr2line
6856 (one_addr2line): Add vector* out-param
6857 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6858 when a lineno entry appeared last for its instruction
6859 (Dwarf_line_info): Add vector* out-param
6860 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6861 * symtab.cc (Odr_violation_compare): Include the lineno in the
6862 comparison again.
6863 (linenos_from_loc): New. Combine the canonical line for an
6864 address with its other lines.
6865 (True_if_intersect): New. Helper functor to make
6866 std::set_intersection a query.
6867 (detect_odr_violations): Compare sets of lines instead of just
6868 one line for each function. This became less deterministic, but
6869 has fewer false positives.
6870 * symtab.h: Declarations.
6871 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6872 mix an optimized and non-optimized object in the same binary
6873 (odr_violation2.so): Same.
6874 * testsuite/Makefile.in: Regenerate from Makefile.am.
6875 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6876 * testsuite/debug_msg.sh: Update line numbers and add
6877 assertions.
6878 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6879 non-optimized context.
6880 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6881 isn't inlined, and use OdrDerived in an optimized context.
6882 * testsuite/odr_header1.h: Defines OdrDerived, where
6883 optimization will change the
6884 first-instruction-in-the-destructor's file and line number.
6885 * testsuite/odr_header2.h: Defines OdrBase.
6886
6887 2011-03-09 Ian Lance Taylor <iant@google.com>
6888
6889 * fileread.cc (File_read::clear_views): Don't delete the whole
6890 file view.
6891
6892 2011-03-08 Ian Lance Taylor <iant@google.com>
6893
6894 PR gold/12525
6895 * fileread.cc: #include <climits>.
6896 (GOLD_IOV_MAX): Define.
6897 (File_read::read_multiple): Limit number of entries by iov_max.
6898 * fileread.h (class File_read): Always set max_readv_entries to
6899 128.
6900
6901 2011-03-07 Ian Lance Taylor <iant@google.com>
6902
6903 PR gold/12525
6904 * options.h (class General_options): Add -dy and -dn.
6905
6906 2011-03-02 Cary Coutant <ccoutant@google.com>
6907
6908 * testsuite/script_test_9.t: Add TLS segment.
6909
6910 2011-03-02 Simon Baldwin <simonb@google.com>
6911
6912 * configure.ac: Add check for gnu_indirect_function support in
6913 the toolchain building binutils.
6914 * configure: Rebuild.
6915
6916 2011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
6917
6918 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6919 plugin only symbols.
6920 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6921 in plugin files as not needed in the symbol table.
6922
6923 2011-02-11 Sriraman Tallam <tmsriram@google.com>
6924
6925 * output.cc (Output_section::add_input_section): Delay fill
6926 generation for section ordering.
6927
6928 2011-02-09 Ian Lance Taylor <iant@google.com>
6929
6930 PR gold/12316
6931 * object.h (class Sized_relobj): Remove clear_local_symbols.
6932 * reloc.cc (Sized_relobj::do_relocate): Don't call
6933 clear_local_symbols.
6934
6935 2011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
6936
6937 * plugin.cc (is_visible_from_outside): Return true for symbols
6938 in the -u option.
6939
6940 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6941
6942 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6943 filename.
6944
6945 2011-02-02 Sriraman Tallam <tmsriram@google.com>
6946
6947 * icf.h (is_section_foldable_candidate): Change type of parameter
6948 to std::string.
6949 * icf.cc (Icf::find_identical_sections): Change type of local variable
6950 section_name to be std::string.
6951 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6952
6953 2011-01-25 Ian Lance Taylor <iant@google.com>
6954
6955 * script.cc (script_add_extern): Rewrite to use
6956 add_symbol_reference.
6957
6958 2011-01-25 Doug Kwan <dougkwan@google.com>
6959
6960 * icf.cc (get_section_contents): Always lock section's object.
6961
6962 2011-01-24 Ian Lance Taylor <iant@google.com>
6963
6964 * options.h (class General_options): Accept
6965 --no-detect-odr-violations.
6966
6967 2011-01-24 Ian Lance Taylor <iant@google.com>
6968
6969 * version.cc (version_string): Bump to 1.11.
6970
6971 2011-01-24 Ian Lance Taylor <iant@google.com>
6972
6973 * plugin.cc (class Plugin_rescan): Define new class.
6974 (Plugin_manager::claim_file): Set any_claimed_.
6975 (Plugin_manager::save_archive): New function.
6976 (Plugin_manager::save_input_group): New function.
6977 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6978 necessary.
6979 (Plugin_manager::new_undefined_symbol): New function.
6980 (Plugin_manager::rescan): New function.
6981 (Plugin_manager::rescannable_defines): New function.
6982 (Plugin_manager::add_input_file): Set any_added_.
6983 * plugin.h (class Plugin_manager): define new fields rescannable_,
6984 undefined_symbols_, any_claimed_, and any_added_. Declare
6985 Plugin_rescan as friend. Declare new functions.
6986 (Plugin_manager::Rescannable): Define type.
6987 (Plugin_manager::Rescannable_list): Define type.
6988 (Plugin_manager::Undefined_symbol_list): Define type.
6989 (Plugin_manager::Plugin_manager): Initialize new fields.
6990 * archive.cc (Archive::defines_symbol): New function.
6991 (Add_archive_symbols::run): Pass archive to plugins if any.
6992 * archive.h (class Archive): Declare defines_symbol.
6993 * readsyms.cc (Input_group::~Input_group): New function.
6994 (Finish_group::run): Pass input_group to plugins if any.
6995 * readsyms.h (class Input_group): Declare destructor.
6996 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6997 any.
6998
6999 2011-01-10 Ian Lance Taylor <iant@google.com>
7000
7001 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7002 section as relro.
7003 (Layout::set_segment_offsets): Reset increase_relro before calling
7004 set_section_addresses a second time.
7005
7006 2011-01-04 Cary Coutant <ccoutant@google.com>
7007
7008 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7009 sections before NOBITS sections.
7010
7011 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7012
7013 * version.cc (print_version): Update copyright to 2011.
7014
7015 2010-12-23 Cary Coutant <ccoutant@google.com>
7016
7017 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7018 of OS to this->add. Add OD parameter to second form of the function.
7019
7020 2010-12-20 Ian Lance Taylor <iant@google.com>
7021
7022 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7023 second of two consecutive entries with same offset.
7024
7025 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7026
7027 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7028 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7029 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7030 to avoid unneeded links against $(LDADD).
7031 * testsuite/Makefile.in: Regenerate.
7032
7033 2010-12-15 Ian Lance Taylor <iant@google.com>
7034
7035 PR gold/12324
7036 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7037 for R_X86_64_32 and R_X86_64_PC32.
7038 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7039 ver_matching_def_pic.o.
7040 (ver_matching_def_pic.o): New target.
7041
7042 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7043
7044 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7045 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7046 Move definition before File_read::View member definitions.
7047 (File_read::View::~View): Initialize and hold lock before
7048 updating current_mapped_bytes.
7049
7050 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7051
7052 * dwarf_reader.cc: Remove outdated comment.
7053 * gold-threads.cc: Fix typo in error message.
7054 * archive.cc: Fix typos in comments.
7055 * archive.h: Likewise.
7056 * arm-reloc-property.cc: Likewise.
7057 * arm-reloc-property.h: Likewise.
7058 * arm-reloc.def: Likewise.
7059 * arm.cc: Likewise.
7060 * attributes.h: Likewise.
7061 * cref.cc: Likewise.
7062 * ehframe.cc: Likewise.
7063 * fileread.h: Likewise.
7064 * gold.h: Likewise.
7065 * i386.cc: Likewise.
7066 * icf.cc: Likewise.
7067 * incremental.h: Likewise.
7068 * int_encoding.cc: Likewise.
7069 * layout.h: Likewise.
7070 * main.cc: Likewise.
7071 * merge.h: Likewise.
7072 * object.cc: Likewise.
7073 * object.h: Likewise.
7074 * options.cc: Likewise.
7075 * readsyms.cc: Likewise.
7076 * reduced_debug_output.cc: Likewise.
7077 * reloc.cc: Likewise.
7078 * script-sections.cc: Likewise.
7079 * sparc.cc: Likewise.
7080 * symtab.h: Likewise.
7081 * target-reloc.h: Likewise.
7082 * target.cc: Likewise.
7083 * target.h: Likewise.
7084 * timer.cc: Likewise.
7085 * timer.h: Likewise.
7086 * x86_64.cc: Likewise.
7087
7088 2010-12-09 Cary Coutant <ccoutant@google.com>
7089
7090 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7091 stack.
7092 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7093 parameter; change all callers.
7094 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7095 * options.h (warn_execstack): New option.
7096
7097 2010-12-07 Doug Kwan <dougkwan@google.com>
7098
7099 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7100 like function call relocations.
7101
7102 2010-12-07 Ian Lance Taylor <iant@google.com>
7103
7104 * archive.cc (Archive::get_elf_object_for_member): Permit
7105 punconfigured to be NULL.
7106 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7107 (Archive::include_member): Pass NULL to get_elf_object_for_member
7108 if we searched for the archive and this is the first included
7109 object.
7110
7111 2010-12-01 Ian Lance Taylor <iant@google.com>
7112
7113 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7114 track_relocs_type_ field.
7115 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7116 Set track_relocs_type_.
7117 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7118 contents when using RELA relocs.
7119 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7120 reloc_map_.
7121 * reloc.cc (Track_relocs::next_addend): New function.
7122 * reloc.h (class Track_relocs): Declare next_addend.
7123
7124 2010-12-01 Ian Lance Taylor <iant@google.com>
7125
7126 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7127 virtual destructor.
7128
7129 2010-12-01 Ian Lance Taylor <iant@google.com>
7130
7131 * README: Update compilers known to work and fail.
7132
7133 2010-11-23 Matthias Klose <doko@ubuntu.com>
7134
7135 * configure.in: For --enable-gold, handle value `default' instead of
7136 `both*'. Always install ld as ld.bfd, install as ld if gold is
7137 not the default.
7138 * configure: Regenerate.
7139
7140 2010-11-18 Doug Kwan <dougkwan@google.com>
7141
7142 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7143 and right_alignment to be zero. Store result alignment only if it is
7144 greater than existing alignment.
7145
7146 2010-11-16 Cary Coutant <ccoutant@google.com>
7147
7148 PR gold/12220
7149 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7150 Check for ".zdebug_line".
7151
7152 2010-11-16 Doug Kwan <dougkwan@google.com>
7153 Cary Coutant <ccoutant@google.com>
7154
7155 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7156 by reference; adjust all callers.
7157 * output.cc (Output_segment::set_section_addresses): Adjust references
7158 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7159 list is empty.
7160 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7161 end at page boundary.
7162
7163 2010-11-16 Cary Coutant <ccoutant@google.com>
7164
7165 PR gold/12220
7166 * layout.cc (Layout::choose_output_section): Transform names of
7167 compressed sections even when using a script with a SECTIONS clause.
7168 (Layout::output_section_name): Remove code to transform
7169 compressed debug section names.
7170 * output.cc (Output_section::add_input_section): Use uncompressed
7171 section size when tracking input sections.
7172
7173 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7174
7175 * symtab.h (Symbol::NON_PIC_REF): Remove.
7176 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7177 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7178 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7179 (Symbol::use_plt_offset): Take a flags argument and pass it
7180 directly to needs_dynamic_reloc. Restrict check for undefined
7181 weak symbols to function calls.
7182 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7183 (Target_arm::Scan::global): Use it.
7184 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7185 (Target_arm::Relocate::relocate): Likewise.
7186 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7187 parameter with an r_type parameter. Use get_reference_flags
7188 to get the flags.
7189 (Target_arm::Relocate::relocate): Update accordingly.
7190 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7191 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7192 (Target_i386::Scan::global): Likewise.
7193 (Target_i386::Relocate::relocate): Likewise.
7194 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7195 parameter with an r_type parameter. Use get_reference_flags
7196 to get the flags.
7197 (Target_i386::Relocate::relocate): Update accordingly.
7198 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7199 (Target_powerpc::Scan::global): Use it.
7200 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7201 (Target_powerpc::Relocate::relocate): Likewise.
7202 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7203 (Target_sparc::Scan::global): Use it.
7204 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7205 (Target_sparc::Relocate::relocate): Likewise.
7206 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7207 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7208 (Target_x86_64::Scan::global): Likewise.
7209 (Target_x86_64::Relocate::relocate): Likewise.
7210
7211 2010-11-08 Doug Kwan <dougkwan@google.com>
7212 Cary Coutant <ccoutant@google.com>
7213
7214 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7215 (Arm_exidx_merge_section::section_contents_): New data member.
7216 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7217 (Arm_input_section::~Arm_input_section): De-allocate memory.
7218 (Arm_input_section::original_contents_): New data member.
7219 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7220 in parameters instead of calling Object::section_contents without
7221 locking.
7222 (Arm_output_section::group_section): New parameter TASK. Pass it
7223 to callees that need locking objects.
7224 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7225 to lock EXIDX input sections. Fix a formatting issue. Call
7226 Arm_exidx_merged_section::build_contents to create merged section
7227 contents.
7228 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7229 to lock object of stub table owner.
7230 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7231 TEXT_SIZE to initialize data member TEXT_SIZE_.
7232 (Arm_exidx_input_section::addralign): Fix typo in comment.
7233 (Arm_exidx_input_section::text_size): New method.
7234 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7235 that require locking objects. Lock objects before scanning for stubs
7236 and updating local symbols.
7237 (Arm_input_section<big_endian>::init): Copy contents of original
7238 input section.
7239 (Arm_input_section<big_endian>::do_write): Use saved contents of
7240 original input section instead of calling Object::section_contents
7241 without locking.
7242 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7243 size without calling Object::section_size().
7244 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7245 for size. Allocate a buffer for merged EXIDX entries.
7246 (Arm_exidx_merged_section::build_contents): New method.
7247 (Arm_exidx_merged_section::do_write): Move merge section contents
7248 building code to Arm_exidx_merged_section::build_contetns. Write
7249 out contetns in buffer instead of building it on the fly.
7250 (Arm_relobj::make_exidx_input_section): Also pass text section size
7251 to Arm_exidx_input_section constructor.
7252 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7253 (Arm_dynobj::do_read_symbols): Fix memory leak.
7254 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7255 * target.h: (class Task): Add forward declaration.
7256 (Target::relax): Add new parameter TASK and pass it to
7257 Target::do_relax().
7258 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7259
7260 2010-11-05 Cary Coutant <ccoutant@google.com>
7261
7262 PR gold/10708
7263 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7264 object when reading from the file.
7265 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7266 second layout pass.
7267 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7268 when reading section contents.
7269 (get_section_contents): Likewise.
7270 (icf::find_identical_sections): Likewise.
7271 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7272 object when reading from the file.
7273 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7274 the object when doing deferred section layout.
7275
7276 2010-11-03 Nick Clifton <nickc@redhat.com>
7277
7278 PR gold/12001
7279 * script.h (class Symbol_assignment: name): New member. Returns
7280 the name of the symbol.
7281 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7282 Returns true if the given symbol name is on the list of
7283 assignments wating to be processed.
7284 * archive.cc (should_incldue_member): If the symbol is undefined,
7285 check to see if it is on the list of symbols pending assignment.
7286
7287 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7288
7289 * script-sections.cc (Script_sections::find_memory_region): Check
7290 for a NULL output section pointer.
7291
7292 2010-10-29 Doug Kwan <dougkwan@google.com>
7293
7294 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7295 Output_section::add_relaxed_input_section.
7296 * output.cc (Output_section::add_relaxed_input_section): Add new
7297 arguments LAYOUT and NAME. Set section order index.
7298 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7299 Copy section order index.
7300 * output.h (Output_section::add_relaxed_input_section): Add new
7301 arguments LAYOUT and NAME.
7302
7303 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7304
7305 * testsuite/Makefile.am: Move gcctestdir/ld rule to
7306 NATIVE_OR_CROSS_LINKER.
7307 * testsuite/Makefile.in: Regenerate.
7308
7309 2010-10-20 Doug Kwan <dougkwan@google.com>
7310
7311 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7312 without SHF_LINK_ORDER flags.
7313 * layout.cc (Layout::choose_output_section): Do not filter
7314 SHF_LINK_ORDER flag in a relocatable link.
7315
7316 2010-10-17 Cary Coutant <ccoutant@google.com>
7317
7318 * output.h (Output_segment::set_section_addresses): Change function
7319 signature. Update all callers.
7320 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7321 sections.
7322 (Output_segment::set_section_addresses): Align after last TLS
7323 section. Add padding before last relro section instead of after.
7324
7325 2010-10-17 Doug Kwan <dougkwan@google.com>
7326
7327 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7328 GOT output section to be writable.
7329
7330 2010-10-14 Cary Coutant <ccoutant@google.com>
7331
7332 * debug.h (DEBUG_INCREMENTAL): New flag.
7333 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7334 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7335 mode.
7336 * incremental.cc (report_command_line): Ignore all forms of
7337 --incremental.
7338 * layout.cc (Layout::Layout): Check parameters for incremental link
7339 mode.
7340 * options.cc (General_options::parse_incremental): New function.
7341 (General_options::parse_no_incremental): New function.
7342 (General_options::parse_incremental_full): New function.
7343 (General_options::parse_incremental_update): New function.
7344 (General_options::incremental_mode_): New data member.
7345 (General_options::finalize): Check incremental_mode_.
7346 * options.h (General_options): Update help text for --incremental.
7347 Add --no-incremental, --incremental-full, --incremental-update.
7348 (General_options::Incremental_mode): New enum type.
7349 (General_options::incremental_mode): New function.
7350 (General_options::incremental_mode_): New data member.
7351 * parameters.cc (Parameters::incremental_mode_): New data member.
7352 (Parameters::set_options): Set incremental_mode_.
7353 (Parameters::set_incremental_full): New function.
7354 (Parameters::incremental): New function.
7355 (Parameters::incremental_update): New function.
7356 (set_parameters_incremental_full): New function.
7357 * parameters.h (Parameters::set_incremental_full): New function.
7358 (Parameters::incremental): New function.
7359 (Parameters::incremental_update): New function.
7360 (Parameters::incremental_mode_): New data member.
7361 (set_parameters_incremental_full): New function.
7362 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7363 incremental link mode.
7364 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7365 (Sized_relobj::do_relocate_sections): Likewise.
7366 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7367 option.
7368 * testsuite/Makefile.in: Regenerate.
7369 * testsuite/incremental_test.sh: Filter all forms of --incremental.
7370
7371 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7372
7373 * script-sections.h (class Script_sections): Make
7374 Sections_elements typedef public.
7375 * script-sections.cc (class Sort_output_sections): Add elements_
7376 field. Add constructor which sets it; change all callers.
7377 (Sort_output_sections::is_before): New function.
7378 (Sort_output_sections::operator()): Call is_before.
7379 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7380 conditional.
7381 * testsuite/script_test_10.sh: New test. Test script section
7382 order.
7383 * testsuite/script_test_10.t: Likewise.
7384 * testsuite/script_test_10.s: Likewise.
7385 * testsuite/Makefile.am: Wrap the cross linker tests and the
7386 common tests into NATIVE_OR_CROSS_LINKER.
7387 (check_SCRIPTS): Add script_test_10.sh.
7388 (check_DATA): Add script_test_10.stdout.
7389 (script_test_10.o, script_test_10): New targets.
7390 (script_test_10.stdout): New target.
7391 * configure, testsuite/Makefile.in: Regenerate.
7392
7393 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7394
7395 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7396 error for the deprecated relocations.
7397 (Target_arm::Scan::global): Likewise.
7398 (Target_arm::Relocate::relocate): Likewise.
7399
7400 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7401
7402 * fileread.cc (Input_file::find_file): Initialize *found_name
7403 and *namep when using the fallback search for case 4.
7404
7405 2010-10-11 Cary Coutant <ccoutant@google.com>
7406
7407 * options.h (class General_options): Redefine -z lazy as an alias for
7408 the negation of -z now.
7409
7410 2010-10-11 Ian Lance Taylor <iant@google.com>
7411
7412 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7413 binding.
7414
7415 2010-10-06 Nick Clifton <nickc@redhat.com>
7416
7417 * script-sections.cc(class Memory_region): Remove
7418 current_lma_offset_ field. Rename current_vma_offset_ to
7419 current_offset_. Add last_section_ field.
7420 (Memory_region::get_current_vma_address): Rename to
7421 get_current_address.
7422 (Memory_region::get_current_lma_address): Delete.
7423 (Memory_region::increment_vma_offset): Rename to
7424 increment_offset.
7425 (Memory_region::increment_lma_offset): Delete.
7426 (Memory_region::attributes_compatible): New method. Returns
7427 true if the provided section is compatible with the region.
7428 (Memory_region::get_last_section): New method. Returns the last
7429 section to use the region.
7430 (Memory_region::set_last_section): New method. Stores the last
7431 section to use the region.
7432 (Script_sections::block_in_region): New method. Returns true if
7433 a block of memory is contained within a region.
7434 (Script_sections::find_memory_region): New method. Locates a
7435 memory region to be used to set a VMA or LMA address.
7436 (Output_section_definition::set_section_addresses): Add code to
7437 check for addresses set by memory regions.
7438 (Output_segment::set_section_addresses): Remove memory region
7439 walking code.
7440 (Script_sections::create_segment): Add a warning if a header
7441 segment is created outside of any region.
7442 * script-sections.h (class Script_sections): Add prototypes for
7443 find_memory_region and block_in_region methods.
7444 * testsuite/memory_test.s: Use .long instead of .word.
7445 * testsuite/memory_test.t: Add some more output sections.
7446 * testsuite/memory_test.sh: Update expected output.
7447
7448 2010-10-02 Doug Kwan <dougkwan@google.com>
7449
7450 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7451 defintion to symtab.h
7452 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7453 declaration to defintion.
7454
7455 2010-10-01 Nick Clifton <nickc@redhat.com>
7456
7457 * expression.cc (eval): Replace dummy argument with NULL.
7458 (eval_maybe_dot): Check for a NULL result section pointer.
7459 (Symbol_expression::value): Likewise.
7460 (Dot_expression::value): Likewise.
7461 (BINARY_EXPRESSION): Likewise.
7462 (Max_expression::value): Likewise.
7463 (Min_expression::value): Likewise.
7464 (Absolute_expression::value): Likewise.
7465 (Addr_expression::value_from_output_section): Likewise.
7466 (Loaddddr_expression::value_from_output_section): Likewise.
7467 (Segment_start_expression::value): Likewise.
7468 * script-sections.cc
7469 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7470 argument with NULL.
7471 (Sections_elememt_dot_assignment::set_section_addresses):
7472 Likewise.
7473 (Output_data_expression::do_write_to_buffer): Likewise.
7474 (Output_section_definition::finalize_symbols): Likewise.
7475 (Output_section_definition::set_section_addresses): Likewise.
7476
7477 2010-09-30 Doug Kwan <dougkwan@google.com>
7478
7479 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7480
7481 2010-09-28 Sriraman Tallam <tmsriram@google.com>
7482
7483 * target.h (Target::can_icf_inline_merge_sections): New virtual
7484 function.
7485 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7486 virtual function.
7487 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7488 virtual function.
7489 * icf.cc (get_section_contents): Inline merge sections only when
7490 target allows it.
7491
7492 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7493
7494 * configure: Regenerate.
7495
7496 2010-09-17 Ian Lance Taylor <iant@google.com>
7497
7498 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
7499 * testsuite/Makefile.am (memory_test.o): New target.
7500 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7501 memory_test.t.
7502 * testsuite/Makefile.in: Rebuild.
7503
7504 2010-09-17 Doug Kwan <dougkwan@google.com>
7505
7506 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7507 defintion if relocation uses GOT entries of the symbol.
7508 * testsuite/icf_safe_test.sh: Fix test.
7509 * testsuite/icf_safe_so_test.sh: Fix test.
7510
7511 2010-09-16 Cary Coutant <ccoutant@google.com>
7512
7513 * script_sections.cc (class Memory_region): Remove "NULL" from
7514 vector initializations.
7515
7516 2010-09-15 Cary Coutant <ccoutant@google.com>
7517
7518 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7519 Resolve forwarding symbols.
7520
7521 2010-09-15 Doug Kwan <dougkwan@google.com>
7522
7523 * gold/testsuite/script_test_3.t: Add ARM special sections.
7524 * gold/testsuite/script_test_4.t: Same.
7525 * gold/testsuite/script_test_5.t: Same.
7526 * gold/testsuite/script_test_6.t: Same.
7527 * gold/testsuite/script_test_7.t: Same.
7528 * gold/testsuite/script_test_7.t: Same.
7529 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7530
7531 2010-09-14 Cary Coutant <ccoutant@google.com>
7532
7533 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7534 (Target_x86_64::Relocate::relocate_tls): Replace check for
7535 saw_tls_block_reloc_ with test for executable section.
7536
7537 2010-09-12 Cary Coutant <ccoutant@google.com>
7538
7539 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7540 position-independent executables to shared libraries need dynamic
7541 relocations.
7542 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7543 position-independent executables.
7544 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7545 * testsuite/Makefile.in: Regenerate.
7546
7547 2010-09-10 Nick Clifton <nickc@redhat.com>
7548
7549 PR gold/11997
7550 * testsuite/memory_test.t: Discard any sections that are not
7551 needed.
7552
7553 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7554
7555 PR gold/11996
7556 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7557 "This::" to work around a bug in gcc 4.2.
7558
7559 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7560
7561 2010-09-09 Rafael Espindola <espindola@google.com>
7562
7563 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7564 sections with different PF_X flags in the same segment.
7565 (Layout::find_first_load_seg): Search all segments to find the first
7566 one.
7567 * options.h (rosegment): New.
7568
7569 2010-09-08 Rafael Espindola <espindola@google.com>
7570
7571 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
7572
7573 2010-09-08 Doug Kwan <dougkwan@google.com>
7574
7575 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7576 (Arm_relobj::do_relocate_sections): Add new parameter for output
7577 file to match the parent.
7578 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7579 of local symbols instead of input values. Update code to track
7580 changes in gold::relocate_section.
7581 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7582 (Sized_relobj::compute_final_local_value_internal): New methods.
7583 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7584 body into private version of Sized_relobj::compute_final_local_value.
7585 Call the inline method.
7586 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7587 merged symbol value if there is one.
7588 (Symbol_value::has_output_value): New method defintiion.
7589 (Sized_relobj::Compute_final_local_value_status): New enum type.
7590 (Sized_relobj::compute_final_local_value): New methods.
7591 (Sized_relobj::compute_final_local_value_internal): New methods.
7592 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7593 and arm_cortex_a8.sh.
7594 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7595 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7596 New tests.
7597 * Makefile.in: Regenerate.
7598 * testsuite/arm_bl_out_of_range.s: Update test.
7599 * testsuite/thumb_bl_out_of_range.s: Ditto.
7600 * testsuite/thumb_blx_out_of_range.s: Ditto.
7601 * testsuite/arm_branch_out_of_range.sh: New file.
7602 * testsuite/arm_cortex_a8.sh: Ditto.
7603 * testsuite/arm_cortex_a8_b.s: Ditto.
7604 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7605 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7606 * testsuite/arm_cortex_a8_bl.s: Ditto.
7607 * testsuite/arm_cortex_a8_blx.s: Ditto.
7608 * testsuite/arm_cortex_a8_local.s: Ditto.
7609 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7610 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7611
7612 2010-09-08 Rafael Espindola <espindola@google.com>
7613
7614 * Makefile.am (memory_test.stdout): Run readelf with -W.
7615 * Makefile.in: Regenerate.
7616 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7617 64 bit output.
7618
7619 2010-09-08 Rafael Espindola <espindola@google.com>
7620
7621 * script-sections.cc (Script_sections::add_memory_region): Convert
7622 field precision to int.
7623 * script.cc (script_set_section_region, script_set_section_region):
7624 Convert field precision to int.
7625
7626 2010-09-08 Rafael Espindola <espindola@google.com>
7627
7628 * arm.cc (do_finalize_sections): Create the __exidx_start and
7629 __exdix_end symbols even when the section is missing.
7630
7631 2010-09-08 Nick Clifton <nickc@redhat.com>
7632
7633 * README: Remove claim that MEMORY is not supported.
7634 * expression.cc (script_exp_function_origin)
7635 (script_exp_function_length): Move from here to ...
7636 * script.cc: ... here.
7637 (script_set_section_region, script_add_memory)
7638 (script_parse_memory_attr, script_include_directive): New
7639 functions.
7640 * script-sections.cc
7641 (class Memory_region): New class.
7642 (class Output_section_definition): Add set_memory_region,
7643 set_section_vma, set_section_lma and get_section_name methods.
7644 (class Script_Sections): Add add_memory_region,
7645 find_memory_region, find_memory_region_origin,
7646 find_memory_region_length and set_memory_region methods.
7647 Have set_section_addresses method walk the list of set memory
7648 regions.
7649 Extend the print methos to display memory regions.
7650 * script-sections.h: Add prototypes for new methods.
7651 Add enum for MEMORY region attributes.
7652 * yyscript.y: Add support for parsing MEMORY regions.
7653 * script-c.h: Add prototypes for new functions.
7654 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7655 * testsuite/Makefile.in: Regenerate.
7656 * testsuite/memory_test.sh: New script.
7657 * testsuite/memory_test.s: New assembler source file.
7658 * testsuite/memory_test.t: New linker script.
7659
7660 2010-08-27 Doug Kwan <dougkwan@google.com>
7661
7662 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7663 reference override an existing dynamic weak reference.
7664 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7665 * testsuite/Makefile.in: Regenerate.
7666 * testsuite/dyn_weak_ref.sh: New file.
7667 * testsuite/dyn_weak_ref_1.c: Ditto.
7668 * testsuite/dyn_weak_ref_2.c: Ditto.
7669
7670 2010-08-27 Ian Lance Taylor <iant@google.com>
7671
7672 * incremental.h (class Incremental_input_entry): Add virtual
7673 destructor.
7674
7675 2010-08-27 Ian Lance Taylor <iant@google.com>
7676
7677 * testsuite/start_lib_test_3.c: Mark t3 as used.
7678
7679 2010-08-27 Nick Clifton <nickc@redhat.com>
7680
7681 * options.cc (version_script): Fix small typo in previous
7682 whitespace tidyup.
7683
7684 2010-08-25 Nick Clifton <nickc@redhat.com>
7685
7686 * archive.cc: Formatting fixes: Remove whitespace between
7687 typename and following asterisk. Remove whitespace between
7688 function name and opening parenthesis.
7689 * archive.h: Likewise.
7690 * arm.cc: Likewise.
7691 * attributes.cc: Likewise.
7692 * attributes.h: Likewise.
7693 * common.cc: Likewise.
7694 * copy-relocs.cc: Likewise.
7695 * dirsearch.h: Likewise.
7696 * dynobj.cc: Likewise.
7697 * ehframe.cc: Likewise.
7698 * ehframe.h: Likewise.
7699 * expression.cc: Likewise.
7700 * fileread.cc: Likewise.
7701 * fileread.h: Likewise.
7702 * gc.h: Likewise.
7703 * gold-threads.cc: Likewise.
7704 * gold.cc: Likewise.
7705 * i386.cc: Likewise.
7706 * icf.h: Likewise.
7707 * incremental-dump.cc: Likewise.
7708 * incremental.cc: Likewise.
7709 * layout.cc: Likewise.
7710 * layout.h: Likewise.
7711 * main.cc: Likewise.
7712 * merge.cc: Likewise.
7713 * merge.h: Likewise.
7714 * object.cc: Likewise.
7715 * object.h: Likewise.
7716 * options.cc: Likewise.
7717 * options.h: Likewise.
7718 * output.cc: Likewise.
7719 * output.h: Likewise.
7720 * plugin.cc: Likewise.
7721 * plugin.h: Likewise.
7722 * powerpc.cc: Likewise.
7723 * reloc.cc: Likewise.
7724 * script-c.h: Likewise.
7725 * script-sections.cc: Likewise.
7726 * script.cc: Likewise.
7727 * stringpool.cc: Likewise.
7728 * symtab.cc: Likewise.
7729 * symtab.h: Likewise.
7730 * target.cc: Likewise.
7731 * timer.cc: Likewise.
7732 * timer.h: Likewise.
7733 * version.cc: Likewise.
7734 * x86_64.cc: Likewise.
7735
7736 2010-08-24 Nick Clifton <nickc@redhat.com>
7737
7738 PR 11899
7739 * layout.cc (segment_precedes): Sort segments by their physical
7740 addresses, if they have been set.
7741
7742 2010-08-23 Cary Coutant <ccoutant@google.com>
7743
7744 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7745 symbols data.
7746 (Lib_group::include_member): Unlock object after deleting its
7747 symbols data.
7748 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7749 the bug fixed here.
7750
7751 2010-08-19 Neil Vachharajani <nvachhar@google.com>
7752 Cary Coutant <ccoutant@google.com>
7753
7754 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7755 constructor, and set_blocker.
7756 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7757 readsyms_blocker_.
7758 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7759 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7760 * testsuite/Makefile.am (start_lib_test): New test case.
7761 * testsuite/Makefile.in: Regenerate.
7762 * testsuite/start_lib_test_main.c: New file.
7763 * testsuite/start_lib_test_1.c: New file.
7764 * testsuite/start_lib_test_2.c: New file.
7765 * testsuite/start_lib_test_3.c: New file.
7766
7767 2010-08-19 Ian Lance Taylor <iant@google.com>
7768
7769 * Makefile.in: Rebuild with automake 1.11.1.
7770 * aclocal.m4: Likewise.
7771 * testsuite/Makefile.in: Likewise.
7772
7773 2010-08-19 Ian Lance Taylor <iant@google.com>
7774
7775 PR 10893
7776 * i386.cc (class Output_data_plt_i386): Update declarations.
7777 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7778 local_ifuncs_ fields.
7779 (Target_i386::do_plt_section_for_global): New function.
7780 (Target_i386::do_plt_section_for_local): New function.
7781 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7782 parameter; change all callers. Initialize global_ifuncs_ and
7783 local_ifuncs_. If doing a static link define __rel_iplt_start and
7784 __rel_iplt_end.
7785 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7786 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7787 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7788 symbols.
7789 (Target_i386::make_plt_section): New function, broken out of
7790 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7791 (Target_i386::make_plt_entry): Call make_plt_section.
7792 (Target_i386::make_local_ifunc_plt_entry): New function.
7793 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7794 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7795 R_386_IRELATIVE to switch.
7796 (Target_i386::Scan::global): Likewise.
7797 (Target_i386::Relocate::relocate): Likewise.
7798 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7799 switch.
7800 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7801 (Target_x86_64::do_plt_section_for_global): New function.
7802 (Target_x86_64::do_plt_section_for_local): New function.
7803 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7804 parameter; change all callers. If doing a static link define
7805 __rela_iplt_start and __rela_iplt_end.
7806 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7807 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7808 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7809 to point to .plt.
7810 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7811 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7812 switch.
7813 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7814 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7815 R_X86_64_IRELATIVE to switch.
7816 (Target_x86_64::Scan::global): Likewise.
7817 (Target_x86_64::Relocate::relocate): Likewise.
7818 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7819 switch.
7820 * target.h (class Target): Add plt_section_for_global and
7821 plt_section_for_local functions. Add do_plt_section_for_global
7822 and do_plt_section_for_local virtual functions.
7823 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7824 clarifying comments.
7825 (Symbol::use_plt_offset): Handle IFUNC symbol.
7826 * object.cc (Sized_relobj::Sized_relobj): Initialize
7827 local_plt_offsets_.
7828 (Sized_relobj::local_has_plt_offset): New function.
7829 (Sized_relobj::local_plt_offset): New function.
7830 (Sized_relobj::set_local_plt_offset): New function.
7831 (Sized_relobj::do_count): Handle IFUNC symbol.
7832 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7833 a bit away from input_shndx_ field. Add set_is_func_symbol and
7834 is_ifunc_symbol functions.
7835 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7836 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7837 local_plt_offsets_ field.
7838 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7839 * output.h (class Output_section_data): Add non-const
7840 output_section function.
7841 (class Output_data_got): Update declarations.
7842 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7843 Add use_plt_offset parameter to global and local constructors.
7844 Change all callers. Change local_sym_index_ field to 31 bits.
7845 Change GSYM_CODE and CONSTANT_CODE accordingly.
7846 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7847 doing a static link don't set sh_link field.
7848 (Output_data_got::Got_entry::write): Use PLT offset if
7849 appropriate.
7850 (Output_data_got::add_global_plt): New function.
7851 (Output_data_got::add_local_plt): New function.
7852 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7853 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7854 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7855 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7856 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7857 IFUNC conditional.
7858 * testsuite/ifunc-sel.h: New file.
7859 * testsuite/ifuncmain1.c: New file.
7860 * testsuite/ifuncmain1vis.c: New file.
7861 * testsuite/ifuncmod1.c: New file.
7862 * testsuite/ifuncdep2.c: New file.
7863 * testsuite/ifuncmain2.c: New file.
7864 * testsuite/ifuncmain3.c: New file.
7865 * testsuite/ifuncmod3.c: New file.
7866 * testsuite/ifuncmain4.c: New file.
7867 * testsuite/ifuncmain5.c: New file.
7868 * testsuite/ifuncmod5.c: New file.
7869 * testsuite/ifuncmain6pie.c: New file.
7870 * testsuite/ifuncmod6.c: New file.
7871 * testsuite/ifuncmain7.c: New file.
7872 * configure, testsuite/Makefile.in: Rebuild.
7873
7874 2010-08-18 Ian Lance Taylor <iant@google.com>
7875
7876 * incremental.cc
7877 (Output_section_incremental_inputs::write_input_files): Add cast
7878 to avoid signed/unsigned comparison warning.
7879 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7880
7881 2010-08-12 Cary Coutant <ccoutant@google.com>
7882
7883 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7884
7885 2010-08-13 Ian Lance Taylor <iant@google.com>
7886
7887 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7888
7889 2010-08-12 Cary Coutant <ccoutant@google.com>
7890 Doug Kwan <dougkwan@google.com>
7891
7892 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7893 defintion overrides non-weak undef, remember that the original undef
7894 is not weak.
7895 * symtab.cc (Symbol_table::sized_write_global): For undef without
7896 an original weak binding, set binding to global in output.
7897 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7898 * testsuite/Makefile.in: Regenerate.
7899 * testsuite/strong_ref_weak_def.sh: New file.
7900 * testsuite/strong_ref_weak_def_1.c: Ditto.
7901 * testsuite/strong_ref_weak_def_2.c: Ditto.
7902
7903 2010-08-12 Cary Coutant <ccoutant@google.com>
7904
7905 * testsuite/incremental_test.sh: Rewrite.
7906 * testsuite/incremental_test_1.c: Rewrite.
7907 * testsuite/incremental_test_2.c: Rewrite.
7908
7909 2010-08-12 Cary Coutant <ccoutant@google.com>
7910
7911 * arm.cc (Target_arm::got_size): Add const.
7912 (Target_arm::got_entry_count): New function.
7913 (Target_arm::plt_entry_count): New function.
7914 (Target_arm::first_plt_entry_offset): New function.
7915 (Target_arm::plt_entry_size): New function.
7916 (Output_data_plt_arm::entry_count): New function.
7917 (Output_data_plt_arm::first_plt_entry_offset): New function.
7918 (Output_data_plt_arm::get_plt_entry_size): New function.
7919 * i386.cc (Target_i386::got_size): Add const.
7920 (Target_i386::got_entry_count): New function.
7921 (Target_i386::plt_entry_count): New function.
7922 (Target_i386::first_plt_entry_offset): New function.
7923 (Target_i386::plt_entry_size): New function.
7924 (Output_data_plt_i386::entry_count): New function.
7925 (Output_data_plt_i386::first_plt_entry_offset): New function.
7926 (Output_data_plt_i386::get_plt_entry_size): New function.
7927 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7928 find_incremental_inputs_sections. Dump incremental_got_plt section.
7929 * incremental.cc: Include target.h.
7930 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7931 parameter. Adjust all callers. Find incremental_got_plt section.
7932 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7933 section.
7934 (Output_section_incremental_inputs::set_final_data_size): Calculate
7935 size of incremental_got_plt section.
7936 (Output_section_incremental_inputs::do_write): Write the
7937 incremental_got_plt section.
7938 (Got_plt_view_info): New struct.
7939 (Local_got_offset_visitor): New class.
7940 (Global_got_offset_visitor): New class.
7941 (Global_symbol_visitor_got_plt): New class.
7942 (Output_section_incremental_inputs::write_got_plt): New function.
7943 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7944 Add parameter. Adjust all callers.
7945 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7946 (Incremental_inputs::got_plt_section): New function.
7947 (Incremental_inputs::got_plt_section_): New data member.
7948 (Incremental_got_plt_reader): New class.
7949 * layout.cc (Layout::create_incremental_info_sections): Add the
7950 incremental_got_plt section.
7951 * object.h (Got_offset_list::get_list): New function.
7952 (Got offset_list::for_all_got_offsets): New function.
7953 (Sized_relobj::local_got_offset_list): New function.
7954 * powerpc.cc (Target_powerpc::got_size): Add const.
7955 (Target_powerpc::got_entry_count): New function.
7956 (Target_powerpc::plt_entry_count): New function.
7957 (Target_powerpc::first_plt_entry_offset): New function.
7958 (Target_powerpc::plt_entry_size): New function.
7959 (Output_data_plt_powerpc::entry_count): New function.
7960 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7961 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7962 * sparc.cc (Target_sparc::got_size): Add const.
7963 (Target_sparc::got_entry_count): New function.
7964 (Target_sparc::plt_entry_count): New function.
7965 (Target_sparc::first_plt_entry_offset): New function.
7966 (Target_sparc::plt_entry_size): New function.
7967 (Output_data_plt_sparc::entry_count): New function.
7968 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7969 (Output_data_plt_sparc::get_plt_entry_size): New function.
7970 * symtab.h (Symbol::got_offset_list): New function.
7971 (Symbol_table::for_all_symbols): New function.
7972 * target.h (Sized_target::got_entry_count): New function.
7973 (Sized_target::plt_entry_count): New function.
7974 (Sized_target::plt_entry_size): New function.
7975 * x86_64.cc (Target_x86_64::got_size): Add const.
7976 (Target_x86_64::got_entry_count): New function.
7977 (Target_x86_64::plt_entry_count): New function.
7978 (Target_x86_64::first_plt_entry_offset): New function.
7979 (Target_x86_64::plt_entry_size): New function.
7980 (Output_data_plt_x86_64::entry_count): New function.
7981 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7982 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7983
7984 2010-08-12 Cary Coutant <ccoutant@google.com>
7985
7986 * archive.cc: Include incremental.h.
7987 (Archive::Archive): Initialize incremental_info_.
7988 (Archive::include_member): Record archive members in incremental info.
7989 (Add_archive_symbols::run): Record begin and end of an archive in
7990 incremental info.
7991 (Lib_group::include_member): Record objects in incremental info.
7992 * archive.h (Incremental_archive_entry): Forward declaration.
7993 (Archive::set_incremental_info): New member function.
7994 (Archive::incremental_info): New member function.
7995 (Archive::Unused_symbol_iterator): New class.
7996 (Archive::unused_symbols_begin): New member function.
7997 (Archive::unused_symbols_end): New member function.
7998 (Archive::incremental_info_): New data member.
7999 * incremental-dump.cc (find_input_containing_global): New function.
8000 (dump_incremental_inputs): Dump new incremental info sections.
8001 * incremental.cc: Include symtab.h.
8002 (Output_section_incremental_inputs): New class.
8003 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8004 new incremental info sections.
8005 (Sized_incremental_binary::do_check_inputs): Likewise.
8006 (Incremental_inputs::report_archive): Remove.
8007 (Incremental_inputs::report_archive_begin): New function.
8008 (Incremental_inputs::report_archive_end): New function.
8009 (Incremental_inputs::report_object): New function.
8010 (Incremental_inputs::finalize_inputs): Remove.
8011 (Incremental_inputs::report_input_section): New function.
8012 (Incremental_inputs::report_script): Rewrite.
8013 (Incremental_inputs::finalize): Do nothing but finalize string table.
8014 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8015 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8016 (Incremental_inputs::create_data_sections): New function.
8017 (Incremental_inputs::relocs_entsize): New function.
8018 (Output_section_incremental_inputs::set_final_data_size): New function.
8019 (Output_section_incremental_inputs::do_write): New function.
8020 (Output_section_incremental_inputs::write_header): New function.
8021 (Output_section_incremental_inputs::write_input_files): New function.
8022 (Output_section_incremental_inputs::write_info_blocks): New function.
8023 (Output_section_incremental_inputs::write_symtab): New function.
8024 * incremental.h (Incremental_script_entry): Forward declaration.
8025 (Incremental_object_entry): Forward declaration.
8026 (Incremental_archive_entry): Forward declaration.
8027 (Incremental_inputs): Forward declaration.
8028 (Incremental_inputs_header_data): Remove.
8029 (Incremental_inputs_header): Remove.
8030 (Incremental_inputs_header_write): Remove.
8031 (Incremental_inputs_entry_data): Remove.
8032 (Incremental_inputs_entry): Remove.
8033 (Incremental_inputs_entry_write): Remove.
8034 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8035 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8036 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8037 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8038 Likewise.
8039 (Incremental_input_entry): New class.
8040 (Incremental_script_entry): New class.
8041 (Incremental_object_entry): New class.
8042 (Incremental_archive_entry): New class.
8043 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8044 (Incremental_inputs::report_inputs): Remove.
8045 (Incremental_inputs::report_archive): Remove.
8046 (Incremental_inputs::report_archive_begin): New function.
8047 (Incremental_inputs::report_archive_end): New function.
8048 (Incremental_inputs::report_object): Change prototype.
8049 (Incremental_inputs::report_input_section): New function.
8050 (Incremental_inputs::report_script): Change prototype.
8051 (Incremental_inputs::get_reloc_count): New function.
8052 (Incremental_inputs::set_reloc_count): New function.
8053 (Incremental_inputs::create_data_sections): New function.
8054 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8055 (Incremental_inputs::inputs_section): New function.
8056 (Incremental_inputs::symtab_section): New function.
8057 (Incremental_inputs::relocs_section): New function.
8058 (Incremental_inputs::get_stringpool): Add const.
8059 (Incremental_inputs::command_line): Add const.
8060 (Incremental_inputs::inputs): Remove.
8061 (Incremental_inputs::command_line_key): New function.
8062 (Incremental_inputs::input_file_count): New function.
8063 (Incremental_inputs::input_files): New function.
8064 (Incremental_inputs::relocs_entsize): New function.
8065 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8066 (Incremental_inputs::finalize_inputs): Remove.
8067 (Incremental_inputs::Input_info): Remove.
8068 (Incremental_inputs::lock_): Remove.
8069 (Incremental_inputs::inputs_): Change type.
8070 (Incremental_inputs::inputs_map_): Remove.
8071 (Incremental_inputs::current_object_entry_): New data member.
8072 (Incremental_inputs::inputs_section_): New data member.
8073 (Incremental_inputs::symtab_section_): New data member.
8074 (Incremental_inputs::relocs_section_): New data member.
8075 (Incremental_inputs::reloc_count_): New data member.
8076 (Incremental_inputs_reader): New class.
8077 (Incremental_symtab_reader): New class.
8078 (Incremental_relocs_reader): New class.
8079 * layout.cc (Layout::finalize): Move finalization of incremental info
8080 and creation of incremental info sections to follow finalization of
8081 symbol table. Set offsets for postprocessing sections.
8082 (Layout::create_incremental_info_sections): Call
8083 Incremental_inputs::create_data_sections. Add incremental symtab
8084 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8085 sections to layout after input sections.
8086 * layout.h (struct Timespec): Forward declaration.
8087 (Layout::incremental_inputs): Add const.
8088 (Layout::create_incremental_info_sections): Add parameter.
8089 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8090 * object.cc: Include incremental.h.
8091 (Relobj::finalize_incremental_relocs): New function.
8092 (Sized_relobj::do_layout): Record input sections in incremental info.
8093 * object.h (Object::output_section): New function.
8094 (Object::output_section_offset): Moved from Relobj.
8095 (Object::get_incremental_reloc_base): New function.
8096 (Object::get_incremental_reloc_count): New function.
8097 (Object::do_output_section): New function.
8098 (Object::do_output_section_offset): Moved from Relobj.
8099 (Object::do_get_incremental_reloc_base): New function.
8100 (Object::do_get_incremental_reloc_count): New function.
8101 (Object::Object): Initialize new data members.
8102 (Relobj::output_section): Renamed do_output_section and moved to
8103 protected.
8104 (Relobj::output_section_offset): Moved to Object.
8105 (Relobj::do_get_incremental_reloc_base): New function.
8106 (Relobj::do_get_incremental_reloc_count): New function.
8107 (Relobj::allocate_incremental_reloc_counts): New function.
8108 (Relobj::count_incremental_reloc): New function.
8109 (Relobj::finalize_incremental_relocs): New function.
8110 (Relobj::next_incremental_reloc_index): New function.
8111 (Relobj::reloc_counts_): New data member.
8112 (Relobj::reloc_bases_): New data member.
8113 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8114 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8115 (Sized_relobj::incremental_relocs_scan): New function.
8116 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8117 (Sized_relobj::incremental_relocs_write): New function.
8118 (Sized_relobj::incremental_relocs_write_reltype): New function.
8119 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8120 incremental link.
8121 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8122 archives and object files elsewhere.
8123 (Add_symbols::run): Report object files here.
8124 (Finish_group::run): Report end of archive at end of group.
8125 * reloc.cc: Include layout.h, incremental.h.
8126 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8127 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8128 (Sized_relobj::incremental_relocs_scan): New function.
8129 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8130 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8131 (Sized_relobj::incremental_relocs_write): New function.
8132 (Sized_relobj::incremental_relocs_write_reltype): New function.
8133 * script.cc (read_input_script): Rewrite test for incremental link.
8134 Change call to Incremental_inputs::report_script.
8135 * symtab.h (Symbol_table::first_global_index): New function.
8136 (Symbol_table::output_count): New function.
8137
8138 2010-08-12 Doug Kwan <dougkwan@google.com>
8139
8140 * arm.cc (Target_arm::merge_object_attributes): Check command line
8141 options --no-wchar-size-warning and --no-enum-size-warning.
8142 * options.h (General_options): Add ld-compatible options
8143 --no-enum-size-warning and --no-wchar-size-warning.
8144
8145 2010-08-04 Ian Lance Taylor <iant@google.com>
8146
8147 * x86_64.cc (Target_x86_64::Scan::local): Use
8148 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8149 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8150 (Target_x86_64::Scan::global): Likewise.
8151 (Target_x86_64::Relocate::relocate): Likewise.
8152 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8153 Likewise.
8154
8155 2010-08-03 Cary Coutant <ccoutant@google.com>
8156
8157 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8158 to reserve space in merged_strings vector. Keep total input size
8159 for stats.
8160 (Output_merge_string::do_print_merge_stats): Print total input size.
8161 * merge.h (Output_merge_string): Add input_size_ field.
8162 * stringpool.cc (Stringpool_template::string_length): Move
8163 implementations out of Stringpool_template class and place in
8164 stringpool.h.
8165 * stringpool.h (string_length): Move out of Stringpool_template.
8166
8167 2010-08-03 Ian Lance Taylor <iant@google.com>
8168
8169 PR 11712
8170 * layout.cc (relaxation_loop_body): If address of load segment is
8171 set, adjust address to include headers if possible.
8172
8173 2010-08-03 Ian Lance Taylor <iant@google.com>
8174
8175 * version.cc (version_string): Bump to 1.10.
8176
8177 2010-08-03 Ian Lance Taylor <iant@google.com>
8178
8179 PR 11805
8180 * layout.h (enum Output_section_order): Define.
8181 (class Layout): Update declarations.
8182 * layout.cc (Layout::get_output_section): Add order parameter.
8183 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8184 is_first_non_relro parameters. Change all callers.
8185 (Layout::choose_output_section): Likewise.
8186 (Layout::add_output_section_data): Likewise.
8187 (Layout::make_output_section): Likewise. Set order.
8188 (Layout::default_section_order): New function.
8189 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8190 * output.cc (Output_section::Output_section): Initialize order_.
8191 Don't initialize deleted fields.
8192 (Output_segment::Output_segment): Don't initialize deleted
8193 fields.
8194 (Output_segment::add_output_section_to_load): New function
8195 replacing add_output_section. Change all callers to call this or
8196 add_output_section_to_nonload.
8197 (Output_segment::add_output_section_to_nonload): New function.
8198 (Output_segment::remove_output_section): Rewrite.
8199 (Output_segment::add_initial_output_data): Likewise.
8200 (Output_segment::has_any_data_sections): Likewise.
8201 (Output_segment::is_first_section_relro): Likewise.
8202 (Output_segment::maximum_alignment): Likewise.
8203 (Output_segment::has_dynamic_reloc): New function replacing
8204 dynamic_reloc_count. Change all callers.
8205 (Output_segment::has_dynamic_reloc_list): New function replacing
8206 dynamic_reloc_count_list. Change all callers.
8207 (Output_segment::set_section_addresses): Rewrite.
8208 (Output_segment::set_offset): Rewrite.
8209 (Output_segment::find_first_and_last_list): Remove.
8210 (Output_segment::set_tls_offsets): Rewrite.
8211 (Output_segment::first_section_load_address): Likewise.
8212 (Output_segment::output_section_count): Likewise.
8213 (Output_segment::section_with_lowest_load_address): Likewise.
8214 (Output_segment::write_section_headers): Likewise.
8215 (Output_segment::print_sections_to_map): Likewise.
8216 * output.h (class Output_data): Remove dynamic_reloc_count_
8217 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8218 (Output_data::add_dynamic_reloc): Rewrite.
8219 (Output_data::has_dynamic_reloc): New function.
8220 (Output_data::dynamic_reloc_count): Remove.
8221 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8222 is_last_relro_, is_first_non_relro_, is_interp_,
8223 is_dynamic_linker_section_ fields. Add order and set_order
8224 functions. Remove is_relro_local, set_is_relro_local,
8225 is_last_relro, set_is_last_relro, is_first_non_relro,
8226 set_is_first_non_relro functions, is_interp, set_is_interp,
8227 is_dynamic_linker_section, and set_is_dynamic_linker_section
8228 functions.
8229 (class Output_segment): Change Output_data_list from std::list to
8230 std:;vector. Add output_lists_ field. Remove output_data_ and
8231 output_bss_ fields. Update declarations.
8232
8233 2010-08-02 Ian Lance Taylor <iant@google.com>
8234
8235 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8236 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8237 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8238
8239 2010-08-02 Ian Lance Taylor <iant@google.com>
8240
8241 PR 11855
8242 * script.cc (Script_options::Script_options): Initialize
8243 symbol_definitions_ and symbol_references_.
8244 (Script_options::add_symbol_assignment): Update
8245 symbol_definitions_ and symbol_references_.
8246 (Script_options::add_symbol_reference): New function.
8247 (script_symbol): New function.
8248 * script.h (class Script_options): Add symbol_definitions_ and
8249 symbol_references_ fields.
8250 (Script_options::referenced_const_iterator): New type.
8251 (Script_options::referenced_begin): New function.
8252 (Script_options::referenced_end): New function.
8253 (Script_options::is_referenced): New function.
8254 (Script_options::any_unreferenced): New function.
8255 * script-c.h (script_symbol): Declare.
8256 * yyscript.y (exp): Call script_symbol.
8257 * symtab.cc: Include "script.h".
8258 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8259 Change all callers. Check symbols referenced by scripts.
8260 (Symbol_table::add_undefined_symbols_from_command_line): Add
8261 layout parameter. Change all callers.
8262 (Symbol_table::do_add_undefined_symbols_from_command_line):
8263 Likewise. Break out loop body. Check symbols referenced by
8264 scripts.
8265 (Symbol_table::add_undefined_symbol_from_command_line): New
8266 function broken out of
8267 do_add_undefined_symbols_from_command_line.
8268 * symtab.h (class Symbol_table): Update declarations.
8269 * archive.cc: Include "layout.h".
8270 (Archive::should_include_member): Add layout parameter. Change
8271 all callers. Check for symbol mentioned in expression.
8272 * archive.h (class Archive): Update declaration.
8273 * object.cc (Sized_relobj::do_should_include_member): Add layout
8274 parameter.
8275 * object.h (Object::should_include_member): Add layout parameter.
8276 Change all callers.
8277 (Object::do_should_include_member): Add layout parameter.
8278 (class Sized_relobj): Update declaration.
8279 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8280 parameter.
8281 * dynobj.h (class Sized_dynobj): Update declaration.
8282 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8283 layout parameter.
8284 * plugin.h (class Sized_pluginobj): Update declaration.
8285
8286 2010-08-02 Ian Lance Taylor <iant@google.com>
8287
8288 PR 11866
8289 * output.cc (Output_segment::set_offset): Search for the first and
8290 last sections rather than assuming that the list is in order.
8291 (Output_segment::find_first_and_last_list): New function.
8292 * output.h (class Output_segment): Update declarations.
8293 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8294 (relro_strip_test_SOURCES): New variable.
8295 (relro_strip_test_DEPENDENCIES): New variable.
8296 (relro_strip_test_LDFLAGS): New variable.
8297 (relro_strip_test_LDADD): New variable.
8298 (relro_strip_test.so): New target.
8299
8300 2010-08-02 Ian Lance Taylor <iant@google.com>
8301
8302 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8303 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8304 (Target_i386::got_tlsdesc_section): New function.
8305 (Target_i386::got_section): Create space for GOT entries for
8306 TLSDESC relocations.
8307 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8308 R_386_TLS_GOTDESC.
8309 (Target_i386::Scan::global): Likewise.
8310 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8311 using TLSDESC GOT.
8312 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8313 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8314 (Target_x86_64::got_tlsdesc_section): New function.
8315 (Target_x86_64::got_section): Create space for GOT entries for
8316 TLSDESC relocations.
8317 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8318 R_386_TLS_GOTDESC.
8319 (Target_x86_64::Scan::global): Likewise.
8320 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8321 using TLSDESC GOT.
8322
8323 2010-08-02 Ian Lance Taylor <iant@google.com>
8324
8325 * testsuite/final_layout.sh: Use dc to convert from hex to
8326 decimal.
8327
8328 2010-07-29 Sriraman Tallam <tmsriram@google.com>
8329
8330 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8331 paramter to the call to gold::gc_process_relocs.
8332 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8333 paramter to the call to gold::gc_process_relocs.
8334 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8335 parameter to the call to gold::gc_process_relocs.
8336 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8337 template parameter to the call to gold::gc_process_relocs.
8338 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8339 paramter to the call to gold::gc_process_relocs.
8340 * gc.h (get_embedded_addend_size): New function.
8341 (gc_process_relocs): Save the size of the reloc for use by ICF.
8342 * icf.cc (get_section_contents): Get the addend from the text section
8343 for SHT_REL relocation sections.
8344 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8345 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8346 * int_encoding.h (read_from_pointer): New overloaded function.
8347 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8348 * testsuite/icf_sht_rel_addend_test.sh: New file.
8349 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8350 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8351
8352 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8353
8354 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8355 * Makefile.in: Regenerate.
8356 * testsuite/Makefile.in: Regenerate.
8357
8358 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8359
8360 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8361 * gold/testsuite/debug_msg.cc: Likewise.
8362 * gold/testsuite/odr_violation1.cc
8363 * gold/testsuite/odr_violation2.cc
8364
8365 2010-07-21 Cary Coutant <ccoutant@google.com>
8366
8367 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8368 string, and length fields.
8369 (Output_merge_string::Merged_strings_list): New type.
8370 (Output_merge_string::Merged_strings_lists): New typedef.
8371 (Output_merge_string): Replace merged_strings_ with
8372 merged_strings_lists_.
8373 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8374 Merged_strings_list per input object and section. Don't store pointer
8375 to the string. Don't store length with each merged string entry.
8376 (Output_merge_string::finalize_merged_data): Loop over list of merged
8377 strings lists. Recompute length of each merged string.
8378
8379 2010-07-15 Cary Coutant <ccoutant@google.com>
8380
8381 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8382 here.
8383
8384 2010-07-14 Ian Lance Taylor <iant@google.com>
8385
8386 * descriptors.cc (Descriptors::open): Report correct name in error
8387 message.
8388
8389 2010-07-13 Doug Kwan <dougkwan@google.com>
8390
8391 * arm.cc (Arm_input_section::Arm_input_section): For a
8392 SHT_ARM_EXIDX section, always keeps the input sections.
8393 (Arm_input_section::set_exidx_section_link): New method.
8394 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8395 has_errors_ to false.
8396 (Arm_exidx_input_section::has_errors,
8397 Arm_exidx_input_section::set_has_errors): New methods.
8398 (Arm_exidx_input_section::has_errors_): New data member.
8399 (Arm_relobj::get_exidx_shndx_list): New method.
8400 (Arm_output_section::append_text_sections_to_list): Do not skip
8401 section without SHF_EXECINSTR.
8402 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8403 errors.
8404 (Arm_relobj::make_exidx_input_section): Add new parameter for text
8405 section header. Make error messages more verbose. Check for
8406 a non-executable section linked to an EXIDX section.
8407 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8408 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8409 check that there is no deferred EXIDX section if we exit early.
8410 Instead of not making an EXIDX section in case of an error, make one
8411 and set the has_errors flag of it.
8412 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8413 in a relocatable link.
8414 (Target_arm::do_relax): Look for the EXIDX output section instead of
8415 assuming that it is called .ARM.exidx.
8416 (Target_arm::fix_exidx_coverage): Add a new parameter for input
8417 section list. Do not check for SHF_EXECINSTR section flags but
8418 skip any input section with errors.
8419 * output.cc (Output_section::Output_section): Initialize
8420 always_keeps_input_sections_ to false.
8421 (Output_section::add_input_section): Check for
8422 always_keeps_input_sections_.
8423 * output.h (Output_section::always_keeps_input_sections,
8424 Output_section::set_always_keeps_input_sections): New methods.
8425 (Output_section::always_keeps_input_sections): New data member.
8426
8427 2010-07-13 Rafael Espindola <espindola@google.com>
8428
8429 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8430 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8431
8432 2010-07-13 Philip Herron <herron.philip@googlemail.com>
8433 Ian Lance Taylor <iant@google.com>
8434
8435 * output.h (Output_section_lookup_maps::add_merge_section):
8436 Correct check of whether value was inserted.
8437 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8438 (Output_section_lookup_maps::add_relaxed_input_section):
8439 Likewise.
8440 * arm.cc (Target_arm::got_section): Remove used local os.
8441 * i386.cc (Target_i386::got_section): Likewise.
8442 * x86_64.cc (Target_x86_64::got_section): Likewise.
8443 * sparc.cc (Target_sparc::got_section): Likewise.
8444 (Target_sparc::relocate): Remove unused local have_got_offset.
8445 * powerpc.cc (Target_powerpc::relocate): Likewise.
8446
8447 2010-07-13 Ian Lance Taylor <iant@google.com>
8448
8449 * compressed_output.cc (zlib_decompress): Fix signature in
8450 !HAVE_ZLIB_H case.
8451
8452 * archive.cc (Archive::include_member): Unlock an external member
8453 of a thin archive. Don't bother to delete an object we know is
8454 NULL.
8455
8456 2010-07-12 Cary Coutant <ccoutant@google.com>
8457
8458 * compressed_output.cc (zlib_decompress): New function.
8459 (get_uncompressed_size): New function.
8460 (decompress_input_section): New function.
8461 * compressed_output.h (get_uncompressed_size): New function.
8462 (decompress_input_section): New function.
8463 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8464 Handle compressed debug sections.
8465 * layout.cc (is_compressed_debug_section): New function.
8466 (Layout::output_section_name): Map compressed section names to
8467 canonical names.
8468 * layout.h (is_compressed_debug_section): New function.
8469 (is_debug_info_section): Recognize compressed debug sections.
8470 * merge.cc: Include compressed_output.h.
8471 (Output_merge_data::do_add_input_section): Handle compressed
8472 debug sections.
8473 (Output_merge_string::do_add_input_section): Handle compressed
8474 debug sections.
8475 * object.cc: Include compressed_output.h.
8476 (Sized_relobj::Sized_relobj): Initialize new data members.
8477 (build_compressed_section_map): New function.
8478 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8479 * object.h (Object::section_is_compressed): New method.
8480 (Object::do_section_is_compressed): New method.
8481 (Sized_relobj::Compressed_section_map): New type.
8482 (Sized_relobj::do_section_is_compressed): New method.
8483 (Sized_relobj::compressed_sections_): New data member.
8484 * output.cc (Output_section::add_input_section): Handle compressed
8485 debug sections.
8486 * reloc.cc: Include compressed_output.h.
8487 (Sized_relobj::write_sections): Handle compressed debug sections.
8488
8489 2010-07-08 Cary Coutant <ccoutant@google.com>
8490
8491 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8492 weak when resolving to a dynamic def.
8493 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8494 for weak undef/dynamic def cases. Adjust callers.
8495 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8496 undef_binding_weak_.
8497 (Symbol_table::sized_write_globals): Adjust symbol binding.
8498 (Symbol_table::sized_write_symbol): Add binding parameter.
8499 * symtab.h (Symbol::set_undef_binding): New method.
8500 (Symbol::is_undef_binding_weak): New method.
8501 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8502 (Symbol_table::should_override): Add new parameter.
8503 (Symbol_table::sized_write_symbol): Add new parameter.
8504
8505 * testsuite/weak_undef_file1.cc: Add new test case.
8506 * testsuite/weak_undef_file2.cc: Fix header comment.
8507 * testsuite/weak_undef_test.cc: Add new test case.
8508
8509 2010-06-29 Doug Kwan <dougkwan@google.com>
8510
8511 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8512 Initialize USE_SYMBOL_.
8513 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8514 definition.
8515 (Arm_reloc_property::uses_symbol_): New data member declaration.
8516 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8517 uses symbol value and symbol is undefined but not weakly undefined.
8518
8519 2010-06-28 Rafael Espindola <espindola@google.com>
8520
8521 * plugin.cc (Plugin::load): Use dlerror.
8522
8523 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8524
8525 * symtab.cc (detect_odr_violations): When reporting an ODR
8526 violation, report an object where the symbol is defined.
8527
8528 2010-06-25 Doug Kwan <dougkwan@google.com>
8529
8530 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8531 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8532 definition.
8533 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8534 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8535 target hook to detect function points.
8536 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8537 * icf.h (Icf::check_section_for_function_pointers): Change type of
8538 parameter SECTION_NAME to const reference to std::string. Use
8539 target hook to determine if section may have unsafe pointers.
8540 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8541 method definition.
8542
8543 2010-06-21 Rafael Espindola <espindola@google.com>
8544
8545 * fileread.cc (Input_file::find_fie): New
8546 (Input_file::open): Use Input_file::find_fie.
8547 * fileread.h (Input_file::find_fie): New
8548 * plugin.cc (set_extra_library_path): New.
8549 (Plugin::load): Add set_extra_library_path to the transfer vector.
8550 (Plugin_manager::set_extra_library_path): New.
8551 (Plugin_manager::add_input_file): Use the extra search path if set.
8552 (set_extra_library_path(): New.
8553 * plugin.h (Plugin_manager): Add set_extra_library_path and
8554 extra_search_path_.
8555
8556 2010-06-19 Cary Coutant <ccoutant@google.com>
8557
8558 * layout.cc (gdb_sections): Add .debug_types.
8559 (lines_only_debug_sections): Likewise.
8560
8561 2010-06-18 Rafael Espindola <espindola@google.com>
8562
8563 * plugin.cc (add_input_file,add_input_library)
8564 (Plugin_manager::add_input_file): Make filename arguments const.
8565 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8566 const.
8567
8568 2010-06-16 Doug Kwan <dougkwan@google.com>
8569
8570 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8571 .ARM.attributes section if we have not merged any input
8572 attributes sections.
8573
8574 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8575
8576 * arm.cc: Allow combining objects with no EABI version
8577 information.
8578
8579 2010-06-15 Rafael Espindola <espindola@google.com>
8580
8581 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8582
8583 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8584
8585 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8586 (struct iovec): Correct !HAVE_READV definition.
8587
8588 2010-06-10 Cary Coutant <ccoutant@google.com>
8589
8590 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8591 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8592 reloc sections.
8593 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8594
8595 PR 11683
8596 * symtab.h (Symbol::is_placeholder): New member function.
8597 * target-reloc.h (relocate_section): Check for placeholder symbols.
8598
8599 * testsuite/Makefile.am (plugin_test_8): New test.
8600 (plugin_test_9): New test.
8601 * testsuite/Makefile.in: Regenerate.
8602
8603 2010-06-09 Nick Clifton <nickc@redhat.com>
8604
8605 * yyscript.y (input_list_element): Allow strings prefixed with
8606 the '-' character. Treat these as libraries.
8607 * script.cc (script_add_library): New function. Adds a library
8608 specified by "-l<name>" found in an input script.
8609 * script-c.h: Add prototype for script_add_library.
8610
8611 2010-06-07 Doug Kwan <dougkwan@google.com>
8612
8613 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8614 Restrict stub-group size to be within long conditional branch
8615 range when working around cortex-A8 erratum.
8616
8617 2010-06-07 Damien Diederen <dd@crosstwine.com>
8618
8619 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8620 #ifdef typo.
8621
8622 2010-06-03 Sriraman Tallam <tmsriram@google.com>
8623
8624 PR gold/11658
8625 * output.cc
8626 (Output_section::Input_section_sort_entry::compare_section_ordering):
8627 Change to return non-zero correctly.
8628 (Output_section::Input_section_sort_section_order_index_compare
8629 ::operator()): Change to fix ambiguity in comparisons.
8630
8631 2010-06-01 Sriraman Tallam <tmsriram@google.com>
8632
8633 * gold.h (is_wildcard_string): New function.
8634 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8635 (Layout::layout_eh_frame): Ditto.
8636 (Layout::find_section_order_index): New method.
8637 (Layout::read_layout_from_file): New method.
8638 * layout.h (Layout::find_section_order_index): New method.
8639 (Layout::read_layout_from_file): New method.
8640 (Layout::input_section_position_): New private member.
8641 (Layout::input_section_glob_): New private member.
8642 * main.cc (main): Call read_layout_from_file here.
8643 * options.h (--section-ordering-file): New option.
8644 * output.cc (Output_section::input_section_order_specified_): New
8645 member.
8646 (Output_section::Output_section): Initialize new member.
8647 (Output_section::add_input_section): Add new parameter.
8648 Keep input sections when --section-ordering-file is used.
8649 (Output_section::set_final_data_size): Sort input sections when
8650 section ordering file is specified.
8651 (Output_section::Input_section_sort_entry): Add new parameter.
8652 Check sorting type.
8653 (Output_section::Input_section_sort_entry::compare_section_ordering):
8654 New method.
8655 (Output_section::Input_section_sort_compare::operator()): Change to
8656 consider section_order_index.
8657 (Output_section::Input_section_sort_init_fini_compare::operator()):
8658 Change to consider section_order_index.
8659 (Output_section::Input_section_sort_section_order_index_compare
8660 ::operator()): New method.
8661 (Output_section::sort_attached_input_sections): Change to sort
8662 according to section order when specified.
8663 (Output_section::add_input_section<32, true>): Add new parameter.
8664 (Output_section::add_input_section<64, true>): Add new parameter.
8665 (Output_section::add_input_section<32, false>): Add new parameter.
8666 (Output_section::add_input_section<64, false>): Add new parameter.
8667 * output.h (Output_section::add_input_section): Add new parameter.
8668 (Output_section::input_section_order_specified): New
8669 method.
8670 (Output_section::set_input_section_order_specified): New method.
8671 (Input_section::Input_section): Initialize section_order_index_.
8672 (Input_section::section_order_index): New method.
8673 (Input_section::set_section_order_index): New method.
8674 (Input_section::section_order_index_): New member.
8675 (Input_section::Input_section_sort_section_order_index_compare): New
8676 struct.
8677 (Output_section::input_section_order_specified_): New member.
8678 * script-sections.cc (is_wildcard_string): Delete and move modified
8679 method to gold.h.
8680 (Output_section_element_input::Output_section_element_input): Modify
8681 call to is_wildcard_string.
8682 (Output_section_element_input::Input_section_pattern
8683 ::Input_section_pattern): Ditto.
8684 (Output_section_element_input::Output_section_element_input): Ditto.
8685 * testsuite/Makefile.am (final_layout): New test case.
8686 * testsuite/Makefile.in: Regenerate.
8687 * testsuite/final_layout.cc: New file.
8688 * testsuite/final_layout.sh: New file.
8689
8690 2010-06-01 Rafael Espindola <espindola@google.com>
8691
8692 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8693
8694 2010-06-01 Rafael Espindola <espindola@google.com>
8695
8696 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8697 visibility of symbols.
8698
8699 2010-05-27 Doug Kwan <dougkwan@google.com>
8700
8701 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8702 from start of output section instead of address for a local symbol
8703 in a merged or relaxed section when doing a relocatable link.
8704
8705 2010-05-26 Rafael Espindola <espindola@google.com>
8706
8707 PR 11604
8708 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8709 adding sections the garbage collector removed.
8710 * gold/testsuite/Makefile.am: Add test.
8711 * gold/testsuite/Makefile.in: Regenerate.
8712 * gold/testsuite/plugin_test_7.sh: New.
8713 * gold/testsuite/plugin_test_7_1.c: New.
8714 * gold/testsuite/plugin_test_7_2.c: New.
8715
8716 2010-05-26 Rafael Espindola <espindola@google.com>
8717
8718 * script-sections.cc (Output_section_definition::set_section_addresses):
8719 Check for --section-start.
8720
8721 2010-05-26 Doug Kwan <dougkwan@google.com>
8722
8723 * arm.cc (Arm_scan_relocatable_relocs): New class.
8724 (Target_arm::relocate_special_relocatable): New method.
8725 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8726 (Arm_relocate_functions::thumb_branch_common): Same.
8727 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8728 instead of Default_scan_relocatable_relocs.
8729 * target-reloc.h (relocate_for_relocatable): Let target handle
8730 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8731 * target.h (Sized_target::relocate_special_relocatable): New method.
8732
8733 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8734
8735 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8736
8737 2010-05-23 Doug Kwan <dougkwan@google.com>
8738
8739 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8740 instead of a cast.
8741 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8742 with a direct branch, not a conditional branch, to a stub.
8743 * merge.cc (Output_merge_base::record_input_section): New method
8744 defintion.
8745 (Output_merge_data::do_add_input_section): Record input section if
8746 keeps-input-sections flag is set.
8747 (Output_merge_string::do_add_input_section): Ditto.
8748 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8749 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8750 INPUT_SECTIONS_.
8751 (Output_merge_base::keeps_input_sections,
8752 Output_merge_base::set_keeps_input_sections,
8753 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8754 method definitions.
8755 (Output_merge_base::Input_sections): New type declaration.
8756 (Output_merge_base::input_sections_begin,
8757 Output_merge_base::input_sections_end,
8758 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8759 (Output_merge_base::bool keeps_input_sections_,
8760 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8761 Output_merge_base::input_sections_): New data members.
8762 (Output_merge_data::do_set_keeps_input_sections): New method
8763 defintion.
8764 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8765 * output.cc (Output_section::Input_section::relobj): Move method
8766 defintion from class declaration to here and handle merge sections.
8767 (Output_section::Input_section::shndx): Ditto.
8768 (Output_section::Output_section): Remove initializations of removed
8769 data members and initialize new data member LOOKUP_MAPS_.
8770 (Output_section::add_input_section): Set keeps-input-sections flag
8771 for a newly created merge output section as appropriate. Adjust code
8772 to use Output_section_lookup_maps class.
8773 (Output_section::add_relaxed_input_section): Adjst code for lookup
8774 maps code refactoring.
8775 (Output_section::add_merge_input_section): Add a new parameter
8776 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8777 class. If adding input section to a newly created merge output
8778 section fails, remove the new merge section.
8779 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
8780 Adjust code for use of the Output_section_lookup_maps class.
8781 (Output_section::find_merge_section): Ditto.
8782 (Output_section::build_lookup_maps): New method defintion.
8783 (Output_section::find_relaxed_input_section): Adjust code to use
8784 Output_section_lookup_maps class.
8785 (Output_section::get_input_sections): Export merge sections. Adjust
8786 code to use Output_section_lookup_maps class.
8787 (Output_section:::add_script_input_section): Adjust code to use
8788 Output_section_lookup_maps class. Update lookup maps for merge
8789 sections also.
8790 (Output_section::discard_states): Use Output_section_lookup_maps.
8791 (Output_section::restore_states): Same.
8792 * output.h (Merge_section_properties): Move class defintion out of
8793 Output_section.
8794 (Output_section_lookup_maps): New class.
8795 (Output_section::Input_section::is_merge_section): New method
8796 defintion.
8797 (Output_section::Input_section::relobj): Move defintion out of class
8798 defintion. Declare method only.
8799 (Output_section::Input_section::shndx): Ditto.
8800 (Output_section::Input_section::output_merge_base): New method defintion.
8801 (Output_section::Input_section::u2_.pomb): New union field.
8802 (Output_section::Merge_section_by_properties_map,
8803 Output_section::Output_section_data_by_input_section_map,
8804 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8805 Remove types.
8806 (Output_section::add_merge_input_section): Add new parameter
8807 KEEPS_INPUT_SECTIONS.
8808 (Output_section::build_lookup_maps): New method declaration.
8809 (Output_section::merge_section_map_,
8810 Output_section::merge_section_by_properties_map_,
8811 Output_section::relaxed_input_section_map_,
8812 Output_section::is_relaxed_input_section_map_valid_): Remove data
8813 members.
8814 (Output_section::lookup_maps_): New data member.
8815
8816 2010-05-21 Doug Kwan <dougkwan@google.com>
8817
8818 PR gold/11619
8819 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8820 avoid a compilation error.
8821
8822 2010-05-19 Rafael Espindola <espindola@google.com>
8823
8824 * script-sections.cc (Output_section_definition::allocate_to_segment):
8825 Update the phdrs_list even when the output section is NULL.
8826 * testsuite/Makefile.am: Add test.
8827 * testsuite/Makefile.in: Regenerate.
8828 * testsuite/script_test_9.cc: New.
8829 * testsuite/script_test_9.sh: New.
8830 * testsuite/script_test_9.t: New.
8831
8832 2010-05-19 Doug Kwan <dougkwan@google.com>
8833
8834 * arm.cc (Arm_input_section::original_size): New method.
8835 (Arm_input_section::do_addralign): Add a cast.
8836 (Arm_input_section::do_output_offset): Remove static cast.
8837 (Arm_input_section::original_addralign,
8838 Arm_input_section::original_size_): Change type to uint32_t.
8839 (Arm_input_section::init): Add safe casts for section alignment
8840 and size.
8841 (Arm_input_section::set_final_data_size): Do not set address and
8842 offset of stub table.
8843 (Arm_output_section::fix_exidx_coverage): Change use of of
8844 Output_section::Simple_input_section to that of
8845 Output_section::Input_section.
8846 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8847 except for the first pass.
8848 * output.cc (Output_section::get_input_sections): Change type of
8849 input_sections to std::list<Input_section>.
8850 (Output_section::add_script_input_section): Rename from
8851 Output_section::add_simple_input_section. Change type of SIS
8852 parameter from Simple_input_section to Input_section.
8853 * output.h (Output_section::Simple_input_section): Remove class.
8854 (Output_section::Input_section): Change class visibility to public.
8855 (Output_section::Input_section::addralign): Use stored alignments
8856 for special input sections if set.
8857 (Output_section::Input_section::set_addralign): New method.
8858 (Output_section::get_input_sections): Change parameter type from
8859 list of Simple_input_section to list of Input_section.
8860 (Output_section::add_script_input_section): Rename from
8861 Output_section::add_simple_input_section. Change first parameter's
8862 type from Simple_input_section to Input_section and remove the
8863 second and third parameters.
8864 * script-sections.cc (Input_section::Input_section_list): Change
8865 type to list of Output_section::Input_section/
8866 (Input_section_info::Input_section_info): Change parameter type of
8867 INPUT_SECTION to Output_section::Input_section.
8868 (Input_section_info::input_section): Change return type.
8869 (Input_section_info::input_section_): Change type to
8870 Output_section::Input_section.
8871 (Output_section_element_input::set_section_addresses): Adjust code
8872 to use Output_section::Input_section instead of
8873 Output_section::Simple_input_section. Adjust code for renaming
8874 of Output_section::add_simple_input_section.
8875 (Orphan_output_section::set_section_addresses): Ditto.
8876
8877 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8878
8879 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8880 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8881
8882 2010-05-18 Rafael Espindola <espindola@google.com>
8883
8884 * options.cc (General_options::finalize): Handle -nostdlib.
8885 * options.h (nostdlib): New option.
8886 * script.cc (script_add_search_dir): Handle -nostdlib.
8887
8888 2010-05-12 Doug Kwan <dougkwan@google.com>
8889
8890 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8891 attributes section only if there no attributes section after merging.
8892 (Target_arm::merge_object_attributes): Move value of
8893 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
8894 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8895 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8896 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8897 and arm_attr_merge_7.stdout.
8898 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8899 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8900 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8901 arm_attr_merge_7b.o): New rules.
8902 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8903 arm_attr_merge_7
8904 * testsuite/Makefile.in: Regenerate.
8905 * testsuite/arm_attr_merge.sh: New file.
8906 * testsuite/arm_attr_merge_[67][ab].s: Same.
8907
8908 2010-05-05 Nick Clifton <nickc@redhat.com>
8909
8910 * po/es.po: Updated Spanish translation.
8911
8912 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8913
8914 * Makefile.am (install-exec-local): Properly install gold as
8915 default cross linker.
8916 * Makefile.in: Regenerated.
8917
8918 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8919 Nick Clifton <nickc@redhat.com>
8920
8921 * configure.ac (install_as_default): Define and set to false
8922 unless --enable-gold or --enable-gold=both/gold has been
8923 specified.
8924 * configure: Regenerate.
8925
8926 * Makefile.am (install-exec-local): Install the executable as
8927 'ld.gold'. If install_as_default is true then also install it as
8928 'ld'.
8929 * Makefile.in: Regenerated.
8930
8931 2010-04-24 Ian Lance Taylor <iant@google.com>
8932
8933 * layout.cc (Layout::layout_reloc): In relocatable link don't
8934 combine reloc sections for grouped sections.
8935
8936 2010-04-23 Sriraman Tallam <tmsriram@google.com>
8937
8938 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8939 sections that are not ordinary to icf.
8940 * icf.cc (get_section_contents): Handle relocation pointing to section
8941 with no object or shndx information.
8942 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8943 * testsuite/Makefile.in: Regenerate.
8944 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8945 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8946
8947 2010-04-22 Ian Lance Taylor <iant@google.com>
8948
8949 * expression.cc (Expression::Expression_eval_info): Add
8950 result_alignment_pointer field.
8951 (Expression::eval_with_dot): Add result_alignment_pointer
8952 parameter. Change all callers.
8953 (Expression::eval_maybe_dot): Likewise.
8954 (class Binary_expression): Add alignment_pointer parameter to
8955 left_value and right_value. Change all callers.
8956 (BINARY_EXPRESSION): Set result alignment.
8957 (class Trinary_expression): Add alignment_pointer parameter to
8958 arg2_value and arg3_value. Change all callers.
8959 (Trinary_cond::value): Set result alignment.
8960 (Max_expression::value, Min_expression::value): Likewise.
8961 (Align_expression::value): Likewise.
8962 * script-sections.cc (class Sections_element): Add dot_alignment
8963 parameter to set_section_addresses virtual function. Update
8964 instantiations.
8965 (class Output_section_element): Likewise.
8966 (Script_sections::create_segments): Add dot_alignment parameter.
8967 Change all callers.
8968 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8969 (Script_sections::set_phdrs_clause_addresses): Likewise.
8970 * script-sections.h: Update declarations.
8971 * script.h: Update declarations.
8972 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8973 min_p_align.
8974 * testsuite/script_test_3.t: Set large alignment.
8975 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8976 segment has expected alignment.
8977
8978 2010-04-22 Nick Clifton <nickc@redhat.com>
8979
8980 * po/gold.pot: Updated by the Translation project.
8981 * po/vi.po: Updated Vietnamese translation.
8982
8983 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8984
8985 * testsuite/Makefile.am (check_PROGRAMS): Add
8986 icf_virtual_function_folding_test.
8987 * testsuite/Makefile.in: Regenerated.
8988
8989 2010-04-15 Andrew Haley <aph@redhat.com>
8990
8991 * options.h (merge_exidx_entries): New option.
8992 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8993 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8994 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8995 (Target_arm::merge_exidx_entries): New function.
8996 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8997 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8998 to Arm_exidx_fixup constructor.
8999 Add new arg, merge_exidx_entries.
9000 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9001 Arm_output_section::fix_exidx_coverage.
9002
9003 2010-04-18 Sriraman Tallam <tmsriram@google.com>
9004
9005 * icf.cc (get_section_contents): Check for preemptible functions.
9006 Ignore addend when appropriate.
9007 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9008 section folded.
9009 (add_from_relobj): Check for section folded.
9010 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9011 * symtab.h (should_add_dynsym_entry): Add new parameter.
9012 * target-reloc.h (scan_relocs): Check for section folded.
9013 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9014 Check reloc types for function pointers in shared objects.
9015 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9016 case.
9017 (icf_preemptible_functions_test): New test case.
9018 (icf_string_merge_test): New test case.
9019 * testsuite.Makefile.in: Regenerate.
9020 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9021 bar_glob. Refactor code.
9022 * testsuite/icf_preemptible_functions_test.cc: New file.
9023 * testsuite/icf_preemptible_functions_test.sh: New file.
9024 * testsuite/icf_string_merge_test.cc: New file.
9025 * testsuite/icf_string_merge_test.sh: New file.
9026 * testsuite/icf_virtual_function_folding_test.cc: New file.
9027 * testsuite/icf_virtual_function_folding_test.sh: New file.
9028
9029 2010-04-14 Doug Kwan <dougkwan@google.com>
9030
9031 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9032 for local symbol recounting if we remove a section due to ICF.
9033 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9034 there are no regular objects in input.
9035
9036 2010-04-13 Doug Kwan <dougkwan@google.com>
9037
9038 * arm.cc (Arm_input_section::set_final_data_size): Compute
9039 accurate final data size instead of using current data size.
9040
9041 2010-04-09 Doug Kwan <dougkwan@google.com>
9042
9043 * layout.cc (Layout::choose_output_section): Handle script section
9044 types.
9045 (Layout::make_output_section_for_script): Add section type parameter.
9046 Handle script section types.
9047 * layout.h (Layout::make_output_section_for_script): Add section
9048 type parameter.
9049 * output.cc (Output_section::Output_section): Initialize data member
9050 is_noload_.
9051 (Output_section::do_reset_address_and_file_offset): Do not set address
9052 to 0 if section is a NOLOAD section.
9053 * output.h (Output_section::is_noload): New method.
9054 (Output_section::set_is_noload): Ditto.
9055 (Output_section::is_noload_): New data member.
9056 * script-c.h (Script_section_type): New enum type.
9057 (struct Parser_output_section_header): Add new file section_type.
9058 * script-sections.cc (Sections_element::output_section_name): Add
9059 parameter for returning script section type.
9060 (Output_section_definition::output_section_name): Ditto.
9061 (Output_section_definition::section_type)P; New method.
9062 (Output_section_definiton::script_section_type_name): Ditto.
9063 (Output_section_definition::script_section_type_): New data member.
9064 (Output_section_definition::Output_section_definition): Initialize
9065 data member Output_section_definition::script_section_type_.
9066 (Output_section_definition::create_sections): Pass script section type
9067 to Layout::make_output_section_for_script.
9068 (Output_section_definition::output_section_name): Return script
9069 section type to caller.
9070 (Output_section_definition::set_section_address): Do not advance
9071 dot value and load address if section type is NOLOAD. Set address
9072 of NOLOAD sections regardless of section flags.
9073 (Output_section_definition::print): Print section type if it is
9074 not SCRIPT_SECTION_TYPE_NONE.
9075 (Output_section_definition::section_type): New method.
9076 (Output_section_definition::script_section_type_name): Ditto.
9077 (Script_sections::output_section_name): Add new parameter
9078 PSECTION_TYPE for returning script section type. Pass it to
9079 section elements. Handle discard sections.
9080 (Sort_output_sections::operator()): Handle NOLOAD sections.
9081 * script-sections.h (Script_sections::Section_type): New enum type.
9082 (Script_sections::output_section_name): Add a new parameter for
9083 returning script section type.
9084 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9085 INFO and NOLOAD.
9086 * yyscript.y (union): Add new field SECTION_TYPE.
9087 (COPY, DSECT, INFO, NOLOAD): New tokens.
9088 (opt_address_and_section_type): Change type to output_section_header.
9089 (section_type): New non-terminal
9090 (section_header): Handle section type.
9091 (opt_address_and_section_type): Return section type value.
9092
9093 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9094
9095 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9096 * testsuite/plugin_common_test_2.c (foo): Likewise.
9097
9098 2010-04-08 Doug Kwan <dougkwan@google.com>
9099
9100 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9101 Output_merge_data.
9102 * output.cc (Output_section::add_merge_input_section): Simplify
9103 code and return status of Output_merge_base::add_input_section.
9104 Update merge section map only if Output_merge_base::add_input_section
9105 returns true.
9106
9107 2010-04-07 Doug Kwan <dougkwan@google.com>
9108
9109 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9110 if section is marked as containing instructions but has no mapping
9111 symbols.
9112 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9113 correct section index.
9114 (Arm_relobj::find_linked_text_section): Ditto.
9115
9116 2010-04-07 Cary Coutant <ccoutant@google.com>
9117
9118 * archive.cc (include_member): Destroy Read_symbols_data object before
9119 releasing file.
9120 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9121 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9122 (Read_symbols_data::~Read_symbols_data) New destructor.
9123 (Section_relocs::Section_relocs) New constructor.
9124 (Section_relocs::~Section_relocs) New destructor.
9125 (Read_relocs_data::Read_relocs_data) New constructor.
9126 (Read_relocs_data::~Read_relocs_data) New destructor.
9127 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9128 pointers to NULL after deleting.
9129
9130 2010-04-07 Doug Kwan <dougkwan@google.com>
9131
9132 * arm.cc: Replace "endianity" with "endianness" in comments.
9133 (Arm_exidx_cantunwind): Ditto.
9134 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9135 (Arm_relobj::merge_flags_and_attributes): New method.
9136 (Arm_relobj::merge_flags_and_attributes_): New data member.
9137 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9138 (Arm_relobj::scan_sections_for_stubs): Ditto.
9139 (Arm_relobj::do_read_symbols): Check to see if we really want to
9140 merge processor-specific flags and attributes. Exit early if
9141 an object is empty except for section names and the undefined symbol.
9142 (Target_arm::do_finalize_sections): Move check for ELF format to
9143 Arm_relobj::do_read_symbols. Merge processor specific flags and
9144 attributes from a regular object only when we have determined that
9145 it is aapropriate. Do not create an .ARM.attributes section in
9146 output if there is no regular input object.
9147 (Target_arm::merge_processor_specific_flags): Check
9148 --warn-mismatch before printing any error.
9149 (Target_arm::merge_object_attributes): Ditto.
9150 * gold.cc (queue_middle_tasks): Handle the case in which there is
9151 no regular object in input.
9152 * options.cc (General_options::parse_EB): New method.
9153 (General_options::parse_EL): Same.
9154 (General_options::General_options): Initialize endianness_.
9155 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9156 New options.
9157 (General_options::Endianness): New enum.
9158 (General_options::endianness): New method.
9159 (General_options::endianness_): New data member.
9160 * parameters.cc (Parameters::set_options): Check target endianness.
9161 (Parameters::set_target_once): Ditto.
9162 (Parameters::check_target_endianness): New method.
9163 (parameters_force_valid_target): If either -EL or -EB is specified,
9164 use it to define endianness of default target.
9165 * parameters.h (Parameters::check_target_endianness): New method
9166 declaration.
9167 * target.h (class Target): Change "endianity" to "endianness"
9168 in comments.
9169
9170 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9171
9172 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9173 * configure: Regenerate.
9174 * Makefile.in: Regenerate.
9175 * testsuite/Makefile.in: Regenerate.
9176
9177 2010-04-06 Cary Coutant <ccoutant@google.com>
9178
9179 gcc PR lto/42757
9180 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9181 prevailing definitions of common symbols.
9182 * testsuite/plugin_test_6.sh: New test case.
9183 * testsuite/plugin_common_test_1.c: New test case.
9184 * testsuite/plugin_common_test_2.c: New test case.
9185 * testsuite/Makefile.am (plugin_test_6): New test case.
9186 * testsuite/Makefile.in: Regenerate.
9187
9188 2010-04-06 Nick Clifton <nickc@redhat.com>
9189
9190 * po/vi.po: New Vietnamese translation.
9191
9192 2010-03-30 Doug Kwan <dougkwan@google.com>
9193
9194 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9195
9196 2010-03-25 Doug Kwan <dougkwan@google.com>
9197
9198 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9199 to avoid a conversion warning on a 32-bit host.
9200
9201 2010-03-24 Ian Lance Taylor <iant@google.com>
9202
9203 * testsuite/script_test_3.t: Add a TLS segment.
9204 * testsuite/Makefile.am (check_PROGRAMS): Add
9205 tls_phdrs_script_test.
9206 (tls_phdrs_script_test_SOURCES): Define.
9207 (tls_phdrs_script_test_DEPENDENCIES): Define.
9208 (tls_phdrs_script_test_LDFLAGS): Define.
9209 (tls_phdrs_script_test_LDADD): Define.
9210 * testsuite/Makefile.in: Rebuild.
9211
9212 2010-03-23 Cary Coutant <ccoutant@google.com>
9213
9214 * fileread.cc (find_or_make_view): Fix comment.
9215
9216 2010-03-23 Ian Lance Taylor <iant@google.com>
9217
9218 * script-sections.cc (class Orphan_section_placement): Define
9219 PLACE_TLS and PLACE_TLS_BSS.
9220 (Orphan_section_placement::Orphan_section_placement): Initialize
9221 new places.
9222 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9223 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9224 (tls_script_test_SOURCES): Define.
9225 (tls_script_test_DEPENDENCIES): Define.
9226 (tls_script_test_LDFLAGS): Define.
9227 (tls_script_test_LDADD): Define.
9228 * testsuite/Makefile.in: Rebuild.
9229
9230 2010-03-22 Doug Kwan <dougkwan@google.com>
9231
9232 * arm.cc (Arm_relocate_functions::abs8,
9233 Arm_relocate_functions::abs16): Use correct check for overflow
9234 specified in the ARM ELF specs.
9235 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9236 target of a BLX instruction specially.
9237 (Reloc_stub::stub_type_for_reloc): Ditto.
9238 (Relocate::relocate): Use symbolic names instead of numeric relocation
9239 codes to report error.
9240 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9241 workaround.
9242 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9243 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9244 thumb2_blx_out_of_range.stdout
9245 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9246 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9247 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9248 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9249 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9250 thumb2_blx_in_range, thumb2_blx_in_range.o,
9251 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9252 thumb2_blx_out_of_range.o): New rules.
9253 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
9254 thumb2_blx_in_range and thumb2_blx_out_of_range.
9255 * testsuite/Makefile.in: Regenerate.
9256 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9257 * testsuite/thumb_blx_in_range.s: New file.
9258 * testsuite/thumb_blx_out_of_range.s: New file.
9259
9260 2010-03-22 Rafael Espindola <espindola@google.com>
9261
9262 * archive.cc (Should_include): Move to archive.h.
9263 (should_include_member): Make it a member of Archive.
9264 (Lib_group): New.
9265 (Add_lib_group_symbols): New.
9266 * archive.h: Include options.h.
9267 (Archive_member): Moved from Archive.
9268 (Should_include): Moved from archive.cc.
9269 (Lib_group): New.
9270 (Add_lib_group_symbols): New.
9271 * dynobj.cc (do_should_include_member): New.
9272 * dynobj.h (do_should_include_member): New.
9273 * gold.cc (queue_initial_tasks): Update call to queue.
9274 * main.cc (main): Print lib group stats.
9275 * object.cc (do_should_include_member): New.
9276 * object.h: Include archive.h.
9277 (Object::should_include_member): New.
9278 (Object::do_should_include_member): New.
9279 (Sized_relobj::do_should_include_member): New.
9280 * options.cc (General_options::parse_start_lib): New.
9281 (General_options::parse_end_lib): New.
9282 (Input_arguments::add_file): Handle lib groups.
9283 (Input_arguments::start_group): Check we are not in a lib.
9284 (Input_arguments::start_lib): New.
9285 (Input_arguments::end_lib): New.
9286 * options.h (General_options): Add start_lib and end_lib.
9287 (Input_argument::lib_): New.
9288 (Input_argument::lib): New.
9289 (Input_argument::is_lib): New.
9290 (Input_file_lib): New.
9291 (Input_arguments::in_lib_): New.
9292 (Input_arguments::in_lib): New.
9293 (Input_arguments::start_lib): New.
9294 (Input_arguments::end_lib_): New.
9295 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9296 in unused members as preempted.
9297 (Sized_pluginobj::do_should_include_member): New.
9298 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9299 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9300 return the blocker.
9301 (Read_symbols::do_whole_lib_group): New.
9302 (Read_symbols::do_lib_group): New.
9303 (Read_symbols::do_read_symbols): Handle lib groups.
9304 (Read_symbols::get_name): Handle lib groups.
9305 * readsyms.h (Read_symbols): Add an archive member pointer.
9306 (Read_symbols::do_whole_lib_group): New.
9307 (Read_symbols::do_lib_group): New.
9308 (Read_symbols::member_): New.
9309 * script.cc (read_input_script): Update call to queue_soon.
9310
9311 2010-03-19 Doug Kwan <dougkwan@google.com>
9312
9313 * arm.cc (Stub_table::Stub_table): Initialize new data members
9314 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9315 (Stub_table::add_reloc_stub): Assign stub offset and update
9316 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9317 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9318 New data members.
9319 (Stub_table::update_data_size_and_addralign): Use
9320 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9321 instead of going over all reloc stubs.
9322 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
9323 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9324 Stringpool_template::offset_ to size of Stringpool_char.
9325 (Stringpool_template::new_key_offset): Remove code to initialize
9326 Stringpool_template::offset_.
9327 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9328 Stringpool_template::offset_ to zero.
9329
9330 2010-03-15 Doug Kwan <dougkwan@google.com>
9331
9332 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9333 offset_.
9334 (Stringpool_template::new_key_offset): New method.
9335 (Stringpool_template::add_string): Assign offsets when adding new
9336 strings.
9337 (Stringpool_template::set_string_offsets): Do not set string offsets
9338 when not optimizing.
9339 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9340 member size_.
9341 (Chunked_vector::clear): Clear size_.
9342 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9343 (Chunked_vector::size): Return size_.
9344 (Chunked_vector::push_back): Use size_ to find insert position.
9345 (Chunked_vector::size_): New data member.
9346 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9347 (Stringpool_template::new_key_offset): New method declaration.
9348 (Stringpool_template::offset_): New data member.
9349
9350 2010-03-15 Rafael Espindola <espindola@google.com>
9351
9352 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9353 Add_symbols' constructor.
9354 * readsyms.h (Add_symbols): Remove the input_group member.
9355
9356 2010-03-10 Ian Lance Taylor <iant@google.com>
9357
9358 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9359 target to ask whether a reference to a symbol requires a stack
9360 split.
9361 * target.h (Target::is_call_to_non_split): New function.
9362 (Target::do_is_call_to_non_split): Declare virtual function.
9363 * target.cc: Include "symtab.h".
9364 (Target::do_is_call_to_non_split): New function.
9365 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9366
9367 2010-03-10 Cary Coutant <ccoutant@google.com>
9368
9369 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9370 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9371 (File_read::open[2]): Add whole_file_view_ to list of views.
9372 (File_read::make_view): Remove test of whole_file_view_.
9373 (File_read::find_or_make_view): Create whole_file_view_ if
9374 necessary.
9375 (File_read::clear_views): Replace bool parameter with enum;
9376 adjust all callers. Don't delete views with permanent data;
9377 do delete cached views and views from archives if
9378 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9379 if clearing the corresponding view.
9380 * fileread.h (File_read::Clear_views_mode): New enum.
9381 (File_read::View::is_permanent_view): New method.
9382 (File_read::clear_views): Replace bool parameter
9383 with enum; adjust all callers.
9384 * options.h (General_options): Change keep_files_mapped option;
9385 add map_whole_files.
9386 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9387 releasing the file.
9388 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9389 the file.
9390
9391 2010-03-10 David S. Miller <davem@davemloft.net>
9392
9393 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9394
9395 2010-03-09 Sriraman Tallam <tmsriram@google.com>
9396
9397 * icf.cc (get_section_contents): Add '@' marker after processing the
9398 merge reloc.
9399
9400 2010-03-08 Doug Kwan <dougkwan@google.com>
9401
9402 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9403 due to a conversion warning.
9404 (Arm_relobj::update_output_local_symbol_count): Check for local
9405 symbol with unset output index.
9406
9407 2010-03-05 Ian Lance Taylor <iant@google.com>
9408
9409 * options.h (class General_options): Add --spare-dynamic-tags.
9410 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9411 --spare-dynamic-tags.
9412
9413 2010-03-05 Ian Lance Taylor <iant@google.com>
9414
9415 * incremental.cc: Include "libiberty.h".
9416
9417 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9418
9419 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9420 function, is_info_ member.
9421 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9422 (Versions::Versions): Update caller.
9423 (Versions::define_base_version): Likewise.
9424 (Versions::add_def): Likewise.
9425
9426 2010-03-03 Sriraman Tallam <tmsriram@google.com>
9427
9428 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9429 (Scan::possible_function_pointer_reloc): New function.
9430 (Scan::local_reloc_may_be_function_pointer): Change to call
9431 possible_function_pointer_reloc.
9432 (Scan::global_reloc_may_be_function_pointer): Ditto.
9433 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9434 relocations in ".data.rel.ro._ZTV" section.
9435 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9436 * testsuite/icf_safe_so_test.cc: Ditto.
9437 * testsuite/icf_safe_test.cc: Ditto.
9438 * testsuite/icf_safe_test.sh: Ditto.
9439
9440 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9441 Ian Lance Taylor <iant@google.com>
9442
9443 * target-reloc.h (relocate_section): Check the symbol table index
9444 for -1U before setting the local symbol index.
9445 (scan_relocatable_relocs): If copying the relocation, record that
9446 the local symbol is required.
9447 * object.h (Symbol_value::is_output_symtab_index_set): New
9448 function.
9449 (Symbol_value::may_be_discarded_from_output_symtab): New
9450 function.
9451 (Symbol_value::has_output_symtab_entry): New function.
9452 (Symbol_value::needs_output_symtab_entry): Remove.
9453 (Symbol_value::output_symtab_index): Make sure the symbol index is
9454 set.
9455 (Symbol_value::set_output_symtab_index): Make sure the symbol
9456 index is not set. Make sure the new index is valid.
9457 (Symbol_value::set_must_have_output_symtab_entry): New function.
9458 (Symbol_value::has_output_dynsym_entry): New function.
9459 (Symbol_value::set_output_dynsym_index): Make sure the new index
9460 is valid.
9461 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9462 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9463 local symbol if permitted.
9464 (Sized_relobj::do_finalize_local_symbols): Call
9465 is_output_symtab_index_set rather than needs_output_symtab_entry.
9466 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9467 rather than needs_output_symtab_entry. Call
9468 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9469 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9470 is_output_symtab_index_set rather than needs_output_symtab_entry.
9471 * testsuite/discard_locals_relocatable_test.c: New file.
9472 * testsuite/discard_locals_test.sh: Test -r.
9473 * testsuite/Makefile.am (check_DATA): Add
9474 discard_locals_relocatable_test1.syms,
9475 discard_local_relocatable_test2.syms.
9476 (MOSTLYCLEANFILES): Likewise. Also add
9477 discard_locals_relocatable_test1.lout and
9478 discard_locals_relocatable_test2.out.
9479 (discard_locals_relocatable_test1.syms): New target.
9480 (discard_locals_relocatable_test.o): New target.
9481 (discard_locals_relocatable_test1.out): New target.
9482 (discard_locals_relocatable_test2.syms): New target.
9483 (discard_locals_relocatable_test2.out): New target.
9484 (various): Add missing ../ld-new dependencies.
9485 * testsuite/Makefile.in: Rebuild.
9486
9487 2010-03-03 Nick Clifton <nickc@redhat.com>
9488
9489 * po/fi.po: New Finnish translation.
9490
9491 2010-03-01 Doug Kwan <dougkwan@google.com>
9492
9493 * layout.cc (Layout::Layout): Force section types of .init_array*,
9494 .preinit_array* and .fini_array* sections.
9495 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9496 Fix check of return value of std::string::find.().
9497 (Output_section::Input_section_sort_compare::operator()): Remove
9498 comment about .init_array.
9499 (Output_section::Input_section_sort_init_fini_compare::operator()):
9500 New method.
9501 (Output_section::sort_attached_input_sections): Handle .init_array
9502 and .fini_array specially.
9503 * output.h (Output_section::Inut_section_sort_compare): Update
9504 comment.
9505 (Output_section::Input_section_sort_init_fini_compare): New struct.
9506
9507 2010-02-26 Doug Kwan <dougkwan@google.com>
9508
9509 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9510 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9511 * testsuite/debug_msg.sh: Avoid matching source line number for
9512 use of global variable undef_int.
9513
9514 2010-02-26 Doug Kwan <dougkwan@google.com>
9515
9516 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9517 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9518 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9519 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9520 * options.cc (General_options::General_options): Initialize member
9521 fix_v4bx_.
9522 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9523 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9524 and rm_no_fix_v4bx.stdout
9525 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9526 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9527 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9528 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9529 and arm_no_fix_v4bx.
9530 * Makefile.in: Regenerate.
9531 * testsuite/arm_fix_v4bx.s: New file.
9532 * testsuite/arm_fix_v4bx.sh: Ditto.
9533
9534 2010-02-24 Doug Kwan <dougkwan@google.com>
9535
9536 * arm.cc (Target_arm::got_section): Make the .got section the first
9537 non RELRO section in the data segment.
9538 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9539 suffixes of section names.
9540
9541 2010-02-24 Doug Kwan <dougkwan@google.com>
9542
9543 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9544 flags and attributes merging if an input file is a binary file.
9545 * fileread.cc (Input_file::open): Record format of original file.
9546 * fileread.h (Input_file::Format): New enum type.
9547 (Input_file::Input_file): Initialize data member format_.
9548 (Input_file::format): New method definition.
9549 (Input_file::format_):: New data member.
9550
9551 2010-02-24 Doug Kwan <dougkwan@google.com>
9552
9553 * arm.cc (Arm_output_data_got): New class.
9554 (ARM_TCB_SIZE): New constant
9555 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9556 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9557 If user uses a script with a SECTIONS clause, issue only a warning
9558 for a misplaced EXIDX input section. Otherwise, issue an error.
9559 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
9560 garbage collection.
9561 (Target_arm::got_mode_index_entry): Handle static linking.
9562 (Target_arm::Scan::local): Ditto.
9563 (Target_arm::Scan::global): Ditto.
9564 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9565 all incorrectly implemented relocations.
9566 (Target_arm::fix_exidx_coverage): Pass layout to
9567 Arm_output_section::fix_exidx_coverage.
9568 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9569 from ".ARM.exidx." and ".ARM.extab.".
9570
9571 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9572
9573 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9574 section if it does not already exist.
9575 * attributes.cc (Attributes_section_data::Attributes_section_data):
9576 Don't crash if size is zero.
9577
9578 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9579 Ian Lance Taylor <iant@google.com>
9580
9581 * gold.cc (queue_middle_tasks): If no input files were opened,
9582 exit.
9583 * workqueue.h (Task_function::Task_function): Assert that there is
9584 a blocker.
9585
9586 2010-02-22 Doug Kwan <dougkwan@google.com>
9587
9588 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9589 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9590 types to avoid warnings due to different uint64_t implementations
9591 on different hosts.
9592
9593 2010-02-21 Doug Kwan <dougkwan@google.com>
9594
9595 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9596 handling of the maximum backward branch offset.
9597 (Arm_relocate_functions::thumb_branch_common): Ditto.
9598 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9599 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
9600 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
9601 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9602 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9603 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9604 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9605 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9606 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9607 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9608 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9609 thumb2_bl_out_of_range.o): New rules.
9610 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9611 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9612 thumb2_bl_out_of_range
9613 * testsuite/Makefile.in: Regenerate.
9614 * testsuite/arm_bl_in_range.s: New file.
9615 * testsuite/arm_bl_out_of_range.s: Ditto.
9616 * testsuite/arm_branch_in_range.sh: Ditto.
9617 * testsuite/arm_branch_range.t: Ditto.
9618 * testsuite/thumb2_branch_range.t: Ditto.
9619 * testsuite/thumb_bl_in_range.s: Ditto.
9620 * testsuite/thumb_bl_out_of_range.s: Ditto.
9621 * testsuite/thumb_branch_range.t: Ditto.
9622
9623 2010-02-20 Sriraman Tallam <tmsriram@google.com>
9624
9625 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9626 Add reloc offset information.
9627 * icf.cc (get_section_contents): Change iterators to point to the new
9628 vectors. Add reloc offset information to the contents.
9629 * icf.h (Icf::Sections_reachable_info): New typedef.
9630 (Icf::Sections_reachable_list): New typedef.
9631 (Icf::Offset_info): New typedef.
9632 (Icf::Reloc_info): New struct typedef.
9633 (Icf::Reloc_info_list): New typedef.
9634 (Icf::symbol_reloc_list): Delete method.
9635 (Icf::addend_reloc_list): Delete method.
9636 (Icf::section_reloc_list): Delete method.
9637 (Icf::reloc_info_list): New method.
9638 (Icf::reloc_info_list_): New member.
9639
9640 2010-02-19 Doug Kwan <dougkwan@google.com>
9641
9642 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9643 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9644 * arm.cc (Arm_relocation_functions): New forward declaration.
9645 (Target_arm::Target_arm): Initialize new data members
9646 got_mod_index_offset_ and tls_base_symbol_defined_.
9647 (Target_arm::Relocate::relocate_tls): New method.
9648 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9649 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9650 New methods.
9651 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
9652 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9653 (Target_arm::got_mod_index_offset_,
9654 Target_arm::tls_base_symbol_defined_): New data members.
9655 (Target_arm::Scan::local, Target::Scan::global,
9656 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9657 relocations.
9658
9659 2010-02-18 Doug Kwan <dougkwan@google.com>
9660
9661 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9662 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9663 text section as a parameter becuase some broken tools may not set
9664 the link in section header.
9665 (Target_arm::has_got_section): New method.
9666 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9667 without any mapping symbol as data only. Remove warning.
9668 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9669 link in its section header, try to discover the link by inspecting the
9670 REL31 relocation at the beginning of the section.
9671 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9672 in error message.
9673 (Target_arm::Scan::global): Treat any reference to the symbol
9674 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9675
9676 2010-02-12 Sriraman Tallam <tmsriram@google.com>
9677
9678 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9679 (Scan::global_reloc_may_be_function_pointer): New function.
9680 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9681 (Scan::global_reloc_may_be_function_pointer): New function.
9682 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9683 (Scan::global_reloc_may_be_function_pointer): New function.
9684 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9685 (Scan::global_reloc_may_be_function_pointer): New function.
9686 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9687 (Scan::global_reloc_may_be_function_pointer): New function.
9688 (Scan::possible_function_pointer_reloc): New function.
9689 (Target_x86_64::can_check_for_function_pointers): New function.
9690 * gc.h (gc_process_relocs): Scan relocation types to determine if
9691 function pointers were taken for targets that support it.
9692 * icf.cc (Icf::find_identical_sections): Include functions for
9693 folding in safe ICF whose pointer is not taken.
9694 * icf.h (Secn_fptr_taken_set): New typedef.
9695 (fptr_section_id_): New member.
9696 (section_has_function_pointers): New function.
9697 (set_section_has_function_pointers): New function.
9698 (check_section_for_function_pointers): New function.
9699 * options.h: Fix comment for safe ICF option.
9700 * target.h (can_check_for_function_pointers): New function.
9701 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9702 Modify icf_safe_test for X86-64.
9703 * testsuite/Makefile.in: Regenerate.
9704 * testsuite/icf_safe_so_test.cc: New file.
9705 * testsuite/icf_safe_so_test.sh: New file.
9706 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9707 (main): Change to take pointer to function kept_func_3.
9708 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9709 folding is done correctly for X86-64.
9710
9711 2010-02-12 David S. Miller <davem@davemloft.net>
9712
9713 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9714 is_symbolless parameter.
9715 (Output_reloc<SHT_REL>::is_symbolless): New.
9716 (Output_reloc<SHT_REL>::is_symbolless_): New.
9717 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9718 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9719 (Output_reloc<SHT_RELA>::is_symbolless): New.
9720 (Output_data_reloc::add_global): Handle is_symbolless.
9721 (Output_data_reloc::add_global_relative): Likewise.
9722 (Output_data_reloc::add_local): Likewise.
9723 (Output_data_reloc::add_local_relative): Likewise.
9724 (Output_data_reloc::add_symbolless_global_addend): New.
9725 (Output_data_reloc::add_symbolless_local_addend): New.
9726 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9727 is_symbolless.
9728 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9729 instead of ->is_relative_
9730 (Output_reloc::write): Likewise.
9731 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9732 (Output_reloc::write_rel): Simplify.
9733
9734 * sparc.cc (Target_sparc::Scan::local): Use
9735 ->add_symbolless_local_addend as needed.
9736 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9737 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9738 based upon relocation offset.
9739
9740 2010-02-11 Doug Kwan <dougkwan@google.com>
9741
9742 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9743 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9744 beginning of function.
9745 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9746 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9747 parameter is_32bit in calls to should_apply_static_reloc.
9748 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9749 (check_DATA): Add arm_abs_global.stdout.
9750 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9751 arm_abs_global.stdout): New rules.
9752 (MOSTLLYCLEANFILES): Add arm_abs_global
9753 * Makefile.in: Regenerate.
9754 * testsuite/arm_abs_global.s: New file.
9755 * testsuite/arm_abs_global.sh: Ditto.
9756 * testsuite/arm_abs_lib.s: Ditto.
9757
9758 2010-02-11 Ian Lance Taylor <iant@google.com>
9759
9760 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9761 Read_relocs task.
9762 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9763 Allocate_commons_task first.
9764 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9765 task, rather than symtab_lock_.
9766 (Gc_process_relocs::~Gc_process_relocs): New function.
9767 (Gc_process_relocs::is_runnable): Check this_blocker_.
9768 (Gc_process_relocs::locks): Use next_blocker_ rather than
9769 blocker_.
9770 (Scan_relocs::~Scan_relocs): New function.
9771 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9772 symtab_lock_.
9773 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9774 next_blocker_.
9775 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9776 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9777 constructor accordingly.
9778 (class Gc_process_relocs): Likewise.
9779 (class Scan_relocs): Likewise.
9780 * common.h (class Allocate_commons_task): Remove symtab_lock_
9781 field, and corresponding constructor parameter.
9782 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9783 symtab_lock_.
9784 (Allocate_commons_task::locks): Likewise.
9785
9786 2010-02-11 Ian Lance Taylor <iant@google.com>
9787
9788 * gold-threads.h (class Once): Define.
9789 (class Initialize_lock): Rewrite as child of Once.
9790 * gold-threads.cc (class Once_initialize): Define.
9791 (once_pointer_control): New static variable.
9792 (once_pointer, once_arg): New static variables.
9793 (c_run_once): New static function.
9794 (Once::Once, Once::run_once, Once::internal_run): New functions.
9795 (class Initialize_lock_once): Remove.
9796 (initialize_lock_control): Remove.
9797 (initialize_lock_pointer): Remove.
9798 (initialize_lock_once): Remove.
9799 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9800 (Initialize_lock::initialize): Rewrite.
9801 (Initialize_lock::do_run_once): New function.
9802 * archive.cc (Archive::interpret_header): Only clear name if it is
9803 not already empty.
9804 * fileread.cc: Include "gold-threads.h"
9805 (file_counts_lock): New static variable.
9806 (file_counts_initialize_lock): Likewise.
9807 (File_read::release): Only increment counts when using --stats.
9808 Use a lock around the increment.
9809 * parameters.cc (class Set_parameters_target_once): Define.
9810 (set_parameters_target_once): New static variable.
9811 (Parameters::Parameters): Move here from parameters.h.
9812 (Parameters::set_target): Rewrite.
9813 (Parameters::set_target_once): New function.
9814 (Parameters::clear_target): Move here and rewrite.
9815 * parameters.h (class Parameters): Update declarations. Add
9816 set_parameters_target_once_ field.
9817 (Parameters::Parameters): Move to parameters.cc.
9818 (Parameters::clear_target): Likewise.
9819 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9820 task.
9821 (Start_group::~Start_group): New function.
9822 (Start_group::is_runnable): New function.
9823 (Start_group::locks, Start_group::run): New functions.
9824 (Finish_group::run): Change saw_undefined to size_t.
9825 * readsyms.h (class Start_group): Define.
9826 (class Finish_group): Change saw_undefined_ field to size_t.
9827 (Finish_group::Finish_group): Remove saw_undefined and
9828 this_blocker parameters. Change all callers.
9829 (Finish_group::set_saw_undefined): New function.
9830 (Finish_group::set_blocker): New function.
9831 * symtab.h (class Symbol_table): Change saw_undefined to return
9832 size_t. Change saw_undefined_ field to size_t.
9833 * target-select.cc (Set_target_once::do_run_once): New function.
9834 (Target_selector::Target_selector): Initialize set_target_once_
9835 field. Don't initialize lock_ and initialize_lock_ fields.
9836 (Target_selector::instantiate_target): Rewrite.
9837 (Target_selector::set_target): New function.
9838 * target-select.h (class Set_target_once): Define.
9839 (class Target_selector): Update declarations. Make
9840 Set_target_once a friend. Remove lock_ and initialize_lock_
9841 fields. Add set_target_once_ field.
9842
9843 2010-02-10 Ian Lance Taylor <iant@google.com>
9844
9845 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9846 queueing any tasks.
9847 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9848 (queue_middle_tasks): Add all blockers before queueing any tasks.
9849 (queue_final_tasks): Likewise.
9850 * token.h (Task_token::add_blockers): New function.
9851 * object.h (Input_objects::number_of_relobjs): New function.
9852
9853 2010-02-10 Ian Lance Taylor <iant@google.com>
9854
9855 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9856 shared, not if not position independent.
9857 * x86_64.cc (Relocate::relocate_tls): Likewise.
9858 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9859 (tls_pie_pic_test): New target.
9860 * testsuite/Makefile.in: Rebuild.
9861
9862 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9863 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9864 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9865 * testsuite/Makefile.in: Rebuild.
9866
9867 2010-02-09 David S. Miller <davem@davemloft.net>
9868
9869 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9870 R_SPARC_RELATIVE using ->add_local_relative().
9871 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9872
9873 * output.h (Output_data_dynamic::add_section_size): New method
9874 that takes two Output_data objects.
9875 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9876 entry param. Handle it in initializers.
9877 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9878 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9879 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9880 arg.
9881 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9882 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9883 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9884 for dynrel_includes_plt.
9885 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9886 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9887 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9888 before .rela.plt
9889 (Target_sparc::do_finalize_sections): Update to pass true for
9890 dynrel_includes_plt.
9891 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9892 output before .rela.plt
9893 (Target_powerpc::do_finalize_sections): Update to pass true for
9894 dynrel_includes_plt when 32-bit.
9895
9896 2010-02-08 Doug Kwan <dougkwan@google.com>
9897
9898 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9899 method.
9900 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9901 Arm_relobj::scan_section_for_cortex_a8_stubs,
9902 Arm_relobj::do_relocation_section): Instead of calling
9903 Output_section::output_address, use faster
9904 Arm_relobj::simple_input_section_output_address.
9905
9906 2010-02-08 David S. Miller <davem@davemloft.net>
9907
9908 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9909 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9910 relocation helper function.
9911
9912 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9913 just like R_SPARC_GOT{10,13,22}.
9914 (Target_sparc::Scan::local): Likewise.
9915 (Target_sparc::Relocate:relocate): Likewise.
9916
9917 2010-02-06 Ian Lance Taylor <iant@google.com>
9918
9919 * configure.ac: Rewrite targetobjs duplicate removal code to use
9920 only shell constructs.
9921 * configure: Rebuild.
9922
9923 2010-02-05 Doug Kwan <dougkwan@google.com>
9924
9925 PR 11247
9926 * arm.cc (Arm_relobj::section_is_scannable): New method.
9927 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9928 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9929
9930 2010-02-04 Doug Kwan <dougkwan@google.com>
9931
9932 PR 11247
9933 * arm-reloc-property.cc (cstdio): Include.
9934 * configure.ac (targetobjs): Remove duplicates.
9935 * configure: Regenerate.
9936 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9937 big and little endian version for a given address size.
9938
9939 2010-02-03 Doug Kwan <dougkwan@google.com>
9940
9941 * arm-reloc-property.cc
9942 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9943 definition.
9944 * arm-reloc-property.h
9945 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9946 New method definition.
9947 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9948 declaration.
9949 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9950 overflow to N.
9951 (GOT_PREL): Change implemented to Y.
9952 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9953 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9954 (Arm_relocate_functions::movw_abs_nc): Remove method.
9955 (Arm_relocate_functions::movt_abs): Ditto.
9956 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9957 (Arm_relocate_functions::thm_movt_abs): Ditto.
9958 (Arm_relocate_functions::movw_rel_nc): Ditto.
9959 (Arm_relocate_functions::movw_rel): Ditto.
9960 (Arm_relocate_functions::movt_rel): Ditto.
9961 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9962 (Arm_relocate_functions:thm_movw_rel): Ditto.
9963 (Arm_relocate_functions:thm_movt_rel): Ditto.
9964 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9965 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9966 New method definitions.
9967 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9968 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9969 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9970 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9971 (Target_arm::Relocate::relocate): Check for non-static or
9972 unimplemented relocation code and exit early. Change calls to
9973 Target_arm::reloc_uses_thumb_bit and
9974 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9975 instead. Refactor code to handle similar relocations to increase
9976 code sharing. Remove check for unsupported relocation code in switch
9977 statement.
9978 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9979 relocation property table to find out size. Change error message to
9980 print out the name of a relocation code instead of the numeric value.
9981 (Target_arm::scan_reloc_for_stub): Use relocation property table
9982 instead of calling Target_arm::reloc_uses_thumb_bit().
9983
9984 2010-02-02 Doug Kwan <dougkwan@google.com>
9985
9986 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9987 types of relaxed input section.
9988
9989 2010-02-02 Doug Kwan <dougkwan@google.com>
9990
9991 * Makefile.am (HFILES): Add arm-reloc-property.h.
9992 (DEFFILES): New.
9993 (TARGETSOURCES): Add arm-reloc-property.cc
9994 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
9995 (libgold_a_SOURCES): $(DEFFILES)
9996 * Makefile.in: Regenerate.
9997 * arm-reloc-property.cc: New file.
9998 * arm-reloc-property.h: New file.
9999 * arm-reloc.def: New file.
10000 * arm.cc: Update comments.
10001 (arm-reloc-property.h): New included header.
10002 (arm_reloc_property_table): New global variable.
10003 (Target_arm::do_select_as_default_target): New method definition.
10004 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10005 arm-reloc-property to targ_extra_obj.
10006 * parameters.cc (set_parameters_target): Call
10007 Target::select_as_default_target().
10008 * target.h (Target::select_as_default_target): New method definition.
10009 (Target::do_select_as_default_target): Same.
10010
10011 2010-02-01 Doug Kwan <dougkwan@google.com>
10012
10013 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10014 first_output_text_section_.
10015 (Arm_exidx_fixup::first_output_text_section): New method definition.
10016 (Arm_exidx_fixup::first_output_text_section_): New data member.
10017 (Arm_exidx_fixup::process_exidx_section): Record the first text
10018 output section seen.
10019 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10020 and entsize in output section header.
10021
10022 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10023
10024 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10025 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10026 (Arm_relocate_functions::thm_alu11): New Method.
10027 (Arm_relocate_functions::thm_pc8): New Method.
10028 (Arm_relocate_functions::thm_pc12): New Method.
10029 (Target_arm::Scan::local): Handle the relocations.
10030 (Target_arm::Scan::global): Likewise.
10031 (Target_arm::Relocate::relocate): Likewise.
10032 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10033
10034 2010-01-29 Doug Kwan <dougkwan@google.com>
10035
10036 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10037 of relocation types as ld.
10038
10039 2010-01-29 Doug Kwan <dougkwan@google.com>
10040
10041 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10042 to public.
10043 (Arm_relocate_functions::thumb_branch_common): Ditto.
10044 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10045 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10046 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10047 Arm_relocate_functions::jump24): Remove.
10048 (Target_arm::Relocate::relocate): Adjust code to call
10049 Arm_relocation_functions::arm_branch_common and
10050 Arm_relocation_functions::thumb_branch_common instead of their removed
10051 wrappers. Merge switch-cases together to reduce source code size.
10052
10053 2010-01-29 Doug Kwan <dougkwan@google.com>
10054
10055 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10056 output_local_symbol_count_needs_update_.
10057 (Arm_relobj::output_local_symbol_count_needs_update,
10058 Arm_relobj::set_output_local_symbol_count_needs_update,
10059 Arm_relobj::update_output_local_symbol_count): New methods.
10060 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10061 member.
10062 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10063 of pointed function as in a R_ARM_PREL31 relocation.
10064 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10065 for output local symbol count updating.
10066 (Target_arm::do_relax): Update output local symbol counts in objects
10067 if necessary.
10068 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10069
10070 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10071
10072 * arm.cc: Added support for the ARM relocations:
10073 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10074 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10075 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10076 movw_prel_nc).
10077 (Arm_relocate_functions::movw_rel): New method.
10078 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10079 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10080 thm_movw_prel_nc).
10081 (Arm_relocate_functions::thm_movw_rel): New method.
10082 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10083 thm_movt_prel).
10084 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10085 relocations.
10086 (Target_arm::Scan::global): Likewise.
10087 (Target_arm::Relocate::relocate): Likewise.
10088 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10089 Likewise.
10090
10091 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10092
10093 * arm.cc: Added support for ARM group relocations.
10094 (Target_arm::reloc_needs_sym_origin): New method.
10095 (Arm_relocate_functions::calc_grp_kn): New method.
10096 (Arm_relocate_functions::calc_grp_residual): New method.
10097 (Arm_relocate_functions::calc_grp_gn): New method.
10098 (Arm_relocate_functions::arm_grp_alu): New Method.
10099 (Arm_relocate_functions::arm_grp_ldr): New Method.
10100 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10101 (Arm_relocate_functions::arm_grp_ldc): New Method.
10102 (Target_arm::Scan::local): Handle the ARM group relocations.
10103 (Target_arm::Scan::global): Likewise.
10104 (Target_arm::Relocate::relocate): Likewise.
10105 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10106 Likewise.
10107
10108 2010-01-26 Doug Kwan <dougkwan@google.com>
10109
10110 * arm.cc (set): Include.
10111 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10112 pointer type.
10113 (Arm_output_section::Text_section_list): New type.
10114 (Arm_output_section::append_text_sections_to_list): New method.
10115 (Arm_output_section::fix_exidx_coverage): Ditto.
10116 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
10117 (Arm_relobj::convert_input_section_to_relaxed_section): Use
10118 Relobj::set_section_offset() instead of
10119 Sized_relobj::invalidate_section_offset().
10120 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
10121 parameter for section headers. Ignore relocation sections for
10122 unallocated sections and EXIDX sections.
10123 (Target_arm::fix_exidx_coverage): New method.
10124 (Target_arm::output_section_address_less_than): New type.
10125 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10126 linked text section instead of the EXIDX section.
10127 (Arm_output_section::create_stub_group): Add an assertion to check
10128 that this is not an EXIDX output section.
10129 (Arm_output_section::append_text_sections_to_list): New method.
10130 (Arm_output_section::fix_exidx_coverage): Ditto.
10131 (Arm_relobj::scan_sections_for_stubs): Adjust call to
10132 Arm_relobj::section_needs_reloc_stub_scanning.
10133 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10134 first pass.
10135 (Target_arm::fix_exidx_coverage): New method.
10136 * object.h (Relobj::set_output_section): New method.
10137 (Sized_relobj::invalidate_section_offset): Remove method.
10138 (Sized_relobj::do_invalidate_section_offset): Remove method.
10139 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10140
10141 2010-01-25 Doug Kwan <dougkwan@google.com>
10142
10143 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10144 Fix warning due to signed and unsigned comparison on a 32-bit host.
10145
10146 2010-01-22 Doug Kwan <dougkwan@google.com>
10147
10148 * arm.cc (Target_arm::do_relax): Record an output section for section
10149 offset adjustment it contains any stub table that has changed.
10150 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10151 offsets in an output section if necessary.
10152 * output.cc (Output_section::Output_section): Initialize
10153 section_offsets_need_adjustments_.
10154 (Output_section::add_input_section_for_script): Renamed to
10155 Output_section::add_simple_input_section.
10156 (Output_section::save_states): Add a comment.
10157 (Output_section::discard_states): New method defintion.
10158 (Output_section::adjust_section_offsets): Same.
10159 * output.h (Output_section::add_input_section_for_script): Renamed to
10160 Output_section::add_simple_input_section.
10161 (Output_section::discard_states): New method declaration.
10162 (Output_section::adjust_section_offsets): Same.
10163 (Output_section::section_offsets_need_adjustment,
10164 Output_section::set_section_offsets_need_adjustment): New method
10165 definitions.
10166 (Output_section::section_offsets_need_adjustment_): New data member.
10167 * script-sections.cc
10168 (Output_section_element_input::set_section_address): Adjust code for
10169 renaming of Output_section::add_input_section_for_script.
10170 (Orphan_output_section::set_section_address): Same.
10171
10172 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10173
10174 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10175 Fix_v4bx enum values .
10176 * gold/options.h (General_options): New option definitions.
10177 (General_options::fix_v4bx): New method.
10178 (General_options::Fix_v4bx): New enum.
10179 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10180 (General_options::parse_fix_v4bx_interworking): New method.
10181
10182 2010-01-22 Doug Kwan <dougkwan@google.com>
10183
10184 * arm.cc (Arm_exidx_fixup): New class.
10185
10186 2010-01-21 Doug Kwan <dougkwan@google.com>
10187
10188 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10189 classes.
10190 (Arm_exidx_section_offset_map): New type.
10191
10192 2010-01-21 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Arm_exidx_input_section): New class.
10195 (Arm_relobj::exidx_input_section_by_link,
10196 Arm_relobj::exidx_input_section_by_shndx,
10197 Arm_relobj::make_exidx_input_section): New methods.
10198 (read_arm_attributes_section): Remove.
10199 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10200 information about them.
10201 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10202 to here.
10203
10204 2010-01-20 Doug Kwan <dougkwan@google.com>
10205
10206 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10207 Input_section_specifier to Section_id.
10208 (Target_arm::new_arm_input_section: Adjust code for change of key
10209 type.
10210 (Target_arm::find_arm_input_section): Ditto.
10211 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10212 (Section_id): Remove.
10213 (Garbage_collection::Section_id_hash): Remove.
10214 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10215 (Section_id): Remove.
10216 (Icf::Section_id_hash): Remove.
10217 * object.h (Section_id, Const_section_id, Section_id_hash,
10218 Const_section_id_hash): New type definitions.
10219 * output.cc (Output_section::add_relaxed_input_section): Change to
10220 use Const_section_id instead of Input_section_specifier as key type.
10221 (Output_section::add_merge_input_section): Ditto.
10222 (Output_section::build_relaxation_map): Change to use Section_id
10223 instead of Input_section_specifier as key type.
10224 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10225 Ditto.
10226 (Output_section::convert_input_sections_to_relaxed_sections): Change
10227 to use Const_section_id instead of Input_section_specifier as key type.
10228 (Output_section::find_merge_section): Ditto.
10229 (Output_section::find_relaxed_input_section): Ditto.
10230 * output.h (Input_section_specifier): Remove class.
10231 (Output_section::Output_section_data_by_input_section_map): Change
10232 key type to Const_section_id.
10233 (Output_section::Output_relaxed_input_section_by_input_section_map):
10234 Ditto.
10235 (Output_section::Relaxation_map): Change key type to Section_id.
10236
10237 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10238
10239 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10240 (class Arm_v4bx_stub): New class.
10241 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10242 (Stub_factory::make_arm_v4bx_stub): New method.
10243 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10244 (Stub_table::empty): Handle v4bx stubs.
10245 (Stub_table::add_arm_v4bx_stub): New method.
10246 (Stub_table::find_arm_v4bx_stub): New method.
10247 (Arm_relocate_functions::v4bx): New method.
10248 (Target_arm::fix_v4bx): New method.
10249 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10250 (Stub_table::relocate_stubs): Likewise.
10251 (Stub_table::do_write): Likewise.
10252 (Stub_table::update_data_size_and_addralign): Likewise.
10253 (Stub_table::finalize_stubs): Likewise.
10254 (Target_arm::Scan::local): Likewise.
10255 (Target_arm::Scan::global): Likewise.
10256 (Target_arm::do_finalize_sections): Likewise.
10257 (Target_arm::Relocate::relocate): Likewise.
10258 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10259 Likewise.
10260 (Target_arm::scan_reloc_for_stub): Likewise.
10261 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10262
10263 2010-01-19 Ian Lance Taylor <iant@google.com>
10264
10265 * output.cc (Output_section_headers::do_sized_write): Write large
10266 segment count to sh_info field.
10267 (Output_file_header::do_sized_write): For large segment count,
10268 write PN_XNUM to e_phnum field.
10269
10270 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10271
10272 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10273 (Arm_relocate_functions::thm_jump8): New function.
10274 (Arm_relocate_functions::thm_jump11): New function.
10275 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10276 R_ARM_THM_JUMP11.
10277 (Target_arm::Scan::global): Likewise.
10278 (Target_arm::Relocate::relocate): Likewise.
10279 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10280 Likewise.
10281
10282 2010-01-14 Doug Kwan <dougkwan@google.com>
10283
10284 * arm.cc (map, utility): Include headers.
10285 (Target_arm::apply_cortex_a8_workaround): New method.
10286 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10287 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10288 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10289 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10290 the --[no-]fix-cortex-a8 command line options.
10291 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10292 (Target_arm::relocate_stub): Use addend in instruction template.
10293 * options.h (DEFINE_bool): Set the user-set flag.
10294 (General_options): Add --[no-]-fix-cortex options.
10295 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
10296 : Update fast look-up map after conversion.
10297
10298 2010-01-14 Sriraman Tallam <tmsriram@google.com>
10299
10300 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10301 in the first pass of do_layout.
10302
10303 2010-01-13 Doug Kwan <dougkwan@google.com>
10304
10305 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10306 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10307 apparent compiler problem of not folding static constant integral
10308 data members of elfcpp::Elf_sizes<32>.
10309
10310 2010-01-13 Doug Kwan <dougkwan@google.com>
10311
10312 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10313 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10314 Arm_relobj::scan_section_for_cortex_a8_erratum,
10315 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10316 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10317 sections to scan for relocation stubs into a new method
10318 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10319 relocation and Cortex-A8 stub scanning.
10320 (Target_arm::do_relax): Force stubs to be after stubbed sections
10321 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
10322 the beginning of a new relaxation pass. Update a comment.
10323 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10324
10325 2010-01-12 Ian Lance Taylor <iant@google.com>
10326
10327 * target-reloc.h (visibility_error): New inline function.
10328 (relocate_section): Call visibility_error.
10329 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10330 (MOSTLYCLEANFILES): Likewise.
10331 (protected_4_pic.o, protected_3.err): New targets.
10332 * testsuite/protected_4.cc: New file.
10333
10334 2010-01-12 Doug Kwan <dougkwan@google.com>
10335
10336 * arm.cc (Cortex_a8_reloc): New class.
10337 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10338 and cortex_a8_relocs_info_.
10339 (Target_arm::fix_cortex_a8): New method definition.
10340 (Target_arm::Cortex_a8_relocs_info): New type.
10341 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10342 New data member declarations.
10343 (Target_arm::scan_reloc_for_stub): Record information about
10344 relocations for THUMB branches that might be exempted from the
10345 Cortex-A8 workaround.
10346 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10347 at the beginning of a relaxation pass.
10348
10349 2010-01-12 Doug Kwan <dougkwan@google.com>
10350
10351 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10352 (Arm_relobj::Mapping_symbol_position,
10353 Arm_reloj::Mapping_symbol_position_less,
10354 Arm_relobj::Mapping_symbols_info): New types.
10355 (Target_arm::is_mapping_symbol_name): New method definition.
10356 (Arm_relobj::do_count_local_symbols): Save information about mapping
10357 symbols.
10358
10359 2010-01-11 Doug Kwan <dougkwan@google.com>
10360
10361 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10362 Arm_relocate_functions::thumb32_branch_upper,
10363 Arm_relocate_functions::thumb32_branch_lower,
10364 Arm_relocate_functions::thumb32_cond_branch_offset,
10365 Arm_relocate_functions::thumb32_cond_branch_upper,
10366 Arm_relocate_functions::thumb32_cond_branch_lower,
10367 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10368 branch offset encoding.
10369 (Arm_relocate_functions::thumb_branch_common): Use new branch
10370 offset encoding methods to avoid code duplication.
10371 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10372 (Stub_addend_reader::operator()): Use new branch encoding method
10373 to avoid code duplication.
10374
10375 2010-01-11 Doug Kwan <dougkwan@google.com>
10376
10377 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10378 (Target_arm::do_finalize_sections): Define special EXIDX section
10379 symbols only if referenced.
10380 * gc.h (Garbage_collection::add_reference): New method.
10381 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10382 code duplication.
10383
10384 2010-01-11 Ian Lance Taylor <iant@google.com>
10385
10386 * script.cc (Version_script_info::build_expression_list_lookup):
10387 Change complaing about duplicate wildcard match from error to
10388 warning.
10389
10390 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10391 of 2009-12-30.
10392 (Version_script_info::Version_script_info): Initialize globs_,
10393 default_version_, default_is_global_, and exact_. Don't
10394 initialize globals_ or locals_.
10395 (Version_script_info::build_lookup_tables): Build local symbols
10396 first.
10397 (Version_script_info::unquote): New function.
10398 (Version_script_info::add_exact_match): New function.
10399 (Version_script_info::build_expression_list_lookup): Remove lookup
10400 parameter. Add is_global parameter. Change all callers. Handle
10401 wildcard pattern specially. Unquote pattern. Call
10402 add_exact_match.
10403 (Version_script_info::get_name_to_match): New function.
10404 (Version_script_info::get_symbol_version): New function.
10405 (Version_script_info::get_symbol_version_helper): Remove.
10406 (Version_script_info::check_unmatched_names): Call unquote.
10407 * script.h (class Version_script_info): Change get_symbol_version
10408 to be non-inline and add is_global parameter; change all callers.
10409 Rewrite symbol_is_local. Update declarations. Define struct
10410 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10411 Remove globals_ and locals_ members. Add exact_, globs_,
10412 default_version_, is_global_.
10413 (Version_script_info::Glob): Remove pattern, add expression and
10414 is_global. Update constructor. Change all callers.
10415 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10416 default version.
10417 (Versions::symbol_section_contents): If a symbol is undefined, or
10418 defined in a dynamic object, set the version index to
10419 VER_NDX_LOCAL.
10420 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10421 symbol_is_local.
10422 (Symbol_table::add_from_pluginobj): Likewise.
10423 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10424
10425 2010-01-11 Doug Kwan <dougkwan@google.com>
10426
10427 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10428 (incremental_dump_LDADD): Add linking option for libintl.
10429 * Makefile.in: Regenerate.
10430
10431 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10432
10433 PR gold/11144
10434 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10435 instead of -Ds.
10436 * testsuite/Makefile.in: Regenerated.
10437
10438 2010-01-10 Doug Kwan <dougkwan@google.com>
10439
10440 * options.h (DEFINE_var): Use parentheses around argument varname__
10441 in macro body to avoid any unintended subsequent substitutions.
10442
10443 2010-01-10 Ian Lance Taylor <iant@google.com>
10444
10445 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10446 candidates before doing symbol resolution.
10447
10448 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10449 ODR candidates if only one is weak.
10450
10451 2010-01-08 Ian Lance Taylor <iant@google.com>
10452
10453 * script.cc (Version_script_info::build_expression_list_lookup):
10454 Don't warn about ambiguous version, just record the ambiguity.
10455 (Version_script_info::get_symbol_version_helper): Give error if
10456 version is ambiguous.
10457
10458 2010-01-08 Doug Kwan <dougkwan@google.com>
10459
10460 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
10461 prev_data_size_ and prev_addralign_. Remove initializer for
10462 deleted data member has_been_changed_.
10463 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10464 to determine if the table is empty.
10465 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10466 Remove.
10467 (Stub_table::add_reloc_stub): Define method in class definition
10468 instead of just declaring it there.
10469 (Stub_table::add_cortex_a8_stub): New method definition.
10470 (Stub_table::update_data_size_and_addralign): Ditto.
10471 (Stub_table::finalize_stubs): Ditto.
10472 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10473 (Stub_table::do_addralign_): Return address alignment in the
10474 (Stub_table::do_reset_address_and_file_offset): Define method in
10475 class definition instead of declaring it there. Set current data
10476 size to be the data size of the previous pass.
10477 (Stub_table::set_final_data_size): Use current data size as the
10478 final data size.
10479 (Stub_table::relocate_stub): Change parameter type of stub from
10480 Reloc_stub pointer to Stub pointer.
10481 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10482 (Stub_table::Cortex_a8_stub_list): New typedef.
10483 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10484 Stub_table::prev_addralign_): New data member.
10485 (Arm_relobj::Arm_relobj): Initialize data member
10486 section_has_cortex_a8_workaround_.
10487 (Arm_relobj::section_has_cortex_a8_workaround,
10488 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10489 definitions.
10490 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10491 declarations.
10492 (Target_arm::relocate_stub): Change parameter type of stub from
10493 Reloc_stub pointer to Stub pointer.
10494 (Insn_template::size, Insn_template::alignment): Handle
10495 THUMB16_SPECIAL_TYPE.
10496 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10497 Stub_table::update_data_size_and_addralign,
10498 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10499 definitions.
10500 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10501 (Stub_table::do_write): Ditto.
10502 (Target_arm::do_relax): Adjust code for changes in Stub_table.
10503
10504 2010-01-08 Ian Lance Taylor <iant@google.com>
10505
10506 PR 11108
10507 * symtab.h (class Symbol): Remove fields is_target_special_ and
10508 has_plt_offset_. Add field is_defined_in_discarded_section_.
10509 (Symbol::is_defined_in_discarded_section): New function.
10510 (Symbol::set_is_defined_in_discarded_section): New function.
10511 (Symbol::has_plt_offset): Rewrite.
10512 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10513 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10514 Don't initialize is_target_special_ or has_plt_offset_.
10515 Initialize is_defined_in_discarded_section_.
10516 (Symbol_table::add_from_relobj): If appropriate, set
10517 is_defined_in_discarded_section.
10518 * resolve.cc (Symbol::override_base_with_special): Don't test
10519 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10520 * target-reloc.h (relocate_section): Do special handling for
10521 symbols defined in discarded sections for global symbols as well
10522 as local symbols.
10523
10524 2010-01-08 Ian Lance Taylor <iant@google.com>
10525
10526 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10527 the SHT_SYMTAB case.
10528
10529 2010-01-08 Ian Lance Taylor <iant@google.com>
10530
10531 * object.cc (Sized_relobj::do_layout): Don't get confused if
10532 layout_eh_frame returns NULL.
10533
10534 2010-01-08 Ian Lance Taylor <iant@google.com>
10535
10536 PR 11084
10537 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10538 dynamic symbol table, use the normal symbol table.
10539 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10540 symbol table.
10541
10542 2010-01-08 Ian Lance Taylor <iant@google.com>
10543
10544 PR 11072
10545 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10546 sections.
10547
10548 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10549
10550 * version.cc (print_version): Change to "Copyright 2010".
10551
10552 2010-01-08 Ian Lance Taylor <iant@google.com>
10553
10554 PR 10287
10555 PR 11063
10556 * i386.cc (class Target_i386): Change return type of plt_section
10557 to be non-const.
10558 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10559 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10560 tls_desc_rel_ field.
10561 (Output_data_plt_i386::rel_tls_desc): New function.
10562 (Target_i386::rel_tls_desc_section): New function.
10563 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10564 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10565 R_386_TLS_DESC reloc in rel_tls_desc_section.
10566 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10567 Define struct Tlsdesc_info.
10568 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10569 (Target_x86_64::do_reloc_symbol_index): New function.
10570 (Target_x86_64::add_tlsdesc_info): New function.
10571 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10572 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10573 tlsdesc_rel_ field.
10574 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10575 all callers.
10576 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10577 (Target_x86_64::rela_tlsdesc_section): New function.
10578 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10579 handling.
10580 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10581 (Target_x86_64::do_reloc_addend): New function.
10582 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10583 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10584 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10585 (Output_reloc::type): New function.
10586 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10587 (Output_reloc::is_target_specific): New function.
10588 (Output_reloc::target_arg): New function.
10589 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10590 absolute relocs and target specific relocs.
10591 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10592 add_target_specific.
10593 (class Output_data_reloc) [SHT_RELA]: Likewise.
10594 * output.cc (Output_reloc::Output_reloc): Add four new versions
10595 for absolute relocs and target specific relocs.
10596 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10597 (Output_reloc::get_symbol_index): Likewise.
10598 (Output_reloc::local_section_offset): Check that local_sym_index_
10599 is not TARGET_CODE or 0.
10600 (Output_reloc::symbol_value): Likewise.
10601 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10602 reloc.
10603 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10604 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10605 functions.
10606 * layout.cc (add_target_dynamic_tags): Use output section for
10607 DT_PLTRELSZ and DT_JMPREL.
10608
10609 2010-01-07 Ian Lance Taylor <iant@google.com>
10610
10611 PR 11061
10612 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10613 function.
10614 (class Output_data_reloc_generic): Define.
10615 (class Output_data_reloc_base): Change base class to
10616 Output_data_reloc_generic. Change add() method to call
10617 bump_relative_reloc_count for a relative reloc. Remove
10618 sort_relocs_ field.
10619 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10620 to sort_relocs().
10621 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10622 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10623 appropriate.
10624 * layout.h (class Layout): Update declaration.
10625
10626 2010-01-07 Ian Lance Taylor <iant@google.com>
10627
10628 * output.h (class Output_data): Add const version of
10629 output_section and do_output_section.
10630 (class Output_section_data): Add const version of
10631 do_output_section.
10632 (class Output_section): Likewise.
10633 * layout.cc (Layout::add_target_dynamic_tags): New function.
10634 * layout.h (class Layout): Update declarations.
10635 * arm.cc (Target_arm::do_finalize_sections): Use
10636 add_target_dynamic_tags.
10637 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10638 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10639 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10640 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10641
10642 2010-01-07 Ian Lance Taylor <iant@google.com>
10643
10644 PR 11042
10645 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10646 object as needed.
10647
10648 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10649 Ian Lance Taylor <iant@google.com>
10650
10651 PR 11019
10652 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10653 Xindex::read_symtab_xindex.
10654
10655 2010-01-07 Doug Kwan <dougkwan@google.com>
10656
10657 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10658 (Insn_template::thumb16_bcond_insn): New method declaration.
10659 (Insn_template): Fix spelling.
10660 (Stub::thumb16_special): New method declaration.
10661 (Stub::do_write): Define virtual method which was previously pure
10662 virtual.
10663 (Stub::do_thumb16_special): New method declaration.
10664 (Stub::do_fixed_endian_write): New template member.
10665 (Reloc_stub::do_write): Remove.
10666 (Reloc_stub::do_fixed_endian_write): Remove.
10667 (Cortex_a8_stub): New class definition.
10668 (Stub_factory::make_cortex_a8_stub): New method definition.
10669 (Stub_factory::Stub_factory): Add missing static storage class
10670 qualifier for elf32_arm_stub_a8_veneer_blx.
10671
10672 2010-01-07 Ian Lance Taylor <iant@google.com>
10673
10674 PR 10980
10675 * options.h (class General_options): Add --warn-unresolved-symbols
10676 and --error-unresolved-symbols.
10677 * errors.cc (Errors::undefined_symbol): Implement
10678 --warn-unresolved-symbols.
10679
10680 * options.h (class General_options): Add -z text and -z textoff.
10681 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10682
10683 2010-01-06 Sriraman Tallam <tmsriram@google.com>
10684
10685 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10686 (Garbage_collection::cident_sections): New function.
10687 (Garbage_collection::add_cident_section): New function.
10688 (Garbage_collection::cident_sections_): New member.
10689 (gc_process_relocs): Add references to sections whose names are C
10690 identifiers.
10691 * gold.h (cident_section_start_prefix): New constant.
10692 (cident_section_stop_prefix): New constant.
10693 (is_cident): New function.
10694 * layout.cc (Layout::define_section_symbols): Replace string constants
10695 with the newly defined constants.
10696 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10697 C identifiers.
10698 * testsuite/Makefile.am: Add gc_orphan_section_test.
10699 * testsuite/Makefile.in: Regenerate.
10700 * testsuite/gc_orphan_section_test.cc: New file.
10701 * testsuite/gc_orphan_section_test.sh: New file.
10702
10703 2010-01-06 Ian Lance Taylor <iant@google.com>
10704
10705 PR 10980
10706 * options.h (class General_options): Add --warn-shared-textrel.
10707 * layout.cc (Layout::finish_dynamic_section): Implement
10708 --warn-shared-textrel.
10709
10710 PR 10980
10711 * options.h (class General_options): Add --warn-multiple-gp.
10712
10713 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10714
10715 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10716 $(THREADSLIB) and $(LIBDL).
10717 * Makefile.in: Rebuild.
10718
10719 2010-01-06 Ian Lance Taylor <iant@google.com>
10720
10721 PR 10980
10722 * options.cc (General_options::parse_section_start): New function.
10723 (General_options::section_start): New function.
10724 (General_options::General_options): Initialize all members.
10725 * options.h: Include <map>
10726 (class General_options): Add --section-start. Add section_starts_
10727 member.
10728 * layout.cc (Layout::attach_allocated_section_to_segment): If
10729 --section-start was used, set the address of the segment. Remove
10730 local sort_sections.
10731 (Layout::relaxation_loop_body): If the address of the load segment
10732 has been set by --section-start, don't use it.
10733 * output.h (Output_segment::update_flags_for_output_section): New
10734 function.
10735 * output.cc (Output_segment::add_output_section): Call
10736 update_flags_for_output_section.
10737
10738 2010-01-05 Ian Lance Taylor <iant@google.com>
10739
10740 PR 10980
10741 * options.h (class General_options): Add --undefined-version.
10742 * script.cc (struct Version_expression): Add was_matched_by_symbol
10743 field.
10744 (Version_script_info::matched_symbol): New function.
10745 (Version_script_info::get_symbol_version_helper): Call
10746 matched_symbol.
10747 (Version_script_info::check_unmatched_names): New function.
10748 * script.h (class Version_script_info): Update declarations.
10749 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10750
10751 * options.h (class General_options): Use DEFINE_bool_alias for
10752 allow_multiple_definition.
10753 * resolve.cc (Symbol_table::should_override): Don't test
10754 allow_multiple_definition.
10755
10756 PR 10980
10757 * options.h (class General_options): Add --cref.
10758 * main.cc (main): Print cref table if --cref. Don't close mapfile
10759 until after printing cref table.
10760 * cref.cc: Include "symtab.h".
10761 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10762 (Cref_table_compare::operator()): New function.
10763 (Cref_inputs::gather_cref): New function.
10764 (filecol): New static const.
10765 (Cref_inputs::print_cref): New function.
10766 (Cref::print_cref): New function.
10767 * cref.h: Include <cstdio>.
10768 (class Cref): Update declarations.
10769 * mapfile.h (Mapfile::file): New function.
10770 * object.h (class Object): Define Symbols. Declare virtual
10771 do_get_global_symbols.
10772 (Object::get_global_symbols): New function.
10773 * object.cc (Input_objects::add_object): Pass object to cref_ if
10774 --cref.
10775 (Input_objects::archive_start): Likewise.
10776 (Input_objects::archive_stop): Likewise.
10777 (Input_objects::print_cref): New function.
10778 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10779 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10780 --cref.
10781 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10782 function.
10783 * plugin.h (class Sized_pluginobj): Update declarations.
10784
10785 2010-01-05 Ian Lance Taylor <iant@google.com>
10786
10787 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10788 to is_default_version. Rename insdef to insdefault.
10789 (Symbol_table::add_from_relobj): Rename def to is_default_version
10790 and local to is_forced_local.
10791 (Symbol_table::add_from_pluginobj): Likewise.
10792 (Symbol_table::add_from_dynobj): Likewise.
10793 (Symbol_table::define_special_symbol): Rename insdef to
10794 insdefault.
10795
10796 2010-01-04 Ian Lance Taylor <iant@google.com>
10797
10798 PR 10980
10799 * options.h (class General_options): Add
10800 --allow-multiple-definition and -z muldefs.
10801 * resolve.cc (Symbol_table::should_override): Don't warn about a
10802 multiple symbol definition if --allow-multiple-definition or -z
10803 muldefs.
10804
10805 PR 10980
10806 * options.h (class General_options): Add --add-needed and
10807 --copy-dt-needed-entries. Tweak --as-needed help entry.
10808 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10809 error if --copy-dt-needed-entries aka --add-needed is used and
10810 would cause a change in behaviour.
10811
10812 PR 10980
10813 * options.h (class General_options): Add -G as a short version of
10814 --shared. Add no-op options -assert, -g, and -i.
10815
10816 2010-01-04 Sriraman Tallam <tmsriram@google.com>
10817
10818 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10819 check for .text or .gnu.linkonce.t sections.
10820 * icf.cc (Icf::find_identical_sections): Ditto.
10821 Change the detection for mangled function name within the section
10822 name.
10823 * icf.h (is_section_foldable_candidate): New function.
10824
10825 2009-12-30 Ian Lance Taylor <iant@google.com>
10826
10827 PR 10980
10828 * options.h (class General_options): Permit two dashes with
10829 --retain-symbols-file.
10830
10831 2009-12-30 Ian Lance Taylor <iant@google.com>
10832
10833 PR 10979
10834 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10835 don't put the file header and segment headers in the text
10836 segment.
10837
10838 PR 10979
10839 * common.cc (Sort_commons::operator()): Stabilize sort when both
10840 entries are NULL.
10841 (Symbol_table::do_allocate_commons_list): When allocating common
10842 symbols, skip a symbol which is no longer common.
10843 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10844 an object before checking its type.
10845 * testsuite/common_test_2.c: New file.
10846 * testsuite/common_test_3.c: New file.
10847 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10848 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10849 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10850 (common_test_2_pic.o, common_test_2.so): New targets.
10851 (common_test_3_pic.o, common_test_3.so): New targets.
10852 * testsuite/Makefile.in: Rebuild.
10853
10854 PR 10979
10855 * script.cc (read_input_script): If we see a new SECTIONS clause,
10856 and we have added an input section, give an error.
10857 * layout.h (class Layout): Add have_added_input_section function.
10858 Add have_added_input_section_ field.
10859 * layout.cc (Layout::Layout): Initialize
10860 have_added_input_section_.
10861 (Layout::layout): Set have_added_input_section_.
10862 (Layout::layout_eh_frame): Likewise.
10863
10864 2009-12-30 Ian Lance Taylor <iant@google.com>
10865
10866 PR 10931
10867 * options.h (class General_options): Add --sort-common option.
10868 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10869 * common.cc (Sort_common): Add sort_order parameter to
10870 constructor. Add sort_order_ field.
10871 (Sort_commons::operator): Check sort_order_.
10872 (Symbol_table::allocate_commons): Determine the sort order.
10873 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10874 Change all callers.
10875 (Symbol_table::do_allocate_commons_list): Likewise.
10876
10877 2009-12-30 Ian Lance Taylor <iant@google.com>
10878
10879 PR 10916
10880 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10881 symbols from this object, don't change the visibility of an
10882 undefined symbol.
10883 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10884
10885 2009-12-30 Ian Lance Taylor <iant@google.com>
10886
10887 PR 10861
10888 * script.h (class Version_script_info): Define Language enum.
10889 Update declarations. Define Glob, Exact, and Lookup types. Add
10890 new fields globals_, locals_, and is_finalized_.
10891 * script.cc: Various formatting fixes.
10892 (class Parser_closure): Change language_stack_ from a vector of
10893 std::string to one of Version_script_info::Language. Adjust all
10894 uses accordingly.
10895 (class Lazy_demangler): Remove.
10896 (struct Version_expression): Change language from std::string to
10897 Version_script_info::Language.
10898 (Version_script_info::Version_script_info): New function.
10899 (Version_script_info::~Version_script_info): Don't call clear.
10900 (Version_script_info::finalize): New function.
10901 (Version_script_info::build_lookup_tables): New function.
10902 (Version_script_info::build_expression_list_lookup): New
10903 function.
10904 (Version_script_info::get_symbol_version_helper): Rewrite to use
10905 lookup tables.
10906 (Version_script_info::print_expression_list): Adjust to use
10907 Version_script_info::Language.
10908 (script_push_lex_into_version_mode): Check that the version script
10909 has not been finalized.
10910 (version_script_push_lang): Change language string to
10911 Version_script_info::Language.
10912 * options.cc (Command_line::version_script): New function.
10913 * options.h (class General_options): Add finalize_dynamic_list
10914 function. Change version_script from declaration to definition.
10915 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10916 * testsuite/version_script.map: Remove duplicate def of foo.
10917 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10918 version_script.map.
10919 * testsuite/Makefile.in: Rebuild.
10920
10921 2009-12-30 Ian Lance Taylor <iant@google.com>
10922
10923 PR 10843
10924 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10925 if the input symbol index is 0, make the output symbol index 0.
10926
10927 2009-12-30 Ian Lance Taylor <iant@google.com>
10928
10929 PR 10670
10930 * options.h (class General_options): Add -x/--discard-all.
10931 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10932 --discard-all. If the local symbol needs a dynamic entry, check
10933 that before handling --discard-locals.
10934
10935 2009-12-30 Ian Lance Taylor <iant@google.com>
10936
10937 PR 10450
10938 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10939 flags to PF_R.
10940 (Output_segment::add_output_section): Don't change the flags if
10941 the type is PT_TLS.
10942
10943 PR 10450
10944 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10945 GNU hash table if they need a dynamic value. Otherwise, don't add
10946 them if they are defined in a dynamic object or are forced local.
10947
10948 2009-12-29 Ian Lance Taylor <iant@google.com>
10949
10950 PR 10450
10951 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10952 .gnu.hash table for a 32-bit target.
10953
10954 PR 10450
10955 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10956 regular and a dynamic object only needs a dynamic symbol table
10957 entry if it is externally visible.
10958
10959 PR 10450
10960 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10961 constructor. Add global_offset_table_ field.
10962 (Target_i386::got_section): Set global_offset_table_.
10963 (Target_i386::do_finalize_sections): Set global_offset_table_
10964 size.
10965 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10966 in constructor. Add global_offset_table_ field.
10967 (Target_x86_64::got_section): Set global_offset_table_.
10968 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10969 size.
10970
10971 * layout.cc (Layout::Layout): Initialize increase_relro_.
10972 (Layout::get_output_section): Add is_relro, is_last_relro, and
10973 is_first_non_relro parameters. Change all callers.
10974 (Layout::choose_output_section): Likewise.
10975 (Layout::add_output_section_data): Likewise.
10976 (Layout::make_output_section): Likewise.
10977 (Layout::set_segment_offsets): Clear increase_relro when using a
10978 linker script.
10979 * layout.h (class Layout): Add increase_relro method. Add
10980 increase_relro_ field. Update declarations.
10981 * output.cc (Output_section::Output_section): Initialize
10982 is_last_relro_ and is_first_non_relro_.
10983 (Output_segment::add_output_section): Group relro sections is
10984 do_sort is true. Handle is_last_relro and is_first_non_relro.
10985 (Output_segment::maximum_alignment): Remove relro handling.
10986 (Output_segment::set_section_addresses): Add increase_relro
10987 parameter. Change all callers. Add initial alignment to align
10988 relro sections on separate page. Remove old relro handling.
10989 (Output_segment::set_section_list_addresses): Remove in_relro
10990 parameter. Change all callers.
10991 (Output_segment::set_offset): Add increase parameter. Change all
10992 callers. Remove old relro handling.
10993 * output.h (class Output_section): Add new methods: is_last_relro,
10994 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10995 Add is_last_relro_ and is_first_non_relro_ fields.
10996 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10997 Create separate .got.plt section. Call increase_relro.
10998 * x86_64.cc (Target_x86_64::got_section): Likewise.
10999 * testsuite/relro_script_test.t: Add .got.plt.
11000
11001 PR 10450
11002 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11003 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11004 (Layout::finalize): Call set_dynamic_symbol_size.
11005 (Layout::set_dynamic_symbol_size): New function.
11006 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11007 set_dynamic_symbol_size.
11008
11009 PR 10450
11010 * output.h (class Output_section): Add is_entsize_zero_ field.
11011 * output.cc (Output_section::Output_section): Initialize
11012 is_entsize_zero_.
11013 (Output_section::set_entsize): If two different entsizes are
11014 requested, force it to zero.
11015 (Output_section::add_input_section): Set flags for .debug_str
11016 before updating section flags. Set entsize.
11017 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11018 and SHF_STRING if all input sections have those flags.
11019
11020 2009-12-29 Rafael Espindola <espindola@google.com>
11021
11022 * main.cc (main): Fix the sys time reporting.
11023 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11024 reporting.
11025
11026 2009-12-29 Sriraman Tallam <tmsriram@google.com>
11027
11028 * options.cc (General_options::parse_version): Allow -v to exit
11029 without an error if there is nothing to link.
11030
11031 2009-12-29 Ian Lance Taylor <iant@google.com>
11032
11033 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11034 using a version of gcc before 4.1.
11035 * configure: Rebuild.
11036
11037 2009-12-28 Chris Demetriou <cgd@google.com>
11038
11039 * attributes.cc (Output_attributes_section_data::do_write): Use
11040 std::vector::front rather than std::vector::data.
11041
11042 2009-12-28 Ian Lance Taylor <iant@google.com>
11043
11044 * symtab.h (class Symbol_table): Add enum Defined.
11045 * resolve.cc (Symbol_table::should_override): Add defined
11046 parameter. Change all callers. Test whether object is NULL
11047 before calling a method on it.
11048 (Symbol_table::report_resolve_problem): Add defined parameter.
11049 Change all callers.
11050 (Symbol_table::should_override_with_special): Likewise.
11051 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11052 parameter. Change all callers.
11053 (Symbol_table::do_define_in_output_data): Likewise.
11054 (Symbol_table::define_in_output_segment): Likewise.
11055 (Symbol_table::do_define_in_output_segment): Likewise.
11056 (Symbol_table::define_as_constant): Likewise.
11057 (Symbol_table::do_define_as_constant): Likewise.
11058 * script.h (class Symbol_assignment): Add is_defsym parameter to
11059 constructor; change all callers.
11060 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11061 parameter. Change all callers. Add is_defsym_ field.
11062 (class Parser_closure): Add parsing_defsym parameter to
11063 constructor; change all callers. Add parsing_defsym accessor
11064 function. Add parsing_defsym_ field.
11065
11066 2009-12-28 Ian Lance Taylor <iant@google.com>
11067
11068 * gold.cc (queue_middle_tasks): Fix formatting.
11069 * object.cc (Relobj::is_section_name_included): Likewise.
11070
11071 2009-12-23 Ian Lance Taylor <iant@google.com>
11072
11073 * i386.cc (Target_i386::do_calls_non_split): Recognize
11074 -fsplit-stack prologue for a function with a static chain.
11075 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11076 -fsplit-stack prologue when using %r11.
11077
11078 2009-12-21 Sriraman Tallam <tmsriram@google.com>
11079
11080 * options.cc (General_options::parse_version): Make -v continue and do
11081 the link like GNU ld does.
11082
11083 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
11084
11085 * Makefile.am (CCFILES): Add timer.cc.
11086 (HFILES): Add timer.h.
11087 * configure.ac: Check for sysconf and times.
11088 * main.cc: include timer.h.
11089 (main): Use Timer instead of get_run_time.
11090 * timer.cc: New.
11091 * timer.h: New.
11092 * workqueue.cc: include timer.h.
11093 (Workqueue::find_and_run_task):
11094 Report user, sys and wall time.
11095 * Makefile.in: Regenerate.
11096 * config.in: Regenerate.
11097 * configure: Regenerate.
11098
11099 2009-12-16 Doug Kwan <dougkwan@google.com>
11100
11101 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11102 sections.
11103 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11104 relaxed input sections.
11105 * output.cc (Output_section::find_relaxed_input_section): Change
11106 return type to Output_relaxed_input_section pointer. Adjust code
11107 for new type of relaxed_input_section_map_.
11108 * output.h (Output_section::find_relaxed_input_section): Change
11109 return type to Output_relaxed_input_section pointer.
11110 (Output_section::Output_relaxed_input_section_by_input_section_map):
11111 New type.
11112 (Output_section::relaxed_input_section_map_): Change type to
11113 Output_section::Output_relaxed_input_section_by_input_section_map.
11114 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11115 input section.
11116
11117 2009-12-15 Ian Lance Taylor <iant@google.com>
11118
11119 * layout.cc (Layout::create_shstrtab): Only write out after input
11120 sections if we are compressing debug sections.
11121
11122 2009-12-15 Ian Lance Taylor <iant@google.com>
11123
11124 * archive.cc (Archive::add_symbols): Only look up a symbol without
11125 a version if there is, in fact, a version.
11126
11127 2009-12-14 Ian Lance Taylor <iant@google.com>
11128
11129 Revert -Wshadow changes, all changes from:
11130 2009-12-11 Doug Kwan <dougkwan@google.com>
11131 2009-12-11 Nick Clifton <nickc@redhat.com>
11132 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11133
11134 2009-12-11 Doug Kwan <dougkwan@google.com>
11135
11136 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11137 due to -Wshadow.
11138 * attributes.cc (Object_attribute::size): Ditto.
11139 (Attributes_section_data::size): Ditto.
11140 (Attributes_section_data::Attributes_section_data): Ditto.
11141 (Output_attributes_section_data::do_write): Ditto.
11142 * attributes.h (Object_attribute::set_type): Ditto.
11143 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11144
11145 2009-12-11 Nick Clifton <nickc@redhat.com>
11146
11147 * archive.cc: Fix shadowed variable warnings.
11148 * arm.cc: Likewise.
11149 * compressed_output.cc: Likewise.
11150 * compressed_output.h: Likewise.
11151 * configure: Likewise.
11152 * dwarf_reader.cc: Likewise.
11153 * dynobj.cc: Likewise.
11154 * dynobj.h: Likewise.
11155 * ehframe.cc: Likewise.
11156 * ehframe.h: Likewise.
11157 * errors.cc: Likewise.
11158 * expression.cc: Likewise.
11159 * fileread.cc: Likewise.
11160 * fileread.h: Likewise.
11161 * freebsd.h: Likewise.
11162 * i386.cc: Likewise.
11163 * icf.cc: Likewise.
11164 * incremental.h: Likewise.
11165 * layout.cc: Likewise.
11166 * layout.h: Likewise.
11167 * mapfile.cc: Likewise.
11168 * merge.cc: Likewise.
11169 * merge.h: Likewise.
11170 * object.cc: Likewise.
11171 * object.h: Likewise.
11172 * options.h: Likewise.
11173 * output.cc: Likewise.
11174 * output.h: Likewise.
11175 * parameters.cc: Likewise.
11176 * plugin.cc: Likewise.
11177 * powerpc.cc: Likewise.
11178 * reduced_debug_output.cc: Likewise.
11179 * reduced_debug_output.h: Likewise.
11180 * reloc.cc: Likewise.
11181 * reloc.h: Likewise.
11182 * resolve.cc: Likewise.
11183 * script-sections.cc: Likewise.
11184 * script.cc: Likewise.
11185 * script.h: Likewise.
11186 * sparc.cc: Likewise.
11187 * symtab.cc: Likewise.
11188 * symtab.h: Likewise.
11189 * target-select.cc: Likewise.
11190 * target-select.h: Likewise.
11191 * token.h: Likewise.
11192 * workqueue.cc: Likewise.
11193 * workqueue.h: Likewise.
11194 * x86_64.cc: Likewise.
11195
11196 2009-12-10 Doug Kwan <dougkwan@google.com>
11197
11198 * arm.cc (attributes.h): New include.
11199 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11200 (Arm_relobj::~Arm_relobj): Delete object pointed by
11201 attributes_section_data_.
11202 (Arm_relobj::attributes_section_data): New method definition.
11203 (Arm_relobj::attributes_section_data_): New data member declaration.
11204 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11205 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11206 attributes_section_data_.
11207 (Arm_dynobj::attributes_section_data): New method definition.
11208 (Arm_dynobj::attributes_section_data_): New data member declaration.
11209 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11210 initialization value of may_use_blx_ to false.
11211 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
11212 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11213 object attributes to compute results instead of hard-coding.
11214 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11215 Target_arm::get_secondary_compatible_arch,
11216 Target_arm::set_secondary_compatible_arch
11217 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11218 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11219 New method declarations.
11220 (Target_arm::get_aeabi_object_attribute): New method definition.
11221 (Target_arm::attributes_section_data_): New data member declaration.
11222 (read_arm_attributes_section): New template definition.
11223 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11224 (Arm_dynobj::do_read_symbols): Ditto.
11225 (Target_arm::do_finalize_sections): Merge attributes sections from
11226 input. Check for BLX use after attributes section merging.
11227 Fix __exidx_start and __exidx_end visibility. Create an
11228 .ARM.attributes section if necessary.
11229 (Target_arm::get_secondary_compatible_arch,
11230 Target_arm::set_secondary_compatible_arch,
11231 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11232 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
11233 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
11234 New method definitions.
11235
11236 2009-12-09 Ian Lance Taylor <iant@google.com>
11237
11238 * plugin.cc (Plugin::load): Don't cast from void* to a function
11239 pointer.
11240
11241 2009-12-09 Ian Lance Taylor <iant@google.com>
11242
11243 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11244 information fields.
11245
11246 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11247
11248 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11249 Replace two_file_shared_1.so with two_file_shared_2.so.
11250 * testsuite/Makefile.in: Regenerated.
11251
11252 2009-12-08 Doug Kwan <dougkwan@google.com>
11253
11254 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11255 (HFILES): Add attributes.h and int_encoding.h.
11256 * Makefile.in: Regenerate.
11257 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11258 function definitions to int_encoding.cc
11259 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11260 prototypes to int_encoding.h
11261 * reduced_debug_output.cc (int_encoding.h): New include.
11262 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11263 function definitions to int_encoding.cc
11264 (insert_into_vector, read_from_pointer): Move template definitions to
11265 int_encoding.h
11266 * attributes.cc: New file.
11267 * attributes.h: New file.
11268 * int_encoding.cc: New file.
11269 * int_encoding.h: New file.
11270
11271 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
11272
11273 PR gold/11055
11274 * incremental-dump.cc (dump_incremental_inputs): New.
11275 (main): Use dump_incremental_inputs.
11276
11277 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11278
11279 PR gold/10893
11280 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11281 checking elfcpp::STT_FUNC.
11282 (Target_i386::Relocate::relocate): Likewise.
11283 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11284
11285 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11286 symbols from shared libraries into normal FUNC symbols.
11287
11288 * symtab.h (Symbol): Add is_func and use it.
11289
11290 2009-12-05 Doug Kwan <dougkwan@google.com>
11291
11292 * arm.cc (Target_arm::arm_info): Initialize new fields
11293 attributes_section and attributes_vendor.
11294 * i386.cc (Target_i386::i386_info): Same.
11295 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11296 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11297 fields attributes_section and attributes_vendor.
11298 * sparc.cc (Target_sparc::sparc_info): Same.
11299 * target.h (Target::attributes_section, Target::attributes_vendor,
11300 Target::is_attributes_section, Target::attribute_arg_type,
11301 Target::attributes_order): New method definitions.
11302 (Target::Target_info::attributes_section,
11303 Target::Target_info::attributes_vendor): New fields.
11304 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11305 virtual method definitions.
11306 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11307 attributes_section and attributes_vendor.
11308 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11309
11310 2009-12-05 Doug Kwan <dougkwan@google.com>
11311
11312 * arm.cc: Update comments about interworking and stub generation.
11313 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11314 considered as non-PIC.
11315 (Arm_relocate_functions::base_abs): Fix formatting.
11316 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11317 of function to use GOT entry address instead of offset.
11318 (Target_arm::Scan::global): Issue an error if a symbol would need a
11319 PLT does not get one because it is untyped. Remove code to create
11320 dynamic symbols for relative branches.
11321 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11322 takes unsigned integer instead of boolean.
11323
11324 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11325
11326 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11327 (two_file_test_LDADD): Likewise.
11328 (common_test_1_LDADD): Likewise.
11329 (exception_test_LDADD) Likewise.
11330 (weak_test_LDADD): Likewise.
11331 (many_sections_test_LDADD): Likewise.
11332 (initpri1_LDADD): Likewise.
11333 (script_test_1_LDADD): Likewise.
11334 (script_test_2_LDADD): Likewise.
11335 (justsyms_LDADD): Likewise.
11336 (binary_test_LDADD): Likewise.
11337 (large_LDADD): Likewise.
11338 * testsuite/Makefile.in: Regenerated.
11339
11340 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
11341
11342 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11343 (Symbol_table::override_with_special): Likewise.
11344 (Symbol_table::add_from_object): Likewise.
11345
11346 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11347
11348 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11349 Don't set the data_offset twice.
11350
11351 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
11352
11353 * testsuite/Makefile.in: Regenerate.
11354
11355 2009-12-03 Doug Kwan <dougkwan@google.com>
11356
11357 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11358 (Target_arm::do_finalize_sections): Add parameter for symbol table
11359 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11360 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11361 parameter for symbol table pointer.
11362 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11363 an additional parameter for a pointer to symbol table.
11364 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11365 parameter for a symbol table pointer.
11366 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11367 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11368 Ditto.
11369 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11370 parameter for a symbol table pointer.
11371
11372 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
11373
11374 * incremental.cc (Incremental_inputs_header)
11375 (Incremental_inputs_header_write, Incremental_inputs_entry)
11376 (Incremental_inputs_entry_write): Move ...
11377 * incremental.h (Incremental_inputs_header)
11378 (Incremental_inputs_header_write, Incremental_inputs_entry)
11379 (Incremental_inputs_entry_write): here.
11380
11381 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11382
11383 * incremental.cc (make_sized_incremental_binary): Set the target.
11384 Error if it is incompatible.
11385 * output.h (Output_file): Add filename method.
11386
11387 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11388
11389 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11390 from the get_* methods.
11391
11392 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11393
11394 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11395 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11396 Write 0 for the data_offset of scripts.
11397
11398 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
11399
11400 * testsuite/Makefile.am: Add the incremental_test.sh test.
11401 * testsuite/incremental_test.sh: New.
11402 * testsuite/incremental_test_1.c: New.
11403 * testsuite/incremental_test_2.c: New.
11404
11405 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
11406
11407 * incremental-dump.cc (main): Fix typos.
11408
11409 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
11410
11411 PR gold/11025
11412 * incremental-dump.cc (main): Use llu to print 64 bit values.
11413
11414 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11415 H.J. Lu <hongjiu.lu@intel.com>
11416
11417 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11418 $(LIBDL).
11419 (incremental_dump_LDADD): Likewise.
11420 * Makefile.in: Regenerated.
11421
11422 2009-11-25 Doug Kwan <dougkwan@google.com>
11423
11424 Revert:
11425
11426 2009-11-25 Doug Kwan <dougkwan@google.com>
11427
11428 * arm.cc (Target_arm::Target_arm): Move method definition
11429 outside of class definition. Add code to handle
11430 --target1-rel, --target1-abs and --target2= options.
11431 (Target_arm::get_reloc_reloc_type): Change method to be
11432 non-static and const.
11433 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11434 New data member declaration.
11435 (Target_arm::Scan::local, Target_arm::Scan::global,
11436 Target_arm::Relocate::relocate,
11437 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11438 Adjust call to Target_arm::get_real_reloc_type.
11439 (Target_arm::get_real_reloc_type): Use command line options
11440 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11441 * options.h (--target1-rel, --target1-abs, --target2): New
11442 ARM-only options.
11443
11444 2009-11-25 Doug Kwan <dougkwan@google.com>
11445
11446 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11447 class definition. Add code to handle --target1-rel, --target1-abs
11448 and --target2= options.
11449 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11450 and const.
11451 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11452 member declaration.
11453 (Target_arm::Scan::local, Target_arm::Scan::global,
11454 Target_arm::Relocate::relocate,
11455 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11456 call to Target_arm::get_real_reloc_type.
11457 (Target_arm::get_real_reloc_type): Use command line options to
11458 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11459 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11460 options.
11461
11462 2009-11-25 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11465 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11466 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11467 formatting.
11468 (Arm_relocate_functions::thm_call): Replace body with a call to
11469 Arm_relocate_functions::thumb_branch_common.
11470 (Arm_relocate_functions::thm_jump24,
11471 Arm_relocate_functions::thm_xpc22): New method definitions.
11472 (Arm_relocate_functions::thumb_branch_common): New method definition.
11473 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11474 operator.
11475 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11476 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11477
11478 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11479
11480 * Makefile.am: Build incremental-dump
11481 * Makefile.in: Regenerate.
11482 * incremental-dump.cc: New.
11483 * incremental.cc (Incremental_inputs_header_data,
11484 Incremental_inputs_entry_data): Move to incremental.h
11485 * incremental.h: (Incremental_inputs_header_data,
11486 Incremental_inputs_entry_data): Move from incremental.cc
11487
11488 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11489
11490 * incremental.cc (Incremental_inputs_header,
11491 Incremental_inputs_header_write, Incremental_inputs_entry,
11492 Incremental_inputs_entry_write): Add a typedef with the data type.
11493
11494 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
11495
11496 * incremental.cc (Incremental_inputs_header,
11497 Incremental_inputs_header_write, Incremental_inputs_entry,
11498 Incremental_inputs_entry_write): Update comment about which
11499 type has the filed descriptions.
11500
11501 2009-11-15 Doug Kwan <dougkwan@google.com>
11502
11503 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11504 (Arm_relocate_functions::arm_branch_common): Change method defintion
11505 in class definition to a method declaration and update list of formal
11506 parameters.
11507 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11508 Arm_relocation_functions::jump24): Adjust call to
11509 Arm_relocate_functions::arm_branch_common. Update list of formal
11510 parameters.
11511 (Arm_relocate_functions::xpc25): New method definition.
11512 (Arm_relocate_functions::arm_branch_common): Move method defintion
11513 out from class definition. Use stubs for mode-switching and extending
11514 branch ranges.
11515 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11516 specially. Change code to enable use of stubs in ARM branches.
11517
11518 2009-11-10 Doug Kwan <dougkwan@google.com>
11519
11520 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11521 in method declaration.
11522 (Target_arm::relocate_stub): New method declaration.
11523 (Target_arm::default_target): Change to return a pointer instead of
11524 a const reference.
11525 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11526 Target_arm::default_target.
11527 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11528 method definition.
11529 (Target_arm::relocate_section): Adjust view.
11530 (Target_arm::relocate_stub): New method definition.
11531
11532 2009-11-10 Doug Kwan <dougkwan@google.com>
11533
11534 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11535 a format warning.
11536 * incremental.cc (open_incremental_binary): Initialized local
11537 variables to avoid warnings.
11538 * object.cc (make_elf_object): Ditto.
11539 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11540 a format warning.
11541
11542 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11543
11544 PR gold/10930
11545 * testsuite/plugin_test.c: Include "config.h".
11546
11547 2009-11-09 Doug Kwan <dougkwan@google.com>
11548
11549 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11550 (arm_symbol_value): Remove.
11551 (Arm_relocate_functions::arm_branch_common,
11552 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11553 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11554 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11555 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11556 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11557 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11558 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11559 Arm_relocate_functions::thm_mobw_abs_nc,
11560 Arm_relocate_functions::thm_mov_abs,
11561 Arm_relocate_functions::movw_prel_nc,
11562 Arm_relocate_functions::thm_movt_abs,
11563 Arm_relocate_functions::movt_prel,
11564 Arm_relocate_functions::thm_movw_prel_nc,
11565 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11566 (Target_arm::Relocate::relocate): Only decompose address into two
11567 parts if relocation type uses the thumb-bit and pass the actual
11568 bit instead of a flag indicating that the thumb-bit is used. Adjust
11569 calls to methods in Arm_relocate_functions for this change.
11570
11571 2009-11-08 Ian Lance Taylor <iant@google.com>
11572
11573 PR 10925
11574 * reloc.cc: Instantiate
11575 Sized_relobj::initialize_input_to_output_maps and
11576 Sized_relobj:free_input_to_output_maps.
11577
11578 2009-11-06 Ian Lance Taylor <iant@google.com>
11579
11580 PR 10876
11581 * defstd.cc (in_segment): Set only_if_ref true for "end".
11582
11583 2009-11-06 Doug Kwan <dougkwan@google.com>
11584
11585 * arm.cc (class Reloc_stub): Correct a comment.
11586 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11587 (Target_arm::scan_section_for_stubs): New method declaration.
11588 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11589 Change methods from private to protected.
11590 (Target_arm::do_may_relax): New method definition.
11591 (Target_arm::do_relax, Target_arm::group_sections,
11592 Target_arm::scan_reloc_for_stub,
11593 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11594 (Target_arm::arm_input_section_map_): New data member declaration.
11595 (Target_arm::scan_reloc_for_stub,
11596 Target_arm::scan_reloc_section_for_stubs,
11597 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11598 Target_arm::do_relax): New method definitions.
11599
11600 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11601
11602 * configure.ac: Check for (struct stat)::st_mtim
11603 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11604 * config.in: Regenerate.
11605 * configure: Regenerate.
11606
11607 2009-11-05 Ian Lance Taylor <iant@google.com>
11608
11609 PR 10910
11610 * output.cc (Output_segment::add_output_section): Add missing
11611 return statement.
11612
11613 2009-11-04 Ian Lance Taylor <iant@google.com>
11614
11615 PR 10880
11616 * object.h (class Object): Add is_needed and set_is_needed
11617 methods. Add is_needed_ field. Make bool fields into bitfields.
11618 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11619 defined in a dynamic object and referenced by a regular object,
11620 set is_needed for the dynamic object.
11621 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11622 if the file is marked with as_needed and it is not needed.
11623
11624 2009-11-04 Ian Lance Taylor <iant@google.com>
11625
11626 PR 10887
11627 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11628 tags if data is discarded by linker script.
11629 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11630 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11631 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11632 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11633
11634 2009-11-04 Ian Lance Taylor <iant@google.com>
11635
11636 * layout.cc (Layout::get_output_section): Add is_interp and
11637 is_dynamic_linker_section parameters. Change all callers.
11638 (Layout::choose_output_section): Likewise.
11639 (Layout::make_output_section): Likewise.
11640 (Layout::add_output_section_data): Add is_dynamic_linker_section
11641 parameter. Change all callers.
11642 * layout.h (class Layout): Update declarations.
11643 * output.h (class Output_section): Add is_interp, set_is_interp,
11644 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11645 Add is_interp_, is_dynamic_linker_section_ fields. Change
11646 generate_code_fills_at_write_ to a bitfield.
11647 * output.cc (Output_section::Output_sections): Initialize new
11648 fields.
11649 (Output_segment::add_output_section): Add do_sort parameter.
11650 Change all callers.
11651
11652 2009-11-03 Ian Lance Taylor <iant@google.com>
11653
11654 PR 10860
11655 * options.h (class General_options): Add --warn-common.
11656 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11657 merging two common symbols.
11658 (Symbol_table::should_override): Handle --warn-common when merging
11659 a common symbol with a defined symbol. Use report_resolve_problem
11660 for multiple definitions.
11661 (Symbol_table::report_resolve_problem): New function.
11662 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11663
11664 2009-11-03 Doug Kwan <dougkwan@google.com>
11665
11666 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11667 stub_factory_.
11668 (Target_arm::stub_factory): New method definition.
11669 (Target_arm::new_arm_input_section,
11670 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11671 Target_arm::reloc_uses_thumb_bit): New method declarations.
11672 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
11673 New type definitions.
11674 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11675 member declarations.
11676 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11677 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11678 New method definitions.
11679
11680 2009-11-03 Ian Lance Taylor <iant@google.com>
11681
11682 * options.h (class General_options): Add --warn_constructors.
11683
11684 2009-11-03 Ian Lance Taylor <iant@google.com>
11685
11686 PR 10893
11687 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11688 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11689
11690 2009-11-03 Ian Lance Taylor <iant@google.com>
11691
11692 PR 10895
11693 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11694 --msgid-bugs-address.
11695 (install-pdf): New target.
11696 (install-data_yes): Look up one directory to find mkinstalldirs.
11697
11698 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11699
11700 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11701 tree.
11702
11703 2009-10-30 Doug Kwan <dougkwan@google.com>
11704
11705 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11706
11707 2009-10-30 Doug Kwan <dougkwan@google.com>
11708
11709 * arm.cc (Stub_addend_reader): New struct template definition
11710 and partial specializations.
11711 (Stub_addend_reader::operator()): New method definition for a
11712 partially specialized template.
11713
11714 2009-10-30 Doug Kwan <dougkwan@google.com>
11715
11716 * arm.cc (Arm_relobj::processor_specific_flags): New method
11717 definition.
11718 (Arm_relobj::do_read_symbols): New method declaration.
11719 (Arm_relobj::processor_specific_flags_): New data member declaration.
11720 (Arm_dynobj): New class definition.
11721 (Target_arm::do_finalize_sections): Add input_objects parameter.
11722 (Target_arm::do_adjust_elf_header): New method declaration.
11723 (Target_arm::are_eabi_versions_compatible,
11724 (Target_arm::merge_processor_specific_flags): New method declaration.
11725 (Target_arm::do_make_elf_object): New overloaded method definitions
11726 and declaration.
11727 (Arm_relobj::do_read_symbols): New method definition.
11728 (Arm_dynobj::do_read_symbols): Ditto.
11729 (Target_arm::do_finalize_sections): Add input_objects parameters.
11730 Merge processor-specific flags from all input objects.
11731 (Target_arm::are_eabi_versions_compatible,
11732 Target_arm::merge_processor_specific_flags,
11733 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11734 New method definitions.
11735 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11736 Input_objects pointer type parameter.
11737 * layout.cc (Layout::finalize): Pass input objects to target's.
11738 finalize_sections function.
11739 * output.cc (Output_file_header::do_sized_write): Set ELF file
11740 header's processor-specific flags.
11741 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11742 Input_objects pointer type parameter.
11743 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11744 * target.h (Input_objects): New forward class declaration.
11745 (Target::processor_specific_flags,
11746 Target::are_processor_specific_flags_sect): New method definitions.
11747 (Target::finalize_sections): Add input_objects parameter.
11748 (Target::Target): Initialize processor_specific_flags_ and
11749 are_processor_specific_flags_set_.
11750 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11751 parameter.
11752 (Target::set_processor_specific_flags): New method definition.
11753 (Target::processor_specific_flags_,
11754 Target::are_processor_specific_flags_set_): New data member
11755 declarations.
11756 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11757 Input_objects pointer type parameter.
11758
11759 2009-10-30 Doug Kwan <dougkwan@google.com>
11760
11761 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11762
11763 2009-10-28 Ian Lance Taylor <iant@google.com>
11764
11765 * object.h (class Relobj): Drop options parameter from
11766 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11767 do_scan_relocs, do_relocate. Change all callers.
11768 (class Sized_relobj): Drop options parameters from
11769 do_gc_process_relocs, do_scan_relocs, do_relocate,
11770 do_relocate_sections, relocate_sections, emit_relocs_scan,
11771 emit_relocs_scan_reltype. Change all callers.
11772 (struct Relocate_info): Remove options field and all references to
11773 it.
11774 * reloc.h (class Read_relocs): Remove options constructor
11775 parameter and options_ field. Change all callers.
11776 (class Gc_process_relocs, class Scan_relocs): Likewise.
11777 (class Relocate_task): Likewise.
11778 * target-reloc.h (scan_relocs): Remove options parameter. Change
11779 all callers.
11780 (scan_relocatable_relocs): Likewise.
11781 * target.h (class Sized_target): Remove options parameter from
11782 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11783 all callers.
11784 * gc.h (gc_process_relocs): Remove options parameter. Change all
11785 callers.
11786 * arm.cc: Update functions to remove options parameters.
11787 * i386.cc: Likewise.
11788 * powerpc.cc: Likewise.
11789 * sparc.cc: Likewise.
11790 * x86_64.cc: Likewise.
11791 * testsuite/testfile.cc: Likewise.
11792
11793 2009-10-28 Doug Kwan <dougkwan@google.com>
11794
11795 * arm.cc (Arm_relobj): New class definition.
11796 (Arm_relobj::scan_sections_for_stubs,
11797 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11798 New method definitions.
11799
11800 2009-10-28 Cary Coutant <ccoutant@google.com>
11801
11802 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11803 (Plugin::cleanup_done_): New member.
11804 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11805 (Plugin_manager::cleanup_done_): Remove.
11806 (Plugin_manager::add_input_file): Edit error message.
11807 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11808 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11809
11810 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11811
11812 * fileread.cc: (File_read::View::~View): Use the new
11813 data_ownership_ filed.
11814 (File_read::~File_read): Dispose the new whole_file_view_.
11815 (File_read::open): Mmap the whole file if needed.
11816 (File_read::open): Use whole_file_view_ instead of contents_.
11817 (File_read::find_view): Use whole_file_view_ if applicable.
11818 (File_read::do_read): Use whole_file_view_ instead of contents_.
11819 (File_read::make_view): Use whole_file_view_ instead of contents_,
11820 update File_read::View::View call.
11821 (File_read::find_or_make_view): Update File_read::View::View
11822 call.
11823 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11824 remove contents_
11825 (File_read::View::Data_ownership): New enum.
11826 (File_read::View::View): Replace bool mapped_ with Data_ownership
11827 argument.
11828 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11829 (File_read::View::data_ownership_): New field.
11830 (File_read::contents_): Remove (replaced by whole_file_view_).
11831 (File_read::whole_file_view_): New field.
11832 * options.h (class General_options): Add --keep-files-mapped.
11833
11834 2009-10-27 Cary Coutant <ccoutant@google.com>
11835
11836 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11837 * testsuite/Makefile.am (plugin_test_5): New test case.
11838 * testsuite/Makefile.in: Regenerate.
11839
11840 2009-10-25 Doug Kwan <dougkwan@google.com>
11841
11842 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11843 from private to protected to allow access by child class.
11844 (Sized_relobj::do_relocate_sections): New method declaration.
11845 (Sized_relobj::relocate_sections): Virtualize.
11846 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
11847 Sized_relobj::relocate_sections. Instantiate template explicitly
11848 for different target sizes and endianity.
11849
11850 2009-10-24 Doug Kwan <dougkwan@google.com>
11851
11852 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11853 (Arm_input_section::as_arm_input_section): New method.
11854 (Arm_output_section): New class definition.
11855 (Arm_output_section::create_stub_group,
11856 Arm_output_section::group_sections): New method definitions.
11857
11858 2009-10-22 Doug Kwan <dougkwan@google.com>
11859
11860 * arm.cc (Arm_input_section): New class definition.
11861 (Arm_input_section::init, Arm_input_section:do_write,
11862 Arm_input_section::set_final_data_size,
11863 Arm_input_section::do_reset_address_and_file_offset): New method
11864 definitions.
11865
11866 2009-10-21 Doug Kwan <dougkwan@google.com>
11867
11868 * arm.cc (Stub_table, Arm_input_section): New forward class
11869 declarations.
11870 (Stub_table): New class defintion.
11871 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11872 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11873 New method definition.
11874
11875 2009-10-21 Doug Kwan <dougkwan@google.com>
11876
11877 * arm.cc: Update copyright comments.
11878 (Target_arm): New forward class template declaration.
11879 (Arm_address): New type.
11880 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11881 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11882 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11883 constants.
11884 (Insn_template): Same.
11885 (DEF_STUBS): New macro.
11886 (Stub_type): New enum type.
11887 (Stub_template): New class definition.
11888 (Stub): Same.
11889 (Reloc_stub): Same.
11890 (Stub_factory): Same.
11891 (Target_arm::Target_arm): Initialize may_use_blx_ and
11892 should_force_pic_veneer_.
11893 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11894 Target_arm::should_force_pic_veneer,
11895 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11896 Target_arm::using_thumb_only, Target_arm:;default_target): New
11897 method defintions.
11898 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11899 New data member declarations.
11900 (Insn_template::size, Insn_template::alignment): New method defintions.
11901 (Stub_template::Stub_template): New method definition.
11902 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11903 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11904 (Stub_factory::Stub_factory): New method definition.
11905 * gold.h (string_hash): New template.
11906 * output.h (Input_section_specifier::hash_value): Use
11907 gold::string_hash.
11908 (Input_section_specifier::string_hash): Remove.
11909 * stringpool.cc (Stringpool_template::string_hash): Use
11910 gold::string_hash.
11911
11912 2009-10-20 Doug Kwan <dougkwan@google.com>
11913
11914 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11915 symbols of relaxed input sections.
11916 * output.h (Output_section::find_relaxed_input_section): Make
11917 method public.
11918
11919 2009-10-16 Doug Kwan <dougkwan@google.com>
11920
11921 * dynobj.cc (Versions::Versions): Initialize version_script_.
11922 Only insert base version symbol definition for a shared object
11923 if version script defines any version versions.
11924 (Versions::define_base_version): New method definition.
11925 (Versions::add_def): Check that base version is not needed.
11926 (Versions::add_need): Define base version lazily.
11927 * dynobj.h (Versions::define_base_version): New method declaration.
11928 (Versions::needs_base_version_): New data member declaration.
11929 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11930 (check_DATA): Add no_version_test.stdout.
11931 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11932 New make rules.
11933 * testsuite/Makefile.in: Regenerate.
11934 * testsuite/no_version_test.c: New file.
11935 * testsuite/no_version_test.sh: Ditto.
11936
11937 2009-10-16 Doug Kwan <dougkwan@google.com>
11938
11939 * expression.cc (class Segment_start_expression): New class definition.
11940 (Segment_start_expression::value): New method definition.
11941 (script_exp_function_segment_start): Return a new
11942 Segment_start_expression.
11943 * gold/script-c.h (script_saw_segment_start_expression): New function
11944 prototype.
11945 * script-sections.cc (Script_sections::Script_sections): Initialize
11946 SAW_SEGMENT_START_EXPRESSION_ to false.
11947 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11948 and -Tbbs options to specify section addresses if given in
11949 command line and no SEGMENT_START expression is seen in a script.
11950 * script-sections.h (Script_sections::saw_segment_start_expression,
11951 Script_sections::set_saw_segment_start_expression): New method
11952 definition.
11953 (Script_sections::saw_segment_start_expression_): New data member
11954 declaration.
11955 * script.cc (script_saw_segment_start_expression): New function.
11956 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11957 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11958 script_test_7.sh and script_test_8.sh.
11959 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11960 script_test_8.stdout.
11961 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11962 (script_test_6, script_test_6.stdout, script_test_7,
11963 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11964 * Makefile.in: Regenerate.
11965 * testsuite/script_test_6.sh: New file.
11966 * testsuite/script_test_6.t: Same.
11967 * testsuite/script_test_7.sh: Same.
11968 * testsuite/script_test_7.t: Same.
11969 * testsuite/script_test_8.sh: Same.
11970
11971 2009-10-16 Doug Kwan <dougkwan@google.com>
11972
11973 * output.cc (Output_segment::set_section_list_address): Cast
11974 expressions to unsigned long long type to avoid format warnings.
11975
11976 2009-10-15 Ian Lance Taylor <iant@google.com>
11977
11978 * script.cc (Script_options::add_symbol_assignment): Always add a
11979 dot assignment to script_sections_.
11980 * script-sections.cc (Script_sections::add_dot_assignment):
11981 Initialize if necessary.
11982
11983 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11984 program headers with no load segment if there is a linker script.
11985
11986 * layout.cc (Layout::set_segment_offsets): Align the file offset
11987 to the segment aligment for -N or -n with no load segment.
11988 * output.cc (Output_segment::add_output_section): Don't crash if
11989 the first section is a TLS section.
11990 (Output_segment::set_section_list_addresses): Print an error
11991 message if the address moves backward in a linker script.
11992 * script-sections.cc
11993 (Output_section_element_input::set_section_addresses): Don't
11994 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11995 (Orphan_output_section::set_section_addresses): Likewise.
11996
11997 2009-10-15 Doug Kwan <dougkwan@google.com>
11998
11999 * layout.cc (Layout::finish_dynamic_section): Generate tags
12000 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12001 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12002 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12003
12004 2009-10-14 Ian Lance Taylor <iant@google.com>
12005
12006 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12007 fields.
12008 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12009 data_shdr fields of relinfo.
12010 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12011 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12012 R_386_TLS_LDO_32, adjust based on section flags.
12013 (Target_i386::Relocate::fix_up_ldo): Remove.
12014
12015 2009-10-13 Ian Lance Taylor <iant@google.com>
12016
12017 Add support for -pie.
12018 * options.h (class General_options): Add -pie and
12019 --pic-executable.
12020 (General_options::output_is_position_independent): Test -pie.
12021 (General_options::output_is_executable): Return true if not shared
12022 and not relocatable.
12023 (General_options::output_is_pie): Remove.
12024 * options.cc (General_options::finalize): Reject incompatible uses
12025 of -pie.
12026 * gold.cc (queue_middle_tasks): A -pie link is not static.
12027 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12028 * symtab.cc (Symbol::final_value_is_known): Return false if
12029 output_is_position_independent.
12030 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12031 output_is_position_independent.
12032 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12033 output_is_position_independent.
12034 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12035 output_is_position_independent.
12036 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12037 two_file_pie_test.
12038 (basic_pie_test.o, basic_pie_test): New targets.
12039 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12040 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12041 (two_file_pie_test): New target.
12042 * testsuite/Makefile.in: Rebuild.
12043 * README: Remove note saying that -pie is not supported.
12044
12045 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12046
12047 * options.h (class General_options): Add -init and -fini.
12048 * layout.cc (Layout::finish_dynamic_section): Emit
12049 given init and fini functions.
12050
12051 2009-10-13 Sriraman Tallam <tmsriram@google.com>
12052
12053 * gc.h (gc_process_relocs): Check if icf is enabled using new
12054 function.
12055 * gold.cc (queue_initial_tasks): Likewise.
12056 (queue_middle_tasks): Likewise.
12057 * object.cc (do_layout): Likewise.
12058 * symtab.cc (is_section_folded): Likewise.
12059 * main.cc (main): Likewise.
12060 * reloc.cc (Read_relocs::run): Likewise.
12061 (Sized_relobj::do_scan_relocs): Likewise.
12062 * icf.cc (is_function_ctor_or_dtor): New function.
12063 (Icf::find_identical_sections): Check if function is ctor or dtor when
12064 safe icf is chosen.
12065 * options.h (General_options::icf): Change option to be an enum.
12066 (Icf_status): New enum.
12067 (icf_enabled): New method.
12068 (icf_safe_folding): New method.
12069 (set_icf_status): New method.
12070 (icf_status_): New variable.
12071 * (options.cc) (General_options::finalize): Set icf_status_.
12072 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12073 icf_test and icf_keep_unique_test to use the --icf enum flag.
12074 * testsuite/icf_safe_test.sh: New file.
12075 * testsuite/icf_safe_test.cc: New file.
12076
12077 2009-10-12 Sriraman Tallam <tmsriram@google.com>
12078
12079 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12080 includes to gc.h and icf.h.
12081 * arm.cc: Include gc.h.
12082 * gold.cc: Likewise.
12083 * i386.cc: Likewise.
12084 * powerpc.cc: Likewise.
12085 * sparc.cc: Likewise.
12086 * x86_64.cc: Likewise.
12087 * gc.h: Include icf.h.
12088
12089 2009-10-11 Ian Lance Taylor <iant@google.com>
12090
12091 * plugin.cc: Include "gold.h" before other header files.
12092
12093 2009-10-10 Chris Demetriou <cgd@google.com>
12094
12095 * options.h (Input_file_argument::Input_file_type): New enum.
12096 (Input_file_argument::is_lib_): Replace with...
12097 (Input_file_argument::type_): New member.
12098 (Input_file_argument::Input_file_argument): Take Input_file_type
12099 'type' rather than boolean 'is_lib' as second argument.
12100 (Input_file_argument::is_lib): Use type_.
12101 (Input_file_argument::is_searched_file): New function.
12102 (Input_file_argument::may_need_search): Handle is_searched_file.
12103 * options.cc (General_options::parse_library): Support -l:filename.
12104 (General_options::parse_just_symbols): Update for Input_file_argument
12105 changes.
12106 (Command_line::process): Likewise.
12107 * archive.cc (Archive::get_file_and_offset): Likewise.
12108 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12109 * script.cc (read_script_file, script_add_file): Likewise.
12110 * fileread.cc (Input_file::Input_file): Likewise.
12111 (Input_file::will_search_for): Handle is_searched_file.
12112 (Input_file::open): Likewise.
12113 * readsyms.cc (Read_symbols::get_name): Likewise.
12114 * testsuite/Makefile.am (searched_file_test): New test.
12115 * testsuite/Makefile.in: Regenerate.
12116 * testsuite/searched_file_test.cc: New file.
12117 * testsuite/searched_file_test_lib.cc: New file.
12118
12119 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12120 Ian Lance Taylor <iant@google.com>
12121
12122 * descriptor.cc: Include <cstdio> and "binary-io.h".
12123 (Descriptors::open): Open the files in binary mode always.
12124 * script.cc (Lex::get_token): Treat \r as whitespace.
12125
12126 2009-10-09 Ian Lance Taylor <iant@google.com>
12127
12128 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12129
12130 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12131 Ian Lance Taylor <iant@google.com>
12132
12133 * configure.ac: Check for readv function also.
12134 * fileread.cc (readv): Define if not HAVE_READV.
12135 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12136 does not exist.
12137 * config.in: Regenerate.
12138 * configure: Regenerate.
12139
12140 2009-10-09 Doug Kwan <dougkwan@google.com>
12141
12142 * layout.cc (Layout::make_output_section): Call target hook to make
12143 ordinary output section.
12144 (Layout::finalize): Adjust parameter list of call the
12145 Target::may_relax().
12146 * layout.h (class Layout::section_list): New method.
12147 * merge.h (Output_merge_base::entsize): Change visibility to public.
12148 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12149 New methods.
12150 (Output_merge_string::do_is_string): New method.
12151 * object.cc (Sized_relobj::do_setup): renamed from
12152 Sized_relobj::set_up.
12153 * object.h (Sized_relobj::adjust_shndx,
12154 Sized_relobj::initializ_input_to_output_maps,
12155 Sized_relobj::free_input_to_output_maps): Change visibilities to
12156 protected.
12157 (Sized_relobj::setup): Virtualize.
12158 (Sized_relobj::do_setup): New method declaration.
12159 (Sized_relobj::invalidate_section_offset,
12160 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12161 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12162 * options.cc (parse_int): New function.
12163 * options.h (parse_int): New declaration.
12164 (DEFINE_int): New macro.
12165 (stub_group_size): New option.
12166 * output.cc (Output_section::Output_section): Initialize memebers
12167 merge_section_map_, merge_section_by_properties_map_,
12168 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12169 (Output_section::add_input_section): Handled deferred code-fill
12170 generation and remove an old comment.
12171 (Output_section::add_relaxed_input_section): New method definition.
12172 (Output_section::add_merge_input_section): Use merge section by
12173 properties map to speed to search. Update merge section maps
12174 as appropriate.
12175 (Output_section::build_relaxation_map): New method definition.
12176 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12177 Same.
12178 (Output_section::relax_input_section): Renamed to
12179 Output_section::convert_input_sections_to_relaxed_sections and change
12180 interface to take a vector of pointers to relaxed sections.
12181 (Output_section::find_merge_section,
12182 Output_section::find_relaxed_input_section): New method definitions.
12183 (Output_section::is_input_address_mapped,
12184 Output_section::output_offset, Output_section::output_address):
12185 Use output section data maps to speed up searching.
12186 (Output_section::find_starting_output_address): Add comments.
12187 (Output_section::do_write,
12188 Output_section::write_to_postprocessing_buffer): Do code-fill
12189 generation as appropriate.
12190 (Output_section::get_input_sections): Invalidate relaxed input section
12191 map.
12192 (Output_section::restore_states): Adjust type of checkpoint .
12193 Invalidate relaxed input section map.
12194 * output.h (Output_merge_base): New class declaration.
12195 (Input_section_specifier): New class defintion.
12196 (class Output_relaxed_input_section) Change base class to
12197 Output_section_data_build.
12198 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12199 base class initializer.
12200 (Output_section::add_relaxed_input_section): New method declaration.
12201 (Output_section::Input_section): Change visibility to protected.
12202 (Output_section::Input_section::relobj,
12203 Output_section::Input_section::shndx): Handle relaxed input sections.
12204 Output_section::input_sections) Change visibility to protected. Also
12205 define overload to return a non-const pointer.
12206 (Output_section::Merge_section_properties): New class defintion.
12207 (Output_section::Merge_section_by_properties_map,
12208 Output_section::Output_section_data_by_input_section_map,
12209 Output_section::Relaxation_map): New types.
12210 (Output_section::relax_input_section): Rename method to
12211 Output_section::convert_input_sections_to_relaxed_sections and change
12212 interface to take a vector of relaxed section pointers.
12213 (Output_section::find_merge_section,
12214 Output_section::find_relaxed_input_section,
12215 Output_section::build_relaxation_map,
12216 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12217 New method declarations.
12218 (Output_section::merge_section_map_
12219 Output_section::merge_section_by_properties_map_,
12220 Output_section::relaxed_input_section_map_,
12221 Output_section::is_relaxed_input_section_map_valid_,
12222 Output_section::generate_code_fills_at_write_): New data members.
12223 * script-sections.cc
12224 (Output_section_element_input::set_section_addresses): Call
12225 current_data_size and addralign methods of relaxed input sections.
12226 (Orphan_output_section::set_section_addresses): Call current_data_size
12227 and addralign methods of relaxed input sections.
12228 * symtab.cc (Symbol_table::compute_final_value): Extract template
12229 from the body of Symbol_table::sized_finalize_symbol.
12230 (Symbol_table::sized_finalized_symbol): Call
12231 Symbol_table::compute_final_value.
12232 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12233 (Symbol_table::compute_final_value): New templated method declaration.
12234 * target.cc (Target::do_make_output_section): New method defintion.
12235 * target.h (Target::make_output_section): New method declaration.
12236 (Target::relax): Add more parameters for input objects, symbol table
12237 and layout. Adjust call to do_relax.
12238 (Target::do_make_output_section): New method declaration.
12239 (Target::do_relax): Add parameters for input objects, symbol table
12240 and layout.
12241
12242 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12243
12244 * pread.c: Include stdio.h.
12245
12246 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12247
12248 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12249 defined.
12250
12251 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12252
12253 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12254 Change read_shndx type to unsigned int.
12255 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12256 int.
12257 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12258 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12259 Change read_shndx type to unsigned int.
12260 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12261 int.
12262 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12263 * layout.cc (Layout::create_symtab_sections): Cast the result of
12264 local_symcount * symsize to off_t in the gold_assert.
12265
12266 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12267
12268 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12269 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12270 R_ARM_BASE_ABS.
12271 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12272 (Arm_relocate_functions::thm_abs5): New function.
12273 (Arm_relocate_functions::abs12): New function.
12274 (Arm_relocate_functions::abs16): New function.
12275 (Arm_relocate_functions::base_abs): New function.
12276 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12277 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12278 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12279 R_ARM_BASE_ABS.
12280 (Scan::global): Likewise.
12281 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12282 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12283 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12284 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12285 R_ARM_BASE_ABS.
12286
12287 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12288
12289 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12290 (Arm_relocate_functions::movt_prel): New function.
12291 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12292 (Arm_relocate_functions::thm_movt_prel): New function.
12293 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12294 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12295 (Scan::global, Relocate::relocate): Likewise.
12296 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12297
12298 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12299
12300 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12301 Incremental_checker.
12302 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12303 unsigned int.
12304 (class Incremental_inputs_header): New class.
12305 (Incremental_inputs_header_writer): Edit comment.
12306 (Incremental_inputs_entry): New class.
12307 (Incremental_inputs_entry_writer): Edit comment.
12308 (Sized_incremental_binary::do_find_incremental_inputs_section):
12309 Add *strtab_shndx parameter, fill it.
12310 (Sized_incremental_binary::do_check_inputs): New method.
12311 (Incremental_checker::can_incrementally_link_output_file): Use
12312 Sized_incremental_binary::check_inputs.
12313 (Incremental_inputs::report_command_line): Save command line in
12314 command_line_.
12315 * incremental.h:
12316 (Incremental_binary::find_incremental_inputs_section): New
12317 method.
12318 (Incremental_binary::do_find_incremental_inputs_section): Add
12319 strtab_shndx parameter.
12320 (Incremental_binary::do_check_inputs): New pure virtual method.
12321 (Sized_incremental_binary::do_check_inputs): Declare.
12322 (Incremental_checker::Incremental_checker): Add incremental_inputs
12323 parameter, use it to initialize incremental_inputs_.
12324 (Incremental_checker::incremental_inputs_): New field.
12325 (Incremental_checker::command_line): New method.
12326 (Incremental_checker::inputs): New method.
12327 (Incremental_checker::command_line_): New field.
12328
12329 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12330
12331 * incremental.cc: Include <cstdarg> and "target-select.h".
12332 (vexplain_no_incremental): New function.
12333 (explain_no_incremental): New function.
12334 (Incremental_binary::error): New method.
12335 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12336 method.
12337 (make_sized_incremental_binary): New function.
12338 (open_incremental_binary): New function.
12339 (can_incrementally_link_file): Add checks if output is ELF and has
12340 inputs section.
12341 * incremental.h: Include "elfcpp_file.h" and "output.h".
12342 (Incremental_binary): New class.
12343 (Sized_incremental_binary): New class.
12344 (open_incremental_binary): Declare.
12345 * object.cc (is_elf_object): Use
12346 elfcpp::Elf_recognizer::is_elf_file.
12347 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12348 * output.h (Output_file::filesize): New method.
12349
12350 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12351
12352 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12353 New function.
12354 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12355 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12356 function.
12357 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12358 function.
12359 (Arm_relocate_functions::movw_abs_nc): New function.
12360 (Arm_relocate_functions::movt_abs): New function.
12361 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12362 (Arm_relocate_functions::thm_movt_abs): New function.
12363 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12364 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12365 (Scan::global): Likewise.
12366 (Relocate::relocate): Likewise.
12367 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12368
12369 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12370
12371 * arm.cc (Arm_relocate_functions::got_prel) New function.
12372 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12373 (Relocate::relocate): Likewise.
12374 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12375
12376 2009-10-06 Ian Lance Taylor <iant@google.com>
12377
12378 * options.h (class General_options): Define
12379 split_stack_adjust_size parameter.
12380 * object.h (class Object): Add uses_split_stack_ and
12381 has_no_split_stack_ fields. Add uses_split_stack and
12382 has_no_split_stack accessor functions. Declare
12383 handle_split_stack_section.
12384 (class Reloc_symbol_changes): Define.
12385 (class Sized_relobj): Define Function_offsets. Declare
12386 split_stack_adjust, split_stack_adjust_reltype, and
12387 find_functions.
12388 * object.cc (Object::handle_split_stack_section): New function.
12389 (Sized_relobj::do_layout): Call handle_split_stack_section.
12390 * dynobj.cc (Sized_dynobj::do_layout): Call
12391 handle_split_stack_section.
12392 * reloc.cc (Sized_relobj::relocate_sections): Call
12393 split_stack_adjust for executable sections in split_stack
12394 objects. Pass reloc_map to relocate_section.
12395 (Sized_relobj::split_stack_adjust): New function.
12396 (Sized_relobj::split_stack_adjust_reltype): New function.
12397 (Sized_relobj::find_functions): New function.
12398 * target-reloc.h: Include "object.h".
12399 (relocate_section): Add reloc_symbol_changes parameter. Change
12400 all callers.
12401 * target.h (class Target): Add calls_non_split method. Declare
12402 do_calls_non_split virtual method. Declare match_view and
12403 set_view_to_nop.
12404 * target.cc: Include "elfcpp.h".
12405 (Target::do_calls_non_split): New function.
12406 (Target::match_view): New function.
12407 (Target::set_view_to_nop): New function.
12408 * gold.cc (queue_middle_tasks): Give an error if mixing
12409 split-stack and non-split-stack objects with -r.
12410 * i386.cc (Target_i386::relocate_section): Add
12411 reloc_symbol_changes parameter.
12412 (Target_i386::do_calls_non_split): New function.
12413 * x86_64.cc (Target_x86_64::relocate_section): Add
12414 reloc_symbol_changes parameter.
12415 (Target_x86_64::do_calls_non_split): New function.
12416 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12417 parameter.
12418 * powerpc.cc (Target_powerpc::relocate_section): Add
12419 reloc_symbol_changes parameter.
12420 * sparc.cc (Target_sparc::relocate_section): Add
12421 reloc_symbol_changes parameter.
12422 * configure.ac: Call AM_CONDITIONAL for the default target.
12423 * configure: Rebuild.
12424 * testsuite/Makefile.am (TEST_AS): New variable.
12425 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12426 (check_DATA): Add split_i386 and split_x86_64 files.
12427 (SPLIT_DEFSYMS): Define.
12428 (split_i386_[1234n].o): New targets.
12429 (split_i386_[124]): New targets.
12430 (split_i386_[1234r].stdout): New targets.
12431 (split_x86_64_[1234n].o): New targets.
12432 (split_x86_64_[124]): New targets.
12433 (split_x86_64_[1234r].stdout): New targets.
12434 (MOSTLYCLEANFILES): Add new executables.
12435 * testsuite/split_i386.sh: New file.
12436 * testsuite/split_x86_64.sh: New file.
12437 * testsuite/split_i386_1.s: New file.
12438 * testsuite/split_i386_2.s: New file.
12439 * testsuite/split_i386_3.s: New file.
12440 * testsuite/split_i386_4.s: New file.
12441 * testsuite/split_i386_n.s: New file.
12442 * testsuite/split_x86_64_1.s: New file.
12443 * testsuite/split_x86_64_2.s: New file.
12444 * testsuite/split_x86_64_3.s: New file.
12445 * testsuite/split_x86_64_4.s: New file.
12446 * testsuite/split_x86_64_n.s: New file.
12447 * testsuite/testfile.cc (Target_test): Update relocation_section
12448 function.
12449 * testsuite/Makefile.in: Rebuild.
12450
12451 2009-10-06 Ian Lance Taylor <iant@google.com>
12452
12453 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12454 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12455 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12456 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12457 the address on ldo_addrs_.
12458 (Target_i386::Relocate::fix_up_ldo): New function.
12459
12460 2009-10-06 Rafael Espindola <espindola@google.com>
12461
12462 * plugin.cc (add_input_library): New.
12463 (Plugin::load): Add add_input_library to tv.
12464 (Plugin_manager::add_input_file): Add the is_lib argument.
12465 (add_input_file): Update call to Plugin_manager::add_input_file.
12466 (add_input_library): New.
12467 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12468
12469 2009-09-30 Doug Kwan <dougkwan@google.com>
12470
12471 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12472 symbol and call Symbol::may_need_copy_reloc to determine if
12473 a copy reloc is needed.
12474 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12475 nocopyreloc is given in command line.
12476 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12477 given in command line.
12478 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12479 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12480 of the removed Target_i386::may_need_copy_reloc.
12481 * options.h (copyreloc): New option with default value false.
12482 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12483 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12484 instead of the removed Target_powerpc::may_need_copy_reloc.
12485 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12486 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12487 instead of the removed Target_sparc::may_need_copy_reloc.
12488 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12489 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12490 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12491 instead of the removed Target_x86_64::may_need_copy_reloc.
12492
12493 2009-09-30 Ian Lance Taylor <iant@google.com>
12494
12495 * object.h (class Object): Remove target_ field, and target,
12496 sized_target, and set_target methods.
12497 (Object::sized_target): Remove.
12498 (class Sized_relobj): Update declarations. Remove sized_target.
12499 * object.cc (Sized_relobj::setup): Remove target parameter.
12500 Change all callers.
12501 (Input_objects::add_object): Don't do anything with the target.
12502 (make_elf_sized_object): Add punconfigured parameter. Change all
12503 callers. Set or test parameter target.
12504 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12505 Change all callers.
12506 * parameters.cc (Parameters::set_target): Change parameter type to
12507 be non-const.
12508 (Parameters::default_target): Remove.
12509 (set_parameters_target): Change parameter type to be non-const.
12510 (parameters_force_valid_target): New function.
12511 (parameters_clear_target): New function.
12512 * parameters.h (class Parameters): Update declarations. Remove
12513 default_target method. Add sized_target and clear_target
12514 methods. Change target_ to be non-const.
12515 (set_parameters_target): Update declaration.
12516 (parameters_force_valid_target): Declare.
12517 (parameters_clear_target): Declare.
12518 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12519 as NULL if we aren't searching.
12520 (Add_symbols::run): Don't check for compatible target.
12521 * fileread.cc (Input_file::open_binary): Call
12522 parameters_force_valid_target.
12523 * gold.cc (queue_middle_tasks): Likewise.
12524 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12525 set_target on object.
12526 * dynobj.h (class Sized_dynobj): Update declarations.
12527 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12528 make_elf_object returns NULL.
12529 (Archive::include_member): Don't check whether object target is
12530 compatible.
12531 * output.cc (Output_section::add_input_section): Get target from
12532 parameters.
12533 (Output_section::relax_input_section): Likewise.
12534 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12535 parameters.
12536 (Sized_relobj::do_scan_relocs): Likewise.
12537 (Sized_relobj::relocate_sections): Likewise.
12538 * resolve.cc (Symbol_table::resolve): Likewise.
12539 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12540 parameter. Change all callers.
12541 (Symbol_table::add_from_object): Get target from parameters.
12542 (Symbol_table::add_from_relobj): Don't check object target.
12543 (Symbol_table::add_from_dynobj): Likewise.
12544 (Symbol_table::define_special_symbol): Get target from
12545 parameters.
12546 * symtab.h (class Symbol_table): Update declaration.
12547 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12548 parameter. Change all callers. Clear parameter target.
12549 (Binary_test): Test target here.
12550 * testsuite/object_unittest.cc (gold_testsuite): Remove
12551 target_test_pointer parameter. Change all callers.
12552 (Object_test): Test target here.
12553
12554 2009-09-26 Ian Lance Taylor <iant@google.com>
12555
12556 * testsuite/initpri1.c: Don't try to use constructor priorities if
12557 compiling with gcc before 4.3.
12558
12559 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12560
12561 * testsuite/retain_symbols_file_test.sh (check_present): Change
12562 output file name to retain_symbols_file_test.stdout.
12563 (check_absent): Likewise.
12564
12565 2009-09-18 Craig Silverstein <csilvers@google.com>
12566
12567 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12568 * options.cc: Include <cerrno> and <fstream>.
12569 (General_options::finalize): Parse -retain-symbols-file tag.
12570 * options.h: New flag.
12571 (General_options): New method should_retain_symbol, new
12572 variable symbols_to_retain.
12573 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12574 should_retain_symbol map.
12575 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12576 * testsuite/Makefile.in: Regenerate.
12577 * testsuite/retain_symbols_file_test.sh: New file.
12578
12579 2009-09-18 Nick Clifton <nickc@redhat.com>
12580
12581 * po/es.po: Updated Spanish translation.
12582
12583 2009-09-17 Doug Kwan <dougkwan@google.com>
12584
12585 * debug.h (DEBUG_RELAXATION): New constant.
12586 (DEBUG_ALL): Add DEBUG_RELAXATION.
12587 (debug_string_to_enum): Add relaxation debug option.
12588 * layout.cc
12589 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12590 Layout::Relaxation_debug_check::read_sections,
12591 Layout::Relaxation_debug_check::read_sections): New method definitions.
12592 (Layout::Layout): Initialize data members
12593 record_output_section_data_from_scrips_,
12594 script_output_section_data_list_ and relaxation_debug_check_.
12595 (Layout::save_segments, Layout::restore_segments,
12596 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12597 Layout::relaxation_loop_body): New method definitions.
12598 (Layout::finalize): Support relaxation. Move section layout code to
12599 Layout::relaxation_loop_body.
12600 (Layout::set_asection_address_from_script): Move code for orphan
12601 section placement out.
12602 (Layout::place_orphan_sections_in_script): New method definition.
12603 * layout.h (Output_segment_headers, Output_file_header):
12604 New forward class declarations.
12605 (Layout::~Layout): Define.
12606 (Layout::new_output_section_data_from_script): New method definition.
12607 (Layout::place_orphan_sections_in_script): New method declaration.
12608 (Layout::Segment_states): New type declaration.
12609 (Layout::save_segments, Layout::restore_segments,
12610 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12611 Layout::relaxation_loop_body): New method declarations.
12612 (Layout::Output_section_data_list): New type declaration.
12613 (Layout::Relaxation_debug_check): New class definition.
12614 (Layout::record_output_section_data_from_script_,
12615 Layout::script_output_section_data_list_, Layout::segment_states_,
12616 Layout::relaxation_debug_check_): New data members.
12617 * output.cc: (Output_section_headers::do_size): New method definition.
12618 (Output_section_headers::Output_section_headers): Move size
12619 computation to Output_section_headers::do_size.
12620 (Output_segment_headers::do_size): New method definition.
12621 (Output_file_header::Output_file_header): Move size computation to
12622 Output_file_header::do_size and call it.
12623 (Output_file_header::do_size): New method definition.
12624 (Output_data_group::Output_data_group): Adjust call to
12625 Output_section_data.
12626 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12627 (Output_symtab_xindex::do_write): Add array bound check.
12628 (Output_section::Input_section::print_to_mapfile): Handle
12629 RELAXED_INPUT_SECTION_CODE.
12630 (Output_section::Output_section): Initialize data member checkpoint_.
12631 (Output_section::~Output_section): Delete checkpoint object pointed
12632 by checkpoint_.
12633 (Output_section::add_input_section): Always add an Input_section if
12634 relaxing.
12635 (Output_section::add_merge_input_section): Add assert.
12636 (Output_section::relax_input_section): New method definition.
12637 (Output_section::set_final_data_size): Set load address to zero for
12638 an unallocated section.
12639 (Output_section::do_address_and_file_offset_have_reset_values):
12640 New method definition.
12641 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12642 Handle relaxed input section.
12643 (Output_section::sort_attached_input_sections): Checkpoint input
12644 section list lazily.
12645 (Output_section::get_input_sections): Change type of input_sections to
12646 list of Simple_input_section pointers. Checkpoint input section list
12647 lazily. Also handle relaxed input sections.
12648 (Output_section::add_input_section_for_script): Take a reference to
12649 a Simple_input_section object instead of Relobj pointer and section
12650 index as parameter. Handle relaxed input sections.
12651 (Output_section::save_states, Output_section::restore_states): New
12652 method definitions.
12653 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12654 (Output_data::is_data_size_fixed): New method definition.
12655 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12656 if it is fixed.
12657 (Output_data::address_and_file_offset_have_reset_values): New method
12658 definition.
12659 (Output_data::do_address_and_file_offset_have_reset_values): New method
12660 definition.
12661 (Output_data::set_data_size): Check that data size is not fixed.
12662 (Output_data::fix_data_size): New method definition.
12663 (Output_data::is_data_size_fixed_): New data member.
12664 (Output_section_headers::set_final_data_size): New method definition.
12665 (Output_section_headers::do_size): New method declaration.
12666 (Output_segment_headers::set_final_data_size): New method definition.
12667 (Output_segment_headers::do_size): New method declaration.
12668 (Output_file_header::set_final_data_size)::New method definition.
12669 (Output_file_header::do_size)::New method declaration.
12670 (Output_section_data::Output_section_data): Add new parameter
12671 is_data_size_fixed and use it to fix data size.
12672 (Output_data_const::Output_data_const): Adjust call to base class
12673 constructor and fix data size.
12674 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12675 base class constructor and fix data size.
12676 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12677 base class constructor and fix data size.
12678 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12679 class constructor and fix data size.
12680 (Output_data_group::set_final_data_size): New method definition.
12681 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12682 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12683 class constructor and fix data size.
12684 (Output_relaxed_input_section): New class definition.
12685 (Output_section::Simple_input_section): New class definition.
12686 (Output_section::get_input_sections): Adjust parameter list.
12687 (Output_section::add_input_section_for_script): Same.
12688 (Output_section::save_states, Output_section::restore_states,
12689 Output_section::do_address_and_file_offset_have_reset_values,
12690 (Output_section::Input_section::Input_section): Handle
12691 RELAXED_INPUT_SECTION_CODE. Add new overload for
12692 Output_relaxed_input_section.
12693 (Output_section::Input_section::is_input_section,
12694 Output_section::Input_section::set_output_section): Handle relaxed
12695 input section.
12696 (Output_section::Input_section::is_relaxed_input_section,
12697 Output_section::Input_section::output_section_data,
12698 Output_section::Input_section::relaxed_input_section): New method
12699 definitions.
12700 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12701 value.
12702 (Output_section::Input_section::u1_): Update comments.
12703 (Output_section::Input_section::u2_): Add new union member poris.
12704 (Output_section::Checkpoint_output_section): New classs definition.
12705 (Output_section::relax_input_section): New method declaration.
12706 (Output_section::checkpoint_): New data member.
12707 (Output_segment): Update comments.
12708 (Output_segment::Output_segment): Un-privatize copy constructor.
12709 (Output_segment::operator=): Un-privatize.
12710 * script-sections.cc (Output_section_element::Input_section_list):
12711 Change element type to Output_section::Simple_input_section.
12712 (Output_section_element_dot_assignment::set_section_addresses):
12713 Register output section data for relaxation clean up.
12714 (Output_data_exression::Output_data_expression): Adjust call to base
12715 constructor to fix data size.
12716 (Output_section_element_data::set_section_addresses): Register
12717 Output_data_expression object for relaxation clean up.
12718 (struct Input_section_info): Replace Relobj pointer and section index
12719 pair with Output_section::Simple_input_section and Convert struct to a
12720 class.
12721 (Input_section_sorter::operator()): Adjust access to
12722 Input_section_info data member to use accessors.
12723 (Output_section_element_input::set_section_addresses): Use layout
12724 parameter. Adjust code to use Output_section::Simple_input_section
12725 and Input_secction_info classes. Register filler for relaxation
12726 clean up.
12727 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12728 and section index pair with Output_section::Simple_input_section
12729 class. Adjust code accordingly.
12730 (Phdrs_element::release_segment): New method definition.
12731 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12732 segment list.
12733 (Script_sections::release_segments): New method definition.
12734 * gold/script-sections.h (Script_sections::release_segments): New
12735 method declaration.
12736 * gold/target.h (Target::may_relax, Target::relax,
12737 Target::do_may_relax, Target::do_relax): New method definitions.
12738
12739 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12740
12741 * arm.cc (has_signed_unsigned_overflow): New function.
12742 (Arm_relocate_functions::abs8): New function.
12743 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12744 (Target_arm::Scan::global): Likewise.
12745 (Target_arm::relocate::relocate): Likewise.
12746 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12747 Likewise.
12748
12749 2009-09-16 Cary Coutant <ccoutant@google.com>
12750
12751 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12752 * testsuite/Makefile.in: Regenerate.
12753
12754 2009-09-11 Nick Clifton <nickc@redhat.com>
12755
12756 * po/gold.pot: Updated by the Translation project.
12757
12758 2009-09-08 Cary Coutant <ccoutant@google.com>
12759
12760 * output.cc (Output_file::open): Add execute permission to empty file.
12761 * testsuite/Makefile.am (permission_test): New test.
12762 * testsuite/Makefile.in: Regenerate.
12763
12764 2009-09-02 Ian Lance Taylor <iant@google.com>
12765
12766 * output.cc (Output_file::resize): Call map_no_anonymous rather
12767 than map.
12768
12769 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12770
12771 * gold.cc: Include "incremental.h".
12772 (queue_initial_tasks): Call Incremental_checker methods.
12773 * incremental.cc: Include "output.h".
12774 (Incremental_checker::can_incrementally_link_output_file): New
12775 method.
12776 * incremental.h (Incremental_checker): New class.
12777
12778 * output.cc (Output_file::open_for_modification): New method.
12779 (Output_file::map_anonymous): Changed return type to bool. Record
12780 map in base_ field.
12781 (Output_file::map_no_anonymous): New method, broken out of map.
12782 (Output_file::map): Use map_no_anonymous and map_anonymous.
12783 * output.h (class Output_file): Update declarations.
12784
12785 2009-08-24 Cary Coutant <ccoutant@google.com>
12786
12787 * options.h (Command_line::Pre_options): New class.
12788 (Command_line::pre_options): New member.
12789 * options.cc (gold::options::ready_to_register): New variable.
12790 (One_option::register_option): Do nothing if not registering options.
12791 Assert if same short option registered twice.
12792 (General_options::General_options): Turn off option registration when
12793 done constructing.
12794 (Command_line::Pre_options::Pre_options): New constructor.
12795
12796 2009-08-24 Cary Coutant <ccoutant@google.com>
12797
12798 * options.h (General_options::no_keep_memory): Remove incorrect
12799 short option.
12800
12801 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12802
12803 * Makefile.am (am__skiplex, am__skipyacc): New.
12804 * Makefile.in: Regenerate.
12805
12806 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12807
12808 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12809 (INCLUDES): ... this.
12810 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12811 (AM_CPPFLAGS): Renamed from ...
12812 (INCLUDE): ... this.
12813 * Makefile.in, testsuite/Makefile.in: Regenerate.
12814
12815 * Makefile.in: Regenerate.
12816 * aclocal.m4: Likewise.
12817 * config.in: Likewise.
12818 * configure: Likewise.
12819 * testsuite/Makefile.in: Likewise.
12820
12821 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12822 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12823 * Makefile.in: Regenerate.
12824 * testsuite/Makefile.in: Regenerate.
12825
12826 2009-08-19 Cary Coutant <ccoutant@google.com>
12827
12828 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12829 symbols in shared libraries overridden by hidden or internal symbols
12830 in the main program.
12831
12832 2009-08-19 Chris Demetriou <cgd@google.com>
12833
12834 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12835 checking source file names in error messages.
12836
12837 2009-08-18 Doug Kwan <dougkwan@google.com>
12838
12839 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12840 an elcpp::Ehdr as parameter. Adjust call to set_target.
12841 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12842 an elfcpp::Ehdr as parameter.
12843 * object.cc (Object::set_target): Remove the version that looks up
12844 a target and sets it.
12845 (Sized_relobj::setup): Take a Target object instead of
12846 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12847 (make_elf_sized_object): Find target and ask target to
12848 make an ELF object.
12849 * object.h: (Object::set_target): Remove the version that looks up
12850 a target and sets it.
12851 (Sized_relobj::setup): Take a Target object instead of
12852 an elfcpp:Ehdr as parameter.
12853 * target.cc: Include dynobj.h.
12854 (Target::do_make_elf_object_implementation): New.
12855 (Target::do_make_elf_object): New.
12856 * target.h (Target::make_elf_object): New template declaration.
12857 (Target::do_make_elf_object): New method declarations.
12858 (Target::do_make_elf_object_implementation): New template declaration.
12859
12860 2009-08-14 Ian Lance Taylor <iant@google.com>
12861
12862 * gold.h (FUNCTION_NAME): Define.
12863 (gold_unreachable): Use FUNCTION_NAME.
12864
12865 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12866
12867 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12868 symbol in the --keep-unique list is not found.
12869
12870 2009-08-12 Sriraman Tallam <tmsriram@google.com>
12871
12872 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12873 been maked as --keep-unique.
12874 (Icf::unfold_section): New function.
12875 * icf.h (Icf::unfold_section): New function.
12876 * options.h (General_options::keep_unique): New option.
12877 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12878 * testsuite/Makefile.in: Regenerate.
12879 * testsuite/icf_keep_unique_test.sh: New file.
12880 * testsuite/icf_keep_unique_test.cc: New file.
12881
12882 2009-08-12 Cary Coutant <ccoutant@google.com>
12883
12884 PR 10471
12885 * resolve.cc (Symbol_table::resolve): Check for references from
12886 dynamic objects to hidden and internal symbols.
12887 * testsuite/Makefile.am (hidden_test.sh): New test.
12888 * testsuite/Makefile.in: Regenerate.
12889 * testsuite/hidden_test.sh: New script.
12890 * testsuite/hidden_test_1.c: New test source.
12891 * testsuite/hidden_test_main.c: New test source.
12892
12893 2009-08-11 Doug Kwan <dougkwan@google.com>
12894
12895 * arm.cc: Update comments.
12896 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12897 segment to locate the .ARM.exidx section if present.
12898
12899 2009-08-09 Doug Kwan <dougkwan@google.com>
12900
12901 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12902 patch.
12903
12904 2009-08-07 Sriraman Tallam <tmsriram@google.com>
12905 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12906 compiler warnings.
12907
12908 2009-08-06 Sriraman Tallam <tmsriram@google.com>
12909
12910 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12911 valid tls_segment only for non-debug-section relocations.
12912 * testsuite/Makefile.am: Add gc_tls_test.
12913 * testsuite/Makefile.in: Regenerate.
12914 * testsuite/gc_tls_test.cc: New file.
12915 * testsuite/gc_tls_test.sh: New file.
12916
12917 2009-08-05 Sriraman Tallam <tmsriram@google.com>
12918
12919 * icf.cc: New file.
12920 * icf.h: New file.
12921 * Makefile.am (CCFILES): Add icf.cc.
12922 (HFILES): Add icf.h
12923 * Makefile.in: Regenerate.
12924 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12925 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12926 section, symbol and addend information for the relocs.
12927 * gold.cc (queue_middle_tasks): Call identical code folding.
12928 * gold.h: Add defines for multimap.
12929 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12930 to the call of finalize_local_symbols.
12931 * main.cc (main): Create object of class Icf.
12932 * object.cc (Sized_relobj::do_layout): Allow this function to be
12933 called twice during icf.
12934 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12935 to sections marked as identical by icf.
12936 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12937 when available.
12938 (Sized_relobj::do_section_entsize): New function.
12939 * object.h (Object::section_entsize): New function.
12940 (Object::do_section_entsize): New pure virtual function.
12941 (Relobj::finalize_local_symbols): Add new parameter.
12942 (Relobj::do_section_entsize): New function.
12943 * options.h (General_options::icf): New option.
12944 (General_options::icf_iterations): New option.
12945 (General_options::print_icf_sections): New option.
12946 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12947 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12948 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12949 icf.
12950 * symtab.cc (Symbol_table::is_section_folded): New function.
12951 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12952 to sections marked as identical by icf.
12953 * symtab.h (Symbol_table::set_icf): New function.
12954 (Symbol_table::icf): New function.
12955 (Symbol_table::is_section_folded): New function.
12956 (Symbol_table::icf_): New data member.
12957 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12958 * testsuite/Makefile.am: Add commands to build icf_test.
12959 * testsuite/Makefile.in: Regenerate.
12960 * testsuite/icf_test.sh: New file.
12961 * testsuite/icf_test.cc: New file.
12962
12963 2009-07-24 Chris Demetriou <cgd@google.com>
12964
12965 * layout.cc (is_compressible_debug_section): Fix incorrect
12966 comment about compressed section names.
12967
12968 2009-07-20 Ian Lance Taylor <ian@airs.com>
12969
12970 PR 10419
12971 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12972
12973 2009-07-16 Ian Lance Taylor <iant@google.com>
12974
12975 PR 10400
12976 * layout.h: #include <map>.
12977 (class Kept_section): Change from struct to class. Add accessors
12978 and setters. Add section size to Comdat_group mapping. Change
12979 Comdat_group to std::map. Add is_comdat_ field. Add
12980 linkonce_size field in union.
12981 (class Layout): Update declaration of find_or_add_kept_section.
12982 Don't declare find_kept_object.
12983 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12984 parameter. Add object, shndx, is_comdat, and is_group_name
12985 parameters. Change all callers. Adjust for new Kept_section.
12986 (Layout::find_kept_object): Remove.
12987 * object.cc (Sized_relobj::include_section_group): Update use of
12988 Kept_section. Rename secnum to shndx. Only record
12989 Kept_comdat_section if sections are the same size.
12990 (Sized_relobj::include_linkonce_section): Update use of
12991 Kept_section. Only record Kept_comdat_section if sections are the
12992 same size. Set size of linkonce section.
12993 (Sized_relobj::map_to_kept_section): Update call to
12994 get_kept_comdat_section.
12995 * object.h (class Sized_relobj): Rename fields in
12996 Kept_comdat_section to drop trailing underscores; change object
12997 field to Relobj*. Change Kept_comdat_section_table to store
12998 struct rather than pointer.
12999 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13000 Add kept_object and kept_shndx parameters. Change all callers.
13001 (Sized_relobj::get_kept_comdat_section): Change return type to
13002 bool. Add kept_object and kept_shndx parameters. Change all
13003 callers.
13004 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13005 Layout::find_or_add_kept_section.
13006
13007 2009-07-09 Ian Lance Taylor <iant@google.com>
13008
13009 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13010 Reserve space in the hash table.
13011
13012 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13013
13014 * fileread.cc (File_read::get_mtime): New method.
13015 * fileread.h (Timespec): New structure.
13016 (File_read::get_mtime): New method.
13017 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13018 Renamed from timestamp_nsec.
13019 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13020 Elf_Xword.
13021 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
13022 timestamp_nsec.
13023 (Incremental_inputs::report_archive): Save mtime; style fix.
13024 (Incremental_inputs::report_obejct): Save mtime; style fix.
13025 (Incremental_inputs::report_script): Save mtime; style fix.
13026 (Incremental_inputs::finalize_inputs): Style fix.
13027 (Incremental_inputs::finalize): Style fix.
13028 (Incremental_inputs::create_input_section_data): Store inputs
13029 mtime.
13030 * incremental.h (Incremental_inputs::report_script): Add mtime
13031 argument.
13032 (Incremental_inputs::Input_info::Input_info): Intialize only one
13033 union member.
13034 (Incremental_inputs::Input_info::archive): Move to nameless
13035 union.
13036 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13037 (Incremental_inputs::Input_info::script): Move to nameless union.
13038 (Incremental_inputs::mtime): New field.
13039 * script.cc (read_input_script): Pass file mtime to
13040 Incremental_input.
13041 * script.h (Script_info::inputs): Style fix.
13042
13043 2009-07-01 Ian Lance Taylor <ian@airs.com>
13044
13045 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13046 instead of 32.
13047
13048 2009-06-24 Ian Lance Taylor <iant@google.com>
13049
13050 PR 10156
13051 * layout.cc (Layout::choose_output_section): If we find an
13052 existing section, update the flags.
13053 (Layout::create_notes): New function, broken out of
13054 Layout::finalize.
13055 (Layout::finalize): Don't create note sections.
13056 (Layout::create_note): Don't crash if linker script discards
13057 section.
13058 (Layout::create_gold_note): Likewise.
13059 (Layout::create_build_id): Likewise. Don't set
13060 after_input_sections on the section.
13061 (Layout::create_executable_stack_info): Remove target parameter.
13062 Change caller.
13063 * layout.h (class Layout): Declare create_notes. Update
13064 declaration of create_executable_stack_info.
13065 * gold.cc (queue_middle_tasks): Call create_notes.
13066 * output.cc (Output_section::update_flags_for_input_section): Move
13067 here from output.h. If SHF_ALLOC flag is newly set, mark address
13068 invalid.
13069 * output.h (Output_data::mark_address_invalid): New function.
13070 (class Output_section): Only declare, not define,
13071 update_flags_for_input_section. Remove set_flags.
13072
13073 2009-06-24 Ian Lance Taylor <iant@google.com>
13074
13075 * script-sections.cc (Output_section_definition::
13076 set_section_addresses): Rename shadowing local load_address to
13077 laddr.
13078
13079 2009-06-24 Ian Lance Taylor <iant@google.com>
13080
13081 PR 10244
13082 * reloc.cc (relocate_sections): Skip empty relocation sections.
13083
13084 2009-06-23 Ian Lance Taylor <iant@google.com>
13085
13086 PR 10156
13087 * layout.cc (Layout::create_note): Use choose_output_section
13088 rather than make_output_section.
13089
13090 2009-06-23 Ian Lance Taylor <iant@google.com>
13091
13092 PR 10237
13093 * options.cc (General_options::parse_V): Set printed_version_.
13094 (General_options::General_options): Initialize printed_version_.
13095 * options.h (class General_options): Add printed_version_ field.
13096 * gold.cc (queue_initial_tasks): If there are no input files,
13097 don't give a fatal error if we printed the version information.
13098 (queue_middle_tasks): If using -r with a shared object, give a
13099 fatal error rather than an ordinary error.
13100
13101 2009-06-23 Ian Lance Taylor <iant@google.com>
13102
13103 PR 10219
13104 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13105 (Layout::make_output_section): Set have_stabstr_section_ if we see
13106 a .stab*str section.
13107 (Layout::finalize): Call link_stabs_sections.
13108 (Layout::link_stabs_sections): New file.
13109 * layout.h (class Layout): Add have_stabstr_section_ field.
13110 Declare link_stabs_sections.
13111
13112 2009-06-23 Doug Kwan <dougkwan@google.com>
13113
13114 * Makefile.am (libgold_a_LIBADD): New.
13115 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
13116 * Makefile.in: Regenerate.
13117 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13118 * configure: Regenerate.
13119 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13120 * fileread.cc: Include sys/state.h
13121 * gold.h: Declare memmem and strndup if found missing.
13122 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13123
13124 2009-06-23 Ian Lance Taylor <iant@google.com>
13125
13126 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13127 * configure: Rebuild.
13128
13129 2009-06-23 Ian Lance Taylor <iant@google.com>
13130
13131 PR 10147
13132 * object.cc (Object::section_contents): Don't try to get a view if
13133 the section has length zero.
13134 (Object::handle_gnu_warning_section): If the section is empty, use
13135 the name of the section as the warning.
13136
13137 2009-06-23 Ian Lance Taylor <iant@google.com>
13138
13139 PR 10133
13140 * stringpool.h (class Stringpool_template): Add optimize_ field.
13141 (Stringpool_template::set_optimize): New function.
13142 * stringpool.cc (Stringpool_template::Stringpool_template):
13143 Initialize optimize_ field.
13144 (Stringpool_template::set_string_offsets): Test local optimize
13145 fild rather than parameter.
13146 * layout.cc (Layout::Layout): Call set_optimize on the section
13147 name stringpool.
13148
13149 2009-06-22 Ian Lance Taylor <iant@google.com>
13150
13151 PR 10030
13152 * yyscript.y: Parse TARGET.
13153 * script.cc (script_set_target): New function.
13154 * script-c.h (script_set_target): Declare.
13155 * options.cc (General_options::string_to_object_format): Rename
13156 from string_to_object_format in anonymous namespace. Change
13157 callers.
13158 * options.h (class General_options): Declare
13159 string_to_object_format.
13160
13161 2009-06-22 Ian Lance Taylor <iant@google.com>
13162
13163 * script-sections.cc (Script_sections::create_segments): Don't put
13164 program headers in a PT_LOAD segment if -n or -N.
13165
13166 2009-06-22 Ian Lance Taylor <iant@google.com>
13167
13168 PR 10141
13169 * options.h (class General_options): Add -z lazy and -z now. Sort
13170 -z options into alphabetical order.
13171 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13172
13173 2009-06-21 Ian Lance Taylor <iant@google.com>
13174
13175 * layout.cc (Layout::make_output_section): Call
13176 Target::new_output_section.
13177 (Layout::attach_allocated_section_to_segment): Put large section
13178 sections in a separate load segment with the large segment flag
13179 set.
13180 (Layout::segment_precedes): Sort large data segments after other
13181 load segments.
13182 (align_file_offset): New static function.
13183 (Layout::set_segment_offsets): Use align_file_offset.
13184 * output.h (class Output_section): Add is_small_section_ and
13185 is_large_section_ fields.
13186 (Output_section::is_small_section): New function.
13187 (Output_section::set_is_small_section): New function.
13188 (Output_section::is_large_section): New function.
13189 (Output_section::set_is_large_section): New function.
13190 (Output_section::is_large_data_section): New function.
13191 (class Output_segment): Add is_large_data_segment_ field.
13192 (Output_segment::is_large_data_segment): New function.
13193 (Output_segment::set_is_large_data_segment): New function.
13194 * output.cc (Output_section::Output_section): Initialize new
13195 fields.
13196 (Output_segment::Output_segment): Likewise.
13197 (Output_segment::add_output_section): Add assertion that large
13198 data sections always go in large data segments. Force small data
13199 sections to the end of the list of data sections. Force small BSS
13200 sections to the start of the list of BSS sections. For large BSS
13201 sections to the end of the list of BSS sections.
13202 * symtab.h (class Symbol): Declare is_common_shndx.
13203 (Symbol::is_defined): Check Symbol::is_common_shndx.
13204 (Symbol::is_common): Likewise.
13205 (class Symbol_table): Define enum Commons_section_type. Update
13206 declarations. Add small_commons_ and large_commons_ fields.
13207 * symtab.cc (Symbol::is_common_shndx): New function.
13208 (Symbol_table::Symbol_table): Initialize new fields.
13209 (Symbol_table::add_from_object): Put small and large common
13210 symbols in the right list.
13211 (Symbol_table::sized_finalized_symbol): Check
13212 Symbol::is_common_shndx.
13213 (Symbol_table::sized_write_globals): Likewise.
13214 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13215 common symbol lists. Don't call do_allocate_commons_list if the
13216 list is empty.
13217 (Symbol_table::do_allocate_commons_list): Remove is_tls
13218 parameter. Add comons_section_type parameter. Change all
13219 callers. Handle small and large common symbols.
13220 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13221 Symbol::is_common_shndx.
13222 * resolve.cc (symbol_to_bits): Likewise.
13223 * target.h (Target::small_common_shndx): New function.
13224 (Target::small_common_section_flags): New function.
13225 (Target::large_common_shndx): New function.
13226 (Target::large_common_section_flags): New function.
13227 (Target::new_output_section): New function.
13228 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13229 small_common_section_flags, and large_common_section_flags
13230 fields.
13231 (Target::do_new_output_section): New virtual function.
13232 * arm.cc (Target_arm::arm_info): Initialize new fields.
13233 * i386.cc (Target_i386::i386_info): Likewise.
13234 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13235 Likewise.
13236 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13237 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13238 (Target_x86_64::do_new_output_section): New function.
13239 * configure.ac: Define conditional MCMODEL_MEDIUM.
13240 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13241 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13242 (large_LDFLAGS): Define.
13243 * testsuite/large.c: New file.
13244 * testsuite/testfile.cc (Target_test::test_target_info):
13245 Initialize new fields.
13246 * configure, testsuite/Makefile.in: Rebuild.
13247
13248 2009-06-05 Doug Kwan <dougkwan@google.com>
13249
13250 * Makefile.am (CCFILES): Add target.cc.
13251 * Makefile.in: Regenerate.
13252 * i386.cc (class Target_i386): Define new virtual method to
13253 override do_is_local_label_name in parent.
13254 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13255 local symbols if --discard-locals or -X is given.
13256 * options.h (class General_options): Declare new options
13257 '--discard-locals' and '-X' for discarding locals.
13258 * target.h (class Target): Define new methods is_local_label_name.
13259 Declare new virtual method do_is_local_label_name.
13260 * target.cc: New file.
13261 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13262 (check_SCRIPTS): Add discard_locals_test.sh.
13263 (check_DATA): Add discard_local_tests.syms.
13264 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13265 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13266 * testsuite/Makefile.in: Regenerate.
13267 * testsuite/discard_locals_test.c: New file.
13268 * testsuite/discard_locals_test.sh: Same.
13269
13270 2009-06-05 Doug Kwan <dougkwan@google.com>
13271
13272 * object.cc (Sized_relobj::Sized_relobj): Initialize
13273 discarded_eh_frame_shndx_ to -1U.
13274 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13275 section.
13276 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13277 a discarded .eh_frame section.
13278 (Sized_relobj::do_finalize_local_symbols): Ditto.
13279 * object.h (class Sized_relobj): Declare new member
13280 discarded_eh_frame_shndx_.
13281 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13282 (local_labels_test.o, local_labels_test): New rules.
13283 * testsuite/Makefile.in: Regenerate.
13284
13285 2009-06-04 Doug Kwan <dougkwan@google.com>
13286
13287 * layout.cc (Layout::section_name_mapping): Add mapping for
13288 special ARM sections.
13289
13290 2009-06-03 Doug Kwan <dougkwan@google.com>
13291
13292 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13293 (utils::has_overflow): Same.
13294
13295 2009-06-03 Ian Lance Taylor <iant@google.com>
13296
13297 * layout.cc (Layout::section_name_mapping): New array, replacing
13298 Layout::linkonce_mapping.
13299 (Layout::section_name_mapping_count): New variable, replacing
13300 Layout::linkonce_mapping_count.
13301 (Layout::linkonce_output_name): Remove.
13302 (Layout::output_section_name): Rewrite.
13303 * layout.h (class Layout): Rename Linkonce_mapping to
13304 Section_name_mapping, linkonce_mapping to section_name_mapping,
13305 linkonce_mapping_count to section_name_mapping_count. Don't
13306 declare linkonce_output_name.
13307
13308 2009-06-03 Doug Kwan <dougkwan@google.com>
13309
13310 * gold/arm.cc (namespace utils): New.
13311 (Target_arm::reloc_is_non_pic): Define new method.
13312 (class Arm_relocate_functions): New.
13313 (Target_arm::Relocate::relocate): Handle relocation types used by
13314 Android.
13315
13316 2009-06-03 Ian Lance Taylor <iant@google.com>
13317
13318 * arm.cc (Target_arm::scan::global): Use || instead of |.
13319
13320 2009-06-02 Doug Kwan <dougkwan@google.com>
13321
13322 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13323 issued_non_pic_error_.
13324 (class Target_arm::Scan): Declare new method check_non_pic.
13325 Define new method symbol_needs_plt_entry.
13326 Declare new data member issued_non_pic_error_.
13327 (class Target_arm::Relocate): Declare new method
13328 should_apply_static_reloc.
13329 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13330 (Target_arm::Scan::check_non_pic): Define new method.
13331 (Target_arm::Scan::local): Handle a small subset of reloc types used
13332 by Android.
13333 (Target_arm::Scan::local): Same.
13334 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13335
13336 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13337
13338 * incremental.cc (Incremental_inputs::report_command_line): Filter
13339 out --incremental-* options.
13340
13341 2009-05-29 Doug Kwan <dougkwan@google.com>
13342
13343 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13344 template class.
13345 (class Target_arm): Update comment.
13346 (Target_arm::Target_arm): Initialize new data members GOT_,
13347 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13348 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13349 and Target_arm::rel_dyn_section.
13350 Declare new_enum Target_arm::Got_type.
13351 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13352 and DYNBSS_.
13353 Update commments for member do_dynsym_value.
13354 (Target_arm::got_size, Target_arm::plt_section,
13355 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13356 new methods inside class defintion.
13357 (Target_arm::got_section): Define new method.
13358 (Target_arm::rel_dyn_section): Same.
13359 (Output_data_plt_arm): New template class.
13360 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13361 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13362 (Output_data_plt_arm::add_entry): Same.
13363 (Output_data_plt_arm::first_plt_entry): Define new
13364 static data member for PLT instruction template.
13365 (Output_data_plt_arm::plt_entry): Same.
13366 (Output_data_plt_arm::do_write): Define new method.
13367 (Target_arm::make_plt_entry): Same.
13368 (Target_arm::do_finalize_sections): Same.
13369 (Target_arm::do_dynsym_value): Same.
13370
13371 2009-05-28 Doug Kwan <dougkwan@google.com>
13372
13373 * Makefile.am (TARGETSOURCES): Add arm.cc.
13374 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13375 * Makefile.in: Regenerate.
13376 * arm.cc: New file.
13377 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13378
13379 2009-05-26 Doug Kwan <dougkwan@google.com>
13380
13381 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13382 (General_options::check_excluded_libs): Strip off directories in
13383 archive name before matching like GNU ld does.
13384 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13385 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13386 (exclude_libs_test_LDFLAGS): Add linker option
13387 -Wl,--exclude-libs,libexclude_libs_test_3
13388 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13389 an explicit archive without using -l.
13390 (alt/libexclude_libs_test_3.a): New make rule.
13391 * testsuite/Makefile.in: Regenerate.
13392 * testsuite/exclude_libs_test.c : Declare lib3_default().
13393 (main): Call it.
13394 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13395 * exclude_libs_test_3.c: New file.
13396
13397 2009-05-26 Nick Clifton <nickc@redhat.com>
13398
13399 * po/id.po: New Indonesian translation.
13400 * po/gold.pot: Updated template file.
13401
13402 2009-05-22 Sriraman Tallam <tmsriram@google.com>
13403
13404 * testsuite/Makefile.am: Add -ffunction-sections to compile
13405 gc_comdat_test files. Add -Wl,--gc-sections to build
13406 gc_comdat_test.
13407 * testsuite/Makefile.in: Regenerate.
13408 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13409
13410 2009-05-21 Sriraman Tallam <tmsriram@google.com>
13411
13412 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13413 kept comdat section was garbage collected.
13414 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13415 * testsuite/Makefile.in: Regenerate.
13416 * testsuite/gc_comdat_test.sh: New file.
13417 * testsuite/gc_comdat_test_1.cc: New file.
13418 * testsuite/gc_comdat_test_2.cc: New file.
13419
13420 2009-05-19 Doug Kwan <dougkwan@google.com>
13421
13422 * archive.cc (Archive::Archive): Move constructor from archive.h
13423 to here. Initialize no_export_.
13424 (Archive::get_elf_object_for_member): Set no_export flag of object.
13425 * archive.h (Archive::Archive): Move constructor body to
13426 archive.cc.
13427 (Archive::no_export): New method.
13428 (Archive::no_export_): New field.
13429 * object.h (Object::Object): Initialize no_export_ to false.
13430 (Object::no_export, Object::set_no_export): New methods.
13431 (Object::no_export_): New field.
13432 * options.cc (General_options::parse_exclude_libs): New method.
13433 (General_options::check_excluded_libs) Same.
13434 * options.h (exclude_libs): New option.
13435 (General_options::check_excluded_libs): New method declaration.
13436 (General_options::excluded_libs_): New field.
13437 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13438 default or protected visibility if an object has no-export flag set.
13439 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13440 (check_SCRIPTS): Add exclude_libs_test.sh.
13441 (check_DATA): Add exclude_libs_test.syms.
13442 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13443 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13444 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13445 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13446 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13447 libexclude_libs_test_2.a): New rules.
13448 * testsuite/Makefile.in: Regenerate.
13449 * testsuite/exclude_libs_test.c: New file.
13450 * testsuite/exclude_libs_test.sh: Ditto.
13451 * testsuite/exclude_libs_test_1.c: Ditto.
13452 * testsuite/exclude_libs_test_2.c: Ditto.
13453
13454 2009-05-15 Ian Lance Taylor <iant@google.com>
13455
13456 * configure.ac: Check for declarations for cases where libiberty.h
13457 checks HAVE_DECL_xxx.
13458 * configure, config.in: Rebuild.
13459
13460 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13461
13462 * gold.h (Incremental_argument_list): Remove (invalid) forward
13463 declaration.
13464 * incremental.cc (Incremental_inputs::report_achive): New method.
13465 (Incremental_inputs::report_object): New method.
13466 (Incremental_inputs::report_script): New method.
13467 (Incremental_inputs::finalize_inputs): New method.
13468 (Incremental_inputs::finalize): Call finalize_inputs().
13469 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13470 Create inputs entries.
13471 * incremental.h (Incremental_input_type): New enum.
13472 (Incremental_inputs::Incremental_input): Initialize new fields.
13473 (Incremental_inputs::report_inputs): New method.
13474 (Incremental_inputs::report_achive): New method.
13475 (Incremental_inputs::report_object): New method.
13476 (Incremental_inputs::report_script): New method.
13477 (Incremental_inputs::finalize_inputs): New method.
13478 (Incremental_inputs::Input_info): New struct.
13479 (Incremental_inputs::Input_info_map): New typedef.
13480 (Incremental_inputs::lock_): New field.
13481 (Incremental_inputs::Inputs_): New field.
13482 (Incremental_inputs::Inputs_map): New field.
13483 * main.cc (main): Call Incremental_input::report_inputs.
13484 * options.h (Input_argument_list): Typedef moved from
13485 Input_arguments.
13486 (Input_file_group::Files): Remove, use ::Input_argument_list.
13487 (Input_file_group::Input_argument_list): Remove, use
13488 ::Input_argument_list.
13489 * plugin.cc (Plugin_manager::add_input_file): Add error in
13490 incremental build.
13491 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13492 functions.
13493 * script.cc (read_input_script): Call
13494 Incremental_input::report_script.
13495 * script.h (Script_info): New class.
13496
13497 2009-04-27 Ian Lance Taylor <iant@google.com>
13498
13499 * x86_64.cc (do_adjust_output_section): Set entsize to
13500 plt_entry_size.
13501
13502 2009-04-23 Elliott Hughes <enh@google.com>
13503
13504 * output.cc (Output_file::close): After short writes, continue
13505 writing from the correct offset in the buffer being written.
13506
13507 2009-04-23 Chris Demetriou <cgd@google.com>
13508
13509 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13510 * configure: Regenerate.
13511 * config.in: Regenerate.
13512 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13513 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13514
13515 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13516
13517 * incremental.cc (Incremental_inputs_header_data): Renamed from
13518 Incremental_input_header_data.
13519 (Incremental_inputs_header_data::data_size): New field.
13520 (Incremental_inputs_header_data::put_input_file_count): Renamed
13521 from input_file_count.
13522 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13523 from command_line_offset.
13524 (Incremental_inputs_header_data::put_reserved): Renamed from
13525 put_reserved.
13526 (Incremental_inputs_entry_data): Renamed from
13527 Incremental_input_entry_data.
13528 (Incremental_inputs_entry_data::data_size): New field.
13529 (Incremental_inputs::report_command_line): New method.
13530 (Incremental_inputs::finalize): New method.
13531 (Incremental_inputs::create_incremental_inputs_data): New method.
13532 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13533 * incremental.h: New file.
13534 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
13535 (Layout::finalize): Create incremental inputs section in
13536 incremental builds.
13537 (Layout::create_incremental_info_sections): New method.
13538 * layout.h (Layout::incremental_inputs): New method.
13539 (Layout::create_incremental_info_sections): New method.
13540 (Layout::incremental_inputs_): New field.
13541 * main.cc (main): Notify Incremental_input of the command line.
13542
13543 2009-04-01 Ian Lance Taylor <iant@google.com>
13544 Mikolaj Zalewski <mikolajz@google.com>
13545
13546 * gold.h (reserve_unordered_map): Define, three versions, one for
13547 each version of Unordered_map.
13548 * layout.cc (Layout::Layout): Remove options parameter. Add
13549 number_of_input_files parameter. Don't initialize options_.
13550 Initialize number_of_input_files_ and resized_signatures_. Move
13551 sections_are_attached_.
13552 (Layout::layout_group): Reserve space for group_signatures_.
13553 (Layout::find_or_add_kept_section): Change name parameter to be a
13554 reference. Resize signatures_ map when it gets large enough.
13555 (Layout::layout_eh_frame): Use parameters->options() instead of
13556 this->options_.
13557 (Layout::make_output_section): Likewise.
13558 (Layout::attach_allocated_section_to_segment): Likewise.
13559 (Layout::finalize, Layout::create_executable_stack): Likewise.
13560 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13561 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13562 * layout.h (class Layout): Update declarations. Remove options_
13563 field. Add number_of_input_files_ and resized_signatures_
13564 fields. Move sections_are_attached_ field.
13565 * main.cc (main): Pass number of input files to Layout
13566 constructor. Don't pass options.
13567
13568 2009-03-30 Ian Lance Taylor <iant@google.com>
13569
13570 * ffsll.c (ffsll): Correct implementation.
13571
13572 2009-03-27 Ian Lance Taylor <iant@google.com>
13573
13574 * ffsll.c: New file.
13575 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13576 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13577 * ftruncate.c (ftruncate): Declare before definition.
13578 * mremap.c (mremap): Likewise.
13579 * pread.c (pread): Likewise.
13580 * configure, Makefile.in, config.in: Rebuild.
13581
13582 * mremap.c: New file.
13583 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13584 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13585 (mremap): Declare if HAVE_MREMAP is not defined.
13586 * configure, Makefile.in, config.in: Rebuild.
13587
13588 2009-03-27 Cary Coutant <ccoutant@google.com>
13589
13590 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13591 position independent.
13592 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13593 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13594
13595 2009-03-24 Cary Coutant <ccoutant@google.com>
13596
13597 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13598 an executable.
13599 (needs_dynamic_reloc): Likewise.
13600
13601 2009-03-24 Ian Lance Taylor <iant@google.com>
13602
13603 * yyscript.y (file_cmd): Recognize EXTERN.
13604 (extern_name_list, extern_name_list_body): New nonterminals.
13605 * script.cc (script_add_extern): Define.
13606 * script-c.h (script_add_extern): Declare.
13607
13608 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
13609
13610 * object.cc (is_elf_object): Define.
13611 * object.h (is_elf_object): Declare.
13612 * archive.cc (Archive::get_elf_object_for_member): Call
13613 is_elf_object.
13614 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
13615
13616 2009-03-24 Elliott Hughes <enh@google.com>
13617
13618 * output.cc (Output_file::map_anonymous): Define.
13619 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13620 try an anonymous one. Report the size if the mmap fails.
13621 * output.h (class Output_file): Declare map_anonymous.
13622
13623 2009-03-24 Ian Lance Taylor <iant@google.com>
13624
13625 * target-select.cc (instantiate_target): Don't acquire the lock if
13626 the instantiated_target_ field has already been set.
13627
13628 2009-03-23 Ian Lance Taylor <iant@google.com>
13629
13630 * gold-threads.h (class Initialize_lock): Define.
13631 * gold-threads.cc (class Initialize_lock_once): Define.
13632 (initialize_lock_control): New static variable.
13633 (initialize_lock_pointer): New static variable.
13634 (initialize_lock_once): New static function.
13635 (Initialize_lock::Initialize_lock): Define.
13636 (Initialize_lock::initialize): Define.
13637 * target-select.h: Include "gold-threads.h".
13638 (class Target_selector): Add lock_ and initialize_lock_ fields.
13639 Don't define instantiate_target, just declare it.
13640 * target-select.cc (Target_selector::Target_selector): Initialize
13641 new fields.
13642 (Target_selector::instantiate_target): Define.
13643 * descriptors.h: Include "gold-threads.h".
13644 (class Descriptors): Add initialize_lock_ field.
13645 * descriptors.cc (Descriptors::Descriptors): Initialize new
13646 field.
13647 (Descriptors::open): Use initialize_lock_ field
13648 * errors.h (class Errors): Add initialize_lock_ field.
13649 * errors.cc (Errors::Errors): Initialize new field.
13650 (Errors::initialize_lock): Use initialize_lock_ field.
13651 * powerpc.cc (class Target_selector_powerpc): Remove
13652 instantiated_target_ field. In do_recognize call
13653 instantiate_target rather than do_instantiate_target. In
13654 do_instantiate_target just allocate a new target.
13655 * sparc.cc (class Target_selector_sparc): Likewise.
13656
13657 * freebsd.h: New file.
13658 * i386.cc: Include "freebsd.h".
13659 (Target_i386): Derive from Target_freebsd rather than
13660 Sized_target.
13661 (Target_selector_i386): Derive from Target_selector_freebsd rather
13662 than Target_selector.
13663 * x86_64.cc: Include "freebsd.h".
13664 (Target_x86_64): Derive from Target_freebsd rather than
13665 Sized_target.
13666 (Target_selector_x86_64): Derive from Target_selector_freebsd
13667 rather than Target_selector.
13668 * target.h (class Target): Add adjust_elf_header and
13669 do_adjust_elf_header.
13670 * output.cc (Output_file_header:: do_sized_write): Call target
13671 adjust_elf_header routine.
13672 * configure.tgt: Set targ_osabi.
13673 * configure.ac: Define GOLD_DEFAULT_OSABI.
13674 * parameters.cc (Parameters::default_target): Pass
13675 GOLD_DEFAULT_OSABI to select_target.
13676 * target-select.h (class Target_selector): Make instantiate_target
13677 protected rather than private.
13678 * Makefile.am (HFILES): Add freebsd.h.
13679 * configure, Makefile.in, config.in: Rebuild.
13680
13681 * merge.cc (do_add_input_section): Correct pend value. Change
13682 message about last entry not being null terminated from error to
13683 warning.
13684
13685 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13686
13687 * incremental.cc: New file.
13688 * Makefile.am (CCFILES): Add incremental.cc.
13689 * Makefile.in: Rebuild.
13690
13691 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13692
13693 * layout.cc (Layout::output_section_name): Preserve names
13694 of '.note.' sections.
13695
13696 2009-03-19 Ian Lance Taylor <iant@google.com>
13697
13698 * descriptors.cc (Descriptors::open): Check that the options are
13699 valid before using them.
13700
13701 2009-03-18 Ian Lance Taylor <iant@google.com>
13702
13703 * script-sections.h: Include <list>.
13704 (class Script_sections): Change Sections_elements from std::vector
13705 to std::list. Typedef public Elements_iterator. Add
13706 orphan_section_placement_, data_segment_align_start_, and
13707 saw_data_segment_align_ fields. Remove data_segment_align_index_
13708 field.
13709 * script-sections.cc (class Orphan_section_placement): New class.
13710 (class Sections_element): Add virtual functions is_relro and
13711 orphan_section_init. Remove virtual function place_orphan_here.
13712 (class Output_section_definition): Add is_relro and
13713 orphan_section_init. Remove place_orphan_here.
13714 (class Orphan_output_section): Likewise.
13715 (Script_sections::Script_sections): Update for field changes.
13716 (Script_sections::data_segment_align): Set saw_data_segment_align_
13717 and data_segment_align_start_, not data_segment_align_index.
13718 (Script_sections::data_segment_relro_end): Check
13719 saw_data_segment_align_. Use data_segment_align_start_ rather
13720 than data_segment_align_index_.
13721 (Script_sections::place_orphan): Rewrite to use
13722 Orphan_section_placement.
13723
13724 2009-03-17 Ian Lance Taylor <iant@google.com>
13725
13726 * archive.cc (Archive::add_symbols): Check for a version attached
13727 to the symbol name in the archive map.
13728 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13729 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13730 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13731 (ver_test_11.a): New target.
13732 * testsuite/Makefile.in: Rebuild.
13733
13734 * configure.ac: Check for chsize and posix_fallocate. Replace
13735 ftruncate.
13736 * ftruncate.c: New file, from gnulib.
13737 * output.cc (posix_fallocate): Define dummy version if not
13738 HAVE_POSIX_FALLOCATE.
13739 (Output_file::map): Call posix_fallocate rather than lseek and
13740 write.
13741 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13742 * configure, Makefile.in, config.in: Rebuild.
13743
13744 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
13745
13746 * layout.h (Layout::create_note): Add section_name parameter.
13747 * layout.cc (Layout::create_note): Likewise.
13748 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
13749
13750 2009-03-17 Ian Lance Taylor <iant@google.com>
13751
13752 * descriptors.cc: Include "options.h".
13753 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13754 (Descriptors::open): Always use O_CLOEXEC when opening a new
13755 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13756 then set FD_CLOEXEC.
13757
13758 * sparc.cc (class Target_sparc): Add has_got_section.
13759 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13760 make sure we have a GOT section.
13761
13762 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13763 (Target_sparc::Scan::local): Likewise.
13764 (Target_sparc::Scan::global): Likewise.
13765 (Target_sparc::Relocate::relocate): Likewise.
13766 (Target_sparc::Relocate::relocate_tls): Likewise.
13767
13768 * symtab.cc (Symbol_table::define_default_version): New function,
13769 broken out of add_from_object.
13770 (Symbol_table::add_from_object): Call define_default_version.
13771 (Symbol_table::define_special_symbol): Add resolve_oldsym
13772 parameter. Change all callers. If the version for a symbol comes
13773 from a version script, resolve it with the symbol with the same
13774 name with no version. Also add the symbol without a version if
13775 appropriate.
13776 (do_define_in_output_data): If resolving with oldsym, don't delete
13777 sym.
13778 (do_define_in_output_segment): Likewise.
13779 (do_define_as_constant): Likewise.
13780 * symtab.h (class Symbol_table): Update declarations.
13781
13782 2009-03-13 Ian Lance Taylor <iant@google.com>
13783
13784 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13785 (Read_symbols::requeue): New function.
13786 (Read_symbols::do_read_symbols): If make_elf_object fails because
13787 the target type is not configured, and the file was searched for,
13788 issue a warning and retry with the next directory.
13789 (Add_symbols::run): If the file has an incompatible format, and
13790 it was searched for, requeue the Read_symbols task. On error,
13791 release the object.
13792 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13793 dirindex parameter to constructor. Change all callers. Declare
13794 incompatible_warning and requeue.
13795 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13796 input_argument_ and input_group_ fields. Add them to
13797 constructor. Change all callers.
13798 (class Read_script): Add dirindex_ field. Add it to constructor.
13799 Change all callers.
13800 * archive.cc (Archive::setup): Remove input_objects parameter.
13801 Change all callers.
13802 (Archive::get_file_and_offset): Likewise.
13803 (Archive::read_all_symbols): Likewise.
13804 (Archive::read_symbols): Likewise.
13805 (Archive::get_elf_object_for_member): Remove input_objects
13806 parameter. Add punconfigured parameter. Change all callers.
13807 (Archive::add_symbols): Change return type to bool. Check return
13808 value of include_member.
13809 (Archive::include_all_members): Likewise.
13810 (Archive::include_member): Change return type to bool. Return
13811 false if first included object has incompatible target. Set
13812 included_member_ field.
13813 (Add_archive_symbols::run): If add_symbols returns false, requeue
13814 Read_symbols task.
13815 * archive.h (class Archive): Add included_member_ field.
13816 Initialize it in constructor. Add input_file and searched_for
13817 methods. Update declarations.
13818 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13819 input_argument_ fields. Add them to constructor. Change all
13820 callers.
13821 * script.cc: Include "target-select.h".
13822 (class Parser_closure): Add skip_on_incompatible_target_ and
13823 found_incompatible_target_ fields. Add
13824 skip_on_incompatible_target parameter to constructor. Change all
13825 callers. Add methods skip_on_incompatible_target,
13826 clear_skip_on_incompatible_target, found_incompatible_target, and
13827 set_found_incompatible_target.
13828 (read_input_script): Add dirindex parameter. Change all callers.
13829 If parser finds an incompatible target, requeue Read_symbols
13830 task.
13831 (script_set_symbol): Clear skip_on_incompatible_target in
13832 closure.
13833 (script_add_assertion, script_parse_option): Likewise.
13834 (script_start_sections, script_add_phdr): Likewise.
13835 (script_check_output_format): New function.
13836 * script.h (read_input_script): Update declaration.
13837 * script-c.h (script_check_output_format): Declare.
13838 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13839 (ignore_cmd): Remove OUTPUT_FORMAT.
13840 * fileread.cc (Input_file::Input_file): Add explicit this.
13841 (Input_file::will_search_for): New function.
13842 (Input_file::open): Add pindex parameter. Change all callers.
13843 * fileread.h (class Input_file): Add input_file_argument method.
13844 Declare will_search_for. Update declarations.
13845 * object.cc (make_elf_object): Add punconfigured parameter.
13846 Change all callers.
13847 * object.h (class Object): Make input_file public. Add
13848 searched_for method.
13849 (make_elf_object): Update declaration.
13850 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13851 restart search.
13852 * dirsearch.h (class Dirsearch): Update declaration.
13853 * options.h (class General_options): Add --warn-search-mismatch.
13854 * parameters.cc (Parameters::is_compatible_target): New function.
13855 * parameters.h (class Parameters): Declare is_compatible_target.
13856 * workqueue.cc (Workqueue::add_blocker): New function.
13857 * workqueue.h (class Workqueue): Declare add_blocker.
13858
13859 * fileread.cc (Input_file::open): Remove options parameter.
13860 Change all callers.
13861 (Input_file::open_binary): Likewise.
13862 * script.cc (read_input_script): Likewise.
13863 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13864 options parameter from constructor. Change all callers.
13865 (class Read_script): Likewise.
13866 * fileread.h (class Input_file): Update declarations.
13867 * script.h (read_input_script): Update declaration.
13868
13869 2009-03-10 Nick Clifton <nickc@redhat.com>
13870
13871 * po/es.po: New Spanish translation.
13872
13873 2009-03-06 Cary Coutant <ccoutant@google.com>
13874
13875 * options.cc (parse_short_option): Keep dash_z from registering itself.
13876
13877 2009-03-03 Ian Lance Taylor <iant@google.com>
13878
13879 PR 9918
13880 * target-reloc.h (relocate_section): Pass output_section to
13881 relocate.
13882 * i386.cc (Target_i386::should_apply_static_reloc): Add
13883 output_section parameter. Change all callers.
13884 (Target_i386::Relocate::relocate): Add output_section parameter.
13885 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13886 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13887 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13888 * testsuite/two_file_shared.sh: New script.
13889 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13890 (check_DATA): Add two_file_shared.dbg.
13891 (two_file_shared.dbg): New target.
13892 * testsuite/Makefile.in: Rebuild.
13893
13894 2009-03-01 Ian Lance Taylor <iant@google.com>
13895
13896 * configure.ac: Check for byteswap.h.
13897 * configure: Rebuild.
13898 * config.in: Rebuild.
13899
13900 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13901
13902 * layout.cc (Layout::find_or_add_kept_section): New function.
13903 (Layout::add_comdat): Removed.
13904 * layout.h (struct Kept_section): Move out of class Layout.
13905 Remove trailing underscores from field names. Add group_sections
13906 field. Rename group_ field to is_group. Change all uses.
13907 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13908 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13909 comdat_groups_ field.
13910 (Sized_relobj::include_section_group): Use
13911 find_or_add_kept_section and Kept_section::group_sections.
13912 (Sized_relobj::include_linkonce_section): Likewise.
13913 * object.cc (class Sized_relobj): Don't define Comdat_group or
13914 Comdat_group_table. Remove find_comdat_group and
13915 add_comdat_group. Remove comdat_groups_ field.
13916 * plugin.cc (include_comdat_group): Use
13917 Layout::find_or_add_kept_section.
13918
13919 2009-02-28 Ian Lance Taylor <iant@google.com>
13920
13921 * README: --gc-sections and map files are now supported. Document
13922 some build requirements.
13923
13924 PR 6992
13925 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13926 relocatable link set the value of the section symbol to zero.
13927 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13928 relocatable link don't include the section address in the local
13929 symbol value.
13930
13931 2009-02-27 Ian Lance Taylor <iant@google.com>
13932
13933 PR 6811
13934 * options.h (class Search_directory): Add is_system_directory.
13935 (class General_options): Declare is_in_system_directory.
13936 * options.cc (get_relative_sysroot): Make static.
13937 (get_default_sysroot): Make static.
13938 (General_optoins::is_in_system_directory): New function.
13939 * fileread.cc (Input_file::is_in_system_directory): New function.
13940 * fileread.h (class Input_file): Declare is_in_system_directory.
13941 * object.h (class Object): Add is_in_system_directory.
13942 (class Input_objects): Remove system_library_directory_ field.
13943 * object.cc (Input_objects::add_object): Don't set
13944 system_library_directory_.
13945 (input_objects::found_in_system_library_directory): Remove.
13946 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13947 parameter. Change all callers.
13948 (Symbol_table::sized_write_globals): Likewise.
13949 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13950 Call Object::is_in_system_directory.
13951 * symtab.h (class Symbol_table): Update declarations.
13952
13953 PR 5990
13954 * descriptors.h (Open_descriptor): Add is_on_stack field.
13955 * descriptors.cc (Descriptors::open): If the descriptor is on the
13956 top of the stack, remove it. Initialize is_on_stack field.
13957 (Descriptors::release): Only add pod to stack if it is not on the
13958 stack already.
13959 (Descriptors::close_some_descriptor): Clear stack_next and
13960 is_on_stack fields.
13961
13962 PR 7091
13963 * output.cc (Output_section::find_starting_output_address): Rename
13964 from starting_output_address; add PADDR parameter; change return
13965 type.
13966 * output.h (class Output_section): Declare
13967 find_starting_output_address instead of starting_output_address.
13968 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13969 section symbol for which we can't find a merge section.
13970
13971 PR 9836
13972 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13973 hidden or internal, force the symbol to be local.
13974 * resolve.cc (Symbol::override_visibility): Define.
13975 (Symbol::override_base): Use override_visibility.
13976 (Symbol_table::resolve): Likewise.
13977 (Symbol::override_base_with_special): Likewise.
13978 (Symbol_table::override_with_special): If the visibility is hidden
13979 or internal, force the symbol to be local.
13980 * symtab.h (class Symbol): Add set_visibility and
13981 override_visibility.
13982 * testsuite/ver_test_1.sh: New file.
13983 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13984 (check_DATA): Add ver_test_1.syms.
13985 (ver_test_1.syms): New target.
13986 * testsuite/Makefile.in: Rebuild.
13987
13988 2009-02-25 Cary Coutant <ccoutant@google.com>
13989
13990 * layout.cc (Layout::choose_output_section): Don't rename sections
13991 when using a linker script that has a SECTIONS clause.
13992 * Makefile.in: Regenerate.
13993
13994 * testsuite/Makefile.am (script_test_5.sh): New test case.
13995 * testsuite/Makefile.in: Regenerate.
13996 * testsuite/script_test_5.cc: New file.
13997 * testsuite/script_test_5.sh: New file.
13998 * testsuite/script_test_5.t: New file.
13999
14000 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
14001
14002 * archive.cc (Archive::include_member): Update calls to add_symbols.
14003 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14004 the Layout argument.
14005 * dynobj.h (do_add_symbols): Add the Layout argument.
14006 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14007 Layout argument.
14008 * object.h (Object::add_symbols): Add the Layout argument.
14009 (Object::do_add_symbols): Add the Layout argument.
14010 (Sized_relobj::do_add_symbols): Add the Layout argument.
14011 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14012 Unify the two versions.
14013 (Add_plugin_symbols): Remove.
14014 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14015 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14016 (Add_plugin_symbols): Remove.
14017 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14018 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14019 (Add_symbols::run): Make it work with Pulginobj.
14020
14021 2009-02-06 Ian Lance Taylor <iant@google.com>
14022
14023 * object.cc (Sized_relobj::do_layout): Make info message start
14024 with lower case letter.
14025
14026 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14027
14028 * binary.cc: Fix file comment.
14029
14030 * options.h (enum Incremental_disposition): Define.
14031 (class General_options): Add new options: --incremental,
14032 --incremental_changed, --incremental_unchanged,
14033 --incremental_unknown. Add incremental_disposition_ and
14034 implicit_incremental_ fields.
14035 (General_options::incremental_disposition): New function.
14036 (class Position_dependent_options): Add incremental_disposition
14037 option.
14038 (Position_dependent_options::copy_from_options): Set incremental
14039 dispositions.
14040 * options.cc (General_options::parse_incremental_changed): New
14041 function.
14042 (General_options::parse_incremental_unchanged): New function.
14043 (General_options::parse_incremental_unknown): New function.
14044 (General_options::General_options): Initialize new fields
14045 incremental_disposition_ and implicit_incremental_.
14046 (General_options::finalize): Check for uasge of --incremental-*
14047 without --incremental.
14048
14049 2009-02-06 Chris Demetriou <cgd@google.com>
14050
14051 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14052 pointer and to report location as the file name associated with
14053 the symbol.
14054 (gold_undefined_symbol_at_location): New function to replace the
14055 old gold_undefined_symbol functionality.
14056 * target-reloc.h (relocate_section): Update to use
14057 gold_undefined_symbol_at_location.
14058 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14059 Call gold_undefined_symbol function rather than gold_error.
14060 * errors.h (Errors::undefined_symbol): Take location as a
14061 string, rather than calculating it from a relocation.
14062 * errors.cc (Errors::fatal): Print "fatal error:" before the
14063 formatted message.
14064 (Errors::error, Errors::error_at_location): Print "error: "
14065 before the formatted message.
14066 (Errors::undefined_symbol): Take location as a string, rather
14067 than calculating it from a relocation.
14068 (gold_undefined_symbol_at_location): New function akin to
14069 old gold_undefined_symbol, calculates location from relocation.
14070 (gold_undefined_symbol): Change to take only a Symbol pointer
14071 and to report location as the file name associated with the symbol.
14072 * testsuite/debug_msg.sh: Update for changed error messages.
14073 * testsuite/undef_symbol.sh: Likewise.
14074
14075 2009-02-04 Duncan Sands <baldrick@free.fr>
14076
14077 PR 9812
14078 * reduced_debug_output.h
14079 (Output_reduced_debug_abbrev_section::failed): Use format for
14080 gold_warning.
14081 (Output_reduced_debug_info_section::faild): Likewise.
14082
14083 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14084
14085 * script.cc (Lazy_demangler): New class.
14086 (Version_script_info::get_symbol_version_helper): Demangle a
14087 symbol only once.
14088
14089 2009-01-29 Cary Coutant <ccoutant@google.com>
14090
14091 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14092 to __tls_get_addr.
14093 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14094
14095 2009-01-28 Ian Lance Taylor <iant@google.com>
14096
14097 * version.cc (version_string): Bump to 1.9.
14098
14099 * gold.h: Include <cstring> and <stdint.h>.
14100 * version.cc: Include <cstdio>.
14101 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14102 warning.
14103 * reduced_debug_output.cc (insert_into_vector): Rename from
14104 Insert_into_vector; change all callers. Use Swap_unaligned to
14105 avoid aliasing issue; remove union since it is unnecessary.
14106
14107 2009-01-27 Sriraman Tallam <tmsriram@google.com>
14108
14109 * Makefile.am (CCFILES): Add gc.cc.
14110 (HFILES): Add gc.h.
14111 * Makefile.in: Regenerate.
14112 * gold.cc (Gc_runner): New class.
14113 (queue_initial_tasks): Call garbage collection related tasks
14114 when corresponding options are invoked.
14115 (queue_middle_gc_tasks): New function.
14116 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14117 processed early before laying out sections during garbage collection.
14118 * gold.h (queue_middle_gc_tasks): New function.
14119 (is_prefix_of): Move from "layout.cc".
14120 * i386.cc (Target_i386::gc_process_relocs): New function.
14121 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14122 * main.cc (main): Create object of class "Garbage_collection".
14123 * object.cc (Relobj::copy_symbols_data): New function.
14124 (Relobj::is_section_name_included): New function.
14125 (Sized_relobj::do_layout): Allow this function to be called twice
14126 during garbage collection and defer layout of section during the
14127 first call.
14128 * object.h (Relobj::get_symbols_data): New function.
14129 (Relobj::is_section_name_included): New function.
14130 (Relobj::copy_symbols_data): New function.
14131 (Relobj::set_symbols_data): New function.
14132 (Relobj::get_relocs_data): New function.
14133 (Relobj::set_relocs_data): New function.
14134 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14135 (Relobj::gc_process_relocs): New function.
14136 (Relobj::do_gc_process_relocs): New pure virtual function.
14137 (Relobj::sd_): New data member.
14138 (Sized_relobj::is_output_section_offset_invalid): New function.
14139 (Sized_relobj::do_gc_process_relocs): New function.
14140 * options.h (General_options::gc_sections): Modify to not be a no-op.
14141 (General_options::print_gc_sections): New option.
14142 * plugin.cc (Plugin_finish::run): Remove function call to
14143 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14144 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14145 * reloc.cc (Read_relocs::run): Add task to process relocs and
14146 determine unreferenced sections when doing garbage collection.
14147 (Gc_process_relocs): New class.
14148 (Sized_relobj::do_gc_process_relocs): New function.
14149 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14150 sections that are garbage collected.
14151 * reloc.h (Gc_process_relocs): New class.
14152 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14153 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14154 symbols whose corresponding sections are garbage collected.
14155 (Symbol_table::Symbol_table): Add new parameter for the garbage
14156 collection object.
14157 (Symbol_table::gc_mark_undef_symbols): New function.
14158 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14159 (Symbol_table::gc_mark_dyn_syms): New function.
14160 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14161 as garbage.
14162 (Symbol_table::add_from_object): Likewise.
14163 (Symbol_table::add_from_relobj): When building shared objects, do not
14164 treat externally visible symbols as garbage.
14165 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14166 table information for static and relocatable links.
14167 * symtab.h (Symbol_table::set_gc): New function.
14168 (Symbol_table::gc): New function.
14169 (Symbol_table::gc_mark_undef_symbols): New function.
14170 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14171 (Symbol_table::gc_mark_dyn_syms): New function.
14172 (Symbol_table::gc_): New data member.
14173 * target.h (Sized_target::gc_process_relocs): New pure virtual
14174 function.
14175 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14176 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14177
14178 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14179
14180 * options.h (General_options::gc_sections): Define as a no-op for now.
14181 (General_options::no_keep_memory): Ditto.
14182 (General_options::Bshareable): Define.
14183 * options.cc (General_options::finalize): Honor -Bshareable.
14184
14185 2009-01-20 Andreas Schwab <schwab@suse.de>
14186
14187 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14188 read the value in the contents, since we don't use it. Use the
14189 template endianness when writing.
14190 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14191
14192 2009-01-19 Andreas Schwab <schwab@suse.de>
14193
14194 * configure.tgt (powerpc64-*): Fix targ_obj.
14195
14196 2009-01-15 Ian Lance Taylor <iant@google.com>
14197
14198 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14199 local symbols when stripping all symbols.
14200
14201 2009-01-14 Cary Coutant <ccoutant@google.com>
14202
14203 * output.cc (Output_reloc): Add explicit instantiations.
14204
14205 2009-01-14 Cary Coutant <ccoutant@google.com>
14206
14207 * archive.cc (Archive::get_elf_object_for_member): Remove call
14208 to File_read::claim_for_plugin.
14209 * descriptors.cc (Descriptors::open): Remove reference to
14210 is_claimed.
14211 (Descriptors::claim_for_plugin): Remove.
14212 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14213 (Descriptors::is_claimed): Remove.
14214 (claim_descriptor_for_plugin): Remove.
14215 * fileread.cc (File_read::claim_for_plugin): Remove.
14216 * fileread.h (File_read::claim_for_plugin): Remove.
14217 (File_read::descriptor): Reopen descriptor if necessary.
14218 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14219 (Plugin_manager::all_symbols_read): Add task parameter. Change
14220 all callers.
14221 (Plugin_manager::get_input_file): New function.
14222 (Plugin_manager::release_input_file): New function.
14223 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14224 corresponding data member.
14225 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14226 and pass to base constructor. Change all callers.
14227 (get_input_file, release_input_file): New functions.
14228 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14229 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14230 (Plugin_manager::all_symbols_read): Add task parameter.
14231 (Plugin_manager::get_input_file): New function.
14232 (Plugin_manager::release_input_file): New function.
14233 (Plugin_manager::task_): New data member.
14234 (Pluginobj::Pluginobj): Add filesize parameter.
14235 (Pluginobj::filename): New function.
14236 (Pluginobj::descriptor): New function.
14237 (Pluginobj::filesize): New function.
14238 (Pluginobj::filesize_): New data member.
14239 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14240 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14241 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14242
14243 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14244 with archive libraries.
14245 * testsuite/Makefile.in: Regenerate.
14246 * testsuite/plugin_test.c (struct sym_info): New type.
14247 (get_input_file, release_input_file): New static variables.
14248 (onload): Capture new transfer vector entries.
14249 (claim_file_hook): Stop reading at end of file according to filesize.
14250 Factor out parsing of readelf output into separate function.
14251 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14252 APIs and get the source file name from the symbol table. Convert
14253 source file name to corresponding object file name. Print info
14254 message when adding new input files.
14255 (parse_readelf_line): New function.
14256 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14257 * testsuite/plugin_test_2.sh: Likewise.
14258 * testsuite/plugin_test_3.sh: Likewise.
14259 * testsuite/plugin_test_4.sh: New test case.
14260
14261 2009-01-07 Ian Lance Taylor <iant@google.com>
14262
14263 * version.cc (version_string): Bump to 1.8.
14264
14265 2008-12-23 Cary Coutant <ccoutant@google.com>
14266
14267 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14268 * plugin.cc (Plugin_manager::finish): Rename as
14269 layout_deferred_objects. Move cleanup to separate function.
14270 (Plugin_manager::cleanup): New function.
14271 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14272 separately.
14273 * plugin.h (Plugin_manager::finish): Rename as
14274 layout_deferred_objects.
14275 (Plugin_manager::cleanup): New function.
14276 (Plugin_manager::cleanup_done): New field.
14277
14278 2008-12-23 Cary Coutant <ccoutant@google.com>
14279
14280 * plugin.cc (is_visible_from_outside): New function.
14281 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14282 so we don't return "IR only" status for exported symbols or -r links.
14283
14284 * testsuite/Makefile.am (plugin_test_3): New test case.
14285 * testsuite/Makefile.in: Regenerate.
14286 * testsuite/plugin_test_3.sh: New file.
14287
14288 2008-12-22 Cary Coutant <ccoutant@google.com>
14289
14290 * object.cc (Sized_relobj::layout_section): New function.
14291 (Sized_relobj::do_layout): Defer layout of input sections until after
14292 plugin has provided replacement files.
14293 (Sized_relobj::do_layout_deferred_sections): New function.
14294 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14295 (Relobj::layout_deferred_sections): New function.
14296 (Relobj::do_layout_deferred_sections): New function.
14297 (Sized_relobj::do_layout_deferred_sections): New function.
14298 (Sized_relobj::layout_section): New function.
14299 (Sized_relobj::Deferred_layout): New structure.
14300 (Sized_relobj::deferred_layout_): New field.
14301 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14302 Change all callers. Layout deferred sections.
14303 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14304 references.
14305 (Plugin_hook::run): Move code from do_plugin_hook inline.
14306 (Plugin_hook::do_plugin_hook): Remove.
14307 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14308 (Plugin_manager::finish): Renamed, was cleanup.
14309 (Plugin_manager::should_defer_layout): New function.
14310 (Plugin_manager::add_deferred_layout_object): New function.
14311 (Plugin_manager::Deferred_layout_list): New type.
14312 (Plugin_manager::deferred_layout_objects_): New field.
14313 (Plugin_hook::do_plugin_hook): Remove.
14314
14315 2008-12-17 Ian Lance Taylor <iant@google.com>
14316
14317 * options.h (class General_options): Add --no case for
14318 --export-dynamic.
14319
14320 2008-12-16 Cary Coutant <ccoutant@google.com>
14321
14322 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14323 vector.
14324 (Plugin_manager::claim_file): Create plugin object even if
14325 plugin did not call the add_symbols callback.
14326 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14327 asking for more symbols than were added.
14328 * testsuite/Makefile.am (plugin_test_1): Add test case with
14329 no global symbols.
14330 (empty.syms): New target.
14331 * testsuite/Makefile.in: Regenerate.
14332 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14333 message. Don't call add_symbols if no globals.
14334 (all_symbols_read_hook): Don't provide replacement for empty
14335 claimed file.
14336
14337 2008-12-12 Ian Lance Taylor <iant@google.com>
14338
14339 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14340 r_type == 0 for a local symbol with r_sym == 0.
14341 (scan_relocatable_relocs): Pass r_sym to
14342 local_non_section_strategy.
14343 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14344 r_sym parameter.
14345
14346 * configure.ac: Update test for TLS descriptors: they are
14347 supported as of glibc 2.9.
14348 * configure: Rebuild.
14349
14350 2008-12-11 Ian Lance Taylor <iant@google.com>
14351
14352 PR 7091
14353 * target-reloc.h (Default_scan_relocatable_relocs): For each
14354 function, map r_type == 0 to RELOC_DISCARD.
14355
14356 2008-12-10 Cary Coutant <ccoutant@google.com>
14357
14358 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14359 object to override a kept COMDAT group from a plugin object.
14360
14361 2008-12-09 Ian Lance Taylor <iant@google.com>
14362
14363 PR 7088
14364 * yyscript.y (file_cmd): Handle INPUT.
14365
14366 * testsuite/initpri1.c: Change all declarations to be full
14367 prototypes by adding void, to avoid compiler warnings.
14368
14369 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
14370
14371 * options.cc (General_options::parse_plugin_opt): New.
14372 (General_options::add_plugin): The argument now is just the filename.
14373 (General_options::add_plugin_option): New.
14374 * options.h (plugin_opt): New.
14375 (add_plugin): Change argument name.
14376 (add_plugin_option): New.
14377 * plugin.cc (Plugin::load): Don't parse the plugin option.
14378 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14379 (Plugin::add_option): New.
14380 (Plugin::args_): Change type.
14381 (Plugin::filename_): New.
14382 (Plugin_manager::add_plugin_option): New.
14383 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14384 * testsuite/Makefile.in: Regenerate.
14385
14386 2008-12-05 Cary Coutant <ccoutant@google.com>
14387
14388 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14389 Handle --strip-lto-sections option.
14390 * options.h (strip_lto_sections): New option.
14391
14392 2008-12-01 Cary Coutant <ccoutant@google.com>
14393
14394 * plugin.cc (ld_plugin_message): Change format parameter to const.
14395 Fix mismatch between new[] and delete.
14396
14397 2008-11-14 Cary Coutant <ccoutant@google.com>
14398
14399 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14400 instead of -1U.
14401
14402 2008-11-05 Craig Silverstein <csilvers@google.com>
14403
14404 * options.cc (General_options::parse_dynamic_list): New function.
14405 * options.h (General_options): New flags dynamic_list,
14406 dynamic_list_data, dynamic_list_cpp_new, and
14407 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14408 (General_options::in_dynamic_list): New function.
14409 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14410 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14411 (Lex::can_continue_name): Likewise.
14412 (yylex): Likewise.
14413 (read_script_file): New parameter script_options.
14414 (read_dynamic_list): New function.
14415 (Script_options::define_dynamic_list): New function.
14416 (dynamic_list_keyword_parsecodes): New variable.
14417 (dynamic_list_keywords): New variable.
14418 * script.h (Script_options::define_dynamic_list): New function
14419 prototype.
14420 (read_dynamic_list): New function prototype.
14421 * symtab.cc (strprefix): New macro.
14422 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14423 dynamic_list_data, dynamic_list_cpp_new, and
14424 dynamic_list_cpp_typeinfo.
14425 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14426 (dynamic_list_expr): New rule.
14427 (dynamic_list_nodes): Likewise.
14428 (dynamic_list_node): Likewise.
14429 * testsuite/Makefile.am (dynamic_list): New test.
14430 * testsuite/Makefile.in: Regenerated.
14431 * testsuite/dynamic_list.t: New file.
14432 * testsuite/dynamic_list.sh: New file.
14433
14434 2008-11-05 Craig Silverstein <csilvers@google.com>
14435
14436 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14437 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14438 (t11_last): Likewise.
14439 * testsuite/ver_test_6.c (main): Likewise.
14440
14441 2008-10-07 Cary Coutant <ccoutant@google.com>
14442
14443 * options.c (General_options::finalize): Add check for -static and
14444 -shared.
14445 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14446 is not empty.
14447
14448 2008-10-02 Cary Coutant <ccoutant@google.com>
14449
14450 * plugin.cc (make_sized_plugin_object): Fix conditional
14451 compilation to work when not all targets are enabled.
14452
14453 2008-09-29 Cary Coutant <ccoutant@google.com>
14454
14455 * archive.cc (Archive::get_file_and_offset): Use filename instead
14456 of name to get library path.
14457 (Archive::include_member): Unlock external member of a thin archive.
14458
14459 * testsuite/Makefile.am (TEST_AR): New variable.
14460 (thin_archive_test_1): New test.
14461 (thin_archive_test_2): New test.
14462 * testsuite/Makefile.in: Regenerate.
14463 * testsuite/thin_archive_main.cc: New file.
14464 * testsuite/thin_archive_test_1.cc: New file.
14465 * testsuite/thin_archive_test_2.cc: New file.
14466 * testsuite/thin_archive_test_3.cc: New file.
14467 * testsuite/thin_archive_test_4.cc: New file.
14468
14469 2008-09-29 Cary Coutant <ccoutant@google.com>
14470
14471 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14472 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14473 instead of -1U.
14474 (Sized_relobj::do_finalize_local_symbols): Likewise.
14475 (Sized_relobj::map_to_kept_section): Likewise.
14476 * object.h (Sized_relobj::invalid_address): New constant.
14477 (Sized_relobj::do_output_section_offset): Check for invalid_address
14478 and return -1ULL.
14479 * output.cc (Output_reloc::local_section_offset): Use constant
14480 invalid_address instead of -1U.
14481 (Output_reloc::get_address): Likewise.
14482 (Output_section::output_address): Change -1U to -1ULL.
14483 * output.h (Output_reloc::invalid_address): New constant.
14484 * reloc.cc (Sized_relobj::write_sections): Use constant
14485 invalid_address instead of -1U.
14486 (Sized_relobj::relocate_sections): Likewise.
14487 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14488 values for merge sections.
14489 * target-reloc.h (relocate_for_relocatable): Use constant
14490 invalid_address instead of -1U.
14491
14492 2008-09-19 Cary Coutant <ccoutant@google.com>
14493
14494 Add plugin functionality for link-time optimization (LTO).
14495 * configure.ac (plugins): Add --enable-plugins option.
14496 * configure: Regenerate.
14497 * config.in: Regenerate.
14498 * Makefile.am (LIBDL): New variable.
14499 (CCFILES): Add plugin.cc.
14500 (HFILES): Add plugin.h.
14501 (ldadd_var): Add LIBDL.
14502 * Makefile.in: Regenerate.
14503
14504 * archive.cc: Include "plugin.h".
14505 (Archive::setup): Don't preread archive symbols when using a plugin.
14506 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14507 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14508 files.
14509 (Archive::include_member): Add symbols from plugin objects.
14510 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14511 * descriptors.cc (Descriptors::open): Check for file descriptors
14512 abandoned by plugins.
14513 (Descriptors::claim_for_plugin): New function.
14514 * descriptors.h (Descriptors::claim_for_plugin): New function.
14515 (Open_descriptor::is_claimed): New field.
14516 (claim_descriptor_for_plugin): New function.
14517 * fileread.cc (File_read::claim_for_plugin): New function.
14518 * fileread.h (File_read::claim_for_plugin): New function.
14519 (File_read::descriptor): New function.
14520 * gold.cc: Include "plugin.h".
14521 (queue_initial_tasks): Add task to call plugin hooks for generating
14522 new object files.
14523 * main.cc: Include "plugin.h".
14524 (main): Load plugin libraries.
14525 * object.h (Pluginobj): Declare.
14526 (Object::pluginobj): New function.
14527 (Object::do_pluginobj): New function.
14528 (Object::set_target): New function.
14529 * options.cc: Include "plugin.h".
14530 (General_options::parse_plugin): New function.
14531 (General_options::General_options): Initialize plugins_ field.
14532 (General_options::add_plugin): New function.
14533 * options.h (Plugin_manager): Declare.
14534 (General_options): Add --plugin option.
14535 (General_options::has_plugins): New function.
14536 (General_options::plugins): New function.
14537 (General_options::add_plugin): New function.
14538 (General_options::plugins_): New field.
14539 * plugin.cc: New file.
14540 * plugin.h: New file.
14541 * readsyms.cc: Include "plugin.h".
14542 (Read_symbols::do_read_symbols): Check for archive before checking
14543 for ELF file. Call plugin hooks to claim files.
14544 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14545 from a real object file; force override when processing replacement
14546 files.
14547 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14548 (Symbol::init_base_object): Likewise.
14549 (Symbol::init_base_output_data): Likewise.
14550 (Symbol::init_base_output_segment): Likewise.
14551 (Symbol::init_base_constant): Likewise.
14552 (Symbol::init_base_undefined): Likewise.
14553 (Symbol::output_section): Assert that object is not a plugin.
14554 (Symbol_table::add_from_pluginobj): New function.
14555 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14556 undefined.
14557 (Symbol_table::sized_write_globals): Likewise.
14558 (Symbol_table::add_from_pluginobj): Instantiate template.
14559 * symtab.h (Sized_pluginobj): Declare.
14560 (Symbol::in_real_elf): New function.
14561 (Symbol::set_in_real_elf): New function.
14562 (Symbol::in_real_elf_): New field.
14563 (Symbol_table::add_from_pluginobj): New function.
14564
14565 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14566 (LIBDL): New variable.
14567 (LDADD): Add LIBDL.
14568 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14569 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14570 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14571 (MOSTLYCLEANFILES): Likewise.
14572 * testsuite/Makefile.in: Regenerate.
14573 * testsuite/plugin_test.c: New file.
14574 * testsuite/plugin_test_1.sh: New file.
14575 * testsuite/plugin_test_2.sh: New file.
14576
14577 2008-09-16 Ian Lance Taylor <iant@google.com>
14578
14579 * target-reloc.h (relocate_section): Check whether a symbol is
14580 defined by the ABI before reporting an undefined symbol error.
14581 * target.h (Target::is_defined_by_abi): Make parameter const.
14582 (Target::do_is_defined_by_abi): Likewise.
14583 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14584 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14585 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14586 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14587 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14588 * testsuite/Makefile.in: Rebuild.
14589
14590 * fileread.cc (make_view): Add casts to avoid warning.
14591
14592 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14593
14594 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14595 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14596
14597 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
14598
14599 * options.h (General_options::output_is_executable): New.
14600 (General_options::output_is_pie): New.
14601 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14602 for shared libraries.
14603 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14604
14605 2008-09-11 Chris Demetriou <cgd@google.com>
14606
14607 * options.h (origin): New -z option.
14608 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14609 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14610 in DT_FLAGS_1.
14611
14612 2008-09-05 Cary Coutant <ccoutant@google.com>
14613
14614 * fileread.cc (File_read::make_view): Add check for attempt to map
14615 beyond end of file.
14616
14617 2008-09-05 Cary Coutant <ccoutant@google.com>
14618
14619 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14620 explicit instantiations.
14621
14622 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14623
14624 PR gold/6858
14625 * options.cc (General_options::finalize): Allow undefined symbols
14626 in shlibs if linking -shared.
14627
14628 PR gold/6859
14629 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14630 symbols as not needing a dynsym entry.
14631
14632 2008-08-20 Craig Silverstein <csilvers@google.com>
14633
14634 * fileread.cc (File_read::open): Do not lock the file unless it
14635 was successfully opened.
14636
14637 2008-08-14 Cary Coutant <ccoutant@google.com>
14638
14639 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14640 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14641 * testsuite/tls_test.cc (struct int128): 128-bit struct
14642 for testing TLS relocs with non-zero addend.
14643 (v12): New TLS variable.
14644 (t12): New test.
14645 (t_last): Add check for v12.
14646 * testsuite/tls_test.h (t12): New function.
14647 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14648
14649 2008-08-13 Ian Lance Taylor <iant@google.com>
14650
14651 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14652 set tls_segment_ or relro_segment_.
14653 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14654 when appropriate.
14655 * output.h (Output_section::clear_is_relro): New function.
14656 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14657 sections specially even when output_data_ is empty.
14658 (Output_segment::maximum_alignment): When first section is relro,
14659 only force alignment for PT_LOAD segments.
14660 * script.cc (script_data_segment_align): New function.
14661 (script_data_segment_relro_end): New function.
14662 * script-c.h (script_data_segment_align): Declare.
14663 (script_data_segment_relro_end): Declare.
14664 * script-sections.h (class Script_sections): Declare
14665 data_segment_align and data_segment_relro_end. Add fields
14666 segment_align_index_ and saw_relro_end_.
14667 * script-sections.cc (class Sections_element): Add set_is_relro
14668 virtual function. Add new bool* parameter to place_orphan_here.
14669 Add get_output_section virtual function.
14670 (class Output_section_definition): Add set_is_relro. Add new
14671 bool* parameter to place_orphan_here. Add get_output_section.
14672 Add is_relro_ field.
14673 (Output_section_definition::Output_section_definition): Initialize
14674 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14675 and is_relro_ fields.
14676 (Output_section_definition::place_orphan_here): Add is_relro
14677 parameter.
14678 (Output_section_definition::set_section_addresses): Set relro for
14679 output section.
14680 (Output_section_definition::alternate_constraint): Likewise.
14681 (class Orphan_output_section): Add new bool* parameter to
14682 place_orphan_here. Add get_output_section.
14683 (Orphan_output_section::place_orphan_here): Add is_relro
14684 parameter.
14685 (Script_sections::Script_sections): Initialize
14686 data_segment_align_index_ and saw_relro_end_.
14687 (Script_sections::data_segment_align): New function.
14688 (Script_sections::data_segment_relro_end): New function.
14689 (Script_sections::place_orphan): Set or clear is_relro.
14690 (Script_sections::set_section_addresses): Force alignment of first
14691 TLS section.
14692 * yyscript.y (exp): Call script_data_segment_align and
14693 script_data_segment_relro_end.
14694 * testsuite/relro_script_test.t: New file.
14695 * testsuite/relro_test.cc (using_script): Declare.
14696 (t1, t2): Test using_script.
14697 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14698 (relro_script_test_SOURCES): Define.
14699 (relro_script_test_DEPENDENCIES): Define.
14700 (relro_script_test_LDFLAGS): Define.
14701 (relro_script_test_LDADD): Define.
14702 (relro_script_test.so): New target.
14703 * testsuite/Makefile.in: Rebuild.
14704
14705 2008-08-06 Cary Coutant <ccoutant@google.com>
14706
14707 * archive.cc (Archive::total_archives, Archive::total_members)
14708 (Archive::total_members_loaded): New variables.
14709 (Archive::setup): Add parameter. Add option to preread
14710 archive symbols.
14711 (Archive::read_armap): Add counter.
14712 (Archive::get_file_and_offset): New function.
14713 (Archive::get_elf_object_for_member): New function.
14714 (Archive::read_all_symbols): New function.
14715 (Archive::read_symbols): New function.
14716 (Archive::add_symbols): Add counters.
14717 (Archive::include_all_members): Use armap to find members if it's
14718 already built.
14719 (Archive::include_member): Skip reading symbols if already read.
14720 Factored code into Archive::get_file_and_offset and
14721 Archive::get_elf_object_for_member. Changed call to
14722 Mapfile::report_include_archive_member.
14723 (Archive::print_stats): New function.
14724 * archive.h: Declare Object and Read_symbols_data classes.
14725 (Archive::Archive): Add initializers for new members.
14726 (Archive::setup): Add parameter.
14727 (Archive::print_stats): New function.
14728 (Archive::total_archives, Archive::total_members)
14729 (Archive::total_members_loaded): New variables.
14730 (Archive::get_file_and_offset): New function.
14731 (Archive::get_elf_object_for_member): New function.
14732 (Archive::read_all_symbols): New function.
14733 (Archive::read_symbols): New function.
14734 (Archive::Archive_member): New class.
14735 (Archive::members_): New member.
14736 (Archive::num_members_): New member.
14737 * main.cc: Include archive.h.
14738 (main): Call Archive::print_stats.
14739 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14740 archive parameter; member_name is now the fully-decorated name.
14741 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14742 * options.h: (General_options): Add --preread-archive-symbols option.
14743 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14744 Archive::setup.
14745
14746 2008-08-04 Ian Lance Taylor <iant@google.com>
14747
14748 * symtab.h (Symbol::use_plt_offset): New function.
14749 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14750 * powerpc.cc (Relocate::relocate): Likewise.
14751 * sparc.cc (Relocate::relocate): Likewise.
14752 * x86_64.cc (Relocate::relocate): Likewise.
14753 * testsuite/weak_plt.sh: New test.
14754 * testsuite/weak_plt_main.cc: New test.
14755 * testsuite/weak_plt_shared.cc: New test.
14756 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14757 (check_PROGRAMS): Add weak_plt.
14758 (check_DATA): Add weak_plt_shared.so.
14759 (weak_plt_main_pic.o, weak_plt): New targets.
14760 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14761 * testsuite/Makefile.in: Rebuild.
14762
14763 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14764 gcctestdir/ld.
14765 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14766 * testsuite/Makefile.in: Rebuild.
14767
14768 2008-08-04 Alan Modra <amodra@bigpond.net.au>
14769
14770 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14771 * Makefile.in: Regenerate.
14772 * po/POTFILES.in: Regenerate.
14773
14774 2008-07-29 Ian Lance Taylor <iant@google.com>
14775
14776 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14777 symbols before other symbols.
14778 * testsuite/script_test_2.cc (test_addr): Declare.
14779 (test_addr_alias): Declare.
14780 (main): Check that test_addr and test_addr_alias have the right
14781 values.
14782 * testsuite/script_test_2.t: Define test_addr_alias and
14783 test_addr.
14784
14785 2008-07-24 Ian Lance Taylor <iant@google.com>
14786
14787 PR 5990
14788 * descriptors.cc: New file.
14789 * descriptors.h: New file.
14790 * gold-threads.h (class Hold_optional_lock): New class.
14791 * fileread.cc: Include "descriptors.h".
14792 (File_read::~File_read): Release descriptor rather than closing
14793 it.
14794 (File_read::open) [file]: Call open_descriptor rather than open.
14795 Set is_descriptor_opened_.
14796 (File_read::open) [memory]: Assert that descriptor is not open.
14797 (File_read::reopen_descriptor): New function.
14798 (File_read::release): Release descriptor.
14799 (File_read::do_read): Make non-const. Reopen descriptor.
14800 (File_read::read): Make non-const.
14801 (File_read::make_view): Reopen descriptor.
14802 (File_read::do_readv): Likewise.
14803 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14804 Update declarations.
14805 * layout.cc: Include "descriptors.h".
14806 (Layout::create_build_id): Use open_descriptor rather than open.
14807 * output.cc: Include "descriptors.h".
14808 (Output_file::open): Use open_descriptor rather than open.
14809 * archive.cc (Archive::const_iterator): Change Archive to be
14810 non-const.
14811 (Archive::begin, Archive::end): Make non-const.
14812 (Archive::count_members): Likewise.
14813 * archive.h (class Archive): Update declarations.
14814 * object.h (Object::read): Make non-const.
14815 * Makefile.am (CCFILES): Add descriptors.cc.
14816 (HFILES): Add descriptors.h.
14817 * Makefile.in: Rebuild.
14818
14819 PR 6716
14820 * gold.h: Always include <clocale>. Add Solaris workarounds
14821 following code in binutils/sysdep.h.
14822
14823 PR 6048
14824 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14825 this->eh_frame_hdr_ is NULL before using it.
14826
14827 * dynobj.cc (Versions::Versions): Update comment.
14828
14829 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14830 the base version name.
14831
14832 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14833 array size plus one.
14834 (Stringpool_template::set_string_offsets): Subtract one from key
14835 before using it as an array index.
14836 (Stringpool_template::get_offset_with_length): Likewise.
14837 (Stringpool_template::write_to_buffer): Likewise.
14838 * stringpool.h (Stringpool_template::get_offset_from_key):
14839 Likewise.
14840
14841 2008-07-23 Ian Lance Taylor <iant@google.com>
14842
14843 PR 6658
14844 * object.h (Merged_symbol_value::value): Do our best to handle a
14845 negative addend.
14846
14847 PR 6647
14848 * script.cc (Version_script_info::get_versions): Don't add empty
14849 version tag to return value.
14850 (Version_script_info::get_symbol_version_helper): Change return
14851 type to bool. Add pversion parameter. Change all callers.
14852 (script_register_vers_node): Don't require a non-NULL tag.
14853 * script.h (class Version_script_info): Update declarations.
14854 (Version_script_info::get_symbol_version): Change return type to
14855 bool. Add version parameter. Change all callers.
14856 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14857 handling. Handle an empty version from a version script.
14858 (Symbol_table::define_special_symbol): Likewise.
14859 * testsuite/ver_test_10.script: New file.
14860 * testsuite/ver_test_10.sh: New file.
14861 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14862 (check_DATA): Add ver_test_10.syms.
14863 (ver_test_10.syms, ver_test_10.so): New target.
14864 * testsuite/Makefile.in: Rebuild.
14865
14866 2008-07-23 Simon Baldwin <simonb@google.com>
14867
14868 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14869 to zero for undefined symbols from dynamic libraries.
14870
14871 2008-07-23 Ian Lance Taylor <iant@google.com>
14872
14873 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14874 Change all callers.
14875 * symtab.h (class Symbol_table): Update declaration.
14876 * testsuite/ver_test_9.cc: New file.
14877 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14878 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14879 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14880 (ver_test_9.so, ver_test_9.o): New targets.
14881 * testsuite/Makefile.in: Rebuild.
14882
14883 2008-07-22 Ian Lance Taylor <iant@google.com>
14884
14885 * options.h (class General_options): Define --check-sections.
14886 * layout.cc (Layout::set_segment_offsets): Handle
14887 --check-sections.
14888
14889 * options.h (class General_options): Define -n/--nmagic and
14890 -N/--omagic.
14891 * options.cc (General_options::finalize): For -n/--nmagic or
14892 -N/--omagic, set -static.
14893 * layout.cc (Layout::attach_allocated_section_to_segment): If
14894 -N/--omagic, don't put read-only and read-write sections in
14895 different segments.
14896 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14897 finding a read-only segment.
14898 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14899 don't set the minimum segment alignment to the common page size,
14900 and don't set the file offset to the address modulo the page size.
14901 * script-sections.cc (Script_sections::create_segments): If
14902 -n/--omagic, don't put read-only and read-write sections in
14903 different segments.
14904
14905 * cref.cc: New file.
14906 * cref.h: New file.
14907 * options.h (class General_options): Add --print-symbol-counts.
14908 * main.cc (main): Issue defined symbol report if requested.
14909 * archive.cc (Archive::interpret_header): Make into a const member
14910 function.
14911 (Archive::add_symbols): Call Input_objects::archive_start and
14912 archive_stop.
14913 (Archive::const_iterator): Define new class.
14914 (Archive::begin, Archive::end): New functions.
14915 (Archive::include_all_members): Rewrite to use iterator.
14916 (Archive::count_members): New function.
14917 * archive.h (class Archive): Update declarations.
14918 (Archive::filename): New function.
14919 * object.cc: Include "cref.h".
14920 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14921 (Sized_relobj::do_get_global_symbol_counts): New function.
14922 (Input_objects::add_object): Add object to cross-referencer.
14923 (Input_objects::archive_start): New function.
14924 (Input_objects::archive_stop): New function.
14925 (Input_objects::print_symbol_counts): New function.
14926 * object.h: Declare Cref and Archive.
14927 (Object::get_global_symbol_counts): New function.
14928 (Object::do_get_global_symbol_counts): New pure virtual function.
14929 (class Sized_relobj): Add defined_count_ field. Update
14930 declarations.
14931 (class Input_objects): Add cref_ field. Update constructor.
14932 Update declarations.
14933 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14934 defined_count_.
14935 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14936 symbol counts.
14937 (Sized_dynobj::do_get_global_symbol_counts): New function.
14938 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14939 defined_count_. Update declarations. Define Symbols typedef.
14940 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14941 parameter. Change all callers.
14942 (Symbol_table::add_from_dynobj): Add sympointers and defined
14943 parameters. Change all callers.
14944 * symtab.h (class Symbol_table): Update declarations.
14945 * Makefile.am (CCFILES): Add cref.cc.
14946 (HFILES): Add cref.h.
14947 * Makefile.in: Rebuild.
14948
14949 2008-07-22 Simon Baldwin <simonb@google.com>
14950
14951 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14952 to zero when writing undefined symbols.
14953
14954 2008-07-22 Ian Lance Taylor <iant@google.com>
14955
14956 * output.cc (Output_section::add_input_section): Don't try to
14957 merge empty merge sections.
14958
14959 2008-07-21 Craig Silverstein <csilvers@google.com>
14960
14961 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14962 Include symbol version in error message.
14963
14964 2008-07-20 Chris Demetriou <cgd@google.com>
14965
14966 * configure.ac (gold_cv_c_random_seed): New configured variable.
14967 (RANDOM_SEED_CFLAGS): New substituted variable.
14968 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14969 * configure: Rebuild.
14970 * Makefile.in: Likewise.
14971 * testsuite/Makefile.in: Likewise.
14972
14973 2008-07-18 Ian Lance Taylor <iant@google.com>
14974
14975 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14976 where we see NAME/NULL and NAME/VERSION as separate symbols.
14977 * testsuite/ver_test_main.cc (main): Call t4.
14978 (t4, t4_2a): Define.
14979 * testsuite/ver_test_2.cc (t4_2): Define.
14980 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14981 * testsuite/ver_test_4.cc (t4_2a): Define.
14982 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14983 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14984
14985 2008-07-17 Ian Lance Taylor <iant@google.com>
14986
14987 * dynobj.cc (Versions::add_def): If we give an error about a
14988 missing version, go ahead and create the version anyhow.
14989
14990 2008-07-10 Ian Lance Taylor <iant@google.com>
14991
14992 Handle output sections with more than 0x7fffffff bytes.
14993 * object.h (class Relobj): Change map_to_output_ to
14994 output_sections_, and just keep a section pointer. Change all
14995 uses. Move comdat group support to Sized_relobj.
14996 (Relobj::is_section_specially_mapped): Remove.
14997 (Relobj::output_section): Remove poff parameter. Change all
14998 callers.
14999 (Relobj::output_section_offset): New function.
15000 (Relobj::set_section_offset): Rewrite.
15001 (Relobj::map_to_output): Remove.
15002 (Relobj::output_sections): New function.
15003 (Relobj::do_output_section_offset): New pure virtual function.
15004 (Relobj::do_set_section_offset): Likewise.
15005 (class Sized_relobj): Add section_offsets_ field. Add comdat
15006 group support from Relobj. Update declarations.
15007 (Sized_relobj::get_output_section_offset): New function.
15008 (Sized_relobj::do_output_section_offset): New function.
15009 (Sized_relobj::do_set_section_offset): New function.
15010 * object.cc (Relobj::output_section_address): Remove.
15011 (Sized_relobj::Sized_relobj): Initialize new fields.
15012 (Sized_relobj::include_section_group): Cast find_kept_object to
15013 Sized_relobj.
15014 (Sized_relobj::include_linkonce_section): Likewise.
15015 (Sized_relobj::do_layout): Use separate arrays for output section
15016 and output offset.
15017 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15018 output_sections.
15019 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15020 output_sections and section_offsets.
15021 (Sized_relobj::write_local_symbols): Likewise.
15022 (map_to_kept_section): Compute output address directly.
15023 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15024 output_sections and section_offsets.
15025 (Sized_relobj::write_sections): Likewise.
15026 (Sized_relobj::relocate_sections): Likewise.
15027 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15028 * output.h (class Output_reloc): Update declarations. Change
15029 u2_.relobj to Sized_relobj*.
15030 (class Output_data_reloc): Change add functions to use
15031 Sized_relobj*.
15032 * output.cc (Output_reloc::Output_reloc): Change relobj to
15033 Sized_relobj*.
15034 (Output_reloc::local_section_offset): Change return type to
15035 Elf_Addr. Use get_output_section_offset.
15036 (Output_reloc::get_address): Likewise.
15037 (Output_section::is_input_address_mapped): Don't call
15038 is_section_specially_mapped.
15039 (Output_section::output_offset): Likewise.
15040 (Output_section::output_address): Likewise.
15041 (Output_section::starting_output_address): Likewise.
15042 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15043 parameter to Sized_relobj*.
15044 (Copy_relocs::need_copy_reloc): Likewise.
15045 (Copy_relocs::save): Likewise.
15046 * copy-relocs.h (class Copy_relocs): Update declarations.
15047 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15048 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15049 * target-reloc.h (relocate_for_relocatable): Change
15050 offset_in_output_section type to Elf_Addr. Change code that uses
15051 it as well.
15052 * layout.cc (Layout::layout): Always set *off.
15053 * mapfile.cc (Mapfile::print_input_section): Use
15054 output_section_offset.
15055 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15056 Sized_relobj*.
15057 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15058 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15059 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15060
15061 2008-07-03 Ian Lance Taylor <iant@google.com>
15062
15063 * layout.cc (Layout::include_section): Do not discard unrecognized
15064 SHT_STRTAB sections.
15065
15066 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15067
15068 * script.cc (Lex::can_continue_name): Make '?' allowable in
15069 version-script names.
15070 * testsuite/version_script.map: Change glob pattern to use '?'
15071
15072 2008-06-30 Manish Singh <yosh@gimp.org>
15073
15074 PR 6585
15075 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15076 Correct typo.
15077
15078 2008-06-30 Ian Lance Taylor <iant@google.com>
15079
15080 PR 6660
15081 PR 6682
15082 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15083 versions]: Don't try to read the value in the contents, since we
15084 don't use it. Use the template endianness when writing.
15085
15086 2008-06-25 Cary Coutant <ccoutant@google.com>
15087
15088 * fileread.cc (File_read::make_view): Assert on zero-length view.
15089 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15090 symbol table when there are no symbols to read.
15091
15092 2008-06-23 Craig Silverstein <csilvers@google.com>
15093
15094 * version.cc (version_string): Bump to 1.7
15095
15096 2008-06-18 Craig Silverstein <csilvers@google.com>
15097
15098 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15099 constant 0xFFFF to type Valtype.
15100 (Powerpc_relocate_functions::rel16_ha): Likewise.
15101
15102 2008-06-17 Ian Lance Taylor <iant@google.com>
15103
15104 * output.h (Output_section::Input_section): Initialize p2align_ to
15105 zero for Output_section_data constructors.
15106 (Output_section::Input_section::addralign): If not an input
15107 section, return the alignment of the Output_section_data.
15108 * testsuite/copy_test.cc: New file.
15109 * testsuite/copy_test_1.cc: New file.
15110 * testsuite/copy_test_2.cc: New file.
15111 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15112 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15113 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15114 (copy_test_1_pic.o, copy_test_1.so): New targets.
15115 (copy_test_2_pic.o, copy_test_2.so): New targets.
15116 * testsuite/Makefile.in: Rebuild.
15117
15118 * script-sections.cc (Script_sections::place_orphan): Initialize
15119 local variable exact.
15120
15121 2008-06-13 David Edelsohn <edelsohn@gnu.org>
15122
15123 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15124
15125 2008-06-12 David Edelsohn <edelsohn@gnu.org>
15126 David S. Miller <davem@davemloft.net>
15127
15128 * powerpc.cc: New file.
15129 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15130 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15131 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15132 * Makefile.in: Rebuild.
15133
15134 2008-06-09 Ian Lance Taylor <iant@google.com>
15135
15136 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15137 <exception>.
15138 (throwing, orig_terminate): New static variables.
15139 (terminate_handler): New static function.
15140 (t2): Set terminate handler.
15141
15142 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15143
15144 PR 6584
15145 * binary.cc (Binary_to_elf::sized_convert): Fix .data
15146 alignment.
15147
15148 2008-05-30 Cary Coutant <ccoutant@google.com>
15149
15150 * archive.cc (Archive::include_all_members) Correct to step
15151 over symbol table and extended name table in thin archives.
15152
15153 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15154
15155 PR 6407
15156 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15157 calculation.
15158
15159 2008-05-28 Caleb Howe <cshowe@google.com>
15160
15161 * reduced_debug_output.cc: New file.
15162 * reduced_debug_output.h: New file.
15163 * options.h (class General_options): Add --strip-debug-non-line.
15164 * options.cc (General_options::finalize): Add strip_debug_non_line
15165 to the strip heirarchy.
15166 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15167 fields.
15168 * layout.cc: Include "reduced_debug_output.h".
15169 (Layout::Layout): Initialize new fields.
15170 (line_only_debug_sections): New static array.
15171 (is_lines_only_debug_sections): New static inline function.
15172 (Layout::include_section): Handle --strip-debug-non-line.
15173 (Layout::make_output_section): If --strip-debug-non-line, build
15174 new output sections for .debug_abbrev and .debug_info.
15175 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15176 gold. Warn about possible overflow.
15177 (read_signed_LEB_128): Likewise.
15178 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15179 (read_signed_LEB_128): Declare.
15180 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15181 (HFILES): Add reduced_debug_output.h.
15182 * Makefile.in: Rebuild.
15183
15184 2008-05-21 Ian Lance Taylor <iant@google.com>
15185
15186 * mapfile.cc: New file.
15187 * mapfile.h: New file.
15188 * options.h (class General_options): Add -M/--print-map and -Map.
15189 * options.cc (General_options::finalize): Make -M equivalent to
15190 -Map -.
15191 * main.cc: Include <cstdio> and "mapfile.h".
15192 (main): Open mapfile if requested.
15193 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15194 constructor. Change caller.
15195 (queue_initial_tasks): Add mapfile parameter. Change caller.
15196 (queue_middle_tasks): Likewise.
15197 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15198 declarations.
15199 * archive.cc: Include "mapfile.h".
15200 (Archive::add_symbols): Add mapfile parameter. Change all
15201 callers. Pass mapfile, symbol, and reason to include_member.
15202 (Archive::include_all_members): Add mapfile parameter. Change all
15203 callers.
15204 (Archive::include_member): Add mapfile, sym, and why parameters.
15205 Change all callers. Report inclusion to map file.
15206 * archive.h: Include "fileread.h".
15207 (class Archive): Update declarations.
15208 (Archive::file): New const method.
15209 (class Add_archive_symbols): Add mapfile_ field. Update
15210 constructor. Change all callers.
15211 * readsyms.h (class Read_symbols): Likewise.
15212 (class Finish_group): Likewise.
15213 (class Read_script): Likewise.
15214 * common.cc: Include "mapfile.h".
15215 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15216 all callers.
15217 (Symbol_table::do_allocate_commons): Likewise.
15218 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15219 symbol allocation to mapfile.
15220 * common.h (class Allocate_commons_task): Add mapfile_ field.
15221 Update constructor. Change all callers.
15222 * symtab.h (class Symbol_table): Update declarations.
15223 * layout.cc: Include "mapfile.h".
15224 (Layout_task_runner::run): Print information to mapfile.
15225 (Layout::create_gold_note): Change Output_data_fixed_space to
15226 Output_data_zero_fill.
15227 (Layout::create_build_id): Likewise.
15228 (Layout::print_to_mapfile): New function.
15229 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15230 constructor. Change caller.
15231 (class Layout): Declare print_to_mapfile.
15232 * output.cc (Output_section::Input_section::print_to_mapfile): New
15233 function.
15234 (Output_section::add_input_section): If producing a map, always
15235 add to input_sections_ list.
15236 (Output_section::do_print_to_mapfile): New function.
15237 (Output_segment::print_sections_to_mapfile): New function.
15238 (Output_segment::print_section_list_to_mapfile): New function.
15239 * output.h: Include "mapfile.h".
15240 (Output_data::print_to_mapfile): New function.
15241 (Output_data::do_print_to_mapfile): New virtual function.
15242 (Output_segment_headers::do_print_to_mapfile): New function.
15243 (Output_file_header::do_print_to_mapfile): New function.
15244 (Output_data_const::do_print_to_mapfile): New function.
15245 (class Output_data_const_buffer): Add map_name_ field. Update
15246 constructor. Change all callers. Add do_print_to_mapfile
15247 function.
15248 (class Output_data_fixed_space): Likewise.
15249 (class Output_data_space): Likewise.
15250 (class Output_data_zero_fill): New class.
15251 (Output_data_strtab::do_print_to_mapfile): New function.
15252 (Output_data_reloc_base::do_print_to_mapfile): New function.
15253 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15254 (Output_data_group::do_print_to_mapfile): New function.
15255 (Output_data_got::do_print_to_mapfile): New function.
15256 (Output_data_dynamic::do_print_to_mapfile): New function.
15257 (Output_symtab_xindex::do_print_to_mapfile): New function.
15258 (class Output_section): Declare do_print_to_mapflie. Declare
15259 print_to_mapfile in Input_section.
15260 (class Output_segment): Declare new functions.
15261 * object.h (Sized_relobj::symbol_count): New function.
15262 * script-sections.cc
15263 (Output_section_element_dot_assignment::set_section_addresses):
15264 Change Output_data_fixed_space to Output_data_zero_fill.
15265 (Output_data_expression::do_print_to_mapfile): New function.
15266 * script.cc (read_input_script): Add mapfile parameter. Change
15267 all callers.
15268 * script.h (read_input_script): Update declaration.
15269 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15270 (Eh_frame::do_print_to_mapfile): New function.
15271 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15272 (Output_merge_string::do_print_to_mapfile): New function.
15273 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15274 function.
15275 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15276 function.
15277 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15278 function.
15279 * Makefile.am (CCFILES): Add mapfile.cc.
15280 (HFILES): Add mapfile.h.
15281 * Makefile.in: Rebuild.
15282
15283 2008-05-19 Ian Lance Taylor <iant@google.com>
15284
15285 * options.h (class General_options): Add -z relro.
15286 * layout.cc (Layout::Layout): Initialize relro_segment_.
15287 (Layout::add_output_section_data): Return the output section.
15288 (Layout::make_output_section): Rcognize relro sections and mark
15289 them appropriately.
15290 (Layout::attach_allocated_section_to_segment): Put relro sections
15291 in a PT_GNU_RELRO segment.
15292 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15293 section as relro.
15294 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15295 PT_TLS segments.
15296 (Layout::linkonce_mapping): Map d.rel.ro.local to
15297 .data.rel.ro.local.
15298 (Layout::output_section_name): Us .data.rel.ro.local for any
15299 section which begins with that.
15300 * layout.h (class Layout): Update add_output_section_data
15301 declaration. Add relro_segment_ field.
15302 * output.cc (Output_section::Output_section): Initialize is_relro_
15303 and is_relro_local_ fields.
15304 (Output_segment::add_output_section): Group relro sections.
15305 (Output_segment::is_first_section_relro): New function.
15306 (Output_segment::maximum_alignment): If there is a relro section,
15307 align the segment to the common page size.
15308 (Output_segment::set_section_addresses): Track whether we are
15309 looking at relro sections. If the last section is a relro
15310 section, align to the common page size.
15311 (Output_segment::set_section_list_addresses): Add in_relro
15312 parameter. Change all callers. Align to the page size when
15313 moving from relro to non-relro section.
15314 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15315 segment.
15316 * output.h (class Output_section): Add is_relro_ and
15317 is_relro_local_ fields.
15318 (Output_section::is_relro): New function.
15319 (Output_section::set_is_relro): New function.
15320 (Output_section::is_relro_local): New function.
15321 (Output_section::set_is_relro_local): New function.
15322 (class Output_segment): Update declarations.
15323 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15324 * sparc.cc (Target_sparc::got_section): Likewise.
15325 * x86_64.cc (Target_x86_64::got_section): Likewise.
15326 * testsuite/relro_test_main.cc: New file.
15327 * testsuite/relro_test.cc: New file.
15328 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15329 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15330 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15331 (relro_test.so, relro_test_pic.o): New targets.
15332 * testsuite/Makefile.in: Rebuild.
15333
15334 2008-05-16 Ian Lance Taylor <iant@google.com>
15335
15336 * output.cc (Output_segment::add_output_section): Remove front
15337 parameter.
15338 * output.h (class Output_segment): Remove
15339 add_initial_output_section and overloaded add_output_section.
15340 Update declaration of remaining add_output_section.
15341 * layout.cc (Layout::create_interp): Call add_output_section
15342 rather than add_initial_output_section.
15343 (Layout::finish_dynamic_section): Likewise.
15344
15345 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15346 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15347 know the dynamic type.
15348 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15349 field. Initialize it in constructor.
15350 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15351 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15352 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15353 reloc.
15354
15355 * output.cc (Output_reloc::get_address): Change return type to
15356 Elf_Addr.
15357 * output.h (class Output_reloc): Update get_address declaration.
15358 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15359 for section addresses.
15360
15361 2008-05-09 Ian Lance Taylor <iant@google.com>
15362
15363 PR 6493
15364 * gold.cc (gold_nomem): Use return value of write.
15365
15366 2008-05-08 Ian Lance Taylor <iant@google.com>
15367
15368 * symtab.c (Symbol::init_base_output_data): Add version
15369 parameter. Change all callers.
15370 (Symbol::init_base_output_segment): Likewise.
15371 (Symbol::init_base_constant): Likewise.
15372 (Symbol::init_base_undefined): Likewise.
15373 (Sized_symbol::init_output_data): Likewise.
15374 (Sized_symbol::init_output_segment): Likewise.
15375 (Sized_symbol::init_constant): Likewise.
15376 (Sized_symbol::init_undefined): Likewise.
15377 (Symbol_table::do_define_in_output_data): If the new symbol has a
15378 version, mark it as the default.
15379 (Symbol_table::do_define_in_output_segment): Likewise.
15380 (Symbol_table::do_define_as_constant): Likewise.
15381 * symtab.h (class Symbol): Update declarations.
15382 (class Sized_symbol): Likewise.
15383 * resolve.cc (Symbol::override_version): New function.
15384 (Symbol::override_base): Call override_version.
15385 (Symbol::override_base_with_special): Likewise.
15386 * testsuite/ver_script_8.script: New file.
15387 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15388 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15389 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15390 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15391
15392 2008-05-06 Ian Lance Taylor <iant@google.com>
15393
15394 PR 6049
15395 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15396 functions.
15397 (class General_options): Remove existing --undefined, and add
15398 --no-undefined instead. Add new --undefined as synonym for -u.
15399 * archive.cc (Archive::add_symbols): Check whether symbol was
15400 named with -u.
15401 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15402 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15403 all uses. Add IS_UNDEFINED. Update declarations to split
15404 different versions of init_base. Declare init_base_undefined.
15405 (Symbol::is_defined): Handle IS_UNDEFINED.
15406 (Symbol::is_undefined): Likewise.
15407 (Symbol::is_weak_undefined): Call is_undefined.
15408 (Symbol::is_absolute): Handle IS_CONSTANT.
15409 (class Sized_symbol): Update declarations to split different
15410 versions of init. Declare init_undefined.
15411 (class Symbol_table): Declare new functions.
15412 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15413 Change all callers.
15414 (Symbol::init_base_output_data): Likewise.
15415 (Symbol::init_base_output_segment): Likewise.
15416 (Symbol::init_base_constant): Likewise.
15417 (Symbol::init_base_undefined): New function.
15418 (Sized_symbol::init_object): Rename from init. Change all
15419 callers.
15420 (Sized_symbol::init_output_data): Likewise.
15421 (Sized_symbol::init_output_segment): Likewise.
15422 (Sized_symbol::init_constant): Likewise.
15423 (Sized_symbol::init_undefined): New function.
15424 (Symbol_table::add_undefined_symbols_from_command_line): New
15425 function.
15426 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15427 function.
15428 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15429 (Symbol::output_section): Likewise.
15430 (Symbol::set_output_section): Likewise.
15431 (Symbol_table::sized_finalize_symbol): Likewise.
15432 (Symbol_table::sized_write_globals): Likewise.
15433 * resolve.cc (Symbol_table::should_override): Likewise.
15434 (Symbol::override_base_with_special): Likewise.
15435
15436 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15437 symbol, change it to have default visibility.
15438 * testsuite/protected_1.cc: New file.
15439 * testsuite/protected_2.cc: New file.
15440 * testsuite/protected_3.cc: New file.
15441 * testsuite/protected_main_1.cc: New file.
15442 * testsuite/protected_main_2.cc: New file.
15443 * testsuite/protected_main_3.cc: New file.
15444 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15445 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15446 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15447 (protected_1.so): New target.
15448 (protected_1_pic.o, protected_2_pic.o): New targets.
15449 (protected_3_pic.o): New target.
15450 (check_PROGRAMS): Add protected_2.
15451 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15452 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15453 * testsuite/Makefile.in: Rebuild.
15454
15455 * options.h (DEFINE_var): Add set_user_set_##varname__.
15456 (DEFINE_bool_alias): New macro.
15457 (class General_options): Define -Bstatic using DEFINE_bool_alias
15458 rather than DEFINE_special. Add --undefined as an alias for -z
15459 defs.
15460 * options.cc (General_options::parse_Bstatic): Remove.
15461
15462 * options.h (class General_options): Add --fatal-warnings.
15463 * main.cc (main): Implement --fatal-warnings.
15464 * errors.h (Errors::warning_count): New function.
15465
15466 * options.h (class General_options): Add -Bsymbolic-functions.
15467 * symtab.h (Symbol::is_preemptible): Check for
15468 -Bsymbolic-functions.
15469
15470 2008-05-05 Ian Lance Taylor <iant@google.com>
15471
15472 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15473 as noVARNAME rather than no-VARNAME.
15474 (class General_options): Add option -z combreloc.
15475 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15476 get_address.
15477 (Output_reloc::sort_before) [SHT_REL]: New function.
15478 (Output_reloc::sort_before) [SHT_RELA]: New function.
15479 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15480 Sort_relocs_comparison.
15481 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15482 parameter. Change all callers.
15483 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15484 sort_relocs parameter. Change all callers.
15485 * output.cc (Output_reloc::get_address): New function, broken out
15486 of write_rel.
15487 (Output_reloc::write_rel): Call it.
15488 (Output_reloc::compare): New function.
15489 (Output_data_reloc_base::do_write): Optionally sort relocs.
15490
15491 * configure.ac: If targ_extra_obj is set, link it in.
15492 * configure.tgt: Initialize all variables.
15493 (x86_64*): Set targ_extra_obj and targ_extra_size.
15494 * configure: Rebuild.
15495
15496 * object.cc (Sized_relobj::include_section_group): Adjust section
15497 indexes read from group data. Build vector to pass to
15498 layout_group.
15499 * layout.cc (Layout::layout_group): Add flags and shndxes
15500 parameters. Remove contents parameter. Change caller. Update
15501 explicit instantiations.
15502 * layout.h (class Layout): Update layout_group declaration.
15503 * output.cc (Output_data_group::Output_data_group): Add flags and
15504 input_shndxes parameters. Remove contents parameter. Change
15505 caller.
15506 (Output_data_group::do_write): Change input_sections_ to
15507 input_shndxes_.
15508 * output.h (class Output_data_group): Update constructor
15509 declaration. Rename input_sections_ to input_shndxes_.
15510 * testsuite/many_sections_test.cc: Add template.
15511
15512 2008-04-30 Cary Coutant <ccoutant@google.com>
15513
15514 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15515
15516 * layout.cc (Layout::include_section): Refactored check for debug
15517 info section.
15518 (Layout::add_comdat): Add new parameters. Change type
15519 of signature parameter. Add object and shndx to signatures table.
15520 (Layout::find_kept_object): New function.
15521 * layout.h: Include <cstring>.
15522 (Layout::is_debug_info_section): New function.
15523 (Layout::add_comdat): Add new parameters.
15524 (Layout::find_kept_object): New function.
15525 (Layout::Kept_section): New struct.
15526 (Layout::Signatures): Change type of map range.
15527 * object.cc (Relobj::output_section_address): New function.
15528 (Sized_relobj::include_section_group): Add new parameters. Change
15529 calls to Layout::add_comdat. Change to build table of kept comdat
15530 groups and table mapping discarded sections to kept sections.
15531 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15532 (Sized_relobj::do_layout): Change calls to include_section_group and
15533 include_linkonce_section.
15534 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15535 value to zero when section is discarded.
15536 (Sized_relobj::map_to_kept_section): New function.
15537 * object.h (Relobj::output_section_address): New function.
15538 (Relobj::Comdat_group): New type.
15539 (Relobj::find_comdat_group): New function.
15540 (Relobj::Comdat_group_table): New type.
15541 (Relobj::Kept_comdat_section): New type.
15542 (Relobj::Kept_comdat_section_table): New type.
15543 (Relobj::add_comdat_group): New function.
15544 (Relobj::set_kept_comdat_section): New function.
15545 (Relobj::get_kept_comdat_section): New function.
15546 (Relobj::comdat_groups_): New field.
15547 (Relobj::kept_comdat_sections_): New field.
15548 (Symbol_value::input_value): Update comment.
15549 (Sized_relobj::map_to_kept_section) New function.
15550 (Sized_relobj::include_linkonce_section): Add new parameter.
15551 * target-reloc.h (Comdat_behavior): New type.
15552 (get_comdat_behavior): New function.
15553 (relocate_section): Add code to map a discarded section to the
15554 corresponding kept section when applying a relocation.
15555
15556 2008-04-30 Craig Silverstein <csilvers@google.com>
15557
15558 * dwarf_reader.cc (next_generation_count): New static var.
15559 (Addr2line_cache_entry): New struct.
15560 (addr2line_cache): New static var.
15561 (Dwarf_line_info::one_addr2line): Added caching.
15562 (Dwarf_line_info::clear_addr2line_cache): New function.
15563 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15564 cache-size parameter.
15565 (Dwarf_line_info::one_addr2line_cache): New function.
15566 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15567 new cache-size argument to one_addr2line(), and clear cache.
15568
15569 2008-04-28 Cary Coutant <ccoutant@google.com>
15570
15571 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15572 R_386_PC8 relocations.
15573
15574 2008-04-23 Ian Lance Taylor <iant@google.com>
15575
15576 * object.cc (Sized_relobj::include_section_group): Check for
15577 invalid section group.
15578
15579 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15580 header size.
15581
15582 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15583 than read for file header.
15584 * archive.cc (Archive::include_member): Likewise.
15585
15586 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
15587
15588 * aclocal.m4: Regenerate.
15589 * configure: Regenerate.
15590
15591 2008-04-19 Ian Lance Taylor <iant@google.com>
15592
15593 * version.cc (version_string): Bump to 1.6.
15594
15595 * testsuite/Makefile.am (many_sections_r_test): New target.
15596 (many_sections_r_test_SOURCES): Remove.
15597 (many_sections_r_test_DEPENDENCIES): Remove.
15598 (many_sections_r_test_LDFLAGS): Remove.
15599 (many_sections_r_test_LDADD): Remove.
15600
15601 * object.cc (Sized_relobj::do_add_symbols): Always pass
15602 local_symbol_count_ to add_from_relobj.
15603
15604 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15605 every thousand variables.
15606 * testsuite/Makefile.in: Rebuild.
15607
15608 * object.cc (Xindex::initialize_symtab_xindex): New function.
15609 (Xindex::read_symtab_xindex): New function.
15610 (Xindex::sym_xindex_to_shndx): New function.
15611 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15612 available.
15613 (Sized_relobj::do_initialize_xindex): New function.
15614 (Sized_relobj::do_read_symbols): Adjust section links.
15615 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15616 parameter. Change all callers.
15617 (Sized_relobj::include_section_group): Adjust section links and
15618 symbol section indexes.
15619 (Sized_relobj::do_layout): Adjust section links.
15620 (Sized_relobj::do_count_local_symbols): Adjust section links and
15621 symbol section indexes.
15622 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15623 ordinary and special symbols.
15624 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15625 dynsym_xindex parameters. Change all callers. Adjust section
15626 links. Use SHN_XINDEX when needed.
15627 (Sized_relobj::get_symbol_location_info): Adjust section links.
15628 Don't get fooled by special symbols.
15629 * object.h (class Xindex): Define.
15630 (class Object): Add xindex_ parameter. Declare virtual functoin
15631 do_initialize_xindex.
15632 (Object::adjust_sym_shndx): New function.
15633 (Object::set_xindex): New protected function.
15634 (class Symbol_value): Add is_ordinary_shndx_ field.
15635 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15636 (Symbol_value::value): Assert ordinary section.
15637 (Symbol_value::initialize_input_to_output_map): Likewise.
15638 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15639 Change all callers.
15640 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15641 all callers.
15642 (class Sized_relobj): Update declarations.
15643 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15644 parameter. Change all callers.
15645 (Sized_relobj::adjust_shndx): New function.
15646 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15647 field.
15648 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15649 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15650 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15651 (Sized_dynobj::read_dynsym_section): Adjust section links.
15652 (Sized_dynobj::read_dynamic): Likewise.
15653 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15654 section links.
15655 (Sized_dynobj::do_initialize_xindex): New function.
15656 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15657 do_initialize_xindex.
15658 (Sized_dynobj::adjust_shndx): New function.
15659 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15660 dynsym_xindex_ fields.
15661 (Layout::finalize): Add a call to set_section_indexes before
15662 creating the symtab sections.
15663 (Layout::set_section_indexes): Don't do anything if the section
15664 already has a section index.
15665 (Layout::create_symtab_sections): Add shnum parameter. Change
15666 caller. Create .symtab_shndx section if needed.
15667 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15668 caller.
15669 (Layout::allocated_output_section_count): New function.
15670 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15671 needed.
15672 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15673 fields. Update declarations.
15674 (Layout::symtab_xindex): New function.
15675 (Layout::dynsym_xindex): New function.
15676 (class Write_symbols_task): Add layout_ field.
15677 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15678 Change caller.
15679 * output.cc (Output_section_headers::Output_section_headers): Add
15680 shstrtab_section parameter. Change all callers.
15681 (Output_section_headers::do_sized_write): Store overflow values
15682 for section count and section string table section index in
15683 section header zero.
15684 (Output_file_header::do_sized_write): Check for overflow of
15685 section count and section string table section index.
15686 (Output_symtab_xindex::do_write): New function.
15687 (Output_symtab_xindex::endian_do_write): New function.
15688 * output.h (class Output_section_headers): Add shstrtab_section_.
15689 Update declarations.
15690 (class Output_symtab_xindex): Define.
15691 (Output_section::has_out_shndx): New function.
15692 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15693 field.
15694 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15695 Change all callers.
15696 (Sized_symbol::init): Likewise.
15697 (Symbol::output_section): Check for ordinary symbol.
15698 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15699 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15700 callers.
15701 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15702 Change all callers. Simplify handling of symbols from sections
15703 not included in the link.
15704 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15705 distinction.
15706 (Weak_alias_sorter::operator()): Assert that symbols are
15707 ordinary.
15708 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15709 distinction.
15710 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15711 parameters. Change all callers.
15712 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15713 symbol distinction. Use SHN_XINDEX when needed.
15714 (Symbol_table::write_section_symbol): Add symtab_xindex
15715 parameter. Change all callers.
15716 (Symbol_table::sized_write_section_symbol): Likewise. Use
15717 SHN_XINDEX when needed.
15718 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15719 declarations.
15720 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15721 (Symbol::is_defined): Check is_ordinary.
15722 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15723 (Symbol::is_absolute, Symbol::is_common): Likewise.
15724 (class Sized_symbol): Update declarations.
15725 (class Symbol_table): Update declarations.
15726 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15727 parameters. Change all callers.
15728 (Sized_symbol::override): Likewise.
15729 (Symbol_table::override): Likewise.
15730 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15731 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15732 is_ordinary, and orig_st_shndx parameters. Change all callers.
15733 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15734 to be in an ordinary section.
15735 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15736 object and is_ordinary parameters. Change all callers.
15737 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15738 Change all callers. Don't add undefined or non-ordinary symbols
15739 to reloc_map_.
15740 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15741 Change all callers.
15742 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15743 declarations.
15744 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15745 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15746 (Sized_relobj::relocate_sections): Likewise.
15747 * target-reloc.h (scan_relocs): Adjust section symbol index.
15748 (scan_relocatable_relocs): Likewise.
15749 * i386.cc (Scan::local): Check for ordinary symbols.
15750 * sparc.cc (Scan::local): Likewise.
15751 * x86_64.cc (Scan::local): Likewise.
15752 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15753 to symbol_section_and_value.
15754 * testsuite/many_sections_test.cc: New file.
15755 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15756 (check_PROGRAMS): Add many_sections_test.
15757 (many_sections_test_SOURCES): Define.
15758 (many_sections_test_DEPENDENCIES): Define.
15759 (many_sections_test_LDFLAGS): Define.
15760 (BUILT_SOURCES): Add many_sections_define.h.
15761 (many_sections_define.h): New target.
15762 (BUILT_SOURCES): Add many_sections_check.h.
15763 (many_sections_check.h): New target.
15764 (check_PROGRAMS): Add many_sections_r_test.
15765 (many_sections_r_test_SOURCES): Define.
15766 (many_sections_r_test_DEPENDENCIES): Define.
15767 (many_sections_r_test_LDFLAGS): Define.
15768 (many_sections_r_test_LDADD): Define.
15769 (many_sections_r_test.o): New target.
15770 * testsuite/Makefile.in: Rebuild.
15771
15772 2008-04-17 Cary Coutant <ccoutant@google.com>
15773
15774 * errors.cc (Errors::info): New function.
15775 (gold_info): New function.
15776 * errors.h (Errors::info): New function.
15777 * gold.h (gold_info): New function.
15778 * object.cc (Input_objects::add_object): Print trace output.
15779 * options.cc (options::parse_set): New function.
15780 (General_options::parse_wrap): Deleted.
15781 (General_options::General_options): Deleted initializer.
15782 * options.h (options::String_set): New typedef.
15783 (options::parse_set): New function.
15784 (DEFINE_set): New macro.
15785 (General_options::wrap): Changed to use DEFINE_set. Changed
15786 callers of any_wrap_symbols and is_wrap_symbol.
15787 (General_options::trace, General_options::trace_symbol):
15788 New options.
15789 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15790 (General_options::wrap_symbols_): Deleted.
15791 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15792
15793 2008-04-17 David S. Miller <davem@davemloft.net>
15794
15795 * options.cc (General_options::parse_V): New function.
15796 * options.h: Add entries for -V and -Qy.
15797
15798 2008-04-17 Ian Lance Taylor <iant@google.com>
15799
15800 * common.cc (Symbol_table::allocate_commons): Remove options
15801 parameter. Change caller.
15802 (Symbol_table::do_allocate_commons): Remove options parameter.
15803 Change caller. Just call do_allocate_commons_list twice.
15804 (Symbol_table::do_allocate_commons_list): New function, broken out
15805 of do_allocate_commons.
15806 * common.h (class Allocate_commons_task): Remove options_ field.
15807 Update constructor.
15808 * symtab.cc (Symbol_table::Symbol_table): Initialize
15809 tls_commons_.
15810 (Symbol_table::add_from_object): Put TLS common symbols on
15811 tls_commons_ list.
15812 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15813 which are IN_OUTPUT_DATA.
15814 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15815 allocate_commons and do_allocate_commons declarations. Declare
15816 do_allocate_commons_list.
15817 * gold.cc (queue_middle_tasks): Update creation of
15818 Allocate_commons_task to not pass options.
15819 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15820 (TLS_TEST_C_FLAGS): New variable.
15821 (tls_test_c_pic.o): New target.
15822 (tls_test_shared.so): Link in tls_test_c_pic.o.
15823 (tls_test_c_pic_ie.o): New target.
15824 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15825 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15826 (tls_test_c.o): New target.
15827 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15828 (tls_pic_test_LDADD): Likewise.
15829 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15830 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15831 (tls_test_c_gnu2.o): New target.
15832 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15833 tls_test_c_gnu2.o.
15834 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15835 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15836 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15837 * testsuite/tls_test.cc: Include "config.h".
15838 (t_last): Call t11_last.
15839 * testsuite/tls_test.h (t11, t11_last): Declare.
15840 * testsuite/tls_test_c.c: New file.
15841 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15842 * configure.ac: Check for OpenMP support.
15843 * configure, config.in, Makefile.in: Rebuild.
15844 * testsuite/Makefile.in: Rebuild.
15845
15846 2008-04-16 Cary Coutant <ccoutant@google.com>
15847
15848 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15849 (Target_i386::tls_base_symbol_defined_): New field.
15850 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15851 (Target_i386::Scan::global): Likewise.
15852 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15853 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15854 (Target_x86_64::tls_base_symbol_defined_): New field.
15855 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15856 (Target_x86_64::Scan::global): Likewise.
15857
15858 2008-04-16 Cary Coutant <ccoutant@google.com>
15859
15860 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15861 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15862 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15863 building shared libraries.
15864 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15865 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15866 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15867 * testsuite/Makefile.in: Rebuild.
15868 * testsuite/weak_undef.h: New file.
15869 * testsuite/weak_undef_file1.cc: Add extra test cases.
15870 * testsuite/weak_undef_file2.cc: Likewise.
15871 * testsuite/weak_undef_test.cc: Likewise.
15872
15873 2008-04-16 David S. Miller <davem@davemloft.net>
15874
15875 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15876 Add issued_non_pic_error_ field. Declare check_non_pic.
15877 (Target_sparc::Scan::check_non_pic): New function.
15878 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15879 (Target_sparc::Scan::global): Likewise.
15880
15881 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15882 * configure: Rebuild.
15883
15884 * options.h (DEFINE_enable): New macro.
15885 (new_dtags): New enable option.
15886 (initfirst, interpose, loadfltr, nodefaultlib,
15887 nodelete, nodlopen, nodump): New -z options.
15888 * layout.cc (Layout:finish_dynamic_section): If new
15889 dtags enabled, emit DT_RUNPATH. Also, emit a
15890 DT_FLAGS_1 containing any specified -z flags.
15891
15892 2008-04-16 Ian Lance Taylor <iant@google.com>
15893
15894 * copy-relocs.cc: New file.
15895 * copy-relocs.h: New file.
15896 * reloc.cc: Remove Copy_relocs code.
15897 * reloc.h: Likewise.
15898 * reloc-types.h (struct Reloc_types) [both versions]: Add
15899 get_reloc_addend_noerror.
15900 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15901 variants of add_global which take an addend which must be zero.
15902 * i386.cc: Include "copy-relocs.h".
15903 (class Target_i386): Change type of copy_relocs_ to variable,
15904 update initializer.
15905 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15906 Change all callers.
15907 (Target_i386::do_finalize_sections): Change handling of
15908 copy_relocs_.
15909 * sparc.cc: Include "copy-relocs.h".
15910 (class Target_sparc): Change type of copy_relocs_ to variable,
15911 update initializer.
15912 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15913 Change all callers.
15914 (Target_sparc::do_finalize_sections): Change handling of
15915 copy_relocs_.
15916 * x86_64.cc: Include "copy-relocs.h".
15917 (class Target_x86_64): Change type of copy_relocs_ to variable,
15918 update initializer.
15919 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15920 class. Change all callers.
15921 (Target_x86_64::do_finalize_sections): Change handling of
15922 copy_relocs_.
15923 * Makefile.am (CCFILES): Add copy-relocs.cc.
15924 (HFILES): Add copy-relocs.h.
15925
15926 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15927
15928 * testsuite/script_test_4.sh: Permit leading zeroes.
15929
15930 2008-04-15 Ian Lance Taylor <iant@google.com>
15931
15932 * script-sections.cc (Script_sections::create_segments): Use
15933 header_size_adjustment even when there is enough room for the
15934 headers.
15935 * testsuite/script_test_4.sh: New file.
15936 * testsuite/script_test_4.t: New file.
15937 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15938 (check_DATA): Add script_test_4.stdout.
15939 (MOSTLYCLEANFILES): Likewise.
15940 (script_test_4): New target.
15941 (script_test_4.stdout): New target.
15942 * testsuite/Makefile.in: Rebuild.
15943
15944 * sparc.cc: Add definitions for Output_data_plt_sparc class
15945 constants.
15946
15947 2008-04-14 David S. Miller <davem@davemloft.net>
15948
15949 * sparc.cc: New file.
15950 * Makefile.am (TARGETSOURCES): Add sparc.cc
15951 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15952 * configure.tgt: Document targ_extra_size and
15953 targ_extra_big_endian. Add entries for sparc-* and
15954 sparc64-*.
15955 * configure.ac: Handle targ_extra_size and
15956 targ_extra_big_endian.
15957 * Makefile.in: Rebuild.
15958 * configure: Likewise.
15959 * po/POTFILES.in: Likewise.
15960 * po/gold.pot: Likewise.
15961
15962 2008-04-14 Ian Lance Taylor <iant@google.com>
15963
15964 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15965 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15966 in the name/type/flags to section mapping. Don't call
15967 allocate_output_section.
15968 (Layout::choose_output_section): Change parameter from adjust_name
15969 to is_input_section. Don't permit input sections after sections
15970 are attached to segments. Don't call allocate_output_section.
15971 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15972 not write_enable_output_section.
15973 (Layout::make_output_section): Don't push to
15974 unattached_section_list_ nor call attach_to_segment. Call
15975 attach_section_to_segment if sections are attached.
15976 (Layout::attach_sections_to_segments): New function.
15977 (Layout::attach_section_to_segment): New function.
15978 (Layout::attach_allocated_section_to_segment): Rename from
15979 attach_to_segment. Remove flags parameter.
15980 (Layout::allocate_output_section): Remove function.
15981 (Layout::write_enable_output_section): Remove function.
15982 * layout.h (class Layout): Update for above changes. Add new
15983 field sections_are_attached_.
15984 * output.h (Output_section::update_flags_for_input_section): New
15985 function.
15986 * output.cc (Output_section::add_input_section): Call
15987 update_flags_for_input_section.
15988 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15989
15990 2008-04-11 Cary Coutant <ccoutant@google.com>
15991
15992 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15993 thought unnecessary.
15994 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15995
15996 2008-04-11 Ian Lance Taylor <iant@google.com>
15997
15998 * output.h (class Output_section_data): Remove inline definition
15999 of set_addralign.
16000 * output.cc (Output_section_data::set_addralign): New function.
16001
16002 2008-04-11 Cary Coutant <ccoutant@google.com>
16003
16004 Add support for TLS descriptors for i386 and x86_64.
16005 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16006 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16007 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16008 GOT_TYPE_TLS_DESC.
16009 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16010 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16011 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16012 relocations.
16013 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16014 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16015 Fix problem with initial-exec relocations.
16016 (Target_i386::Relocate::relocate_tls): Likewise.
16017 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16018 relaxation.
16019 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16020 support for section-plus-offset dynamic table entries.
16021 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16022 (Output_data_dynamic::Dynamic_entry): Add support for
16023 section-plus-offset dynamic table entries.
16024 (Output_data_dynamic::Classification): Likewise.
16025 (Output_data_dynamic::classification_): Renamed offset_.
16026 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16027 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16028 (Target_x86_64::make_plt_section): New function.
16029 (Target_x86_64::reserve_tlsdesc_entries): New function.
16030 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16031 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16032 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16033 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16034 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16035 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16036 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16037 add extra PLT entry for TLS descriptors.
16038 (Output_data_plt_x86_64::got_): New field.
16039 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16040 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16041 fields.
16042 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16043 descriptors.
16044 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16045 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16046 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16047 R_386_TLS_DESC_CALL relocations.
16048 (Target_x86_64::Scan::global): Likewise.
16049 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16050 for TLS descriptors.
16051 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16052 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16053 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16054 GD-to-IE relaxation.
16055 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16056 and TLS_DESCRIPTORS.
16057 * Makefile.in: Rebuild.
16058 * configure: Rebuild.
16059 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16060 (tls_test_shared2.so): New target.
16061 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16062 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16063 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16064 (tls_shared_gd_to_ie_test_LDADD): New variable.
16065 (tls_shared_gnu2_gd_to_ie_test): New target.
16066 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16067 New targets.
16068 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16069 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16070 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16071 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16072 (tls_shared_gnu2_test): New target.
16073 (tls_test_gnu2_shared.so): New target.
16074 (tls_shared_gnu2_test_SOURCES): New variable.
16075 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16076 (tls_shared_gnu2_test_LDFLAGS): New variable.
16077 (tls_shared_gnu2_test_LDADD): New variable.
16078 * testsuite/Makefile.in: Rebuild.
16079 * testsuite/Makefile.
16080
16081 2008-04-11 Ian Lance Taylor <iant@google.com>
16082
16083 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16084 justsyms.t.
16085 * testsuite/Makefile.in: Rebuild.
16086
16087 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16088 long.
16089 * testsuite/script_test_2.cc (main): Adjust test.
16090
16091 2008-04-11 David S. Miller <davem@davemloft.net>
16092 Ian Lance Taylor <iant@google.com>
16093
16094 * options.h (General_options): Add entries for '-Y' and
16095 '-relax'.
16096 * options.cc (General_options:finalize): If -Y was used, add those
16097 entries to the library path instead of the default "/lib" and
16098 "/usr/lib".
16099
16100 2008-04-11 David S. Miller <davem@davemloft.net>
16101
16102 * testsuite/justsyms.t: Start at 0x100.
16103 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
16104 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16105 long.
16106 * testsuite/script_test_2.cc: Adjust string and section length
16107 checks.
16108
16109 2008-04-09 Ian Lance Taylor <iant@google.com>
16110
16111 PR gold/5996
16112 * script-sections.cc (Sections_element::allocate_to_segment): Add
16113 orphan parameter.
16114 (Output_section_definition::allocate_to_segment): Likewise.
16115 (Orphan_output_section::allocate_to_segment): Likewise.
16116 (Script_sections::attach_sections_using_phdrs_clause): Don't
16117 propagate non-PT_LOAD segments to orphan sections.
16118 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16119 readelf rather than objdump.
16120 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16121 .interp section and PT_INTERP segment are the same size.
16122 * testsuite/Makefile.in: Rebuild.
16123
16124 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16125 aliases for symbols defined in the same object.
16126 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16127 (weak_alias_test_SOURCES): New variable.
16128 (weak_alias_test_DEPENDENCIES): New variable.
16129 (weak_alias_test_LDFLAGS): New variable.
16130 (weak_alias_test_LDADD): New variable.
16131 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16132 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16133 (weak_alias_test_3.o): New target.
16134 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16135 * testsuite/weak_alias_test_main.cc: New file.
16136 * testsuite/weak_alias_test_1.cc: New file.
16137 * testsuite/weak_alias_test_2.cc: New file.
16138 * testsuite/weak_alias_test_3.cc: New file.
16139
16140 2008-04-08 Ian Lance Taylor <iant@google.com>
16141
16142 * options.h (class General_options): Add --noinhibit-exec option.
16143 * main.cc (main): Check --noinhibit-exec.
16144
16145 * options.h (class General_options): Define --wrap as a special
16146 option. Add wrap_symbols_ field.
16147 (General_options::any_wrap_symbols): New function.
16148 (General_options::is_wrap_symbol): New function.
16149 * options.cc (General_options::parse_wrap): New function.
16150 (General_options::General_options): Initialize wrap_symbols_.
16151 * symtab.cc (Symbol_table::wrap_symbol): New function.
16152 (Symbol_table::add_from_object): Handle --wrap.
16153 * symtab.h (class Symbol_table): Declare wrap_symbol.
16154 * target.h (Target::wrap_char): New function.
16155 (Target::Target_info): Add wrap_char field.
16156 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16157 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16158 * testsuite/testfile.cc (Target_test::test_target_info):
16159 Likewise.
16160
16161 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16162 there is one.
16163
16164 * layout.h (class Layout): Add added_eh_frame_data_ field.
16165 * layout.cc (Layout::Layout): Initialize new field.
16166 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16167 output section until we find a section we merged successfully.
16168 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16169 that the size be non-zero.
16170
16171 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16172 qualifier.
16173
16174 2008-04-08 Craig Silverstein <csilvers@google.com>
16175
16176 * configure.ac: Export new conditional variable HAVE_ZLIB.
16177 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16178 on HAVE_ZLIB.
16179 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16180 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16181
16182 2008-04-07 Ian Lance Taylor <iant@google.com>
16183
16184 * version.cc (version_string): Set to "1.5".
16185
16186 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16187 Add issued_non_pic_error_ field. Declare check_non_pic.
16188 (Target_x86_64::Scan::check_non_pic): New function.
16189 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16190 (Target_x86_64::Scan::global): Likewise.
16191
16192 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16193 addend parameter. Change caller. Handle merge sections.
16194 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16195 Address to Addend. Don't add in the result of
16196 local_section_offset, pass down the addend and use the returned
16197 value.
16198 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16199 Update declarations of local_section_offset and symbol_value.
16200 * testsuite/two_file_test_1.cc (t18): New function.
16201 * testsuite/two_file_test_2.cc (f18): New function.
16202 * testsuite/two_file_test_main.cc (main): Call t18.
16203 * testsuite/two_file_test.h (t18, f18): Declare.
16204
16205 * configure.ac: Don't test for objdump, c++filt, or readelf.
16206 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16207 conditionals.
16208 (TEST_READELF): New variable.
16209 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16210 (check_PROGRAMS): Add two_file_strip_test.
16211 (two_file_strip_test): New target.
16212 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16213 (two_file_same_shared_strip_test_SOURCES): New variable.
16214 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16215 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16216 (two_file_same_shared_strip_test_LDADD): New variable.
16217 (two_file_shared_strip.so): New target.
16218 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16219 (ver_test_5.syms, ver_test_7.syms): Likewise.
16220 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16221 (strip_test_3.stdout): Use TEST_OBJDUMP.
16222 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16223
16224 2008-04-04 Cary Coutant <ccoutant@google.com>
16225
16226 * symtab.h (Symbol::is_weak_undefined): New function.
16227 (Symbol::is_strong_undefined): New function.
16228 (Symbol::is_absolute): New function.
16229 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16230 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16231 absolute symbols.
16232 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16233 (weak_undef_test): New target.
16234 * testsuite/Makefile.in: Rebuild.
16235 * testsuite/weak_undef_file1.cc: New file.
16236 * testsuite/weak_undef_file2.cc: New file.
16237 * testsuite/weak_undef_test.cc: New file.
16238
16239 2008-04-03 Craig Silverstein <csilvers@google.com>
16240
16241 * compressed_output.h (class Output_compressed_section): Use
16242 unsigned buffer.
16243 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16244 add zlib header.
16245 (zlib_compressed_suffix): Removed.
16246 (Output_compressed_section::set_final_data_size): Use unsigned
16247 buffers.
16248 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16249 Fix linker invocation.
16250 (flagstest_o_specialfile_and_compress_debug_sections):
16251 Likewise.
16252 * testsuite/Makefile.in: Regenerated.
16253
16254 2008-04-02 David S. Miller <davem@davemloft.net>
16255
16256 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16257 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16258
16259 2008-04-02 Craig Silverstein <csilvers@google.com>
16260
16261 * TODO: New file.
16262
16263 2008-04-02 Ian Lance Taylor <iant@google.com>
16264
16265 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16266 parameters. Update for new key type to views_. Change all
16267 callers.
16268 (File_read::read): Adjust for byteshift in returned view.
16269 (File_read::add_view): New function, broken out of
16270 find_and_make_view.
16271 (File_read::make_view): New function, broken out of
16272 find_and_make_view.
16273 (File_read::find_or_make_view): Add offset and aligned
16274 parameters. Rewrite accordingly. Change all callers.
16275 (File_read::get_view): Add offset and aligned parameters. Adjust
16276 for byteshift in return value.
16277 (File_read::get_lasting_view): Likewise.
16278 * fileread.h (class File_read): Update declarations.
16279 (class File_read::View): Add byteshift_ field. Add byteshift to
16280 constructor. Add byteshift method.
16281 * archive.h (Archive::clear_uncached_views): New function.
16282 (Archive::get_view): Add aligned parameter. Change all callers.
16283 * object.h (Object::get_view): Add aligned parameter. Change all
16284 callers.
16285 (Object::get_lasting_view): Likewise.
16286
16287 * fileread.cc (File_read::release): Don't call clear_views if
16288 there are multiple objects.
16289 * fileread.h (File_read::clear_uncached_views): New function.
16290 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16291 on the archive.
16292
16293 2008-03-31 Cary Coutant <ccoutant@google.com>
16294
16295 Add thin archive support.
16296 * archive.cc (Archive::armagt): New const.
16297 (Archive::setup): Remove task parameter and calls to unlock.
16298 (Archive::unlock_nested_archives): New function.
16299 (Archive::read_header): Add nested_off parameter. Change
16300 all callers.
16301 (Archive::interpret_header): Likewise.
16302 (Archive::include_all_members): Change to handle thin
16303 archives.
16304 (Archive::include_member): Likewise.
16305 * archive.h (Archive::Archive): Add new parameters and
16306 initializers.
16307 (Archive::armagt): New const.
16308 (Archive::setup): Remove task parameter.
16309 (Archive::unlock_nested_archives): New function.
16310 (Archive::read_header): Add nested_off parameter.
16311 (Archive::interpret_header): Likewise.
16312 (Archive::Nested_archive_table): New typedef.
16313 (Archive::is_thin_archive_): New field.
16314 (Archive::nested_archives_): New field.
16315 (Archive::options_): New field.
16316 (Archive::dirpath_): New field.
16317 (Archive::task_): New field.
16318 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16319 for thin archives. Pass additional parameters to
16320 Archive::Archive. Unlock the archive file after calling
16321 Archive::setup.
16322
16323 2008-03-29 Ian Lance Taylor <iant@google.com>
16324
16325 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16326 version symbol to be local.
16327 * testsuite/ver_test_4.sh: New file.
16328 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16329 (check_DATA): Add ver_test_4.syms.
16330 (ver_test_4.syms): New target.
16331 * testsuite/Makefile.in: Rebuild.
16332
16333 * output.cc
16334 (Output_section::Input_section_sort_entry::has_priority): New
16335 function.
16336 (Output_section::Input_section_sort_entry::match_file_name): New
16337 function.
16338 (Output_section::Input_section_sort_entry::match_section_name):
16339 Remove.
16340 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16341 Remove.
16342 (Output_section::Input_section_sort_entry::match_section_file):
16343 Remove.
16344 (Output_section::Input_section_sort_compare::operator()): Rewrite
16345 using new Input_section_sort_entry functions. Sort crtbegin and
16346 crtend first. Sort sections with no priority before sections with
16347 a priority.
16348 * testsuite/initpri1.c (d3): Check j != 4.
16349 (cd5): New constructor/destructor function.
16350 (main): Check j != 2.
16351
16352 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16353 new symbol when resolving, don't call set_is_default.
16354 * testsuite/ver_test_7.cc: New file.
16355 * testsuite/ver_test_7.sh: New file.
16356 * testsuite/Makefile.am (ver_test_7.so): New target.
16357 (ver_test_7.o): New target.
16358 (check_SCRIPTS): Add ver_test_7.sh.
16359 (check_DATA): Add ver_test_7.syms.
16360 (ver_test_7.syms): New target.
16361
16362 2008-03-28 Ian Lance Taylor <iant@google.com>
16363
16364 * layout.cc (Layout::layout): If we see an input section with a
16365 name that needs sorting, set the must_sort flag for the output
16366 section.
16367 (Layout::make_output_section): If the name of the output section
16368 indicates that it might require sorting, set the may_sort flag.
16369 * output.h (Output_section::may_sort_attached_input_sections): New
16370 function.
16371 (Output_section::set_may_sort_attached_input_sections): New
16372 function.
16373 (Output_section::must_sort_attached_input_sections): New
16374 function.
16375 (Output_section::set_must_sort_attached_input_sections): New
16376 function.
16377 (class Output_section): Declare Input_section_sort_entry. Define
16378 Input_section_sort_compare. Declare
16379 sort_attached_input_sections. Add new fields:
16380 may_sort_attached_input_sections_,
16381 must_sort_attached_input_sections_,
16382 attached_input_sections_are_sorted_.
16383 * output.cc (Output_section::Output_section): Initialize new
16384 fields.
16385 (Output_section::add_input_section): Add an entry to
16386 input_sections_ if may_sort or must_sort are true.
16387 (Output_section::set_final_data_size): Call
16388 sort_attached_input_sections if necessary.
16389 (Output_section::Input_section_sort_entry): Define new class.
16390 (Output_section::Input_section_sort_compare::operator()): New
16391 function.
16392 (Output_section::sort_attached_input_sections): New function.
16393 * configure.ac: Check whether the compiler supports constructor
16394 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16395 * testsuite/initpri1.c: New file.
16396 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16397 CONSTRUCTOR_PRIORITY.
16398 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16399 (initpri1_LDFLAGS): New variable.
16400 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16401
16402 2008-03-27 Ian Lance Taylor <iant@google.com>
16403
16404 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16405 * testsuite/common_test_1.c: New file.
16406 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16407 (common_test_1_SOURCES): New variable.
16408 (common_test_1_DEPENDENCIES): New variable.
16409 (common_test_1_LDFLAGS): New variable.
16410
16411 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16412 and commons_ correctly when NAME/VERSION does not override
16413 NAME/NULL.
16414 * testsuite/ver_test_6.c: New file.
16415 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16416 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16417 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16418
16419 2008-03-26 Ian Lance Taylor <iant@google.com>
16420
16421 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16422 of an undefined symbol from a version script.
16423 * testsuite/Makefile.am (ver_test_5.so): New target.
16424 (ver_test_5.o): New target.
16425 (check_SCRIPTS): Add ver_test_5.sh.
16426 (check_DATA): Add ver_test_5.syms.
16427 (ver_test_5.syms): New target.
16428 * testsuite/ver_test_5.cc: New file.
16429 * testsuite/ver_test_5.script: New file.
16430 * testsuite/ver_test_5.sh: New file.
16431 * Makefile.in, testsuite/Makefile.in: Rebuild.
16432
16433 PR gold/5986
16434 Fix problems building gold with gcc 4.3.0.
16435 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16436 (gold_error_at_location, gold_warning_at_location): Use it.
16437 * configure.ac: Check whether we can compile and use a template
16438 function with a printf attribute.
16439 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16440 when jumping over bytes.
16441 * object.cc: Instantiate Object::read_section_data.
16442 * debug.h: Include <cstring>
16443 * dwarf_reader.cc: Include <algorithm>
16444 * main.cc: Include <cstring>.
16445 * options.cc: Include <cstring>.
16446 * output.cc: Include <cstring>.
16447 * script.cc: Include <cstring>.
16448 * script.h: Include <string>.
16449 * symtab.cc: Include <cstring> and <algorithm>.
16450 * target-select.cc: Include <cstring>.
16451 * version.cc: Include <string>.
16452 * testsuite/testmain.cc: Include <cstdlib>.
16453 * configure, config.in: Rebuild.
16454
16455 2008-03-25 Ian Lance Taylor <iant@google.com>
16456
16457 * options.cc: Include "../bfd/bfdver.h".
16458 (options::help): Print bug reporting address.
16459
16460 * version.cc (print_version): Adjust output for current value of
16461 BFD_VERSION_STRING.
16462
16463 * NEWS: New file.
16464
16465 * options.cc (options::help): Print list of supported targets.
16466 * target-select.h: Include <vector>.
16467 (class Target_selector): Make machine_, size_, and is_big_endian_
16468 fields const. Add bfd_name_ and instantiated_target_ fields.
16469 (Target_selector::Target_selector): Add bfd_name parameter.
16470 (Target_selector::recognize): Make non-virtual, call
16471 do_recognize.
16472 (Target_selector::recognize_by_name): Make non-virtual, call
16473 do_recognize_by_name.
16474 (Target_selector::supported_names): New function.
16475 (Target_selector::bfd_name): New function.
16476 (Target_selector::do_instantiate_target): New pure virtual
16477 function.
16478 (Target_selector::do_recognize): New virtual function.
16479 (Target_selector::do_recognize_by_name): New virtual function.
16480 (Target_selector::instantiate_target): New private function.
16481 (supported_target_names): Declare.
16482 * target-select.cc (Target_selector::Target_selector): Update for
16483 new parameter and fields.
16484 (select_target_by_name): Check that the name matches before
16485 calling recognize_by_name.
16486 (supported_target_names): New function.
16487 * i386.cc (class Target_selector_i386): Update Target_selector
16488 constructor call. Remove recognize and recognize_by_name. Add
16489 do_instantiate_target.
16490 * x86_64.cc (class Target_selector_x86_64): Likewise.
16491 * testsuite/testfile.cc (class Target_selector_test): Update for
16492 changes to Target_selector.
16493
16494 * README: Rewrite, with some notes on unsupported features.
16495
16496 2008-03-24 Cary Coutant <ccoutant@google.com>
16497
16498 * i386.cc (Target_i386::Got_type): New enum declaration.
16499 (Target_i386::Scan::local): Updated callers of Output_data_got
16500 member functions.
16501 (Target_i386::Scan::global): Likewise.
16502 (Target_i386::Relocate::relocate): Likewise.
16503 (Target_i386::Relocate::relocate_tls): Likewise.
16504 * object.h (Got_offset_list): New class.
16505 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16506 (Sized_relobj::local_got_offset): Likewise.
16507 (Sized_relobj::set_local_got_offset): Likewise.
16508 (Sized_relobj::local_has_tls_got_offset): Removed.
16509 (Sized_relobj::local_tls_got_offset): Removed.
16510 (Sized_relobj::set_local_tls_got_offset): Removed.
16511 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16512 * output.cc (Output_data_got::add_global): Added got_type parameter.
16513 (Output_data_got::add_global_with_rel): Likewise.
16514 (Output_data_got::add_global_with_rela): Likewise.
16515 (Output_data_got::add_global_pair_with_rel): New function.
16516 (Output_data_got::add_global_pair_with_rela): New function.
16517 (Output_data_got::add_local): Added got_type parameter.
16518 (Output_data_got::add_local_with_rel): Likewise.
16519 (Output_data_got::add_local_with_rela): Likewise.
16520 (Output_data_got::add_local_pair_with_rel): New function.
16521 (Output_data_got::add_local_pair_with_rela): New function.
16522 (Output_data_got::add_global_tls): Removed.
16523 (Output_data_got::add_global_tls_with_rel): Removed.
16524 (Output_data_got::add_global_tls_with_rela): Removed.
16525 (Output_data_got::add_local_tls): Removed.
16526 (Output_data_got::add_local_tls_with_rel): Removed.
16527 (Output_data_got::add_local_tls_with_rela): Removed.
16528 * output.h (Output_data_got::add_global): Added got_type parameter.
16529 (Output_data_got::add_global_with_rel): Likewise.
16530 (Output_data_got::add_global_with_rela): Likewise.
16531 (Output_data_got::add_global_pair_with_rel): New function.
16532 (Output_data_got::add_global_pair_with_rela): New function.
16533 (Output_data_got::add_local): Added got_type parameter.
16534 (Output_data_got::add_local_with_rel): Likewise.
16535 (Output_data_got::add_local_with_rela): Likewise.
16536 (Output_data_got::add_local_pair_with_rel): New function.
16537 (Output_data_got::add_local_pair_with_rela): New function.
16538 (Output_data_got::add_global_tls): Removed.
16539 (Output_data_got::add_global_tls_with_rel): Removed.
16540 (Output_data_got::add_global_tls_with_rela): Removed.
16541 (Output_data_got::add_local_tls): Removed.
16542 (Output_data_got::add_local_tls_with_rel): Removed.
16543 (Output_data_got::add_local_tls_with_rela): Removed.
16544 * resolve.cc (Symbol::override_base_with_special): Removed
16545 reference to has_got_offset_ field.
16546 * symtab.cc (Symbol::init_fields): Replaced initialization
16547 of got_offset_ with got_offsets_. Removed initialization
16548 of has_got_offset_
16549 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
16550 (Symbol::got_offset): Likewise.
16551 (Symbol::set_got_offset): Likewise.
16552 (Symbol::has_tls_got_offset): Removed.
16553 (Symbol::tls_got_offset): Removed.
16554 (Symbol::set_tls_got_offset): Removed.
16555 (Symbol::got_offset_): Removed.
16556 (Symbol::tls_mod_got_offset_): Removed.
16557 (Symbol::tls_pair_got_offset_): Removed.
16558 (Symbol::got_offsets_): New field.
16559 (Symbol::has_got_offset): Removed.
16560 (Symbol::has_tls_mod_got_offset): Removed.
16561 (Symbol::has_tls_pair_got_offset): Removed.
16562 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16563 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16564 member functions.
16565 (Target_x86_64::Scan::global): Likewise.
16566 (Target_x86_64::Relocate::relocate): Likewise.
16567 (Target_x86_64::Relocate::relocate_tls): Likewise.
16568
16569 2008-03-25 Ben Elliston <bje@au.ibm.com>
16570
16571 * yyscript.y: Fix spelling error in comment.
16572
16573 2008-03-24 Ian Lance Taylor <iant@google.com>
16574
16575 * options.h (class General_options): Define build_id option.
16576 * layout.h (class Layout): Declare write_build_id, create_note,
16577 create_build_id. Add build_id_note_ member.
16578 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16579 "libiberty.h", "md5.h", "sha1.h".
16580 (Layout::Layout): Initialize eh_frame_data_,
16581 eh_frame_hdr_section_, and build_id_note_.
16582 (Layout::finalize): Call create_build_id.
16583 (Layout::create_note): New function, broken out of
16584 Layout::create_gold_note.
16585 (Layout::create_gold_note): Call create_note.
16586 (Layout::create_build_id): New function.
16587 (Layout::write_build_id): New function.
16588 (Close_task_runner::run): Call write_build_id.
16589
16590 * x86_64.cc: Correct license to GPLv3.
16591
16592 2008-03-23 Ian Lance Taylor <iant@google.com>
16593
16594 * options.cc: Include "demangle.h".
16595 (parse_optional_string): New function.
16596 (parse_long_option): Handle takes_optional_argument.
16597 (parse_short_option): Update dash_z initializer. Handle
16598 takes_optional_argument.
16599 (General_options::General_options): Initialize do_demangle_.
16600 (General_options::finalize): Set do_demangle_. Handle demangling
16601 style.
16602 * options.h (parse_optional_string): Declare.
16603 (struct One_option): Add optional_arg field. Update constructor.
16604 Update call constructor calls. Add takes_optional_argument
16605 function.
16606 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16607 (DEFINE_optional_string): Define.
16608 (General_options::demangle): Change from DEFINE_bool to
16609 DEFINE_optional_string.
16610 (General_options::no_demangle): New function.
16611 (General_options::do_demangle): New function.
16612 (General_options::set_do_demangle): New function.
16613 (General_options::execstack_status_): Move definition to end of
16614 class definition.
16615 (General_options::static_): Likewise.
16616 (General_options::do_demangle_): New field.
16617 * object.cc (big_endian>::get_symbol_location_info): Call
16618 Options::do_demangle, not Options::demangle.
16619 * symtab.cc (demangle): Likewise.
16620
16621 2008-03-22 Ian Lance Taylor <iant@google.com>
16622
16623 * gold.h: Include <cstddef> and <sys/types.h>
16624 * options.h: Include <cstring>.
16625
16626 2008-03-21 Ian Lance Taylor <iant@google.com>
16627
16628 * Added source code to GNU binutils.
16629 \f
16630 Copyright (C) 2008-2015 Free Software Foundation, Inc.
16631
16632 Copying and distribution of this file, with or without modification,
16633 are permitted in any medium without royalty provided the copyright
16634 notice and this notice are preserved.
16635
16636 Local Variables:
16637 mode: change-log
16638 left-margin: 8
16639 fill-column: 74
16640 version-control: never
16641 End:
This page took 0.789606 seconds and 4 git commands to generate.