Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
be66981e
L
12015-02-21 H.J. Lu <hongjiu.lu@intel.com>
2
3 * configure.ac (default_size): Set to 32 for x32.
4 * configure: Regenerated.
5
e3ee8ed4
AM
62015-02-18 Alan Modra <amodra@gmail.com>
7
8 PR 17954
9 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
10 visibility.
11
3a935c6c
RÁE
122015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
13
14 * gc.h (Garbage_collection::add_reference): Don't use find.
15
e0a1e121
RÁE
162015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
17
18 * object.cc (write_local_symbols): avoid std::vector copy.
19
45a4fb1a
RÁE
202015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
21
22 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
23
2d9afefe
MW
242015-02-09 Mark Wielaard <mjw@redhat.com>
25
26 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
27 DW_LANG_Fortran03 and DW_LANG_Fortran08.
28
e9c1bdad
CC
292015-02-16 Cary Coutant <ccoutant@google.com>
30
31 PR gold/13577
32 PR gold/16992
33 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
34 DF_SYMBOLIC if --dynamic-list option is used.
35 * options.cc (General_options::finalize): --dynamic-list is not
36 mutually exclusive with -Bsymbolic.
37 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
38 listed in --dynamic-list.
39 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
40 -Bsymbolic-functions.
41 * testsuite/Makefile.in: Regenerate.
42
0ed4b0bf
CC
432015-02-16 Cary Coutant <ccoutant@google.com>
44
45 PR gold/17971
46 * incremental.cc: Remove redundant include of "output.h".
47
1a920511
JY
482015-02-12 Jing Yu <jingyu@google.com>
49
50 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
51 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
52 New relocation.
53 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
54 TLSLE_MOVW_* relocations.
55 (Target_aarch64::Scan::global): Likewise.
56 (Target_aarch64::Relocate::relocate): Likewise.
57 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
58 for new TLSLE_MOVW_* relocations.
59
07f107f3
WN
602015-02-11 Will Newton <will.newton@linaro.org>
61
62 PR gold/13321
63 * arm.cc (Target_arm::make_plt_section): Create an ARM
64 state mapping symbol at the start of the PLT.
65
e051a5b5
L
662015-02-09 H.J. Lu <hongjiu.lu@intel.com>
67
68 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
69 Replace two_file_shared_2.so with two_file_shared_1.so.
70 * testsuite/Makefile.in: Regenerated.
71
dddcc5b9
AM
722015-02-09 Alan Modra <amodra@gmail.com>
73
74 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
75 plugin_test_thin.a and defsym_test.
76 * testsuite/Makefile.in: Regenerate.
77
b39b8b9d
RÁE
782015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
79
80 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
81 body.
82
b66d1c52
CC
832015-02-04 Peter Collingbourne <pcc@google.com>
84
85 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
86 forwarding symbols when computing symbol resolution info for plugins.
87 * plugin.h (Plugin_manager::symtab): New method.
88 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
89
23081de0
CC
902015-02-03 Cary Coutant <ccoutant@google.com>
91 Peter Collingbourne <pcc@google.com>
92
93 PR gold/15660
94 * archive.cc (Thin_archive_object_unlocker): New class.
95 (Archive::include_member): Unlock external members of thin archives.
96 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
97 (plugin_test_2): Likewise.
98 (plugin_test_3): Likewise.
99 (plugin_test_4): Likewise.
100 (plugin_test_5): Likewise.
101 (plugin_test_6): Likewise.
102 (plugin_test_7): Likewise.
103 (plugin_test_8): Likewise.
104 (plugin_test_9): Likewise.
105 (plugin_test_10): Likewise.
106 (plugin_test_11): New test case.
107 * testsuite/Makefile.in: Regenerate.
108 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
109 file to decide whether to claim file.
110 (all_symbols_read_hook): Likewise.
111 * testsuite/plugin_test_1.sh: Adjust expected output.
112 * testsuite/plugin_test_2.sh: Likewise.
113 * testsuite/plugin_test_3.sh: Likewise.
114 * testsuite/plugin_test_6.sh: Likewise.
115 * testsuite/plugin_test_tls.sh: Likewise.
116 * testsuite/plugin_test_11.sh: New testcase.
117
1182015-02-03 Cary Coutant <ccoutant@google.com>
119
120 * descriptors.cc (Descriptors::open): Set artificially-low limit for
121 file descriptors when debugging enabled. Add debug output.
122 (Descriptors::release): Add debug output.
123 (Descriptors::close_some_descriptor): Likewise.
124 (Descriptors::close_all): Likewise.
125 * fileread.cc (File_read::lock): Likewise.
126 (File_read::unlock): Likewise.
127
24dd5808
CC
1282015-02-02 Cary Coutant <ccoutant@google.com>
129
130 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
131 executable output file.
132
fa89cc82
HS
1332015-01-22 Han Shen <shenhan@google.com>
134
135 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
136 (Target_arm::do_plt_address_for_global): New method.
137 (Target_arm::do_plt_address_for_local): New method.
138 (Target_arm::rel_irelative_section): New method.
139 (Target_arm::make_data_plt): Add more parameters for plt ctor.
140 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
141 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
142 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
143 (Target_arm::Scan::check_non_pic): Add ifunc support.
144 (Target_arm::Scan::local): Add ifunc support.
145 (Target_arm::Scan::global): Add ifunc support.
146 (Target_arm::make_plt_section): New method.
147 (Target_arm::make_plt_entry): Change to call to make_plt_section.
148 (Target_arm::make_local_ifunc_plt_entry): New method.
149 (Target_arm::got_irelative_): New member.
150 (Target_arm::rel_irelative_): New member.
151 (Target_arm::got_section): Add creation for got_irelative_.
152 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
153 (Target_arm::Relocate::relocate): Properly set local ifunc address.
154 (Target_arm::do_dynsym_value): Properly set global ifunc address.
155 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
156 (Output_data_plt_arm::IRelative_data): New type.
157 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
158 (Output_data_plt_arm::add_entry): Add more parameters.
159 (Output_data_plt_arm::add_relocation): New method.
160 (Output_data_plt_arm::add_local_ifunc_entry): New method.
161 (Output_data_plt_arm::rel_irelative): New method.
162 (Output_data_plt_arm::entry_count): Modified.
163 (Output_data_plt_arm::address_for_global): New method.
164 (Output_data_plt_arm::address_for_local): New method.
23081de0 165gold/
fa89cc82
HS
166 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
167 (Output_data_plt_arm::insert_irelative_data): New method.
168 (Output_data_plt_arm::irelative_rel_): New member.
169 (Output_data_plt_arm::got_): New member.
170 (Output_data_plt_arm::got_irelative_): New member.
171 (Output_data_plt_arm::irelative_count_): New member.
172 (Output_data_plt_arm::IRelative_data_vec): New typedef.
173 (Output_data_plt_arm::irelative_data_vec_): New member.
174 (Output_data_plt_arm::do_write): Write out irelative entries.
175 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
176 more parameters to ctor.
177 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
178 more parameters to ctor.
179 * output.h (Output_data_reloc::add_local_relative): New method.
180 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
181
0f81d3f0
AM
1822015-01-29 Alan Modra <amodra@gmail.com>
183
184 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
185 and GOT_TLSGD to LE optimization.
186
65d92137
CC
1872015-01-28 Cary Coutant <ccoutant@google.com>
188
189 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
190 for undef TLS symbols.
191 (Target_x86_64::Relocate::relocate_tls): Likewise.
192 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
193
5485698a
CC
1942015-01-25 Cary Coutant <ccoutant@google.com>
195
196 * output.cc (Output_segment::set_section_addresses): Fix calculation
197 of size of relro segment.
198
b01a4b04
AM
1992015-01-22 Alan Modra <amodra@gmail.com>
200
201 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
202 condition for need of ifunc plt entry.
203 (Target_powerpc::Scan::global <got relocs>): Likewise.
204
3d0064a9
CC
2052015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
206
207 * mips.cc (reloc_high): Add r_sym.
208 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
209 reloc_high constructor.
210 (Mips_relocate_functions::relgot16_local): Likewise.
211 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
212 r_type to decide whether LO16 matches HI16.
213 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
214 rello16 and relgot16_local.
215
a5cd8f05
CC
2162015-01-09 Cary Coutant <ccoutant@google.com>
217
218 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
219 unless alignment is larger than page size.
220
4fc1b9d4
L
2212015-01-06 H.J. Lu <hongjiu.lu@intel.com>
222 Cary Coutant <ccoutant@google.com>
223
224 PR gold/17729
225 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
226 (DEFAULT_TARGET_X32): Set for x32.
227 * x86_64.cc (cmp_insn_32): New.
228 (lea_r10_insn_32): Likewise.
229 (lea_r11_insn_32): Likewise.
230 (cmp_insn_64): Likewise.
231 (lea_r10_insn_64): Likewise.
232 (lea_r11_insn_64): Likewise.
233 (Target_x86_64<size>::do_calls_non_split): Handle x32.
234 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
235 (check_DATA): Add split_x32 files.
236 (split_x32_[1234n].o): New targets.
237 (split_x32_[124]): New targets.
238 (split_x32_[1234r].stdout): New targets.
239 * testsuite/split_x32.sh: New file.
240 * testsuite/split_x32_1.s: Likewise.
241 * testsuite/split_x32_2.s: Likewise.
242 * testsuite/split_x32_3.s: Likewise.
243 * testsuite/split_x32_4.s: Likewise.
244 * testsuite/split_x32_n.s: Likewise.
245 * configure: Regenerated.
246 * testsuite/Makefile.in: Likewise.
247
e749cab8
L
2482015-01-06 H.J. Lu <hongjiu.lu@intel.com>
249
250 PR gold/17809
251 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
252 x32.
253
af759df0
AM
2542015-01-02 Alan Modra <amodra@gmail.com>
255
256 * version.cc (print_version): Just print current year.
257 * dwp.cc (print_version): Likewise.
258
b90efa5b
AM
2592015-01-01 Alan Modra <amodra@gmail.com>
260
261 Update year range in copyright notice of all files.
262
f12d1e8a
AM
2632014-12-25 Alan Modra <amodra@gmail.com>
264
265 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
266 new enums.
267 (Target_arm::merge_object_attributes, ): Likewise.
268
5c294fee
TG
2692014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
270
271 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
272 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
273 AEABI_VFP_args_vfp to check that.
274 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
275 value and replace hardcoded values by enum values.
276
e30880c2
CC
2772014-12-22 Cary Coutant <ccoutant@google.com>
278
279 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
280
bd040da1
L
2812014-12-20 H.J. Lu <hongjiu.lu@intel.com>
282
283 PR gold/14608
284 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
285 to "return i * i * 3;".
286
e02a4046
CC
2872014-12-16 Cary Coutant <ccoutant@google.com>
288
289 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
290 (Mapfile::print_output_data): Use current_data_size() to avoid
291 assert for sections requiring postprocessing; if address is not valid,
292 print 0.
293 (Mapfile::print_output_section): Use current_data_size(); print note
294 that addresses and sizes are before compression.
295
add6016b
L
2962014-12-14 H.J. Lu <hongjiu.lu@intel.com>
297
298 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
299 Cast current_group_size to unsigned long when reporting error.
300
0bf32ea9
JY
3012014-12-10 Jing Yu <jingyu@google.com>
302
303 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
304 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
305 Update error message.
306 (Target_aarch64::do_relax): Use absolute value of option
307 stub_group_size. Replace local variable with class member
308 stub_group_size_.
309
cbcb23fa
AM
3102014-12-04 Alan Modra <amodra@gmail.com>
311
312 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
313 addend of PLTREL24 reloc when not generating a plt stub. Make
314 max_branch_offset an "Address".
fbad6518 315 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
316 (Target_powerpc::Relocate::relocate): Likewise.
317
1611bc4a
AM
3182014-12-04 Alan Modra <amodra@gmail.com>
319
320 PR 17670
321 * symtab.cc (Symbol::set_undefined): Remove assertion.
322 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
323 on symbols defined in discarded sections, instead return false.
324 Rearrange params, update all callers.
325 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
326 branches to syms in discarded sections.
327 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
328 undefined and flag as discarded.
329 (Target_powerpc::Relocate::relocate): Localize variable.
330
4759c34e
L
3312014-12-03 H.J. Lu <hongjiu.lu@intel.com>
332
333 PR gold/17675
334 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
335 * testsuite/Makefile.in: Regenerated.
336
1f98a074
AM
3372014-12-03 Alan Modra <amodra@gmail.com>
338
339 PR 17566
340 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
341 when adding dynamic relocations against section symbols.
342
fb257835
DI
3432014-12-01 Dimitry Ivanov <dimitry@google.com>
344
345 * layout.cc (Layout::finish_dynamic_section): When '-z global'
346 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
347 * options.h (General_options): New -z option (global).
348
d8e60314
CC
3492014-12-01 Cary Coutant <ccoutant@google.com>
350
351 PR gold/17578
352 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
353 is given.
354 (Layout::create_executable_stack_info): Warn when -z noexecstack is
355 given but some inputs require executable stack.
356
982bbd97
CC
3572014-11-26 Cary Coutant <ccoutant@google.com>
358
359 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
360 .debug_str_offsets; strip .debug_gnu_pubnames and
361 .debug_gnu_pubtypes.
362 (lines_only_debug_sections): Strip all four new sections.
363
bb779192
HS
3642014-11-26 Jing Yu <jingyu@google.com>
365
366 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
367 register to be x0 when to relax TLSDESC_LD64_LO12.
368
a3e60ddb
AM
3692014-11-26 Alan Modra <amodra@gmail.com>
370
371 * powerpc.cc (struct Stub_table_owner): New.
372 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
373 unsigned int vector. Update all references.
374 (powerpc_relobj::set_stub_table): Take an unsigned int param
375 rather than a Stub_table. Update callers.
376 (Powerpc_relobj::clear_stub_table): New function.
377 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
378 stub_group_size_ vars.
379 (Target_powerpc::new_stub_table): Delete.
380 (max_branch_delta): New function, extracted from..
381 (Target_powerpc::Relocate::relocate): ..here..
382 (Target_powerpc::Branch_info::make_stub): ..and here. Return
383 status on whether stub created successfully.
384 (Stub_control::Stub_control): Add "no_size_errors" param. Move
385 default sizing to..
386 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
387 reduce on relax failure.
388 (Target_powerpc::group_sections): Add "no_size_errors" param.
389 Use stub_group_size_. Set up group info in a temp vector,
390 before building Stub_table vector. Account for input sections
391 possibly already converted to relaxed sections.
392 (Stub_table::init): Delete. Merge into..
393 (Stub_table::Stub_table): ..here.
394 (Stub_table::can_reach_stub): New function.
395 (Stub_table::add_plt_call_entry): Add "from" parameter and
396 return true iff stub could be reached.
397 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
398 param too.
399 (Stub_table::clear_stubs): Add "all" param.
400
a20605cf
AM
4012014-11-26 Alan Modra <amodra@gmail.com>
402
403 * powerpc.cc (Stub_control::set_output_and_owner): New function.
404 (Target_powerpc::group_sections): Use it.
405
43b64deb
CC
4062014-11-25 Cary Coutant <ccoutant@google.com>
407
408 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
409 (Binary_to_elf::write_symbol): Add st_size parameter.
410 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
411
c924eb67
CC
4122014-11-25 Cary Coutant <ccoutant@google.com>
413
414 PR gold/17639
415 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
416 (Sized_relobj_file::do_layout): Handle deferred sections properly
417 during GC pass 1. Don't add reloc sections to deferred list twice.
418 * object.h (Sized_relobj_file::is_deferred_layout): New function.
419 (Sized_relobj_file::is_deferred_layout_): New data member.
420
9d585188
L
4212014-11-21 H.J. Lu <hongjiu.lu@intel.com>
422
423 PR gold/17619
424 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
425 Check PC-relative offset overflow in PLT entry.
426
3ffaac20
AM
4272014-11-21 Alan Modra <amodra@gmail.com>
428
429 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
430 for undefined weaks.
431
0cfb0717
AM
4322014-11-20 Alan Modra <amodra@gmail.com>
433
434 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
435 from --stub-group-size parameter divided by 1024.
436 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
437 template parameter. Update all uses.
438 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
439 has_stub_value. Set for long branches. Don't report overflow for
440 branch to undefined weak symbols. Print info message on
441 overflowing branch to stub.
442
f9dffbf0
AM
4432014-11-20 Alan Modra <amodra@gmail.com>
444
445 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
446
e88ba8d5
L
4472014-11-13 H.J. Lu <hongjiu.lu@intel.com>
448
449 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
450 entry for R_X86_64_GOTPLT64.
451 (Target_x86_64<size>::Relocate::relocate): Update comments for
452 R_X86_64_GOTPLT64.
453
d37ffe25
ED
4542014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
455
456 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
457 * plugin.h: add lock definition
458
9726c3c1
HS
4592014-10-29 Han Shen <shenhan@google.com>
460 Jing Yu <jingyu@google.com>
461
462 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
463 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
464 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
465 Symbol::TLS_REF.
466 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
467 method.
468 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
469 (Target_aarch64::tls_ld_to_le): New method.
470 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
471 for 64bit targets.
472 (Output_data_plt_aarch64::irelative_rel_): New data member.
473 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
474 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
475 (Output_data_plt_aarch64::add_relocation): New method.
476 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
477 offset. Add got_irelative size to got size.
478 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
479 type string with the new typename.
480 (AArch64_relocate_functions::update_adr): Replace parameter x with
481 immed.
482 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
483 (AArch64_relocate_functions::reloc_common): New method.
484 (AArch64_relocate_funcsions::rela_general): Extract common part out
485 into reloc_common method.
486 (AArch64_relocate_functions::rela_general): Likewise.
487 (AArch64_relocate_functions::pcrela_general): Likewise.
488 (AArch64_relocate_functions::adr): New method.
489 (AArch64_relocate_functions::adrp): Calculate immed before calling
490 update_adr.
491 (AArch64_relocate_functions::adrp): Likewise.
492 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
493 comparing x to 0. Calculate immed from ~x when x < 0.
494 (Target_aarch64::optimize_tls_reloc): Add new cases for
495 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
496 TLSLD_MOVW_DTPREL_G0_NC.
497 (Target_aarch64::possible_function_pointer_reloc): Implement this
498 method.
499 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
500 comment.
501 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
502 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
503 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
504 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
505 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
506 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
507 (Target_aarch64::make_plt_entry): Call add_entry with two more
508 parameters.
509 (Target_aarch64::make_local_ifunc_plt_entry): New method.
510 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
511 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
512 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
513 (Target_aarch64::Relocate::relocate_tls): Add cases for
514 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
515 TLSLD_MOVW_DTPREL_G0_NC.
516 * testsuite/icf_safe_so_test.cc: Correct test comment.
517 * testsuite/icf_safe_test.sh: Add AArch64 arch.
518
80272b8c
AM
5192014-10-22 Alan Modra <amodra@gmail.com>
520
521 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
522 thread_starter.
523
998a69f4
AS
5242014-10-18 Andreas Schwab <schwab@linux-m68k.org>
525
526 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
527
aed56ec5
CC
5282014-10-17 Cary Coutant <ccoutant@google.com>
529
530 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
531 Add "typename" keyword.
532
bb779192 5332014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
534 Jing Yu <jingyu@google.com>
535
536 Patch for gold aarch64 backend to support relaxation.
537 * aarch64-reloc.def: Change format.
538 * aarch64.cc (class Reloc_stub): New class.
539 (class Stub_table): New class.
540 (class AArch64_relobj): New class.
541 (class AArch64_input_section): New class.
542 (class AArch64_output_section): New class.
543 (Target_aarch64::new_stub_table): New method.
544 (Target_aarch64::new_aarch64_input_section): New method.
545 (Target_aarch64::find_aarch64_input_section): New method.
546 (Target_aarch64::scan_section_for_stubs): New method.
547 (Target_aarch64::scan_reloc_section_for_stubs): New method.
548 (Target_aarch64::relocate_stub): New method.
549 (Target_aarch64::current_target): New method.
550 (Target_aarch64::do_make_elf_object): New method.
551 (Target_aarch64::do_may_relax): New method.
552 (Target_aarch64::do_relax): New method.
553 (Target_aarch64::group_sections): New method.
554 (Target_aarch64::scan_reloc_for_stub): New method.
555 (Target_aarch64::do_make_output_section): New method.
556 (Target_aarch64::stub_tables_): New data member.
557 (Target_aarch64::aarch64_input_section_map_): New data member.
558 (AArch64_relocate_functions::maybe_apply_stub): New method.
559
db4c9594
CC
5602014-09-30 Cary Coutant <ccoutant@google.com>
561
562 PR gold/17432
563 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
564
cd6da036
KC
5652014-09-30 Kito Cheng <kito@0xlab.org>
566
567 PR gold/13597
568 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
569 hash table before sysv-style hash table.
570
5f772412
ST
5712014-09-29 Sriraman Tallam <tmsriram@google.com>
572
573 * options.h (--pic-executable): Add negative to alias to -no-pie.
574
5efeedf6
CC
5752014-09-26 Cary Coutant <ccoutant@google.com>
576
577 PR gold/16773
578 * object.cc (Sized_relobj_file): Compute value of section symbols
579 for TLS sections the same as TLS symbols.
580
1707f183
CC
5812014-09-25 Cary Coutant <ccoutant@google.com>
582
583 PR gold/17432
584 * resolve.cc (Symbol_table::resolve): Override common placeholder
585 symbols, but adjust sizes.
586 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
587 symbols to common lists.
588
00cac886
AM
5892014-09-24 Alan Modra <amodra@gmail.com>
590
591 * po/POTFILES.in: Regenerate.
592
635aa30e
CC
5932014-09-23 Taiju Tsuiki <tzik@google.com>
594 Cary Coutant <ccoutant@google.com>
595
71b9b91b 596 PR gold/14860
635aa30e
CC
597 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
598 on input_sections_blocker.
599 * layout.cc (Write_sections_task::locks): Unblock
600 input_sections_blocker_.
601 * layout.h (Write_sections_task::Write_sections_task): Add
602 input_sections_blocker.
603 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
604 to DEPENDENCIES.
605 * testsuite/Makefile.in: Regenerate.
606
c0c71592
RÁE
6072014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
608
609 * testsuite/Makefile.am (plugin_test_10): New test.
610 * testsuite/Makefile.in: Regenerate
611 * testsuite/plugin_common_test_2.c (c1): Align to 8.
612 * testsuite/plugin_test_10.sh: New file.
613
6168c2a1
RÁE
6142014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
615
616 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
617 * resolve.cc (Symbol_table::resolve): Don't override common symbols
618 during the replacement phase.
619
3a531937
JY
6202014-09-17 Han Shen <shenhan@google.com>
621 Jing Yu <jingyu@google.com>
622
623 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
624 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
625 * aarch64.cc (Target_aarch64): Add data members
626 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
627 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
628 constructor.
629 (Target_aarch64::do_reloc_symbol_index): New method.
630 (Target_aarch64::do_reloc_addend): New method.
631 (Target_aarch64::add_tlsdesc_info): New method.
632 (Target_aarch64::do_dynsym_value): New method.
633 (Target_aarch64::do_make_data_plt): Add new parameters: got,
634 got_irelative. Pass them to Output_data_plt_aarch64_standard.
635 (Target_aarch64::make_data_plt): Add new parameters: got,
636 got_irelative. Pass them to do_make_data_plt.
637 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
638 (Target_aarch64::Relocate:tls_gd_to_le): New method.
639 (Target_aarch64::Relocate:tls_ie_to_le): New method.
640 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
641 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
642 (Target_aarch64::got_tlsdesc_section): New method.
643 (Target_aarch64::make_local_ifunc_plt_entry): New method.
644 (Target_aarch64::define_tls_base_symbol): New method.
645 (Target_aarch64::reserve_tlsdesc_entries): New method.
646 (Target_aarch64::got_mod_index_entry): New method.
647 (Target_aarch64::rela_tlsdesc_section): New method.
648 (Target_aarch64::rela_irelative_section): New method.
649 (Target_aarch64::Tlsdesc_info): New struct.
650 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
651 relocations and tlsdesc relocations.
652 (Target_aarch64::optimize_tls_reloc): Implement method.
653 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
654 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
655 in constructor.
656 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
657 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
658 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
659 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
660 (Output_data_plt_aarch64::rela_tlsdesc): New method.
661 (Output_data_plt_aarch64::rela_irelative): New method.
662 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
663 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
664 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
665 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
666 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
667 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
668 (Output_data_plt_aarch64_standard): New member variables:
669 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
670 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
671 New parameter: got, got_irelative.
672 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
673 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
674 (Output_data_plt_aarch64::do_write): Replace got_address with
675 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
676 (AArch64_relocate_functions::update_movnz): New method.
677 (AArch64_relocate_functions): Correct format.
678 (AArch64_relocate_functions::movnz): New method.
679 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
680 before the switch. Add new cases to switch.
00cac886 681 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
682 tlsgd tlsdesc cases.
683 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
684 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
685 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
686 Call reloc_name_in_error_message to print unsupported reloc.
687 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
688 make_data_plt.
689 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
690 relocs. Fill in some more dynamic tags.
691 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
692 Skip call tls_get_addr when tlsgd is relaxed.
693 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
694 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
695 tlsdesc->ie relaxation.
696
62661c93
SS
6972014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
698
699 * mips.cc (Target_mips_nacl): New class.
700 (Target_selector_mips_nacl): New class.
701 (target_selector_mips32): Rename from target_selector_mips32be and use
702 Target_selector_mips_nacl instead of Target_selector_mips.
703 (target_selector_mips32el): Rename from target_selector_mips32 and use
704 Target_selector_mips_nacl instead of Target_selector_mips.
705 (target_selector_mips64): Rename from target_selector_mips64be and use
706 Target_selector_mips_nacl instead of Target_selector_mips.
707 (target_selector_mips64el): Rename from target_selector_mips64 and use
708 Target_selector_mips_nacl instead of Target_selector_mips.
709 (Target_mips::mips_info): Add const attribute.
710
54674d38
CC
7112014-09-02 Cary Coutant <ccoutant@google.com>
712
713 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
714 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
715 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
716 (Sized_incr_dynobj::do_section_name): Likewise.
717 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
718 (Sized_incr_dynobj::do_section_name): Likewise.
719 * object.h (Object::section_name): Likewise.
720 (Object::do_section_name): Likewise.
721 (Sized_relobj_file::do_section_name): Likewise.
722 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
723 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
724
9860cbcf
CC
7252014-09-02 Cary Coutant <ccoutant@google.com>
726
727 PR gold/17005
728 * ehframe.cc (Fde::write): Add output_offset parameter.
729 (Cie::write): Likewise.
730 (Eh_frame::set_final_data_size): Account for offset within output
731 section.
732 (Eh_frame::do_sized_write): Likewise.
733 * ehframe.h (Fde::write): Add output_offset parameter.
734 (Cie::write): Likewise.
735 * output.cc (Output_section::Input_section_sort_entry): Remove
736 section_has_name_; add output_section_name parameter. Use
737 output section name for non-input sections.
738 (Output_section::Input_section_sort_entry::section_has_name): Remove.
739 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
740 (Output_section::Input_section_sort_compare): Remove logic for
741 sections without names.
742 (Output_section::Input_section_sort_init_fini_compare): Likewise.
743 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
744 Likewise.
745 (Output_section::Input_section_sort_section_name_compare): Likewise.
746
8e33481e
HS
7472014-08-29 Han Shen <shenhan@google.com>
748 Jing Yu <jingyu@google.com>
749
750 * aarch64-reloc-property.cc
751 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
752 reference reloc property in the table.
753 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
754 3 other entries.
755 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
756 2 new overloaded methods.
757 (Output_data_got_aarch64::do_write): Add code to write out
758 static relocs.
759 (class Output_data_got_aarch64::Static_reloc): New class to wrap
760 static relocs.
761 (Output_data_got_aarch64::static_relocs): New vector to
762 hold static relocs.
763 (Target_aarch64::TCB_SIZE): New const static memeber.
764 (Target_aarch64::tcb_size): New method.
765 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
766 (Target_aarch64::Relocate::relocate_tls): New method.
767 (Target_aarch64::Scan::local): Add code handling new reloc types.
768 (Target_aarch64::Scan::global): Add code handling new reloc types.
769
81233653
ST
7702014-08-13 Sriraman Tallam <tmsriram@google.com>
771
772 * options.h (-no-pie): Add option.
773
9363c7c3
JY
7742014-08-08 Jing Yu <jingyu@google.com>
775 Han Shen <shenhan@google.com>
776
777 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
778 (DEFFILES): add aarch64-reloc.def.
779 (TARGETSOURCES): Add aarch64-reloc-property.cc.
780 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
781 * Makefile.in: Regenerate.
782 * aarch64-reloc-property.cc: New file.
783 * aarch64-reloc-property.h: New file.
784 * aarch64-reloc.def: New file.
785 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
786 with tab to make the format consistent.
787 (Output_data_got_aarch64::symbol_table_): New method.
788 (Target_aarch64::do_plt_address_for_global): New method.
789 (Target_aarch64::do_plt_address_for_local): New method.
790 (Target_aarch64::do_select_as_default_target): New method.
791 (Target_aarch64::do_make_data_plt): New method.
792 (Target_aarch64::make_data_plt): New method.
793 (Output_data_plt_aarch64::has_irelative_section): New method.
794 (Output_data_plt_aarch64::address_for_global): New method.
795 (Output_data_plt_aarch64::address_for_local): New method.
796 (Output_data_plt_aarch64::irelative_rel_): New parameter.
797 (Output_data_plt_aarch64::add_entry): Implement contents.
798 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
799 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
800 the got_pov entry to plt0.
801 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
802 Implement contents.
803 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
804 (AArch64_howto): New struct.
805 (aarch64_howto[]): New static const array.
806 (AArch64_relocate_functions): New class.
807 (Target_aarch64::Scan::get_reference_flags): Remove method.
808 (Target_aarch64::Scan::local): Implement to support a few relocations.
809 (Target_aarch64::Scan::global): Implement to support a few relocations.
810 (Target_aarch64::make_plt_section): Implement contents.
811 (Target_aarch64::make_plt_entry): Implement contents.
812 (Target_aarch64::do_finalize_sections): Implement contents.
813 (Target_aarch64::Relocate::relocate): Implement a few relocations.
814 (Target_aarch64::relocate_section): Implement contents.
815
ad9fe6c1
AM
8162014-08-06 Alan Modra <amodra@gmail.com>
817
818 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
819
7cd4e5b7
AM
8202014-08-06 Alan Modra <amodra@gmail.com>
821
822 PR 13227
823 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
824
5ad9b0a7
ST
8252014-07-21 Sriraman Tallam <tmsriram@google.com>
826
827 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 828 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 829
e051745c
CC
8302014-07-08 Cary Coutant <ccoutant@google.com>
831
832 * expression.cc (struct Expression::Expression_eval_info): Add
833 new fields type_pointer, vis_pointer, and nonvis_pointer.
834 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
835 nonvis_pointer parameters. Adjust all calls.
836 (Symbol_expression::value): Update type, visibility, and nonvis bits
837 in caller.
838 * script.cc (Symbol_assignment::sized_finalize): Update type,
839 visibility, and remaining st_other bits for new symbol.
840 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
841 vis_pointer, and nonvis_pointer parameters.
842 * symtab.h (Symbol::set_type): New method.
843
844 * testsuite/Makefile.am (defsym_test): New test.
845 * testsuite/Makefile.in: Regenerate.
846 * testsuite/defsym_test.c: New file.
847 * testsuite/defsym_test.sh: New file.
848
f35c4853
CC
8492014-07-08 Cary Coutant <ccoutant@google.com>
850
851 PR gold/15639
852 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
853 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
854 (Sized_dynobj::base_read_symbols): ...new method.
855 * object.h (Sized_relobj_file::base_read_symbols): New method.
856 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
857 (Sized_relobj_file::base_read_symbols): ...new method.
858 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
859 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
860 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
861
2900af2d
AM
8622014-07-04 Alan Modra <amodra@gmail.com>
863
864 * po/POTFILES.in: Regenerate.
865
053a4d68
JY
8662014-07-02 Jing Yu <jingyu@google.com>
867
868 * aarch64.cc: New file
869 * Makefile.am (TARGETSOURCES): Add aarch64.cc
870 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
871 * Makefile.in: Regenerate.
872 * configure.tgt: Add entries for aarch64*.
873 * configure.ac: Likewise.
874 * configure: Likewise.
875
7b549045
AM
8762014-06-27 Alan Modra <amodra@gmail.com>
877
878 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
879
cb818dbf
CC
8802014-06-24 Cary Coutant <ccoutant@google.com>
881
882 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
883 sections.
884 (Dwo_file::sized_read_unit_index): Likewise.
885
9810d34d
SS
8862014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
887
888 * mips.cc: New file.
889 * Makefile.am (TARGETSOURCES): Add mips.cc
890 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
891 * configure.tgt: Add entries for mips*.
892 * configure.ac: Likewise.
893 * Makefile.in: Regenerate.
894 * configure: Likewise.
895
9baa787b
CC
8962014-06-09 Cary Coutant <ccoutant@google.com>
897
898 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
899 unit_length is within section bounds.
900
8f89af0a
CC
9012014-06-09 Cary Coutant <ccoutant@google.com>
902
903 PR gold/16980
904 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
905 map.
906
a47622ac
AM
9072014-06-07 Alan Modra <amodra@gmail.com>
908
909 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
910
4320c691
CC
9112014-06-06 Cary Coutant <ccoutant@google.com>
912
913 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
914 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
915 (Dwarf_pubnames_table::read_header): Likewise.
916 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
917 .debug_gnu_pubtypes.
918
270c9937
JB
9192014-06-05 Joel Brobecker <brobecker@adacore.com>
920
921 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
922 * Makefile.in, configure: Regenerate.
923
397998fc
AM
9242014-06-03 Alan Modra <amodra@gmail.com>
925
926 * powerpc.cc (addis_12_2): Define.
927 (Stub_table::do_write): Support fusion on ELFv2 stubs.
928
61f5c66f
AM
9292014-06-03 Alan Modra <amodra@gmail.com>
930
931 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
932 st_other output.
933
f6971787
AM
9342014-06-02 Alan Modra <amodra@gmail.com>
935
936 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
937 Only ignore relocs on ELFv1.
938 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
939
f6fb8322
CC
9402014-05-30 Cary Coutant <ccoutant@google.com>
941
942 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
943 * testsuite/Makefile.in: Regenerate.
944 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
945
c23dd342
L
9462014-05-27 H.J. Lu <hongjiu.lu@intel.com>
947
948 PR gold/16945
949 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
950 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
951
5fe7ffdc
AM
9522014-05-15 Alan Modra <amodra@gmail.com>
953
954 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
955 Compare FDE contents with DW_CFA_nop rather than 0.
956
a82bef93
ST
9572014-05-13 Sriraman Tallam <tmsriram@google.com>
958
959 * symtab.h (may_need_copy_reloc): Remove check for position independent
960 code.
961 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
962 position independence before pc absolute may_need_copy_reloc call.
963 Add check for executable output befor pc relative may_need_copy_reloc
964 call.
965 * i386.cc: Ditto.
966 * arm.cc: Ditto.
967 * sparc.cc: Ditto.
968 * tilegx.cc: Ditto.
969 * powerpc.cc: Add check for no position independence before
970 may_need_copy_reloc calls.
971 * testsuite/pie_copyrelocs_test.cc: New file.
972 * testsuite/pie_copyrelocs_shared_test.cc: New file.
973 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 974 * Makefile.in: Regenerate.
a82bef93 975
53c66605
ML
9762014-05-08 Martin Liška <mliska@suse.cz>
977
978 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
979
57b2284c
CC
9802014-05-06 Cary Coutant <ccoutant@google.com>
981
982 PR gold/16900
983 * i386.cc (Output_data_got_plt_i386): New class.
984 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
985 parameter. Change all callers.
986 (Output_data_plt_i386::layout_): Remove.
987 (Output_data_plt_i386::got_plt_): Change type.
988 (Target_i386::got_plt_): Change type. Change all references.
989 (Target_i386::got_section): Create instance of new class.
990 (Output_data_got_plt_i386::do_write): New function.
991 * x86_64.cc (Output_data_got_plt_x86_64): New class.
992 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
993 parameter. Change all callers.
994 (Output_data_plt_x86_64::layout_): Remove.
995 (Output_data_plt_x86_64::got_plt_): Change type.
996 (Target_x86_64::got_plt_): Change type. Change all references.
997 (Target_x86_64::got_section): Create instance of new class.
998 (Output_data_got_plt_x86_64::do_write): New function.
999 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1000 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1001 class.
1002
6b97515d 10032014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1004
6b97515d
CC
1005 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1006 if we have pubnames/pubtypes.
1007
d1bddd3c
CC
10082014-05-02 Cary Coutant <ccoutant@google.com>
1009
5fe7ffdc
AM
1010 * defstd.cc (in_segment): Define __ehdr_start here...
1011 * layout.cc (Layout::finalize): ...Instead of here. Set the
1012 output segment when known.
1013 * resolve.cc (Symbol::override_base_with_special): Remember
1014 the original binding.
1015 * symtab.cc (Symbol::set_output_segment): New function.
1016 (Symbol::set_undefined): New function.
1017 * symtab.h (Symbol::is_weak_undefined): Check original undef
1018 binding.
1019 (Symbol::is_strong_undefined): New function.
1020 (Symbol::set_output_segment): New function.
1021 (Symbol::set_undefined): New function.
1022 * target-reloc.h (is_strong_undefined): Remove.
1023 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1024 Check for hidden undefs.
1025 (relocate_section): Call Symbol::is_strong_undefined.
1026
1027 * testsuite/Makefile.am (ehdr_start_test_1)
1028 (ehdr_start_test_2, ehdr_start_test_3)
1029 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1030 * testsuite/Makefile.in: Regenerate.
1031 * testsuite/ehdr_start_def.cc: New source file.
1032 * testsuite/ehdr_start_test.cc: New source file.
1033 * testsuite/ehdr_start_test.t: New linker script.
1034 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1035
7849f6d8
CC
10362014-04-23 Cary Coutant <ccoutant@google.com>
1037
bf2cc635 1038 PR gold/16870
7849f6d8
CC
1039 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1040
99fd8cff
CC
10412014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1042
1043 * layout.cc (Layout::include_section): Allow a target to decide
1044 whether to include a section.
1045 * target.h (Target::should_include_section): New function.
1046 (Target::do_should_include_section): New function.
1047
91f43acd
CC
10482014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1049
1050 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1051 inline into ...
1052 (Copy_relocs::emit): ... here.
1053 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1054 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1055 (Copy_reloc_entry::entries_): Change from private to protected.
1056
c4eb27e1
ST
10572014-04-02 Sriraman Tallam <tmsriram@google.com>
1058
1059 * icf.cc (get_section_contents): Replace copies of reloc
1060 vectors with const references.
1061
ae447ddd
CC
10622014-04-02 Cary Coutant <ccoutant@google.com>
1063
1064 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1065 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1066 * configure: Regenerate.
1067 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1068 -fno-use-linker-plugin.
1069 (LINK1, CXXLINK1): Add it to the link command.
1070 * testsuite/Makefile.in: Regenerate.
1071
fa47fa92
AM
10722014-03-12 Alan Modra <amodra@gmail.com>
1073
1074 * Makefile.in: Regenerate.
1075
9b12c500
CC
10762014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1077
1078 * symtab.h (Symbol::set_nonvis): New function.
1079
beacaa96
CC
10802014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1081
1082 * symtab.cc (Sized_symbol<32>::init_output_data):
1083 Instantiate the template.
1084 (Sized_symbol<64>::init_output_data): Likewise.
1085
800d9823
CC
10862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1087
1088 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1089 adjust dynamic symbol value.
1090 * target.h (Target::adjust_dyn_symbol): New function.
1091 (Target::do_adjust_dyn_symbol): New function.
1092
918fc1f8 10932014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1094
918fc1f8
CC
1095 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1096 Get the value of DYNAMIC_CUSTOM dynamic entry.
1097 * output.h (Output_data_dynamic::add_custom): New function.
1098 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1099 dynamic entry.
1100 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1101 * target.h (Target::dynamic_tag_custom_value): New function.
1102 (Target::do_dynamic_tag_custom_value): New function.
1103
98ff9231
CC
11042014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1105
1106 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1107 dynsym indexes.
1108 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1109 (Target::do_has_custom_set_dynsym_indexes): New function.
1110 (Target::set_dynsym_indexes): New function.
1111 (Target::do_set_dynsym_indexes): New function.
1112
b80eed39
AM
11132014-03-07 Alan Modra <amodra@gmail.com>
1114
1115 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1116 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1117 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1118 (Powerpc_relocate_functions::has_overflow_bitfield,
1119 overflowed): Use the above.
1120 (Target_powerpc::Relocate::relocate): Correct overflow checking
1121 for a number of relocations. Modify overflow test for 16-bit
1122 fields in instructions to signed/unsigned according to whether
1123 the field takes a signed or unsigned value.
1124
4b95cf5c
AM
11252014-03-05 Alan Modra <amodra@gmail.com>
1126
1127 Update copyright years.
1128
45965137
AM
11292014-03-05 Alan Modra <amodra@gmail.com>
1130
1131 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1132 R_PPC64_ADDR64_LOCAL.
1133 (Target_powerpc::Relocate::relocate): Likewise.
1134
2c80b753
AM
11352014-03-03 Alan Modra <amodra@gmail.com>
1136
1137 * dwp.cc (print_version): Update copyright year to current.
1138
c1c69e83
AM
11392014-02-10 Alan Modra <amodra@gmail.com>
1140
1141 * po/gold.pot: Regenerate.
1142
dd0c4e70
CC
11432014-02-06 Cary Coutant <ccoutant@google.com>
1144
1145 Fix problem where -u is ignored when a weak undef is seen.
1146
1147 * archive.cc (Library_base::should_include_member): Reorder
1148 code to check for -u option if a weak undef has already been seen.
1149 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1150 * testsuite/Makefile.in: Regenerate.
1151 * testsuite/weak_undef_file3.cc: New file.
1152 * testsuite/weak_undef_file4.cc: New file.
1153 * testsuite/weak_undef_test_2.cc: New file.
1154
1a221d3d
CC
11552014-02-05 Cary Coutant <ccoutant@google.com>
1156
1157 Fix issues with gold undefined symbol diagnostics.
1158
1159 PR binutils/15435
1160 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1161 check to here.
1162 * target-reloc.h (is_strong_undefined): New function.
1163 (relocate_section): Move undef vtable symbol check from here.
1164 Check for is_strong_undefined.
1165
e889f0a4 11662014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1167
e889f0a4
CC
1168 Fix problems with the --dynamic-list option.
1169
1170 PR gold/13577
1171 * options.cc (General_options::parse_dynamic_list):
1172 Set have_dynamic_list_.
1173 (General_options::General_options): Initialize have_dynamic_list_.
1174 (General_options::finalize): Turn off -Bsymbolic and
1175 -Bsymbolic-functions if --dynamic-list provided.
1176 * options.h (General_options::have_dynamic_list): New function.
1177 (General_options::have_dynamic_list_): New data member.
1178 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1179 correctly.
5fe7ffdc 1180
e889f0a4
CC
1181 PR gold/16530
1182 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1183 in --dynamic-list, mark it.
5fe7ffdc 1184
e889f0a4
CC
1185 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1186 (dynamic_list_2): New test case.
1187 * testsuite/Makefile.in: Regenerate.
1188 * testsuite/dynamic_list_2.cc: New file.
1189 * testsuite/dynamic_list_2.t: New file.
1190 * testsuite/dynamic_list_lib1.cc: New file.
1191 * testsuite/dynamic_list_lib2.cc: New file.
1192 * testsuite/gc_dynamic_list_test.c: New file.
1193 * testsuite/gc_dynamic_list_test.sh: New file.
1194 * testsuite/gc_dynamic_list_test.t: New file.
1195
ec673e64
CC
11962014-01-28 Cary Coutant <ccoutant@google.com>
1197
1198 Add .gdb_index version 7 support.
1199
1200 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1201 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1202 debug sections.
1203 (Dwarf_ranges_table::read_ranges_table): Likewise.
1204 (Dwarf_pubnames_table::read_section): Check for GNU-style
1205 sections, and for compressed debug sections.
1206 (Dwarf_pubnames_table::read_header): Compute end address of table.
1207 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1208 for end of list by offset, not by offset == 0.
1209 (Dwarf_info_reader::do_read_string_table): Check for compressed
1210 debug sections.
1211 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1212 Initialize new data members.
1213 (Dwarf_pubnames_table::next_name): return flag_byte.
1214 (Dwarf_pubnames_table::end_of_table_): New data member.
1215 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1216 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1217 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1218 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1219 read skeleton type unit DIEs.
1220 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1221 (Gdb_index::do_write): Write flag_byte.
1222 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1223 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1224 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1225 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1226
221fd5d5
L
12272014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1228
1229 * version.cc (print_version): Update copyright year to 2014.
1230
6c09fb0b
ILT
12312013-12-19 Dimitry Andric <dimitry@andric.com>
1232
1233 * stringpool.cc (Stringpool_template::reserve): Add
1234 HAVE_UNORDERED_MAP case.
1235 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1236
8356f2d0
CC
12372013-12-18 Cary Coutant <ccoutant@google.com>
1238
1239 * configure.ac: Check for <unordered_set> and <unordered_map>.
1240 * config.in: Regenerate.
1241 * configure: Regenerate.
1242 * system.h: Use <unordered_set> and <unordered_map> if available.
1243
f2c7d7ee
RM
12442013-12-10 Roland McGrath <mcgrathr@google.com>
1245
1246 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1247 with $(INSTALL_PROGRAM_ENV).
1248 * Makefile.in: Regenerate.
1249
6632e8cc
CC
12502013-11-22 Cary Coutant <ccoutant@google.com>
1251
1252 * configure.ac: Add check for which library is needed for
1253 dlopen.
1254 * configure: Regenerate.
1255
0c075858
CC
12562013-11-22 Cary Coutant <ccoutant@google.com>
1257
1258 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1259 assembler.
1260 * testsuite/Makefile.in: Regenerate.
1261
f49fe902
L
12622013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1263
1264 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1265 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1266 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1267 (Target_x86_64<size>::Scan::local): Likewise.
1268 (Target_x86_64<size>::Scan::global): Likewise.
1269 (Target_x86_64<size>::Relocate::relocate): Likewise.
1270 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1271 Likewise.
1272 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1273 R_X86_64_PC32_BND.
1274
1275 * testsuite/Makefile.am (check_PROGRAMS): Add
1276 exception_x86_64_bnd_test.
1277 (exception_x86_64_bnd_test_SOURCES): New macro.
1278 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1279 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1280 (exception_x86_64_bnd_test_LDADD): Likewise.
1281 (exception_x86_64_bnd_1.o): New rule.
1282 (exception_x86_64_bnd_2.o): Likewise.
1283 * testsuite/Makefile.in: Regenerated.
1284
9055360d
AM
12852013-11-15 Alan Modra <amodra@gmail.com>
1286
1287 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1288 accessor.
1289 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1290 Only call ppc64_local_entry_offset for 64-bit. Restrict
1291 symval_for_branch lookup to ELFv1.
1292 (Stub_table::add_plt_call_entry): Use unsigned int off.
1293 (Output_data_glink::Address, invalid_address): New.
1294 (Output_data_glink::add_eh_frame): Move out of line. Add
1295 support for ELFv2.
1296 (Output_data_glink::add_global_entry, find_global_entry,
1297 global_entry_address): New functions.
1298 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1299 ge_size): New variables.
1300 (Output_data_glink::set_final_data_size): Add global entry
1301 stub sizing.
1302 (Output_data_glink::do_write): Write global entry stubs.
1303 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1304 parameter. Return true for ELFv2. Adjust callers.
1305 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1306 ELFv1. Similarly for ifunc and dynamic relocation processing
1307 specific to ELFv1. Recognize that symbols are defined on
1308 their plt entries for ELFv2.
1309 (Target_powerpc::symval_for_branch): Assert if called for
1310 ELFv2 or ppc32.
1311 (Target_powerpc::Relocate::relocate): Use global entry plt
1312 stub for symbol value if such exists on ELFv2.
1313 (Target_powerpc::Relocate::relocate): Don't call
1314 symval_for_branch when ELFv2. Do adjust for local entry
1315 offset when ELFv2.
1316 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1317 plt stub for ELFv2.
1318 (Target_powerpc::do_plt_address_for_global): Similarly.
1319
cafdd569
CC
13202013-11-14 Cary Coutant <ccoutant@google.com>
1321
1322 Revert patch -- this did not fix the problem, and there is
1323 no race there.
1324
1325 2013-11-14 Cary Coutant <ccoutant@google.com>
1326
1327 PR gold/14860
1328 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1329 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1330 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1331 updating fde_offsets_.
1332 (Eh_frame_hdr::lock_): New data member.
1333
94e49e16
CC
13342013-11-14 Cary Coutant <ccoutant@google.com>
1335
1336 * dwp.cc (Dwo_file_entry): New type.
1337 (File_list): Use Dwo_file_entry.
1338 (Dwo_file::verify): New function.
1339 (Dwo_file::verify_dwo_list): New function.
1340 (Dwo_file::sized_verify_dwo_list): New function.
1341 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1342 list.
1343 (Dwp_options): New enum type.
1344 (dwp_options): Add --verify-only.
1345 (usage): Likewise.
1346 (main): Likewise.
1347 * dwp.h (gold_info): Add declaration.
1348
7cdd7d57
CC
13492013-11-14 Cary Coutant <ccoutant@google.com>
1350
1351 PR gold/14860
1352 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1353 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1354 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1355 updating fde_offsets_.
1356 (Eh_frame_hdr::lock_): New data member.
1357
1d946cb3
CC
13582013-11-06 Cary Coutant <ccoutant@google.com>
1359
1360 PR gold/15758
1361 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1362 before reloc sections.
1363
4f65b40e
AM
13642013-11-04 Alan Modra <amodra@gmail.com>
1365
1366 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1367 (Symbol::needs_dynamic_reloc): Test new flag.
1368 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1369 (Target_powerpc::Scan::get_reference_flags): Add target param.
1370 Return FUNC_DESC_ABI for 64-bit ELFv1.
1371 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1372 call.
1373 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1374 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1375
908794a9
CC
13762013-10-31 Cary Coutant <ccoutant@google.com>
1377
1378 Restore support for dwp v2 DWARF package file format.
1379
1380 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1381 tu_length parameter. Adjust all callers.
1382 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1383 * dwp.cc: Include dwarf.h.
1384 (Section_bounds): New struct type.
1385 (Unit_set): New struct type.
1386 (Dwo_file::Dwo_file): Initialize new data member.
1387 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1388 Combine and rename to...
1389 (Dwo_file::read_unit_index): ...this.
1390 (Dwo_file::sized_read_compunit_index)
1391 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1392 (Dwo_file::sized_read_unit_index): ...this.
1393 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1394 parameters; add section_id parameter.
1395 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1396 (Dwo_file::add_unit_set): ...this.
1397 (Dwo_file::shndx_map_): Remove.
1398 (Dwo_file::sect_offsets_): New data member.
1399 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1400 (Dwp_output_file::add_section): Rename to...
1401 (Dwp_output_file::add_contribution): ...this.
1402 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1403 (Dwp_output_file::add_tu_set): Likewise.
1404 (Dwp_output_file::Contribution): New type.
1405 (Dwp_output_file::Section::contributions): New data member.
1406 (Dwp_output_file::Cu_or_tu_set): Remove.
1407 (Dwp_output_file::Section::Section): New ctor.
1408 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1409 (Dwp_output_file::Dwp_index::Section_table): New type.
1410 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1411 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1412 parameter.
1413 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1414 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1415 (Dwp_output_file::Dwp_index::section_table): New member function.
1416 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1417 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1418 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1419 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1420 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1421 (Dwp_output_file::Dwp_index::section_table_): New data member.
1422 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1423 (Dwp_output_file::add_output_section): New member function.
1424 (Dwp_output_file::write_new_section): New member function.
1425 (Dwp_output_file::write_contributions): New member function.
1426 (Dwp_output_file::section_id_map_): New data member.
1427 (class Dwo_id_info_reader): Remove.
1428 (class Unit_reader): New class.
1429 (get_dwarf_section_name): New function.
1430 (Dwo_file::read_executable): Adjust initializations of class data.
1431 (Dwo_file::read): Add support for v2 package file format.
1432 (Dwo_file::read_unit_index): Likewise.
1433 (Dwo_file::sized_read_unit_index): Likewise.
1434 (Dwo_file::copy_section): Likewise.
1435 (Dwo_file::add_unit_set): Likewise.
1436 (Dwp_output_file::add_output_section): Likewise.
1437 (Dwp_output_file::add_contribution): Likewise.
1438 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1439 for empty slot.
1440 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1441 file format.
1442 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1443 slot.
1444 (Dwp_output_file::initialize): Remove unused function.
1445 (Dwp_output_file::finalize): Add support for v2 package file format.
1446 (Dwp_output_file::write_index): Likewise.
1447 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1448 function prototype.
1449
2500c017
CC
14502013-10-31 Cary Coutant <ccoutant@google.com>
1451
1452 * configure.ac: Fix check for -fmerge-constants.
1453 * configure.ac: Regenerate.
1454
dd0845d7
RM
14552013-10-30 Roland McGrath <mcgrathr@google.com>
1456
1457 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1458 Correct 9-byte nop sequence to match what the assembler generates.
1459
b4f7960d
AM
14602013-10-30 Alan Modra <amodra@gmail.com>
1461
1462 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1463 ppc64_local_entry_offset, ppc64_local_entry_offset,
1464 do_read_symbols): New functions.
1465 (Powerpc_relobj::e_flags_, st_other_): New vars.
1466 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1467 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1468 (Powerpc_relobj::e_flags_): New var.
1469 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1470 and adjust for ELFv2.
1471 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1472 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1473 (Powerpc_dynobj::do_find_special_sections): Likewise.
1474 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1475 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1476 to ELFv2 local entry.
1477 (Target_powerpc::do_relax): No thread safe barriers needed for
1478 ELFv2.
1479 (Output_data_plt_powerpc::initial_plt_entry_size_,
1480 plt_entry_size): Delete. Replace all uses with
1481 first_plt_entry_offset() and plt_entry_size().
1482 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1483 reserved_size parm. Update callers.
1484 (Output_data_plt_powerpc::entry_count): Update.
1485 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1486 and use Target_powerpc::first_plt_entry_offset().
1487 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1488 rename to plt_entry_size.
1489 (Output_data_plt_powerpc::add_ifunc_entry,
1490 add_local_ifunc_entry): Adjust reloc for ELFv2.
1491 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1492 (glink_eh_frame_fde_64v2): New.
1493 (Stub_table::plt_call_size): Support ELFv2 sizing.
1494 (Output_data_glink::add_eh_frame): Use the new FDE.
1495 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1496 (Stub_table::do_write): Write ELFv2 stubs and glink.
1497 (Target_powerpc::Relocate::relocate): Replaces nop after call
1498 with ld 2,24(1) and adjust local offset destination for ELFv2.
1499
f9c6b907
AM
15002013-10-30 Alan Modra <amodra@gmail.com>
1501
1502 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1503 (Target_powerpc::Scan::global, local): Likewise.
1504 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1505 on all ppc64 @h and @ha relocs.
1506
e84fe78f
AM
15072013-10-14 Alan Modra <amodra@gmail.com>
1508
1509 * output.h (Output_data_got::add_constant): Tidy.
1510 (Output_data_got::add_constant_pair): New function.
1511 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1512 methods used so as to first call reserve_ent().
1513
679e4abf
RM
15142013-10-11 Roland McGrath <mcgrathr@google.com>
1515
44dcb735
RM
1516 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1517 add_got_entry and add_got_entry_pair.
1518
13323c49
RM
1519 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1520 (HAVE_PUBNAMES): Likewise.
1521 * configure: Regenerate.
1522
1496b446
RM
1523 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1524 * testsuite/Makefile.in: Regenerate.
1525
cc84c10b
RM
1526 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1527 Remove const from declaration.
1528 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1529 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1530 * output.h (Output_file_header): Remove const from member target_
1531 and corresponding constructor argument.
1532 * output.cc (Output_file_header::Output_file_header): Update prototype.
1533 (Output_file_header::do_sized_write): Use this->target_ in place
1534 of parameters()->target().
1535
52f66a2c
RM
1536 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1537
2b64b551
RM
1538 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1539 * configure: Regenerate.
1540 * Makefile.in: Regenerate.
1541 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1542 * testsuite/merge_string_literals_2.c: Likewise.
1543 * testsuite/Makefile.am
1544 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1545 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1546 literal -fmerge-constants.
1547 * testsuite/Makefile.in: Regenerate.
1548
43819297
RM
1549 * i386.cc (Target_i386): Remove unused member dynbss_.
1550 * arm.cc (Target_arm): Likewise.
1551 * powerpc.cc (Target_powerpc): Likewise.
1552 * sparc.cc (Target_sparc): Likewise.
1553 * tilegx.cc (Target_tilegx): Likewise.
1554 * x86_64.cc (Target_x86_64): Likewise.
1555 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1556 type_signature_, type_offset_.
1557 * plugin.h (Plugin_hook): Remove unused member layout_.
1558 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1559 mapfile_.
1560 (Read_member): Remove unused members input_objects_, symtab_,
1561 mapfile_, layout_.
1562 (Check_library): Remove unused member symtab_.
1563 * archive.h (Lib_group): Remove unused member lib_.
1564 * archive.cc (Lib_group::Lib_group): Update initializer.
1565 * incremental.h (Incremental_binary): Remove unused member target_.
1566 (Incremental_script_entry): Removed unused member script_.
1567 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1568 * icf.h (Icf): Remove unused member num_tracked_relocs.
1569
39d9ead7
RM
1570 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1571 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1572 its only use.
1573 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1574
679e4abf
RM
1575 * archive.h: Use struct rather than class for forward declaration
1576 of Read_symbols_data.
1577
54de2ea6
CC
15782013-10-07 Cary Coutant <ccoutant@google.com>
1579
1580 PR gold/16010
1581 * testsuite/Makefile.am (icf_test): Fix dependencies.
1582 (icf_safe_test): Likewise.
1583 (icf_safe_so_test): Likewise.
1584 (large_symbol_alignment): Add empty _LDADD rule.
1585 * testsuite/Makefile.in: Regenerate.
1586
b14016f0
L
15872013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1588
1589 PR gold/15927
1590 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1591 relocation for R_X86_64_32 on x32.
1592
eb426534
RM
15932013-08-27 Roland McGrath <mcgrathr@google.com>
1594
1595 * output.cc (Output_segment::set_section_addresses): Take new
1596 Target* argument. If target->isolate_execinstr() and the segment
1597 is executable and starts at a target->abi_pagesize() boundary,
1598 pad its end out to a target->abi_pagesize() boundary with code fill.
1599 * output.h (Output_segment::set_section_addresses): Update decl.
1600 * layout.h (Layout::check_output_data_for_reset_values): Take new
1601 argument RELAX_OUTPUTS.
1602 (Layout): New member relax_output_list_.
1603 (Layout::add_relax_output): New method.
1604 * layout.cc (Layout::Layout): Update constructor.
1605 (Layout::reset_relax_output): New method.
1606 (Layout::clean_up_after_relaxation): Call it.
1607 (Layout::prepare_for_relaxation): Update caller.
1608 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1609 Call reset_relax_output before re-processing segments for
1610 isolate_execinstr case.
1611 (Layout::write_data): Handle relax_output_list_.
1612 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1613 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1614
9aff4b7a
NC
16152013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1616
1617 PR binutils/15834
1618 * object.h: Fix typos.
1619
93f8221c
RM
16202013-08-16 Roland McGrath <mcgrathr@google.com>
1621
1622 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1623 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1624
e44c3715
CC
16252013-08-07 Cary Coutant <ccoutant@google.com>
1626
1627 Revert support for v2 DWP files:
1628
1629 2013-03-01 Cary Coutant <ccoutant@google.com>
1630
1631 Add dwp support for v2 DWARF package file format.
1632 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1633 tu_length parameter. Adjust all callers.
1634 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1635 * dwp.cc: Include dwarf.h.
1636 (Section_bounds): New struct type.
1637 (Unit_set): New struct type.
1638 (Dwo_file::Dwo_file): Initialize new data member.
1639 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1640 Combine and rename to...
1641 (Dwo_file::read_unit_index): ...this.
1642 (Dwo_file::sized_read_compunit_index)
1643 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1644 (Dwo_file::sized_read_unit_index): ...this.
1645 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1646 parameters; add section_id parameter.
1647 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1648 (Dwo_file::add_unit_set): ...this.
1649 (Dwo_file::shndx_map_): Remove.
1650 (Dwo_file::sect_offsets_): New data member.
1651 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1652 (Dwp_output_file::add_section): Rename to...
1653 (Dwp_output_file::add_contribution): ...this.
1654 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1655 (Dwp_output_file::add_tu_set): Likewise.
1656 (Dwp_output_file::Contribution): New type.
1657 (Dwp_output_file::Section::contributions): New data member.
1658 (Dwp_output_file::Cu_or_tu_set): Remove.
1659 (Dwp_output_file::Section::Section): New ctor.
1660 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1661 (Dwp_output_file::Dwp_index::Section_table): New type.
1662 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1663 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1664 parameter.
1665 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1666 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1667 (Dwp_output_file::Dwp_index::section_table): New member function.
1668 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1669 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1670 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1671 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1672 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1673 (Dwp_output_file::Dwp_index::section_table_): New data member.
1674 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1675 (Dwp_output_file::add_output_section): New member function.
1676 (Dwp_output_file::write_new_section): New member function.
1677 (Dwp_output_file::write_contributions): New member function.
1678 (Dwp_output_file::section_id_map_): New data member.
1679 (class Dwo_id_info_reader): Remove.
1680 (class Unit_reader): New class.
1681 (get_dwarf_section_name): New function.
1682 (Dwo_file::read_executable): Adjust initializations of class data.
1683 (Dwo_file::read): Add support for v2 package file format.
1684 (Dwo_file::read_unit_index): Likewise.
1685 (Dwo_file::sized_read_unit_index): Likewise.
1686 (Dwo_file::copy_section): Likewise.
1687 (Dwo_file::add_unit_set): Likewise.
1688 (Dwp_output_file::add_output_section): Likewise.
1689 (Dwp_output_file::add_contribution): Likewise.
1690 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1691 for empty slot.
1692 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1693 file format.
1694 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1695 slot.
1696 (Dwp_output_file::initialize): Remove unused function.
1697 (Dwp_output_file::finalize): Add support for v2 package file format.
1698 (Dwp_output_file::write_index): Likewise.
1699 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1700 function prototype.
1701
c6905c28
CC
17022013-07-31 Cary Coutant <ccoutant@google.com>
1703
1704 * object.cc (Sized_relobj::do_output_section_address): New function.
1705 (Sized_relobj): Instantiate explicitly.
1706 * object.h (Object::output_section_address): New function.
1707 (Object::do_output_section_address): New function.
1708 (Sized_relobj::do_output_section_address): New function.
1709 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1710
17112013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1712 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1713
1714 * parameters.cc (Parameters::entry): Return target-specific entry
1715 symbol name.
1716 * target.h (Target::entry_symbol_name): New function.
1717 (Target_info::entry_symbol_name): New data member.
1718
1719 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1720 * i386.cc (Target_i386::i386_info): Likewise.
1721 (Target_i386_nacl::i386_nacl_info): Likewise.
1722 * sparc.cc (Target_sparc::sparc_info): Likewise.
1723 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1724 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1725 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1726 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1727
234d4ab8
SA
17282013-07-22 Sterling Augustine <saugustine@google.com>
1729
1730 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1731 Convert parameter shndx to local variable. Add parameters symtab
1732 and symtab_size. Scan over section names. Find relocation
1733 section corresponding to current section. Create and initialize
1734 reloc_mapper_ and reloc_type_.
1735 (Dwarf_pubnames_table::read_header): Add assertion. Change
1736 unit_length to off_t. Initialize member unit_length_. Fill in field
1737 cu_offset_.
1738 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1739 Initialize new fields unit_length_ and cu_offset_.
1740 (Dwarf_pubnames_table::read_section): Update prototype.
1741 (Dwarf_pubnames_table::cu_offset): New member function.
1742 (Dwarf_pubnames_table::subsection_size): Likewise.
1743 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1744 New fields.
1745 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1746 member functions public.
1747 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1748 Update comment. Rework logic. Move repeated parts to...
1749 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1750 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1751 pubtypes_table_, and stmt_list_offset.
1752 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1753 Gdb_index::find_pubtype_offset,
1754 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1755 (Gdb_index::pubnames_read): Update prototype and rework logic.
1756 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1757 Forward declare.
1758 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1759 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1760 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1761 Gdb_index::map_pubtable_to_dies):
1762 Declare functions.
1763 (Gdb_index::pubnames_read): Update declaration.
1764 (Gdb_index::Pubname_offset_map): New type.
1765 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1766 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1767 Gdb_index::stmt_list_offset): Declare.
1768 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1769 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1770 Gdb_index::pubtypes_offset_): Remove.
1771
a3ed37d8
RM
17722013-07-19 Roland McGrath <mcgrathr@google.com>
1773
1774 * options.h (General_options): Add -Trodata-segment option.
1775 * parameters.cc (Parameters::check_rodata_segment): New function.
1776 (Parameters::set_target_once): Call it.
1777 * parameters.h (Parameters): Declare it (private member function).
1778 * layout.cc (load_seg_unusable_for_headers): New function, broken
1779 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1780 then validate rodata segment rather than text segment.
1781 (relaxation_loop_body): Call that.
1782 (is_text_segment): New function. Don't admit a non-executable
1783 segment if TARGET->isolate_execinstr().
1784 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1785
eb5b4ded
CC
17862013-07-15 Shawn Landden <shawnlandden@gmail.com>
1787
1788 PR gold/15070
1789 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1790 * nacl.h (Sniff_file::View::View): Request aligned view.
1791
4d5effb9
CC
17922013-07-11 Cary Coutant <ccoutant@google.com>
1793
1794 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1795 correct BRLT entry size.
1796
ba8ca3e7
AM
17972013-07-03 Alan Modra <amodra@gmail.com>
1798
1799 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1800 comment.
1801
267257d2
CC
18022013-07-01 Cary Coutant <ccoutant@google.com>
1803
1804 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1805 reloc_type_.
1806 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1807 (Dwarf_ranges_table::lookup_reloc): New function.
1808 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1809 reloc_type_.
1810 (Dwarf_ranges_table::lookup_reloc): New function.
1811 (Dwarf_ranges_table::reloc_type_): New data member.
1812
06f30c9d
CC
18132013-06-27 Jing Yu <jingyu@google.com>
1814
1815 PR gold/15662
1816 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1817 function.
1818 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1819 (Target_powerpc::do_relax): Call the above.
1820
a2d7bf59
AM
18212013-06-27 Cary Coutant <ccoutant@google.com>
1822
1823 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1824 on garbage collected .opd section.
1825
18262013-06-27 Alan Modra <amodra@gmail.com>
1827
1828 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1829 is non-zero.
1830 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1831 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1832
32364e50
CC
18332013-06-14 Cary Coutant <ccoutant@google.com>
1834
1835 * resolve.cc (Symbol::override_base): Don't override st_type
1836 from plugin placeholder symbols.
1837 (Symbol_table::resolve): Likewise.
1838 (Symbol_table::should_override): Don't complain about TLS mismatch
1839 if the TO symbol is a plugin placeholder.
1840 * testsuite/Makefile.am (plugin_test_tls): New test.
1841 * testsuite/Makefile.in: Regenerate.
1842 * testsuite/plugin_test_tls.sh: New test script.
1843 * testsuite/two_file_test_2_tls.cc: New test source.
1844 * testsuite/two_file_test_tls.cc: New test source.
1845
7fb47cc9
CC
18462013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1847
1848 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1849 the maximum segment alignment is larger than the page size.
1850 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1851 correctly aligns the symbols with large alignemnt.
1852 * testsuite/Makefile.in: Regenerate.
1853 * testsuite/large_symbol_alignment.cc: New file.
1854
6934001a
CC
18552013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1856 Sriraman Tallam <tmsriram@google.com>
1857
1858 * options.h (sort_section): New option.
1859 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1860 Rename from Input_section_sort_section_name_special_ordering_compare.
1861 (Input_section_sort_section_name_compare): New struct.
1862 * output.cc (Output_section::Input_section_sort_section_name_compare::
1863 operator()): New function.
1864 (Output_section::sort_attached_input_sections): Use new sort function
1865 for .text if --sort-section=name is specified.
1866 * layout.cc (Layout::make_output_section):
1867 Add sorting by name when --sort-section=name is specified.
1868 * testsuite/Makefile.am (text_section_grouping): Test option
1869 --sort-section=name.
1870 * testsuite/Makefile.in: Regenerate.
1871 * testsuite/section_sorting_name.cc: New file.
1872 * testsuite/section_sorting_name.sh: New file.
1873
93acabad
CC
18742013-05-21 Cary Coutant <ccoutant@google.com>
1875
1876 * symtab.h (Symbol::is_cxx_vtable): New function.
1877 * target-reloc.h (relocate_section): Check for vtable symbol.
1878 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1879 * testsuite/Makefile.in: Regenerate.
1880 * testsuite/missing_key_func.cc: New test source.
1881 * testsuite/missing_key_func.sh: New test script.
1882
60e8b3fc
CC
18832013-05-21 Cary Coutant <ccoutant@google.com>
1884
2b64b551
RM
1885 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1886 type of enclosing symbol.
1887 (Relocate_info::location): Check symbol type when describing symbol.
1888 * object.h (Symbol_location_info): Remove unused line_number;
1889 add enclosing_symbol_type.
1890 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1891
9df9de2c
CC
18922013-05-13 Cary Coutant <ccoutant@google.com>
1893
2b64b551
RM
1894 * configure.ac: Export DEFAULT_TARGET.
1895 * configure: Regenerate.
1896 * Makefile.in: Regenerate.
1897 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1898 * testsuite/Makefile.in: Regenerate.
1899 * testsuite/debug_msg.sh: Delete duplicate tests.
1900 Don't check undef_int error message match for powerpc where the
1901 source file and line number aren't available.
9df9de2c 1902
bbc5ae17
RM
19032013-05-10 Roland McGrath <mcgrathr@google.com>
1904
1905 * options.h (General_options): Add --rosegment-gap option.
1906 * options.cc (finalize): --rosegment-gap implies --rosegment.
1907 * layout.cc (set_segment_offsets): Let user option override
1908 target->rosegment_gap().
1909
0c6e6c39
RM
19102013-05-10 Roland McGrath <mcgrathr@google.com>
1911
1912 * options.h (General_options): Remove leading space from help
1913 messages for -nostdlib and --rosegment.
1914
cde7cb01
MR
19152013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1916
1917 PR ld/15365
1918 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1919
f31ae5b8
AM
19202013-05-03 Alan Modra <amodra@gmail.com>
1921
1922 * merge.cc (Output_merge_string::do_add_input_section): Correct
1923 scan for number of strings. Rename vars to avoid shadowing.
1924 Include missing terminator in input_size_.
1925
d3a7cd45
L
19262013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1927
1928 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1929 Restore empty string handling.
1930
6ad3daba
CC
19312013-05-01 Cary Coutant <ccoutant@google.com>
1932
1933 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1934 uninitialized warning.
1935
e31908b6
CC
19362013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1937
1938 * output.cc (Output_section::add_merge_input_section): Allow
1939 to merge sections if the alignment is more than character size.
1940 * merge.h (Output_merge_string::Output_merge_string): Remove
1941 assert.
1942 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1943 only not-null strings. Check the alignment of strings.
1944 * stringpool.h
1945 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1946 alignment as the argument.
1947 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1948 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1949 Align non-zero length strings according to the addralign_.
1950 (Stringpool_template<Stringpool_char>::set_string_offsets):
1951 Updating offsets according to the given alignment.
1952 * testsuite/Makefile.am (text_section_grouping): Test if string
1953 literals are getting merged.
1954 * testsuite/Makefile.in: Regenerate.
1955 * testsuite/merge_string_literals_1.c: New file.
1956 * testsuite/merge_string_literals_2.c: Ditto.
1957 * testsuite/merge_string_literals.sh: Ditto.
1958
0e804863
ILT
19592013-04-26 Ian Lance Taylor <iant@google.com>
1960
1961 * target-reloc.h (relocate_section): If the reloc offset is out of
1962 range, pass VIEW as NULL to relocate.relocate.
1963 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1964 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1965 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1966 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1967 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1968 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1969
e7c5ea40
CC
19702013-04-26 Geoff Pike <gpike@chromium.org>
1971
1972 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1973 * layout.cc (Hash_task): New class.
1974 (Layout::queue_build_id_tasks): New function.
1975 (Layout::write_build_id): Handle single-thread portion of build ID
1976 computation. (In some cases, all of it is single-threaded.) Replace
1977 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1978 functionality in fewer lines of code.
1979 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1980 * options.h (General_options): make "--build-id" default to tree
1981 rather than sha1. Add two new options related to --build-id=tree:
1982 --build-id-chunk-size-for-treehash and
1983 --build-id-min-file-size-for-treehash.
1984 * Makefile.am: add testing of --build-id=tree and related new options
1985 (these tests will be invoked by "make check").
1986 * Makefile.in: Regenerate.
1987
49926cd0
AM
19882013-04-25 Alan Modra <amodra@gmail.com>
1989
1990 * configure.tgt: Add powerpcle and powerpc64le.
1991
a4034750
AM
19922013-04-22 Alan Modra <amodra@gmail.com>
1993
1994 PR gold/15355
1995 * layout.cc (Layout::segment_precedes): Allow more than one
1996 segment with the same type and flags.
1997
e79c84aa
CC
19982013-04-15 Cary Coutant <ccoutant@google.com>
1999
2000 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2001 allocate space in file for BSS sections.
2002
2199fbe7
CC
20032013-04-15 Cary Coutant <ccoutant@google.com>
2004
2005 * script-sections.cc (Orphan_output_section): Reset address
2006 to zero after each orphaned section for relocatable links.
2007
502e8a84
CC
20082013-04-15 Cary Coutant <ccoutant@google.com>
2009
a4034750
AM
2010 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2011 section starting address for relocatable link.
2012 * testsuite/Makefile.am (script_test_11): New test.
2013 * testsuite/Makefile.in: Regenerate.
2014 * testsuite/script_test_11.c: New source file.
2015 * testsuite/script_test_11.t: New linker script.
502e8a84 2016
0cfdc767
AM
20172013-04-13 Alan Modra <amodra@gmail.com>
2018
2019 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2020 owner when sections are not adjacent and exceed group size.
2021 (Target_powerpc::group_sections): Handle corner case.
2022 (Target_powerpc::Branch_info::make_stub): Handle case where
2023 stub table doesn't exist due to branches in non-exec sections.
2024 (Target_powerpc::Relocate::relocate): Likewise.
2025
6830ee24
AM
20262013-04-11 Alan Modra <amodra@gmail.com>
2027
2028 PR gold/15354
2029 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2030 .branch_lt to match bfd ld. Adjust comments throughout file.
2031
54a3d865
ILT
20322013-04-04 Ian Lance Taylor <iant@google.com>
2033
2034 GCC PR c++/56840
2035 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2036 sections before checking whether they are included in the link.
2037
9993ba11
ST
20382013-03-29 Sriraman Tallam <tmsriram@google.com>
2039
2040 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2041 object before calling the plugin claim_file handler. Pass the elf
2042 object of the archive to the plugin. Delete the elf object if the
2043 plugin claims the file.
2044
ebacd51e
AM
20452013-03-21 Alan Modra <amodra@gmail.com>
2046
2047 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2048 segment when omagic.
2049
117be58f
AM
20502013-03-21 Alan Modra <amodra@gmail.com>
2051
2052 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2053 comparison warning.
2054 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2055 uninitialized" warning.
2056
32e2b61d
AM
20572013-03-20 Alan Modra <amodra@gmail.com>
2058
2059 * symtab.h (Symbol::clear_version): New function.
2060 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2061 is_needed by weak references. Clear version for symbols defined
2062 in as-needed objects that are not needed.
2063
b3ccdeb5
AM
20642013-03-15 Alan Modra <amodra@gmail.com>
2065
2066 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2067 static and public. Add report_err param. Return false for data refs.
2068 (Target_powerpc::rela_dyn_section): New overloaded function.
2069 (Target_powerpc::plt_, iplt_): Elucidate.
2070 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2071 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2072 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2073 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2074 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2075 push_branch and make_plt_entry for ifunc syms when
2076 reloc_needs_plt_for_ifunc.
2077 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2078 for ifunc unless reloc_needs_plt_for_ifunc.
2079
ad3d8a2f
AM
20802013-03-15 Alan Modra <amodra@gmail.com>
2081
2082 * gc.h (gc_process_relocs): Don't look through function descriptors.
2083 * icf.cc (get_section_contents): Do so here instead.
2084
4d9aa155
AM
20852013-03-13 Alan Modra <amodra@gmail.com>
2086
2087 * powerpc.cc (is_branch_reloc): Forward declare.
2088 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2089 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2090 false for 64-bit, true for 32-bit non-branch relocs.
2091 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2092 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2093 nm output.
2094 (icf_safe_test): Generate linker map file as well as nm output.
2095 (icf_safe_so_test): Likewise.
2096 * testsuite/Makefile.in: Regenerate.
2097 * testsuite/icf_test.sh: Parse linker map file to determine
2098 section folding.
2099 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2100 * testsuite/icf_safe_so_test.sh: Likewise.
2101 (X86_32_or_ARM_specific_safe_fold): Merge into..
2102 (arch_specific_safe_fold): ..this.
2103 (X86_64_specific_safe_fold): Delete unused function.
2104
57420c20
AM
21052013-03-12 Alan Modra <amodra@gmail.com>
2106
2107 * gc.h (gc_process_relocs): Look through function descriptors
2108 to determine shndx, symvalue and addend used by ICF. Tidy
2109 variable duplication.
2110
dc3714f3
AM
21112013-03-11 Alan Modra <amodra@gmail.com>
2112
2113 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2114 * layout.cc (Layout_task_runner::run): ..to here.
2115 * symtab.h (struct Symbol_location): Extract from..
2116 (class Symbol_table): ..here.
2117 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2118 * target.h (class Target): Add function_location and
2119 do_function_location functions.
2120 (class Sized_target): Add do_function_location.
2121 * object.h (class Sized_relobj_file): Move find_shdr..
2122 (class Object): ..to here.
2123 * object.cc: Likewise. Update to suit. Instantiate.
2124 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2125 * powerpc.cc (class Powerpc_dynobj): New.
2126 (Target_powerpc::do_function_location): New function.
2127 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2128 (Powerpc_dynobj::do_read_symbols): New function.
2129 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2130
956b03bb
ILT
21312013-03-08 Ian Lance Taylor <iant@google.com>
2132
2133 * options.cc (General_options::string_to_object_format): Accept
2134 "default".
2135
4bead2d5
AM
21362013-03-08 Alan Modra <amodra@gmail.com>
2137
2138 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2139 pointer to Post_fde.
2140 (struct Post_fde): Move definition to here..
2141 * ehframe.cc (struct Post_fde): ..from here.
2142 (Cie::write): Don't alloc Post_fde.
2143 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2144
02e60bf7
AM
21452013-03-07 Alan Modra <amodra@gmail.com>
2146
2147 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2148 relocation referencing .LC0.
2149 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2150
8343f03a
AM
21512013-03-07 Alan Modra <amodra@gmail.com>
2152
2153 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2154 always_inline. Add assembly for powerpc to avoid GOT.
2155
3366d57c
AM
21562013-03-07 Alan Modra <amodra@gmail.com>
2157
2158 * testsuite/script_test_10.sh: Don't test .bss section
2159 header number.
2160
6c77229c
AM
21612013-03-06 Alan Modra <amodra@gmail.com>
2162
2163 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2164 (Target_powerpc::symval_for_branch): Add symtab param. Update
2165 all callers. Handle folded sections.
2166 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2167 to Powerpc_relobj.
2168 (Global_symbol_visitor_opd::operator()): Likewise.
2169
a39e4af6
AM
21702013-03-04 Alan Modra <amodra@gmail.com>
2171
2172 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2173 * testsuite/Makefile.in: Regenerate.
2174
d5834edb
CC
21752013-03-01 Cary Coutant <ccoutant@google.com>
2176
2177 Add dwp support for v2 DWARF package file format.
2178 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2179 tu_length parameter. Adjust all callers.
2180 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2181 * dwp.cc: Include dwarf.h.
2182 (Section_bounds): New struct type.
2183 (Unit_set): New struct type.
2184 (Dwo_file::Dwo_file): Initialize new data member.
2185 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2186 Combine and rename to...
2187 (Dwo_file::read_unit_index): ...this.
2188 (Dwo_file::sized_read_compunit_index)
2189 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2190 (Dwo_file::sized_read_unit_index): ...this.
2191 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2192 parameters; add section_id parameter.
2193 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2194 (Dwo_file::add_unit_set): ...this.
2195 (Dwo_file::shndx_map_): Remove.
2196 (Dwo_file::sect_offsets_): New data member.
2197 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2198 (Dwp_output_file::add_section): Rename to...
2199 (Dwp_output_file::add_contribution): ...this.
2200 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2201 (Dwp_output_file::add_tu_set): Likewise.
2202 (Dwp_output_file::Contribution): New type.
2203 (Dwp_output_file::Section::contributions): New data member.
2204 (Dwp_output_file::Cu_or_tu_set): Remove.
2205 (Dwp_output_file::Section::Section): New ctor.
2206 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2207 (Dwp_output_file::Dwp_index::Section_table): New type.
2208 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2209 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2210 parameter.
2211 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2212 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2213 (Dwp_output_file::Dwp_index::section_table): New member function.
2214 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2215 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2216 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2217 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2218 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2219 (Dwp_output_file::Dwp_index::section_table_): New data member.
2220 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2221 (Dwp_output_file::add_output_section): New member function.
2222 (Dwp_output_file::write_new_section): New member function.
2223 (Dwp_output_file::write_contributions): New member function.
2224 (Dwp_output_file::section_id_map_): New data member.
2225 (class Dwo_id_info_reader): Remove.
2226 (class Unit_reader): New class.
2227 (get_dwarf_section_name): New function.
2228 (Dwo_file::read_executable): Adjust initializations of class data.
2229 (Dwo_file::read): Add support for v2 package file format.
2230 (Dwo_file::read_unit_index): Likewise.
2231 (Dwo_file::sized_read_unit_index): Likewise.
2232 (Dwo_file::copy_section): Likewise.
2233 (Dwo_file::add_unit_set): Likewise.
2234 (Dwp_output_file::add_output_section): Likewise.
2235 (Dwp_output_file::add_contribution): Likewise.
2236 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2237 for empty slot.
2238 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2239 file format.
2240 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2241 slot.
2242 (Dwp_output_file::initialize): Remove unused function.
2243 (Dwp_output_file::finalize): Add support for v2 package file format.
2244 (Dwp_output_file::write_index): Likewise.
2245 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2246 function prototype.
2247
a68a081d
CC
22482013-03-01 Cary Coutant <ccoutant@google.com>
2249
2250 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2251 function into class definition in header file.
2252 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2253 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2254 New function.
2255 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2256
9d5781f8
AM
22572013-02-28 Alan Modra <amodra@gmail.com>
2258
2259 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2260 * target.cc (Target::do_plt_fde_location): New function.
2261 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2262 accessor function, and constructor param.
2263 (struct Post_fde, Post_fdes): Declare.
2264 (Cie::write): Add post_fdes param.
2265 * ehframe.cc (Fde::write): Use plt_fde_location.
2266 (struct Post_fde): Define.
2267 (Cie::write): Stash FDEs added post merge mapping.
2268 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2269 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2270 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2271 other FDEs.
2272 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2273 (Target_powerpc::has_glink): New function.
2274 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2275 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2276 glink_eh_frame_fde_32, default_fde): New data.
2277 (Stub_table::eh_frame_added_): New var.
2278 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2279 Make const.
2280 (Stub_table::add_eh_frame): New function.
2281 (Output_data_glink::add_eh_frame): New function.
2282 (Target_powerpc::make_glink_section): Call add_eh_frame.
2283
214383dd
ILT
22842013-02-15 Ian Lance Taylor <iant@google.com>
2285
2286 * options.h (DEFINE_uint64_alias): Define.
2287 (class General_options): Add -Ttext-segment as an alias for
2288 -Ttext.
2289
91c2b899
AM
22902013-02-15 Alan Modra <amodra@gmail.com>
2291
2292 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2293 (Stub_table::do_write): ..here, two places.
2294 (Stub_table::plt_call_size): Use it here too.
2295
20e2a8aa
ILT
22962013-02-11 Ian Lance Taylor <iant@google.com>
2297
2298 * descriptors.cc (Descriptors::close_all): New function.
2299 * descriptors.h (class Descriptors): Declare close_all.
2300 (close_all_descriptors): New inline function.
2301 * plugin.cc: Include "descriptors.h".
2302 (Plugin_manager::cleanup): Call close_all_descriptors.
2303
8952bc69
AM
23042013-02-06 Alan Modra <amodra@gmail.com>
2305
2306 * README: Update coding style link.
2307
29bd8b6b
CC
23082013-01-28 Cary Coutant <ccoutant@google.com>
2309
a4034750
AM
2310 * dwp.cc (File_list): New typedef.
2311 (Dwo_name_info_reader): New class.
2312 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2313 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2314 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2315 (Dwo_file::read_executable): New function.
2316 (Dwo_file::read): Move common setup code to ...
2317 (Dwo_file::make_object): ... here.
2318 (dwp_options): Add --exec/-e.
2319 (usage): Likewise.
2320 (main): Likewise.
29bd8b6b 2321
c6ac678d
ST
23222013-01-24 Sriraman Tallam <tmsriram@google.com>
2323
2324 * layout.cc (Layout::layout): Check for option text_reorder.
2325 (Layout::make_output_section): Ditto.
2326 * options.h (text_reorder): New option.
2327 * output.cc (Input_section_sort_compare): Remove special ordering
2328 of section names.
2329 (Output_section::
2330 Input_section_sort_section_name_special_ordering_compare::
2331 operator()): New function.
2332 (Output_section::sort_attached_input_sections): Use new sort function
2333 for .text.
2334 * output.h (Input_section_sort_section_name_special_ordering_compare):
2335 New struct.
2336 * testsuite/Makefile.am (text_section_grouping): Test option
2337 --no-text-reorder
2338 * testsuite/Makefile.in: Regenerate.
2339 * testsuite/text_section_grouping.sh: Check order of functions without
2340 default text reordering.
2341
50701cc1
MF
23422013-01-18 Mike Frysinger <vapier@gentoo.org>
2343
2344 * options.h (General_options): Change default to true for new_dtags.
2345
b1b00fcc
MF
23462013-01-18 Mike Frysinger <vapier@gentoo.org>
2347
2348 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2349 when enable_new_dtags is false. Only add DT_RUNPATH when
2350 enable_new_dtags is true.
2351
ec5b8187
AM
23522013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2353
2354 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2355 used in declaration and definition consistent.
2356 (Target_powerpc::symval_for_branch): Ditto.
2357
a880d4c4
ST
23582013-01-16 Sriraman Tallam <tmsriram@google.com>
2359
2360 * testsuite/plugin_final_layout.cc: Fix comment.
2361
7c381248
ST
23622013-01-16 Sriraman Tallam <tmsriram@google.com>
2363
2364 * layout.cc (Layout::layout): Do not do default sorting for
2365 text sections when section ordering is specified.
2366 (make_output_section): Ditto.
2367 * testsuite/plugin_final_layout.cc: Name the function sections
2368 to catch reordering issues.
2369
e2458743
AM
23702013-01-15 Alan Modra <amodra@gmail.com>
2371
2372 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2373 plt-thread-safe.
2374
431ed302
AM
23752013-01-15 Alan Modra <amodra@gmail.com>
2376
2377 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2378 * testsuite/Makefile.in: Regenerate.
2379
0ec6429b
AM
23802013-01-14 Alan Modra <amodra@gmail.com>
2381
2382 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2383 * testsuite/Makefile.in: Regenerate.
2384
0bf402d5
ILT
23852013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2386
36af3926 2387 PR bfd/14430
0bf402d5
ILT
2388 Fix mingw gold build with plugins enabled
2389 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2390 * configure.ac: Export DLOPEN_LIBS and add headers check.
2391 * plugin.cc: Handle non-dlfcn case.
2392 * Makefile.in: Regenerate.
2393 * config.in: Regenerate.
2394 * configure: Regenerate.
2395 * testsuite/Makefile.in: Regenerate.
2396
9e9143bc
ST
23972013-01-09 Sriraman Tallam <tmsriram@google.com>
2398
2399 * output.h (sort_attached_input_sections): Change to be public.
2400 * script-sections.cc
2401 (Output_section_definition::set_section_addresses): Sort
2402 attached input sections according to section order before linker
2403 script assigns section addresses.
2404 (Orphan_output_section::set_section_addresses): Sort
2405 attached input sections according to section order before linker
2406 script assigns section addresses.
2407 * Makefile.am (final_layout.sh): Use a simple linker script to
2408 check if section ordering still works.
2409 * Makefile.in: Regenerate.
2410
679af368
ILT
24112013-01-09 Ben Cheng <bccheng@google.com>
2412
2413 * arm.cc (Target_arm::attributes_accept_div): New function.
2414 (Target_arm::attributes_forbid_div): New function.
2415 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2416 attribute using the same new functions as what bfd/elf32_arm.c
2417 does.
2418
3136a00e
CC
24192013-01-07 Cary Coutant <ccoutant@google.com>
2420
2421 PR gold/14993
2422 * output.cc (Output_section::add_input_section): For incremental
2423 updates, don't track input sections that are allocated from patch
2424 space.
2425
f2a6224b
L
24262013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2427 Ian Lance Taylor <iant@google.com>
2428
2429 PR gold/14897
2430 * configure.ac (--enable-ld): Removed.
2431 (install_as_default): Set to yes only for --enable-gold=default
2432 or --disable-ld.
2433 * configure: Regenerated.
2434
4f46f626
L
24352013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2436
2437 * options.h (General_options): Add -fuse-ld= for GCC linker
2438 option compatibility.
2439
26e4ef59
CC
24402013-01-04 Cary Coutant <ccoutant@google.com>
2441
2442 * configure.ac: Fix typo restoring CXXFLAGS.
2443 * configure: Regenerate.
2444
3d587466
CC
24452013-01-04 Cary Coutant <ccoutant@google.com>
2446
4f46f626
L
2447 * testsuite/Makefile.am (CXXLINK_S): New macro.
2448 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2449 * testsuite/Makefile.in: Regenerate.
3d587466 2450
44db6695
L
24512013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2452
2453 * version.cc (print_version): Update copyright year to 2013.
2454
edcac0c1
ILT
24552012-12-20 Ian Lance Taylor <iant@google.com>
2456
2457 * layout.cc (Layout::special_ordering_of_input_section): New
2458 function.
2459 (Layout::layout): If input section requires special ordering, must
2460 sort input sections.
2461 (Layout::make_output_section): May sort .text input sections.
2462 (Layout::is_section_name_prefix_grouped): Remove.
2463 * layout.h (class Layout): Declare
2464 special_ordering_of_input_section. Don't declare
2465 is_section_name_prefix_grouped.
2466 * output.cc (Output_section::add_input_section): Revert last
2467 change.
2468 (Output_section::Input_section_sort::match_file_name): Don't crash
2469 if called on output section data.
2470 (Output_section::Input_section_sort_compare): Sort based on
2471 special ordering.
2472 (Output_section::Input_section_sort_section_order_index_compare):
2473 Revert last patch.
2474 (Output_section::sort_attached_input_sections): Likewise.
2475
28f2a4ac
ST
24762012-12-18 Sriraman Tallam <tmsriram@google.com>
2477
edcac0c1 2478 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2479 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2480 * output.cc (Output_section::add_input_section): Check if section
2481 name contains special prefix. Keep input sections to sort such
2482 sections.
2483 (Output_section::Input_section_sort_section_order_index_compare
2484 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2485 (Output_section::sort_attached_input_sections): Add condition to
2486 Input_section_entry constructor call.
28f2a4ac
ST
2487 * testsuite/Makefile.am (text_section_grouping): New test.
2488 * testsuite/Makefile.in: Regenerate.
2489 * testsuite/text_section_grouping.cc: New file.
2490 * testsuite/text_section_grouping.sh: New file.
2491
5bf135a7
NC
24922012-12-17 Nick Clifton <nickc@redhat.com>
2493
2494 * Makefile.am: Add copyright notice.
2495 * NEWS: Likewise.
2496 * README: Likewise.
2497 * configure.ac: Likewise.
2498 * ftruncate.c: Likewise.
2499 * Makefile.in: Regenerate.
2500
59965708
CC
25012012-12-14 Cary Coutant <ccoutant@google.com>
2502
a4034750
AM
2503 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2504 --no-as-needed flag.
2505 (exception_separate_shared_12_test): Likewise.
2506 (incremental_copy_test): Likewise.
2507 * testsuite/Makefile.in: Regenerate.
59965708 2508
2a77e2ab
CC
25092012-12-14 Cary Coutant <ccoutant@google.com>
2510
2511 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2512 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2513
e3deeb9c
AM
25142012-12-12 Alan Modra <amodra@gmail.com>
2515
2516 * powerpc.cc (class Track_tls): New.
2517 (class Relocate, class Scan): Inherit Track_tls.
2518 (Target_powerpc::Scan::local, global): Track tls optimization
2519 and avoid creating plt entry for __tls_get_addr if all uses
2520 are optimized away.
2521 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2522
d8f5a274
AM
25232012-12-12 Alan Modra <amodra@gmail.com>
2524
2525 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2526 Replace no_toc_optimize with toc_optimize.
2527 * output.h (Output_section::input_sections): Provide non-const variant.
2528 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2529 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2530 accessors.
2531 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2532 (class Sort_toc_sections): New.
2533 (Target_powerpc::do_finalize_sections): Sort toc sections.
2534 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2535
4c8a1de1
RM
25362012-12-10 Roland McGrath <mcgrathr@google.com>
2537
2538 * testsuite/binary_unittest.cc (read_all): New function.
2539 (Sized_binary_test): Use it instead of ::read.
2540 * fileread.cc (do_read): Don't assume pread always reads the whole
2541 amount in a single call.
2542
edc27beb
AM
25432012-12-10 Alan Modra <amodra@gmail.com>
2544
2545 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2546 Set EM_PPC64 or EM_PPC here.
2547 (Target_selector_powerpc::do_recognize): Delete.
2548
906b9150
AM
25492012-12-10 Alan Modra <amodra@gmail.com>
2550
2551 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2552 stub_table_.
2553 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2554
418c15ae
RM
25552012-12-07 Roland McGrath <mcgrathr@google.com>
2556
2557 * testsuite/binary_unittest.cc (Sized_binary_test):
2558 Use open_descriptor rather than ::open.
2559
decdd3bc
AM
25602012-12-07 Alan Modra <amodra@gmail.com>
2561
2562 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2563 typedef and invalid_address constant.
2564 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2565 instantiate constants.
2566
db399005
ILT
25672012-12-06 Roland McGrath <mcgrathr@google.com>
2568
2569 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2570 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2571 * aclocal.m4: Regenerate.
2572 * configure: Regenerate.
2573 * Makefile.in: Regenerate.
2574 * testsuite/Makefile.in: Regenerate.
2575
aba6bc71
AM
25762012-12-07 Alan Modra <amodra@gmail.com>
2577
2578 * options.h (General_options): Add no_toc_optimize.
2579 * powerpc.cc (ok_lo_toc_insn): New function.
2580 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2581
9e69ed50
AM
25822012-12-06 Alan Modra <amodra@gmail.com>
2583
2584 * options.h (General_options): Add plt_align, plt_static_chain,
2585 plt_thread_safe. Update stub_group_size help text.
2586 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2587 for new plt_thread_safe_ var.
2588 (use_plt_offset): Correct comments.
2589 (Target_powerpc::do_relax): Look for thread creation symbols to
2590 determine default plt_thread_safe value. Clear plt call stubs
2591 as well as branch stubs each iteration.
2592 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2593 insn constants.
2594 (l, hi, ha, write_insn): Move earlier.
2595 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2596 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2597 plt stubs too.
2598 (Stub_table::update_size): Adjust.
2599 (Stub_table::prev_size, set_prev_size): Delete.
2600 (Stub_table::stub_align): Let --plt-align affect result.
2601 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2602 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2603 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2604 (Stub_table::do_write): Support more stub variants.
2605
f43ba157
AM
26062012-12-04 Alan Modra <amodra@gmail.com>
2607
2608 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2609 (Target_powerpc::do_define_standard_symbols): New function.
2610
34171bc5
AM
26112012-12-03 Alan Modra <amodra@gmail.com>
2612
2613 * output.h: Formatting, whitespace.
2614
dc9589e9 26152012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2616
2617 * layout.h (Layout::get_executable_sections): Declare.
2618 * layout.cc (Layout::get_executable_sections): New function.
2619 * arm.cc (Target_arm::group_sections): Use it.
2620 (Arm_output_section::group_sections): Delete now redundant test.
2621 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2622 param to handle relative relocs.
2623 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2624 (Output_data_reloc::add_absolute): Adjust.
2625 (Output_data_reloc::add_relative): New function.
2626 (Output_data::reset_data_size): New function.
2627 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2628 (Output_section::set_addralign): New function.
2629 (Output_section::checkpoint_set_addralign): New function.
2630 (Output_section::clear_section_offsets_need_adjustment): New function.
2631 (Output_section::input_sections): Make public.
2632 * powerpc.cc (class Output_data_brlt_powerpc): New.
2633 (class Stub_table, class Stub_control): New.
2634 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2635 stub_table_, set_stub_table, stub_table): New vectors and accessor
2636 functions.
2637 (Target_powerpc::do_may_relax, do_relax, push_branch,
2638 new_stub_table, stub_tables, brlt_section, group_sections,
2639 add_branch_lookup_table, find_branch_lookup_table,
2640 write_branch_lookup_table, make_brlt_section): New functions.
2641 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2642 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2643 branch_info_): New vars.
2644 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2645 make call stubs here.
2646 (Output_data_glink): Remove all call stub handling from this class.
2647 (Target_powerpc::Scan::local, global): Save interesting branch
2648 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2649 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2650 functions on final link.
2651 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2652 Handle long branch destinations too.
2653 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2654 do_plt_address_for_local): Adjust lookup of plt call stubs.
2655
627b30b7
AM
26562012-11-30 Alan Modra <amodra@gmail.com>
2657
2658 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2659 relocs against protected symbols when building 32-bit shared libs.
2660
40b469d7
AM
26612012-11-30 Alan Modra <amodra@gmail.com>
2662
2663 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2664 param. Call got_section() to make .got. Update all callers
2665 and their callers and so on.
2666
bb66a627
AM
26672012-11-30 Alan Modra <amodra@gmail.com>
2668
2669 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2670 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2671 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2672 value if it already exists.
2673
d2cf1c6c
L
26742012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2675
2676 PR gold/14858
2677 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2678
edccdf7c
RM
26792012-11-14 Roland McGrath <mcgrathr@google.com>
2680
2681 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2682 than bfc instruction for data sandboxing.
2683
6febeb74
AM
26842012-11-08 Alan Modra <amodra@gmail.com>
2685
2686 * po/POTFILES.in: Regenerate.
2687
0a6f1bf2
AM
26882012-11-05 Alan Modra <amodra@gmail.com>
2689
2690 * configure.ac: Apply 2012-09-10 change to config.in here.
2691 * configure: Regenerate.
2692
26a4e9cb
AM
26932012-11-05 Alan Modra <amodra@gmail.com>
2694
2695 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2696 (struct Opd_ent): Use "Address" rather than "Offset".
2697 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2698 (Target_powerpc::got_section): Make public.
2699 (Target_powerpc::scan_relocs): Move code setting symbols..
2700 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2701 Create _SDA_BASE_ only when referenced.
2702
cc928013
RM
27032012-11-02 Roland McGrath <mcgrathr@google.com>
2704
2705 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2706 from last change.
2707
50ed5eb1
RM
27082012-11-01 Roland McGrath <mcgrathr@google.com>
2709
62fe925a
RM
2710 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2711 for offset_in_output_section parameter.
2712 (Sized_target::relocate_special_relocatable): Likewise.
2713 * arm.cc (Target_arm::relocate_relocs): Likewise.
2714 (Target_arm::relocate_special_relocatable): Likewise.
2715 * i386.cc (Target_i386::relocate_relocs): Likewise.
2716 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2717 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2718 * target-reloc.h (relocate_relocs): Likewise.
2719 * testsuite/testfile.cc (Target_test): Likewise.
2720 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2721 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2722
2723 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2724 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2725
2726 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2727 parameter, which is unused in the [!F_SETFD] case.
2728
50ed5eb1
RM
2729 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2730 SYMNDX to off_t before comparing it to this->data_size().
2731 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2732 * incremental.cc (Output_section_incremental_inputs::do_write):
2733 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2734
2cadc0bf
RM
2735 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2736
3bfcb652
NC
27372012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2738
2739 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2740 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2741 in EABI_VER5.
2742
c1a8d56e
CC
27432012-10-29 Cary Coutant <ccoutant@google.com>
2744
2745 * dwp.cc (usage): Add file and exit status parameters;
2746 add --help and --version options.
2747 (print_version): New function.
2748 (main): Add --help and --version options.
2749
b2490a7b
L
27502012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2751
2752 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2753 final_layout_sequence.txt.
2754 * testsuite/Makefile.in: Regenerated.
2755
aa543512
L
27562012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2757
2758 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2759 COMPILE generated by automake.
2760 (LINK1): Likewise.
2761 (CXXCOMPILE1): Likewise.
2762 (CXXLINK1): Likewise.
2763 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2764 (LINK): Likewise.
2765 (CXXCOMPILE): Likewise.
2766 (CXXLINK): Likewise.
2767 * testsuite/Makefile.in: Regenerated.
2768
d361fafb
L
27692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2770
2771 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2772 on bad fwrite return.
2773
598c7410
L
27742012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2775
2776 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2777 on val.
2778
35c813e2
CC
27792012-10-23 Cary Coutant <ccoutant@google.com>
2780
2781 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2782 * testsuite/Makefile.in: Regenerate.
2783 * testsuite/dwp_test.h: New source file.
2784 * testsuite/dwp_test_1.cc: New source file.
2785 * testsuite/dwp_test_1.s: New source file.
2786 * testsuite/dwp_test_1.sh: New source file.
2787 * testsuite/dwp_test_1b.cc: New source file.
2788 * testsuite/dwp_test_1b.s: New source file.
2789 * testsuite/dwp_test_2.cc: New source file.
2790 * testsuite/dwp_test_2.s: New source file.
2791 * testsuite/dwp_test_2.sh: New source file.
2792 * testsuite/dwp_test_main.cc: New source file.
2793 * testsuite/dwp_test_main.s: New source file.
2794
77429909
CC
27952012-10-23 Cary Coutant <ccoutant@google.com>
2796
2797 * dwp.h: New header file.
2798 * dwp.cc: New source file.
2799 * gold.h: Move shared declarations to system.h.
2800 * system.h: New header file.
2801 * Makefile.am: Add dwp.
2802 * Makefile.in: Regenerate.
2803
ed5d6712
CC
28042012-10-23 Cary Coutant <ccoutant@google.com>
2805
2806 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2807 Dwarf_info_reader::read_from_pointer.
2808 (Dwarf_pubnames_table::read_header): Likewise.
2809 (Dwarf_pubnames_table::next_name): Likewise.
2810 (Dwarf_die::read_attributes): Likewise.
2811 (Dwarf_die::skip_attributes): Likewise.
2812 (Dwarf_info_reader::read_from_pointer): New function template.
2813 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2814 (Dwarf_pubnames_table): Likewise.
2815 (Dwarf_info_reader::read_from_pointer): New function template.
2816 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2817 Dwarf_pubnames_table ctor.
2818
8787852d
CC
28192012-10-23 Cary Coutant <ccoutant@google.com>
2820
2821 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2822 abbrev_shndx.
2823 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2824 abbrev_shndx_.
2825 (Dwarf_info_reader::set_abbrev_shndx): New method.
2826 (Dwarf_info_reader::abbrev_shndx_): New data member.
2827
9fc236f3
CC
28282012-10-23 Cary Coutant <ccoutant@google.com>
2829
2830 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2831 from object, not parameters.
2832 (Dwarf_info_reader::parse): Likewise.
2833 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2834 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2835 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2836 methods.
2837
effe8365
CC
28382012-10-23 Cary Coutant <ccoutant@google.com>
2839
2840 * fileread.cc (Input_file::Input_file): New constructor.
2841 * fileread.h (class Input_file): Add new constructor.
2842
1698990d
AM
28432012-10-18 Alan Modra <amodra@gmail.com>
2844
2845 PR gold/14727
2846 * object.cc (Relobj::is_section_name_included): Also match
2847 .sdata personality section.
2848
168a4726
AM
28492012-10-18 Alan Modra <amodra@gmail.com>
2850
2851 * target-reloc.h (class Default_comdat_behavior): New, package up..
2852 (get_comdat_behaviour): ..this.
2853 (relocate_section): Add Relocate_comdat_behavior template arg,
2854 adjust code to suit.
2855 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2856 (Target_arm::scan_reloc_section): Likewise.
2857 * i386.cc (Target_i386::relocate_section): Likewise.
2858 * sparc.cc (Target_sparc::relocate_section): Likewise.
2859 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2860 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2861 * powerpc.cc (class Relocate_comdat_behavior): New.
2862 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2863 gold::relocate_section with new template arg.
2864
acc276d8
AM
28652012-10-18 Alan Modra <amodra@gmail.com>
2866
2867 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2868 dynamic relocs for GOT_TPREL got entries, without symbol if
2869 resolving locally.
2870 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2871 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2872 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2873
e10f9870
AM
28742012-10-17 Alan Modra <amodra@gmail.com>
2875
2876 PR gold/14726
2877 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2878
ae034989
ST
28792012-10-16 Sriraman Tallam <tmsriram@google.com>
2880
2881 * layout.cc (Layout::include_section): Keep sections marked
2882 SHF_EXCLUDE when doing relocatable links.
2883
f3a0ed29
AM
28842012-10-16 Alan Modra <amodra@gmail.com>
2885
2886 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2887 (Target_powerpc::do_finalize_sections): Call it.
2888 (Output_data_save_res): New class and supporting functions.
2889 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2890 normal symbols defined in object files.
2891
c6de8ed4
AM
28922012-10-12 Alan Modra <amodra@gmail.com>
2893
2894 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2895 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2896 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2897 section if scan_opd_relocs not yet called.
2898 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2899
03e25981
AM
29002012-10-12 Alan Modra <amodra@gmail.com>
2901
2902 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2903 add_local_ifunc_entry): Revert last change.
2904 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2905
c9824451
AM
29062012-10-05 Alan Modra <amodra@gmail.com>
2907
2908 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2909 do_plt_address_for_global): New functions.
2910 (Output_data_got_powerpc::do_write): Don't segfault when linking
2911 statically.
2912 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2913 add_local_ifunc_entry): Return true on adding entry..
2914 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2915 glink->add_entry call. Remove unused symtab param. Adjust calls.
2916 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2917 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2918 set up symbols here.
2919 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2920 syms here. Do so even when no .iplt. Don't segfault when linking
2921 statically.
2922 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2923 new variants without reloc param.
2924 (Glink_sym_ent::Glink_sym_ent): Likewise.
2925 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2926 reloc when refs will resolve to plt call stub.
2927 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2928 R_PPC_PLTREL24 to resolve locally.
2929 (Target_powerpc::Scan::global): Correct ifunc handling.
2930 (Target_powerpc::Relocate::relocate): Correct local sym glink
2931 lookup. Don't destroy "value" when we have a plt call stub,
2932 and when checking plt call validity.
2933 (Target_powerpc::do_dynsym_value): Simplify.
2934
19fec8c1
AM
29352012-10-05 Alan Modra <amodra@gmail.com>
2936
2937 * i386.cc (Output_data_plt_i386::address_for_global,
2938 address_for_local): Add plt offset to returned value. Adjust uses.
2939 * sparc.cc (Output_data_plt_sparc::address_for_global,
2940 address_for_local): Likewise.
2941 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2942 address_for_local): Likewise.
2943 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2944 address_for_local): Likewise.
2945 * target.h (Target::plt_address_for_global, plt_address_for_local):
2946 Update comment.
2947 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2948 (Output_data_got::Got_entry::write): Nor here.
2949 * output.h: Comment fix.
2950
e867b647
WL
29512012-10-02 Jiong Wang <jiwang@tilera.com>
2952
2953 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2954 global_offset_table_ value for larget got.
2955 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2956
e5d5f5ed
AM
29572012-09-29 Alan Modra <amodra@gmail.com>
2958
2959 * powerpc.cc (Target_powerpc::iplt_): New output section.
2960 (Target_powerpc::iplt_section, make_iplt_section,
2961 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2962 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2963 Target_powerpc::plt_entry_count): Count iplt entries too.
2964 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2965 reloc section in constructor. New params.
2966 (Target_powerpc::make_plt_section): Create reloc section here instead.
2967 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2968 functions.
2969 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2970 (Output_data_glink::add_entry, find_entry): New functions to
2971 deal with local syms.
2972 (Glink_sym_ent): Add support for local syms.
2973 (Output_data_glink::do_write): Handle ifunc plt entries.
2974 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2975 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2976 (Target_powerpc::Relocate::relocate): Likewise.
2977 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2978
ec4dbad3
AM
29792012-09-25 Alan Modra <amodra@gmail.com>
2980
2981 * object.h (Sized_relobj_file::adjust_local_symbol,
2982 do_adjust_local_symbol): New functions.
2983 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2984 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2985 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2986 and irregular opd entry spacing.
2987 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2988 (Global_symbol_visitor_opd): New functor.
2989 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2990 on deleted opd entries.
2991
5c0b3823
WL
29922012-09-15 Jiong Wang <jiwang@tilera.com>
2993
2994 * tilegx.cc: New file.
2995 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2996 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2997 * configure.tgt: Add entries for tilegx*.
2998 * configure.ac: Likewise.
2999 * Makefile.in: Rebuild.
3000 * configure: Likewise.
3001 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3002 tilegx.
3003
bfdfa4cd
AM
30042012-09-13 Alan Modra <amodra@gmail.com>
3005
3006 * target-reloc.h (scan_relocs): Call scan.local for relocs
3007 against symbols in discarded sections. Pass is_discarded
3008 param.
3009 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3010 Add is_discarded param.
3011 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3012 is_discarded to flag opd entry as discarded. Don't emit dyn
3013 relocs on such entries.
3014 (Target_powerpc::Scan::global): Similarly detect and handle
3015 such opd entries.
3016 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3017 opd_ent_. Update all uses.
3018 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3019 (Target_powerpc::relocate_section): Zero out discarded opd
3020 entry relocs.
3021
d77a0555
ILT
30222012-09-12 Ian Lance Taylor <iant@google.com>
3023
3024 PR gold/14570
3025 * output.cc: Rename Output_data_got template parameter from size
3026 to got_size for all functions. Compile all variants of
3027 Output_data_got.
3028 (Output_data_got::Got_entry::write): Correct use of size for
3029 symbol value. Use local_is_tls rather than casting to
3030 Sized_relobj_file.
3031 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3032 (class Sized_relobj_file): Add do_local_is_tls.
3033 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3034
815a1205
AM
30352012-09-11 Alan Modra <amodra@gmail.com>
3036
3037 PR gold/14566
3038 * layout.cc (Layout::set_segment_offsets): When using
3039 common-page-size alignment, ensure we are on a new max-page-size
3040 page.
3041 * output.cc (Output_segment::set_section_addresses): Use
3042 abi_pagesize, not common_pagesize for relro boundary.
3043 (Output_segment::set_offset): Likewise.
3044
bd73a62d
AM
30452012-09-11 Alan Modra <amodra@gmail.com>
3046
3047 * output.h (Output_data_got::add_global_tls, add_local_tls,
3048 add_local_tls_pair): New functions.
3049 (Output_data_got::add_local_pair_with_rel): Remove second
3050 reloc param. Expand comment.
3051 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3052 use_plt_or_tls_offset_, similarly for constructor param.
3053 (Output_data_got::Got_entry::write): Add got_index param.
3054 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3055 add_local_tls_pair): New functions.
3056 (Output_data_got::Got_entry::write): Handle tls symbols
3057 with use_plt_or_tls_offset_ set specially.
3058 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3059 (Output_data_got::do_write): Replace iterator with index, pass
3060 index to entry write function.
3061 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3062 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3063 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3064 call.
3065 * i386.cc (Target_i386::Scan::local): Likewise.
3066 * sparc.cc (Target_sparc::Scan::local): Likewise.
3067 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3068 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3069 do_tls_offset_for_global): New functions.
3070 (Target_powerpc::Scan::local): Correct TLS relocations and got
3071 entry values.
3072 (Target_powerpc::Scan::global): Don't emit unnecessary
3073 dynamic relocations on TLS GOT entries.
3074
00716ab1
AM
30752012-09-10 Matthias Klose <doko@ubuntu.com>
3076
3077 * config.in: Disable sanity check for kfreebsd.
3078
c891b3f9
SA
30792012-09-10 Sterling Augustine <saugustine@google.com>
3080
3081 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3082 (Gdb_index::pubtypes_read): New parameter.
3083 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3084 to calls.
3085 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3086 pubtypes_object_.
3087
e81fea4d
AM
30882012-09-09 Alan Modra <amodra@gmail.com>
3089
3090 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3091 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3092 * gc.h (gc_process_relocs): Call target gc_add_reference.
3093 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3094 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3095 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3096 unnecessary cast.
3097 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3098 to cater for when we don't need code offset. Update use.
3099 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3100 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3101 set_opd_valid): New functions.
3102 (Target_powerpc::do_gc_add_reference): New function.
3103 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3104 stashed refs.
3105 (Target_powerpc::do_gc_mark_symbol): New function.
3106
d2d60eef
CC
31072012-09-06 Cary Coutant <ccoutant@google.com>
3108
3109 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3110 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3111 (Dwarf_die::skip_attributes): Likewise.
3112 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3113 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3114 (main): Call it.
3115 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3116
32ed4573
L
31172012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3118
3119 * testsuite/script_test_3.t: Add .got.plt output section
3120 statement.
3121 * testsuite/script_test_4.t: Likewise.
3122
f4baf0d4
AM
31232012-09-05 Alan Modra <amodra@gmail.com>
3124
3125 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3126 update all uses and lose "enum" when using type.
3127
864a1b56
AM
31282012-09-05 Alan Modra <amodra@gmail.com>
3129
3130 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3131 * configure: Regenerate.
3132 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3133 (plugin_final_layout.stdout): Likewise.
3134 (memory_test): Set page sizes to 0x1000.
3135 * testsuite/Makefile.in: Regenerate.
3136 * testsuite/discard_locals_test.sh: Add FIXME comment.
3137 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3138 * testsuite/pr14265.t: Add .got output section statement.
3139 * testsuite/script_test_2.t: Likewise.
3140 * testsuite/script_test_3.t: Likewise.
3141 * testsuite/script_test_4.t: Likewise.
3142 * testsuite/script_test_5.t: Likewise.
3143 * testsuite/script_test_6.t: Likewise.
3144 * testsuite/script_test_7.t: Likewise.
3145 * testsuite/script_test_9.t: Likewise.
3146
3ea0a085
AM
31472012-09-05 Alan Modra <amodra@gmail.com>
3148
3149 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3150 (Powerpc_relocate_functions::Status): New typedef.
3151 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3152 (Target_powerpc::Scan::local): Handle REL64.
3153 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3154 for REL32 and REL64.
3155 (Target_powerpc::symval_for_branch): New function, extracted from..
3156 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3157 checks. Report overflow errors.
3158
7404fe1b
AM
31592012-09-05 Alan Modra <amodra@gmail.com>
3160
3161 * object.h (Sized_relobj_file::emit_relocs): Delete.
3162 (Sized_relobj_file::emit_relocs_reltype): Delete.
3163 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3164 relocate_relocs for --emit-relocs.
3165 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3166 * output.h: Update comment.
3167 (Output_segment::first_section): New function.
3168 (Output_segment::first_section_load_address): Use first_section.
3169 * output.cc (Output_segment::first_section): New function extracted..
3170 (Output_segment::first_section_load_address): ..from here. Delete.
3171 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3172 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3173 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3174 adjust call to target.h function.
3175 * i386.cc (Target_i386): Likewise.
3176 * sparc.cc (Target_sparc): Likewise.
3177 * x86_64.cc (Target_x86_64): Likewise.
3178 * powerpc.cc (Target_powerpc): Likewise.
3179 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3180 first tls section has section symbol for optimised local dynamic
3181 output relocs.
3182 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3183 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3184 optimised tls code.
3185 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3186 Rename to relocate_relocs. Update error message.
3187
957564c9
AS
31882012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3189
3190 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3191 --just-symbols.
3192
dd93cd0a
AM
31932012-08-31 Alan Modra <amodra@gmail.com>
3194
3195 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3196 (Powerpc_relobj::toc_base_offset): New stub function.
3197 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3198 got_mod_index_offset to tlsld_got_offset. Update all refs.
3199 (Target_powerpc::Relocate::enum skip_tls): New.
3200 (Target_powerpc::call_tls_get_addr_): New var.
3201 (Target_powerpc::is_branch_reloc): Move to file scope.
3202 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3203 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3204 New functions.
3205 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3206 (powerpc_info): Correct common_pagesize for ppc64.
3207 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3208 (Powerpc_relocate_functions): Add overflow check enums and functions.
3209 Add non-shift version of rela, rela_ua. Delete all rel public
3210 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3211 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3212 addr16_ha3, addr14 functions.
3213 (Output_data_got_powerpc::add_constant_pair): New function.
3214 (Output_data_got_powerpc::got_base_offset): Likewise.
3215 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3216 (instruction constants): Sort, add some more.
3217 (Output_data_glink::do_write): Add and use Address typedef. Use
3218 object->toc_base_offset() stub for 64-bit.
3219 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3220 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3221 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3222 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3223 Always treat .opd relocs as against locally defined symbol.
3224 Correct condition for RELATIVE relocs.
3225 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3226 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3227 for 32-bit syms with a plt entry. Correct ppc64 toc base
3228 calculations. Handle TLS relocs, and more. Add overflow
3229 checking and adjust for Powerpc_relocate_functions changes.
3230 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3231 Reinstate --emit-relocs code with FIXME.
3232
a1373b60
AM
32332012-08-30 Alan Modra <amodra@gmail.com>
3234
3235 * layout.cc (Layout::set_segment_offsets): Set p_align to
3236 abi_pagesize, not common_pagesize.
3237 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3238 to determine whether file header can go in segment.
3239
703d02da
AM
32402012-08-30 Alan Modra <amodra@gmail.com>
3241
3242 * output.h (Output_reloc::Output_reloc <output section>): Add
3243 is_relative param. Adjust calls.
3244 (Output_reloc::add_output_section_relative): New functions.
3245 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3246 is_relative.
3247 (Output_reloc::symbol_value): Handle SECTION_CODE.
3248
16164a6b
ST
32492012-08-24 Sriraman Tallam <tmsriram@google.com>
3250
3251 * gold.cc (queue_middle_tasks): Call layout again when unique
3252 segments for sections is desired.
3253 * layout.cc (Layout::Layout): Initialize new members.
3254 (Layout::get_output_section_flags): New function.
3255 (Layout::choose_output_section): Call get_output_section_flags.
3256 (Layout::layout): Make output section for mapping to a unique segment.
3257 (Layout::insert_section_segment_map): New function.
3258 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3259 output sections marked so.
16164a6b
ST
3260 (Layout::segment_precedes): Check for unique segments when sorting.
3261 * layout.h (Layout::Unique_segment_info): New struct.
3262 (Layout::Section_segment_map): New typedef.
3263 (Layout::insert_section_segment_map): New function.
3264 (Layout::get_output_section_flags): New function.
3265 (Layout::is_unique_segment_for_sections_specified): New function.
3266 (Layout::set_unique_segment_for_sections_specified): New function.
3267 (Layout::unique_segment_for_sections_specified_): New member.
3268 (Layout::section_segment_map_): New member.
3269 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3270 Rename is_gc_pass_one to is_pass_one.
3271 Rename is_gc_pass_two to is_pass_two.
3272 Rename is_gc_or_icf to is_two_pass.
3273 Check for which pass based on whether symbols data is present.
3274 Make it two pass when unique segments for sections is desired.
3275 * output.cc (Output_section::Output_section): Initialize new
3276 members.
3277 * output.h (Output_section::is_unique_segment): New function.
3278 (Output_section::set_is_unique_segment): New function.
3279 (Output_section::is_unique_segment_): New member.
3280 (Output_section::extra_segment_flags): New function.
3281 (Output_section::set_extra_segment_flags): New function.
3282 (Output_section::extra_segment_flags_): New member.
3283 (Output_section::segment_alignment): New function.
3284 (Output_section::set_segment_alignment): New function.
3285 (Output_section::segment_alignment_): New member.
3286 (Output_segment::Output_segment): Initialize is_unique_segment_.
3287 (Output_segment::is_unique_segment): New function.
3288 (Output_segment::set_is_unique_segment): New function.
3289 (Output_segment::is_unique_segment_): New member.
3290 * plugin.cc (allow_unique_segment_for_sections): New function.
3291 (unique_segment_for_sections): New function.
3292 (Plugin::load): Add new functions to transfer vector.
3293 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3294 * Makefile.in: Regenerate.
3295 * testsuite/plugin_final_layout.sh: Check if unique segment
3296 functionality works.
3297 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3298 are available.
3299 (allow_unique_segment_for_sections): New global.
3300 (unique_segment_for_sections): New global.
3301 (claim_file_hook): Call allow_unique_segment_for_sections.
3302 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3303
1e2bee4f
CC
33042012-08-22 Cary Coutant <ccoutant@google.com>
3305
3306 * layout.cc (Layout::include_section): Don't assert on GROUP
3307 sections with --emit-relocs.
3308
1d5dfe78
CC
33092012-08-21 Cary Coutant <ccoutant@google.com>
3310
3311 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3312 if --export-dynamic-symbol names an undef symbol.
3313
c9269dff
AM
33142012-08-18 Alan Modra <amodra@gmail.com>
3315
3316 * powerpc.cc: Formatting and white space.
3317 (Powerpc_relobj): Rename got2_section_ to special_.
3318 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3319 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3320 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3321 (Target_powerpc): Add Address typedef and invalid_address. Use
3322 throughout.
3323 (Target_powerpc::is_branch_reloc): New function.
3324 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3325 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3326 for dst_mask, value and addend.
3327 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3328 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3329 (Output_data_glink::do_write): Correct toc base. Don't try to use
3330 uint16_t for 24-bit offset. Use get_output_section_offset and
3331 check return.
3332 (Target_powerpc::Scan::local): Handle more relocs.
3333 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3334 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3335 Plug in toc restoring insn after plt calls. Translate branches
3336 to function descriptor symbols to corresponding entry point.
3337 (Target_powerpc::relocate_for_relocatable): Check return from
3338 get_output_section_offset.
3339 * symtab.h: Comment typo.
3340
b1759dce
ILT
33412012-08-14 Ian Lance Taylor <iant@google.com>
3342
3343 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3344 unsupported_relocal_local to call unsupported_reloc_global.
3345
b9b2ae8b
NC
33462012-08-14 Nick Clifton <nickc@redhat.com>
3347
3348 PR ld/14265
3349 * script-sections.cc (Sections_element::output_section_name): Add
3350 keep return parameter.
3351 (Output_section_element::match_name): Add keep return parameter.
3352 Return the value of the keep_ member.
3353 * script-sections.h (class Output_section): Update
3354 output_section_name prototype.
3355 * layout.cc (Layout::keep_input_section): New public member
3356 function.
3357 (Layout::choose_output_section): Pass keep parameter to
3358 output_section_name.
3359 * layout.h (class Layout): Add keep_input_section.
3360 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3361 sections.
3362 * testsuite/Makefile.am: Add a test.
3363 * testsuite/Makefile.in: Regenerate.
3364 * testsuite/pr14265.c: Source file for the test.
3365 * testsuite/pr14265.t: Linker script for the test.
3366 * testsuite/pr14265.sh: Shell script for the test.
3367
921b5322
AM
33682012-08-14 Alan Modra <amodra@gmail.com>
3369
3370 * target.h (Target::output_section_name): New function.
3371 (Target::do_output_section_name): New function.
3372 * layout.cc (Layout::choose_output_section): Call the above.
3373 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3374
6ce78956
AM
33752012-08-14 Alan Modra <amodra@gmail.com>
3376
3377 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3378 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3379 for replace_constant call.
3380 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3381 (Output_data_glink::do_print_to_mapfile): New function.
3382 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3383 (Target_powerpc::Relocate::relocate): Likewise.
3384
d1a8cabd
AM
33852012-08-14 Alan Modra <amodra@gmail.com>
3386
3387 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3388 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3389 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3390 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3391 all references to shndx_. Handle special case for R_PPC_PLTREL24
3392 here.
3393 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3394 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3395 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3396 here.
3397 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3398 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3399
d83ce4e3
AM
34002012-08-12 Alan Modra <amodra@gmail.com>
3401
3402 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3403 (glink insn constants): Use uint32_t.
3404 (Output_data_glink::add_entry): Use insert, not [] operator.
3405
cf43a2fe
AM
34062012-08-11 Alan Modra <amodra@gmail.com>
3407
3408 * object.h (Sized_relobj_file::find_shdr): New function.
3409 (Sized_relobj_file::find_special_sections): New function.
3410 * object.cc (Sized_relobj_file::find_shdr): New function.
3411 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3412 (Sized_relobj_file::find_special_sections): New function, split out..
3413 (Sized_relobj_file::do_read_symbols): ..from here.
3414 * output.h (Output_data_got::replace_constant): New function.
3415 (Output_data_got::num_entries): New function.
3416 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3417 (Output_data_got::got_offset): Protected rather than private.
3418 (Output_data_got::replace_got_entry): New function.
3419 * output.cc (Output_data_got::replace_got_entry): New function.
3420 * powerpc.cc (class Powerpc_relobj): New.
3421 (class Powerpc_relocate_functions): Delete all psymval variants or
3422 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3423 Implement _ha functions using corresponding _hi function.
3424 (Powerpc_relobj::find_special_sections): New function.
3425 (Target_powerpc::do_make_elf_object): New function.
3426 (class Output_data_got_powerpc): New.
3427 (class Output_data_glink): New.
3428 (class Powerpc_scan_relocatable_reloc): New.
3429 Many more changes througout file.
3430
3c892704
NC
34312012-08-09 Nick Clifton <nickc@redhat.com>
3432
3433 * po/vi.po: Updated Vietnamese translation.
3434
82435b3b
ILT
34352012-08-07 Ian Lance Taylor <iant@google.com>
3436
3437 * layout.cc (Layout::add_target_dynamic_tags): If
3438 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3439 plt_rel.
3440
a6dc81d2
NC
34412012-07-30 Nick Clifton <nickc@redhat.com>
3442
3443 * po/gold.pot: Updated template.
3444 * po/es.po: Updated Spanish translation.
3445
f1415016
CC
34462012-07-18 Cary Coutant <ccoutant@google.com>
3447
3448 PR gold/14344
3449 * configure.ac: Add check for -gpubnames support.
3450 * configure: Regenerate.
3451 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3452 support; force -gno-pubnames.
3453 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3454 support.
3455 (gdb_index_test_4): New test.
3456 * testsuite/Makefile.in: Regenerate.
3457 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3458 * testsuite/gdb_index_test_2.sh: Likewise.
3459 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3460 * testsuite/gdb_index_test_4.sh: New script.
3461 * testsuite/gdb_index_test_comm.sh: New script with common code;
3462 don't look for space after colon.
3463
b7fd7c37
ST
34642012-07-16 Sriraman Tallam <tmsriram@google.com>
3465
3466 * gold.cc (queue_middle_tasks): Update function order only after
3467 deferred objects due to plugins are processed.
3468
1f3212db
ILT
34692012-07-11 Ian Lance Taylor <iant@google.com>
3470
3471 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3472 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3473 (Target_arm::scan_reloc_for_stub): Likewise.
3474 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3475 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3476 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3477 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3478 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3479
81c82a68
ILT
34802012-07-10 Dodji Seketeli <dodji@redhat.com>
3481 Ian Lance Taylor <iant@google.com>
3482
3483 PR gold/14309
3484 * configure.ac: Test whether std::tr1::hash<off_t> works.
3485 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3486 needed.
3487 * output.h (class Output_fill): Add virtual destructor.
3488 * configure, config.in: Rebuild.
3489
eabc84f4
RM
34902012-06-22 Roland McGrath <mcgrathr@google.com>
3491
3492 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3493
370e30b6
RÁE
34942012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3495
3496 * plugin.cc (Plugin::load): Handle position independent executables.
3497
fb1b895d
CC
34982012-06-06 Cary Coutant <ccoutant@google.com>
3499
3500 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3501 add .debug_macro.
3502 (lines_only_debug_sections): Likewise.
3503 (gdb_fast_lookup_sections): New static array.
3504 (is_gdb_debug_section): Rename formal parameter.
3505 (is_lines_only_debug_section): Likewise.
3506 (is_gdb_fast_lookup_section): New function.
3507 (Layout::include_section): Check for ".zdebug_" prefix; pass
3508 section name suffix to is_gdb_debug_section, et al.; check for
3509 fast-lookup sections when building .gdb_index.
3510 * options.h (--strip-debug-gdb): Update GDB version number.
3511
7c0640fa
CC
35122012-06-06 Cary Coutant <ccoutant@google.com>
3513
3514 * configure.ac: Add check for fallocate.
3515 * configure: Regenerate.
3516 * config.in: Regenerate.
3517
3518 * options.h (class General_options): Add --mmap-output-file and
3519 --posix-fallocate options.
3520 * output.cc: (posix_fallocate): Remove; replace with...
3521 (gold_fallocate): New function.
3522 (Output_file::map_no_anonymous): Call gold_fallocate.
3523 (Output_file::map): Check --mmap-output-file option.
3524
2a49eb69
DK
35252012-06-05 Jing Yu <jingyu@google.com>
3526
3527 * gold.h (textdomain): Add do {} to empty while(0).
3528 (bindtextdomain): Likewise.
3529
fad072ac
CC
35302012-06-04 Cary Coutant <ccoutant@google.com>
3531
3532 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3533 has_dynsym_index.
3534
8cc69fb6
ST
35352012-05-25 Sriraman Tallam <tmsriram@google.com>
3536
3537 * symtab.cc (Symbol_table::define_special_symbol):
3538 Initialize *poldsym to prevent uninitialized variable errors.
3539
1be75daa
CC
35402012-05-23 Cary Coutant <ccoutant@google.com>
3541
3542 * layout.cc (Layout::section_name_mapping): Add rules to handle
3543 exact match on .data.rel.ro.local or .data.rel.ro.
3544 (Layout::output_section_name): Check for exact matches.
3545
9b689de0
CC
35462012-05-23 Cary Coutant <ccoutant@google.com>
3547
3548 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3549 more carefully.
3550
b24fdbf5
CC
35512012-05-22 Cary Coutant <ccoutant@google.com>
3552
3553 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3554 object before exporting symbol.
3555
e550e1a2
L
35562012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3557
3558 * testsuite/tls_test.cc: Include "config.h" first.
3559 * testsuite/tls_test_c.c: Likewise.
3560
df7b86aa
NC
35612012-05-17 Daniel Richard G. <skunk@iskunk.org>
3562 Nick Clifton <nickc@redhat.com>
3563
3564 PR 14072
3565 * configure.in: Add check that sysdep.h has been included before
3566 any system header files.
3567 * configure: Regenerate.
3568 * config.in: Regenerate.
3569
1007b503
CC
35702012-05-14 Cary Coutant <ccoutant@google.com>
3571
3572 * layout.cc (Layout::make_output_section): Mark .tdata section
3573 as RELRO.
3574 * testsuite/relro_test.cc: Add a TLS variable.
3575
fd885f3a
L
35762012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3577
3578 PR gold/14091
3579 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3580 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3581 R_X86_64_64.
3582
80f5885c
CC
35832012-05-08 Cary Coutant <ccoutant@google.com>
3584
3585 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3586 (lines_only_debug_sections): Likewise.
3587
2e702c99
RM
35882012-05-02 Roland McGrath <mcgrathr@google.com>
3589
3590 * nacl.cc: New file.
3591 * nacl.h: New file.
3592 * Makefile.am (CCFILES, HFILES): Add them.
3593 * Makefile.in: Regenerate.
3594 * i386.cc (Output_data_plt_i386_nacl): New class.
3595 (Output_data_plt_i386_nacl_exec): New class.
3596 (Output_data_plt_i386_nacl_dyn): New class.
3597 (Target_i386_nacl): New class.
3598 (Target_selector_i386_nacl): New class.
3599 (target_selector_i386): Use it instead of Target_selector_i386.
3600 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3601 (Target_x86_64_nacl): New class.
3602 (Target_selector_x86_64_nacl): New class.
3603 (target_selector_x86_64, target_selector_x32): Use it instead of
3604 Target_selector_x86_64.
3605 * arm.cc (Output_data_plt_arm_nacl): New class.
3606 (Target_arm_nacl): New class.
3607 (Target_selector_arm_nacl): New class.
3608 (target_selector_arm, target_selector_armbe): Use it instead of
3609 Target_selector_arm.
3610
3611 * target-select.cc (select_target): Take new Input_file* and off_t
3612 arguments, pass them on to recognize method of selector.
3613 * object.cc (make_elf_sized_object): Update caller.
3614 * parameters.cc (parameters_force_valid_target): Likewise.
3615 * incremental.cc (make_sized_incremental_binary): Likewise.
3616 * target-select.h: Update decl.
3617 (Target_selector::recognize): Take new Input_file* argument,
3618 pass it on to do_recognize.
3619 (Target_selector::do_recognize): Take new Input_file* argument.
3620 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3621 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3622 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3623 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3624
3625 * target.h (Target::Target_info): New members isolate_execinstr
3626 and rosegment_gap.
3627 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3628 * arm.cc (Target_arm::arm_info): Update initializer.
3629 * i386.cc (Target_i386::i386_info): Likewise.
3630 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3631 * sparc.cc (Target_sparc::sparc_info): Likewise.
3632 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3633 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3634 * layout.cc (Layout::attach_allocated_section_to_segment):
3635 Take new const Target* argument. If target->isolate_execinstr(), act
3636 like --rosegment.
3637 (Layout::find_first_load_seg): Take new const Target* argument;
3638 if target->isolate_execinstr(), reject PF_X segments.
3639 (Layout::relaxation_loop_body): Update caller.
3640 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3641 reset file offset to zero when we hit LOAD_SEG, and then do a second
3642 loop over the segments before LOAD_SEG to reassign offsets after
3643 addresses have been determined. Handle target->rosegment_gap().
3644 (Layout::attach_section_to_segment): Take new const Target* argument;
3645 pass it to attach_allocated_section_to_segment.
3646 (Layout::make_output_section): Update caller.
3647 (Layout::attach_sections_to_segments): Take new const Target* argument;
3648 pass it to attach_section_to_segment.
3649 * gold.cc (queue_middle_tasks): Update caller.
3650 * layout.h (Layout): Update method decls with new arguments.
3651
3652 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3653 Target_info pointer to use.
3654 (Target_arm::do_make_data_plt): New virtual method.
3655 (Target_arm::make_data_plt): New method that calls it.
3656 (Target_arm::make_plt_entry): Use it.
3657 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3658 for the section alignment.
3659 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3660 method.
3661 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3662 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3663 method.
3664 (Output_data_plt_arm::get_plt_entry_size): Call it.
3665 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3666 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3667 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3668 method.
3669 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3670 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3671 method instead of sizeof(plt_entry).
3672 (Output_data_plt_arm::add_entry): Likewise.
3673 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3674 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3675 than static method.
3676 (Target_arm::plt_entry_size): Likewise.
3677 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3678 Move to ...
3679 (Output_data_plt_arm_standard): ... here, new class.
3680 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3681 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3682 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3683
3684 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3685 Take additional argument for the PLT entry size.
3686 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3687 Use get_plt_entry_size method rather than plt_entry_size variable.
3688 (Output_data_plt_x86_64::reserve_slot): Likewise.
3689 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3690 (Output_data_plt_x86_64::add_entry): Likewise.
3691 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3692 (Output_data_plt_x86_64::address_for_global): Likewise.
3693 (Output_data_plt_x86_64::address_for_local): Likewise.
3694 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3695 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3696 Make method non-static.
3697 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3698 method.
3699 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3700 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3701 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3702 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3703 virtual method.
3704 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3705 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3706 virtual method.
3707 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3708 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3709 virtual method.
3710 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3711 (Output_data_plt_x86_64::plt_entry_size)
3712 (Output_data_plt_x86_64::first_plt_entry)
3713 (Output_data_plt_x86_64::plt_entry)
3714 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3715 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3716 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3717 (Output_data_plt_x86_64_standard): ... here, new class.
3718 (Target_x86_64::Target_x86_64): Take optional argument for the
3719 Target_info pointer to use.
3720 (Target_x86_64::do_make_data_plt): New virtual method.
3721 (Target_x86_64::make_data_plt): New method to call it.
3722 (Target_x86_64::init_got_plt_for_update): Use that.
3723 Call this->plt_->add_eh_frame method here.
3724 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3725 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3726 rather than static method.
3727 (Target_x86_64::plt_entry_size): Likewise.
3728 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3729 rather than plt_entry_size variable. Move guts of PLT filling to...
3730 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3731 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3732 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3733
3734 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3735 additional argument for the section alignment.
3736 Don't do add_eh_frame_for_plt here.
3737 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3738 non-static. Use get_plt_entry_size method rather than plt_entry_size
3739 variable.
3740 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3741 method.
3742 (Output_data_plt_i386::get_plt_entry_size): Call it.
3743 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3744 (Output_data_plt_i386::add_eh_frame): New method to call it.
3745 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3746 method.
3747 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3748 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3749 method.
3750 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3751 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3752 method instead of plt_entry_size.
3753 (Output_data_plt_i386::plt_entry_size)
3754 (Output_data_plt_i386::plt_eh_frame_fde_size)
3755 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3756 (Output_data_plt_i386_standard): ... here, new class.
3757 (Output_data_plt_i386_exec): New class.
3758 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3759 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3760 (Output_data_plt_i386::exec_plt_entry): Move to ...
3761 (Output_data_plt_i386_exec::plt_entry): ... here.
3762 (Output_data_plt_i386_dyn): New class.
3763 (Output_data_plt_i386::first_plt_entry): Move to ...
3764 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3765 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3766 (Output_data_plt_i386_dyn::plt_entry): ... here.
3767 (Target_i386::Target_i386): Take optional argument for the Target_info
3768 pointer to use.
3769 (Target_i386::do_make_data_plt): New virtual method.
3770 (Target_i386::make_data_plt): New method to call it.
3771 (Target_i386::make_plt_section): Use that.
3772 Call this->plt_->add_eh_frame method here.
3773 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3774 rather than plt_entry_size variable.
3775 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3776 (Output_data_plt_i386::address_for_local): Likewise.
3777 (Output_data_plt_i386::do_write): Likewise.
3778 Move guts of PLT filling to...
3779 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3780 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3781 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3782 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3783
b9b9f2ee
CC
37842012-05-01 Cary Coutant <ccoutant@google.com>
3785
3786 * dwarf_reader.cc (Dwarf_die::read_attributes)
3787 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3788 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3789 * reduced_debug_output.cc
3790 (Output_reduced_debug_info_section::get_die_end): Remove
3791 DW_FORM_GNU_ref_index. Add default case.
3792
57923f48
MW
37932012-04-26 Mark Wielaard <mjw@redhat.com>
3794
3795 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3796 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3797 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3798 DW_AT_high_pc as offset from DW_AT_low_pc.
3799
3800 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3801 * testsuite/Makefile.in: Regenerate.
3802 * testsuite/gdb_index_test_3.c: New test source file.
3803 * testsuite/gdb_index_test_3.sh: New test source file.
3804
2c54b4f4
ILT
38052012-04-25 Ian Lance Taylor <iant@google.com>
3806
3807 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3808 pointer.
3809 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3810 as a class, not a struct.
3811 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3812 (Target_arm::apply_cortex_a8_workaround): Likewise.
3813 * gc.h: Declare Reloc_types as a struct, not a class.
3814 * object.h: Declare Symbols_data as a struct.
3815 * reloc.h: Declare Read_relocs_data as a struct.
3816 * target.h: Declare Relocate_info as a struct.
3817
a5a5f7a3
DM
38182012-04-24 David S. Miller <davem@davemloft.net>
3819
3820 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3821 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3822 and R_SPARC_WPLT30.
3823
f038d496
CC
38242012-04-24 Cary Coutant <ccoutant@google.com>
3825
3826 * incremental-dump.cc (find_input_containing_global): Replace
3827 magic number with symbolic constant.
3828 (dump_incremental_inputs): Update version number.
3829 * incremental.cc (Output_section_incremental_inputs): Update version
3830 number; import symbolic constants from Incremental_inputs_reader.
3831 (Incremental_inputs::create_data_sections): Align relocations
3832 section correctly for 64-bit targets.
3833 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3834 constants; add padding.
3835 (Output_section_incremental_inputs::write_header): Add assert for
3836 header_size.
3837 (Output_section_incremental_inputs::write_input_files): Add assert
3838 for input_entry_size.
3839 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3840 add assert for object_info_size, input_section_entry_size,
3841 global_sym_entry_size.
3842 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3843 for data structure sizes; use them.
3844 (Incremental_input_entry_reader): Import symbolic constants from
3845 Incremental_inputs_reader; use them.
3846
a4d85145
DM
38472012-04-23 David S. Miller <davem@davemloft.net>
3848
3849 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3850 and elf_flags_set_.
3851 (Target_sparc::Target_sparc): Initialize new fields.
3852 (Target_sparc::do_make_elf_object): New function.
3853 (Target_sparc::do_adjust_elf_header): New function.
3854
1d509098
CC
38552012-04-23 Cary Coutant <ccoutant@google.com>
3856
3857 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3858 CU range table of gdb index.
3859
7ebeff7f
DM
38602012-04-20 David S. Miller <davem@davemloft.net>
3861
3862 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3863 instead of false.
3864
13cf9988
DM
38652012-04-16 David S. Miller <davem@davemloft.net>
3866
2a1079e8
DM
3867 * sparc.cc (Target_sparc::got_address): New function.
3868 (Sparc_relocate_functions::gdop_hix22): New function.
3869 (Sparc_relocate_functions::gdop_lox10): New function.
3870 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3871 relocs.
3872 (Target_sparc::Scan::local): Likewise if the global symbol is not
3873 preemptible and is not IFUNC.
3874 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3875 transformations for local and non-preemptible non-IFUNC global
3876 symbols.
3877
0bc964fc
DM
3878 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3879 writing out 64-bit part of ranges.
3880
661d7a80
DM
3881 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3882 -fpic and -fpie respectively.
3883 * Makefile.in: Regenerate.
3884
8c2bf391
DM
3885 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3886 (Target_sparc::Target_sparc): Initialize new field.
3887 (Target_sparc::do_plt_section_for_global): New function.
3888 (Target_sparc::do_plt_section_for_local): New function.
3889 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3890 (Target_sparc::make_plt_section): New function, broken out of
3891 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3892 (Target_sparc::make_plt_entry): Call make_plt_section.
3893 (Target_sparc::make_local_ifunc_plt_entry): New function.
3894 (Target_sparc::rela_ifunc_section): New function.
3895 (Target_sparc::plt_section): Remove const.
3896 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3897 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3898 and ifunc_count_ fields.
3899 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3900 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3901 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3902 (Output_data_plt_sparc::rela_ifunc): New function.
3903 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3904 (Output_data_plt_sparc::has_ifunc_section): New function.
3905 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3906 (Output_data_plt_sparc::address_for_global): New function.
3907 (Output_data_plt_sparc::address_for_local): New function.
3908 (Output_data_plt_sparc::plt_index_to_offset): New function.
3909 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3910 and entry_count.
3911 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3912 entry_count.
3913 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3914 R_SPARC_JMP_IREL to switch.
3915 (Target_sparc::Scan::check_non_pic): Likewise.
3916 (Target_sparc::Scan::local): Handle IFUNC symbols.
3917 (Target_sparc::Scan::local): Likewise.
3918 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3919 and plt_address_for_local.
3920 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3921 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3922
13cf9988
DM
3923 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3924 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3925 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3926 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3927 global relocs too.
3928 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3929 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3930 calls.
3931 * sparc.cc (Target_sparc::Scan::global): Likewise.
3932 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3933
31821be0
CC
39342012-04-16 Cary Coutant <ccoutant@google.com>
3935
3936 * archive.cc (Library_base::should_include_member): Check for
3937 --export-dynamic-symbol.
3938 * options.h (class General_options): Add --export-dynamic-symbol.
3939 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3940 --export-dynamic-symbol.
3941 (Symbol_table::gc_mark_undef_symbols): Likewise.
3942 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3943
2615994e
DM
39442012-04-12 David S. Miller <davem@davemloft.net>
3945
3946 * sparc.cc (Reloc::wdisp10): New relocation method.
3947 (Reloc::h34): Likewise.
3948 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3949 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3950 R_SPARC_WDISP10.
3951 (Target_sparc::Scan::local): Likewise.
3952 (Target_sparc::Scan::global): Likewise.
3953 (Target_sparc::Relocate::relocate): Likewise.
3954
6782735d
CC
39552012-04-09 Cary Coutant <ccoutant@google.com>
3956
3957 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3958 low_pc == 0.
3959
8c7a0b00
ILT
39602012-04-06 Ian Lance Taylor <iant@google.com>
3961
3962 * timer.cc: #include <unistd.h>.
3963
58797674
RM
39642012-04-06 Roland McGrath <mcgrathr@google.com>
3965
3966 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3967 * config.in: Regenerate.
3968 * configure: Regenerate.
3969
44350750
NC
39702012-04-05 Nick Clifton <nickc@redhat.com>
3971
3972 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3973 (AM_LC_MESSAGES): Add.
3974 * aclocal.m4: Regenerate.
3975 * config.in: Regenerate.
3976 * configure: Regenerate.
3977
c1027032
CC
39782012-03-21 Cary Coutant <ccoutant@google.com>
3979
3980 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3981 * Makefile.in: Regenerate.
3982 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3983 (Sized_elf_reloc_mapper::symbol_section): New function.
3984 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3985 (make_elf_reloc_mapper): New function.
3986 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3987 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3988 (Dwarf_abbrev_table::do_get_abbrev): New function.
3989 (Dwarf_ranges_table::read_ranges_table): New function.
3990 (Dwarf_ranges_table::read_range_list): New function.
3991 (Dwarf_pubnames_table::read_section): New function.
3992 (Dwarf_pubnames_table::read_header): New function.
3993 (Dwarf_pubnames_table::next_name): New function.
3994 (Dwarf_die::Dwarf_die): New function.
3995 (Dwarf_die::read_attributes): New function.
3996 (Dwarf_die::skip_attributes): New function.
3997 (Dwarf_die::set_name): New function.
3998 (Dwarf_die::set_linkage_name): New function.
3999 (Dwarf_die::attribute): New function.
4000 (Dwarf_die::string_attribute): New function.
4001 (Dwarf_die::int_attribute): New function.
4002 (Dwarf_die::uint_attribute): New function.
4003 (Dwarf_die::ref_attribute): New function.
4004 (Dwarf_die::child_offset): New function.
4005 (Dwarf_die::sibling_offset): New function.
4006 (Dwarf_info_reader::check_buffer): New function.
4007 (Dwarf_info_reader::parse): New function.
4008 (Dwarf_info_reader::do_parse): New function.
4009 (Dwarf_info_reader::do_read_string_table): New function.
4010 (Dwarf_info_reader::lookup_reloc): New function.
4011 (Dwarf_info_reader::get_string): New function.
4012 (Dwarf_info_reader::visit_compilation_unit): New function.
4013 (Dwarf_info_reader::visit_type_unit): New function.
4014 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4015 Sized_elf_reloc_mapper.
4016 (Sized_dwarf_line_info::symbol_section): Remove function.
4017 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4018 (Sized_dwarf_line_info::read_line_mappings): Remove object
4019 parameter, adjust callers.
4020 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4021 * dwarf_reader.h: Include <sys/types.h>.
4022 (class Track_relocs): Remove forward declaration.
4023 (class Elf_reloc_mapper): New class.
4024 (class Sized_elf_reloc_mapper): New class.
4025 (class Dwarf_abbrev_table): New class.
4026 (class Dwarf_range_list): New class.
4027 (class Dwarf_ranges_table): New class.
4028 (class Dwarf_pubnames_table): New class.
4029 (class Dwarf_die): New class.
4030 (class Dwarf_info_reader): New class.
4031 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4032 (Sized_dwarf_line_info::symbol_section): Remove member function.
4033 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4034 base class.
4035 * gdb-index.cc: New source file.
4036 * gdb-index.h: New source file.
4037 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4038 and .debug_types sections, call Layout::add_to_gdb_index.
4039 (Sized_relobj_incr::do_section_name): Implement.
4040 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4041 return type; Implement.
4042 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4043 return type.
4044 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4045 parameter list and return type.
4046 (Sized_incr_dynobj::do_section_contents): Likewise.
4047 * layout.cc: Include gdb-index.h.
4048 (Layout::Layout): Initialize gdb_index_data_.
4049 (Layout::init_fixed_output_section): Check for .gdb_index section.
4050 (Layout::add_to_gdb_index): New function. Instantiate.
4051 * layout.h: Add forward declaration for class Gdb_index.
4052 (Layout::add_to_gdb_index): New member function.
4053 (Layout::gdb_index_data_): New data member.
4054 * main.cc: Include gdb-index.h.
4055 (main): Print statistics for gdb index.
4056 * object.cc (Object::section_contents): Move code into
4057 do_section_contents.
4058 (need_decompressed_section): Check for sections needed when building
4059 gdb index.
4060 (build_compressed_section_map): Likewise.
4061 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4062 gdb index.
4063 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4064 sections; call Layout::add_to_gdb_index.
4065 (Sized_relobj_file::do_decompressed_section_contents): Call
4066 do_section_contents directly.
4067 * object.h (Object::do_section_contents): Adjust parameter list and
4068 return type.
4069 (Object::do_decompressed_section_contents): Call do_section_contents
4070 directly.
4071 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4072 return type.
4073 * options.h (class General_options): Add --gdb-index option.
4074 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4075 list and return type.
4076 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4077 * reloc.h (Track_relocs::checkpoint): New function.
4078 (Track_relocs::reset): New function.
4079
4080 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4081 New test cases.
4082 * testsuite/Makefile.in: Regenerate.
4083 * testsuite/gdb_index_test.cc: New test source file.
4084 * testsuite/gdb_index_test_1.sh: New test source file.
4085 * testsuite/gdb_index_test_2.sh: New test source file.
4086
647f1574
DK
40872012-03-19 Doug Kwan <dougkwan@google.com>
4088
4089 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4090 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4091 __exidx_start and __exidx_end. Make symbol table parameter
4092 anonymous as it is not used.
4093 * gold.cc (queue_middle_tasks): Call target hook to define any
4094 target-specific symbols.
4095 * target.h (Target::define_standard_symbols): New method.
4096 (Target::do_define_standard_symbols): Same.
4097 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4098 * testsuite/Makefile.in: Regenerate.
4099 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4100 and __exidx_end.
4101 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4102 relocations are generated for __exidx_start and __exidx_end.
4103
7c6109da
DK
41042012-03-16 Doug Kwan <dougkwan@google.com>
4105
4106 * testsuite/Makefile.am: Disable test initpri3b.
4107 * testsuite/Makefile.in: Regenerate.
4108
7b8957f8
DK
41092012-03-15 Doug Kwan <dougkwan@google.com>
4110
4111 * arm.cc (Target_arm::got_section): Make .got section read-only
4112 if -z now is given.
4113
14dc9ef7
ILT
41142012-03-15 Ian Lance Taylor <iant@google.com>
4115
4116 PR gold/13850
4117 * layout.cc (Layout::make_output_section): Correctly mark
4118 SHT_INIT_ARRAY, et. al., as relro.
4119
fa40b62a
DK
41202012-03-14 Doug Kwan <dougkwan@google.com>
4121
4122 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4123 dynamic relocations for protected symbols in shared objects.
4124
fd325007
ILT
41252012-03-13 Ian Lance Taylor <iant@google.com>
4126
4127 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4128 keep the larger alignment.
4129
e8dd54e1
CC
41302012-03-12 Cary Coutant <ccoutant@google.com>
4131
4132 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4133 handling of DW_LNE_define_file.
4134
feb5f3b0
CC
41352012-03-12 Cary Coutant <ccoutant@google.com>
4136
4137 * reduced_debug_output.cc
4138 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4139 codes to switch.
4140
a1fb4256
CC
41412012-02-29 Cary Coutant <ccoutant@google.com>
4142
4143 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4144
5dd8762a
CC
41452012-02-29 Cary Coutant <ccoutant@google.com>
4146
4147 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4148 Call Object::decompressed_section_contents.
4149 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4150 New dtor.
4151 (Sized_dwarf_line_info::buffer_start_): New data member.
4152 * merge.cc (Output_merge_data::do_add_input_section): Call
4153 Object::decompressed_section_contents.
4154 (Output_merge_string::do_add_input_section): Likewise.
4155 * object.cc (need_decompressed_section): New function.
4156 (build_compressed_section_map): Decompress sections needed later.
4157 (Sized_relobj_file::do_decompressed_section_contents): New function.
4158 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4159 * object.h (Object::decompressed_section_contents): New function.
4160 (Object::discard_decompressed_sections): New function.
4161 (Object::do_decompressed_section_contents): New function.
4162 (Object::do_discard_decompressed_sections): New function.
4163 (Compressed_section_info): New type.
4164 (Compressed_section_map): Include decompressed section contents.
4165 (Sized_relobj_file::do_decompressed_section_contents): New function.
4166 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4167
7b5de7ee
CC
41682012-02-16 Cary Coutant <ccoutant@google.com>
4169
4170 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4171 * testsuite/Makefile.in: Regenerate.
4172
f9fa4a63
CC
41732012-02-14 Cary Coutant <ccoutant@google.com>
4174
4175 * options.cc (General_options::finalize): Disallow -pie and -static.
4176
2c175ebc
DK
41772012-02-03 Doug Kwan <dougkwan@google.com>
4178
4179 * arm.cc (Arm_relocate_functions::abs8,
4180 Arm_relocate_functions::abs16): Use
4181 Bits::has_signed_unsigned_overflow32.
4182 (Arm_relocate_functions::thm_abs8): Correct range of
4183 overflow check.
4184 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4185 in assertions.
4186
90cff06f
DK
41872012-02-02 Doug Kwan <dougkwan@google.com>
4188
4189 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4190 position independent outputs, not just shared objects.
4191
63887f3d
L
41922012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4193
4194 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4195 * configure: Regenerated.
4196
bef2b434
ILT
41972012-01-27 Ian Lance Taylor <iant@google.com>
4198
4199 * reloc.h (Bits): New class with static functions, copied from
4200 namespace utils in arm.cc.
4201 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4202 instead.
4203
c335b55d
L
42042012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4205
4206 * incremental.cc (write_info_blocks): Correct relocation offset.
4207
41194d9f
L
42082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4209
4210 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4211 (Relocate::tls_gd_to_le): Likewise.
4212
1bae613c
L
42132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4214
4215 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4216
24482ca0
L
42172012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4218
4219 * configure.ac: Check if -mcmodel=medium works.
4220 * configure: Regenerated.
4221
c2c7840a
CC
42222012-01-24 Cary Coutant <ccoutant@google.com>
4223
4224 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4225 definition and ...
4226 (read_unsigned_LEB_128_x): ... this new function.
4227 (read_signed_LEB_128): Replaced with inline definition and ...
4228 (read_signed_LEB_128_x): ... this new function.
4229 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4230 (read_unsigned_LEB_128): Add inline definition.
4231 (read_signed_LEB_128_x): New function.
4232 (read_signed_LEB_128): Add inline definition.
4233 * testsuite/Makefile.am (leb128_unittest): New unit test.
4234 * testsuite/Makefile.in: Regenerate.
4235 * testsuite/leb128_unittest.cc: New unit test.
4236
833de760 42372012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4238
4239 PR gold/13617
4240 * i386.cc (Target_i386::do_code_fill): When using a jmp
4241 instruction, pad with nop instructions.
4242 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4243
618d6666
L
42442012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4245
4246 * x86_64.cc (gc_process_relocs): Add typename on types used in
4247 template.
4248 (scan_relocs): Likewise.
4249 (relocate_section): Likewise.
4250 (apply_relocation): Likewise.
4251
3660ff06
L
42522012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4253
4254 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4255 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4256 under x32.
4257
fc51264f
L
42582012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4259
4260 * x86_64.cc: Initial support for x32.
4261
dd74ae06
CC
42622012-01-03 Cary Coutant <ccoutant@google.com>
4263
4264 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4265 Use abstract base class for GOT.
4266 * gold/output.h (class Output_data_got_base): New abstract base class.
4267 (class Output_data_got): Derive from new base class, adjust ctors.
4268 (Output_data_got::reserve_slot): Make virtual; rename to
4269 do_reserve_slot; Adjust callers.
4270 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4271 pointer to abstract base class.
4272 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4273
83896202
ILT
42742011-12-18 Ian Lance Taylor <iant@google.com>
4275
4276 * object.h (Relobj::local_symbol_value): New function.
4277 (Relobj::local_plt_offset): New function.
4278 (Relobj::local_has_got_offset): New function.
4279 (Relobj::local_got_offset): New function.
4280 (Relobj::set_local_got_offset): New function.
4281 (Relobj::do_local_symbol_value): New pure virtual function.
4282 (Relobj::do_local_plt_offset): Likewise.
4283 (Relobj::do_local_has_got_offset): Likewise.
4284 (Relobj::do_local_got_offset): Likewise.
4285 (Relobj::do_set_local_got_offset): Likewise.
4286 (Sized_relobj::do_local_has_got_offset): Rename from
4287 local_has_got_offset.
4288 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4289 (Sized_relobj::do_set_local_got_offset): Rename from
4290 set_local_got_offset.
4291 (Sized_relobj_file::do_local_plt_offset): Rename from
4292 local_plt_offset.
4293 (Sized_relobj_file::do_local_symbol_value): New function.
4294 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4295 local_plt_offset.
4296 * output.cc (Output_data_got::Got_entry::write): Change object to
4297 Relobj. Use local_symbol_value.
4298 (Output_data_got::add_global_with_rel): Change rel_dyn to
4299 Output_data_reloc_generic*. Use add_global_generic.
4300 (Output_data_got::add_global_with_rela): Remove. Change all
4301 callers to use add_global_with_rel.
4302 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4303 Output_data_reloc_generic*. Use add_global_generic.
4304 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4305 callers to use add_global_pair_with_rel.
4306 (Output_data_got::add_local): Change object to Relobj*.
4307 (Output_data_got::add_local_plt): Likewise.
4308 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4309 change rel_dyn to Output_data_reloc_generic*. Use
4310 add_local_generic.
4311 (Output_data_got::add_local_with_rela): Remove. Change all
4312 callers to use all_local_with_rel.
4313 (Output_data_got::add_local_pair_with_rel): Change object to
4314 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4315 add_output_section_generic.
4316 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4317 callers to use add_local_pair_with_rel.
4318 (Output_data_got::reserve_local): Change object to Relobj*.
4319 * output.h: (class Output_data_reloc_generic): Add pure virtual
4320 declarations for add_global_generic, add_local_generic,
4321 add_output_section_generic.
4322 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4323 functions for Output_data_reloc_generic. Update declarations for
4324 changes listed in output.cc.
4325 (class Output_data_got): Change template parameter to got_size.
4326 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4327 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4328 function.
4329 (Sized_relobj_incr::do_local_plt_offset): New function.
4330 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4331 add_global_generic.
4332
76677ad0
CC
43332011-12-17 Cary Coutant <ccoutant@google.com>
4334
4335 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4336 * resolve.cc (Symbol_table::resolve): Likewise.
4337 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4338 arrays.
4339 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4340
8b8dd8d5
ILT
43412011-12-16 Ian Lance Taylor <iant@google.com>
4342
4343 * output.h (Output_data_reloc_generic::add): Only call
4344 add_dynamic_reloc if this is a dynamic reloc section.
4345
d55525b9
L
43462011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4347
4348 PR gold/13505
4349 * target-reloc.h (apply_relocation): Replace <64, false> with
4350 <size, big_endian>.
4351
ff81c7c1
NC
43522011-11-25 Nick Clifton <nickc@redhat.com>
4353
4354 * po/it.po: New Italian translation.
4355
628f39be
SA
43562011-11-17 Sterling Augustine <saugustine@google.com>
4357
4358 * script.cc (script_include_directive): Implement.
4359 (read_script_file): New local variables name and search_path. Update
4360 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4361 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4362 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4363
98ef3ea4
SA
43642011-11-11 Sterling Augustine <saugustine@google.com>
4365
4366 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4367 (file_or_sections_cmd): Likewise.
4368
f4a8b6d7
DK
43692011-11-11 Doug Kwan <dougkwan@google.com>
4370
4371 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4372 if --just-symbols is given.
4373
29ab395d
DK
43742011-11-10 Doug Kwan <dougkwan@google.com>
4375
4376 PR gold/13362
4377 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4378 when processing data relocs.
4379 * reloc.h (Relocate_functions::rel_unaligned): New method.
4380 (Relocate_functions::pcrel_unaligned): Ditto.
4381 (Relocate_functions::rel32_unaligned): Ditto.
4382 (Relocate_functions::pcrel32_unaligned): Ditto.
4383
2c339f71
DK
43842011-11-09 Doug Kwan <dougkwan@google.com>
4385
4386 PR gold/13362
4387 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4388 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4389 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4390 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4391 (Relocate_functions::rel_unaligned): New.
4392 (Relocate_functions::rel32_unaligned): New.
4393 * target-reloc.h (relocate_for_relocatable): Add code to handle
4394 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4395 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4396 arm_unaligned_reloc_r): New targets.
4397 * testsuite/Makefile.in: Regenerate.
4398 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4399 linking.
4400
3f3cddf1
ILT
44012011-11-02 Ian Lance Taylor <iant@google.com>
4402
4403 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4404 NATIVE_LINKER.
4405 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4406 * options.cc (General_options::finalize): Use library search path
4407 from configure script if specified. If not native and no sysroot,
4408 only search TOOLLIBDIR.
4409 * options.h (Search_directory::Search_directory): Change name to
4410 const std::string&.
4411 (General_options::add_to_library_path_with_sysroot): Change arg to
4412 const std::string&.
4413 * configure, Makefile.in, config.in: Rebuild.
4414
a8e2273b
ILT
44152011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4416
4417 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4418 we are working around the ARM1176 Erratum.
4419 * options.h (General_options::fix_arm1176): Add option.
4420 * testsuite/Makefile.am: Add testcases, and keep current ones
4421 working.
4422 * testsuite/Makefile.in: Regenerate.
4423 * testsuite/arm_fix_1176.s: New file.
4424 * testsuite/arm_fix_1176.sh: Likewise.
4425
cd6eab1c
ILT
44262011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4427
4428 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4429 may_use_blx_.
4430 (Target_arm::may_use_blx): Remove method.
4431 (Target_arm::set_may_use_blx): Likewise.
4432 (Target_arm::may_use_v4t_interworking): New method.
4433 (Target_arm::may_use_v5t_interworking): Likewise.
4434 (Target_arm::may_use_blx_): Remove member variable.
4435 (Arm_relocate_functions::arm_branch_common): Check for v5T
4436 interworking.
4437 (Arm_relocate_functions::thumb_branch_common): Likewise.
4438 (Reloc_stub::stub_type_for_reloc): Likewise.
4439 (Target_arm::do_finalize_sections): Correct interworking checks.
4440 * testsuite/Makefile.am: Add new tests.
4441 * testsuite/Makefile.in: Regenerate.
4442 * testsuite/arm_farcall_arm_arm.s: New test.
4443 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4444 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4445 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4446 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4447 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4448 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4449 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4450
286adcf4
CC
44512011-10-31 Cary Coutant <ccoutant@google.com>
4452
4453 PR gold/13023
4454 * expression.cc (Expression::eval_with_dot): Add
4455 is_section_dot_assignment parameter.
4456 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4457 absolute and assigning to dot within a section.
4458 * script-sections.cc
4459 (Output_section_element_assignment::set_section_addresses): Pass
4460 dot_section to set_if_absolute.
4461 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4462 as is_section_dot_assignment flag to eval_with_dot.
4463 (Output_section_element_dot_assignment::set_section_addresses):
4464 Likewise.
4465 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4466 parameter. Also set value if relative to dot_section; set the
4467 symbol's output_section.
4468 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4469 parameter. Adjust all callers.
4470 (Expression::eval_maybe_dot): Likewise.
4471 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4472 Adjust all callers.
4473 * testsuite/script_test_2.t: Test assignment of an absolute value
4474 to dot within an output section element.
4475
9634ed06
CC
44762011-10-31 Cary Coutant <ccoutant@google.com>
4477
4478 * options.h (class General_options): Add --[no-]gnu-unique options.
4479 * symtab.cc (Symbol_table::sized_write_globals): Convert
4480 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4481
de4101c7
CC
44822011-10-31 Cary Coutant <ccoutant@google.com>
4483
4484 PR gold/13359
4485 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4486 unnecessary assertion.
4487 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4488
7257cc92
ST
44892011-10-31 Sriraman Tallam <tmsriram@google.com>
4490
4491 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4492 gc_mark_symbol.
4493 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4494 gc_mark_symbol.
4495 Change to just keep the section associated with symbol.
4496 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4497 they are externally visible and --export-dynamic is turned on.
4498 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4499
bfc34b3f
ILT
45002011-10-19 Ian Lance Taylor <iant@google.com>
4501
4502 PR gold/13163
4503 * script-sections.cc
4504 (Output_section_element_dot_assignment::needs_output_section): New
4505 function.
4506
ea0d8c47
ILT
45072011-10-19 Ian Lance Taylor <iant@google.com>
4508
4509 PR gold/13204
4510 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4511 --section-start option was seen.
4512 * options.h (General_options::any_section_start): New function.
4513
abd242a9
DM
45142011-10-18 David S. Miller <davem@davemloft.net>
4515
4516 PR binutils/13301
4517 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4518 member to track relocation locations that have moved during TLS
4519 reloc optimizations.
4520 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4521 (Target_sparc::Relocate::relocate): Adjust view down by 4
4522 bytes if it matches reloc_adjust_addr_.
4523 (Target_sparc::Relocate::relocate_tls): Always move the
4524 __tls_get_addr call delay slot instruction forward 4 bytes when
4525 performing relaxation.
4526
bab9090f
CC
45272011-10-18 Cary Coutant <ccoutant@google.com>
4528
4529 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4530 (Output_file::map_no_anonymous): Check for non-zero
4531 return code from posix_fallocate.
4532
f7c5b166
CC
45332011-10-17 Cary Coutant <ccoutant@google.com>
4534
4535 PR gold/13245
4536 * plugin.cc (is_visible_from_outside): Check for symbols
4537 referenced from dynamic objects.
4538 * resolve.cc (Symbol_table::resolve): Don't count references
4539 from dynamic objects as references from real ELF files.
4540 * testsuite/plugin_test_2.sh: Adjust expected result.
4541
b490c0bb
CC
45422011-10-17 Cary Coutant <ccoutant@google.com>
4543
4544 * gold.cc: Include timer.h.
4545 (queue_middle_tasks): Stamp time.
4546 (queue_final_tasks): Likewise.
4547 * main.cc (main): Store timer in parameters. Print timers
4548 for each pass.
4549 * parameters.cc (Parameters::Parameters): Initialize timer_.
4550 (Parameters::set_timer): New function.
4551 (set_parameters_timer): New function.
4552 * parameters.h (Parameters::set_timer): New function.
4553 (Parameters::timer): New function.
4554 (Parameters::timer_): New data member.
4555 (set_parameters_timer): New function.
4556 * timer.cc (Timer::stamp): New function.
4557 (Timer::get_pass_time): New function.
4558 * timer.h (Timer::stamp): New function.
4559 (Timer::get_pass_time): New function.
4560 (Timer::pass_times_): New data member.
4561
f475cf7b
CC
45622011-10-17 Cary Coutant <ccoutant@google.com>
4563
4564 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4565 task for members of lib groups.
4566
cdd7e244
CC
45672011-10-17 Cary Coutant <ccoutant@google.com>
4568
4569 PR gold/13288
4f95c8b4 4570 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4571 (File_read::make_view): Move bounds check (replace with assert)...
4572 (File_read::find_or_make_view): ... to here.
4573
dfb45471
CC
45742011-10-12 Cary Coutant <ccoutant@google.com>
4575
4f95c8b4 4576 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4577 ::read returns less than requested size.
4578
53bbcc1b
CC
45792011-10-10 Cary Coutant <ccoutant@google.com>
4580
4f95c8b4 4581 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4582 Initialize defined_count_.
4583 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4584 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4585 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4586 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4587 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4588 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4589 member.
4590 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4591 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4592 Return zeroes instead of internal error.
4593
397b129b
CC
45942011-10-10 Cary Coutant <ccoutant@google.com>
4595
4596 PR gold/13249
4f95c8b4 4597 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4598 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4599 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4600 (Output_reloc::type_): Adjust size of bit field.
4601 (Output_reloc::use_plt_offset_): New bit field.
4602 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4603 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4604 flag. Adjust all callers.
4f95c8b4 4605 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4606 creating RELATIVE relocations.
4607
d5698657
NC
46082011-10-10 Nick Clifton <nickc@redhat.com>
4609
4610 * po/es.po: Updated Spanish translation.
4611 * po/fi.po: Updated Finnish translation.
4612
6a59a5c2
DN
46132011-10-03 Diego Novillo <dnovillo@google.com>
4614
4615 * options.cc (parse_uint): Fix dereference of RETVAL.
4616
f0558624
ST
46172011-09-29 Sriraman Tallam <tmsriram@google.com>
4618
4619 * layout.h (section_order_map_): New member.
4620 (get_section_order_map): New member function.
4621 * output.cc (Output_section::add_input_section): Check for patterns
4622 only when --section-ordering-file is specified.
4623 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4624 output_sections have been formed.
4625 * layout.cc (Layout_Layout): Initialize section_order_map_.
4626 * plugin.cc (update_section_order): Store order in order_map. Do not
4627 update the order.
4628 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4629 * testsuite/Makefile.in: Regenerate.
4630 * testsuite/plugin_section_order.c: New file.
4631 * testsuite/plugin_final_layout.cc: New file.
4632 * testsuite/plugin_final_layout.sh: New file.
4633
a7dac153
CC
46342011-09-29 Cary Coutant <ccoutant@google.com>
4635
4f95c8b4 4636 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4637 Check for NULL.
4f95c8b4 4638 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4639 symbols during incremental update.
4640 (Symbol_table::add_from_dynobj): Likewise.
4641
eebd87a5
ILT
46422011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4643 Ian Lance Taylor <iant@google.com>
4644
4645 * symtab.cc (Symbol_table::define_special_symbol): Always
4646 canonicalize version string.
4647
403a3331
CC
46482011-09-26 Cary Coutant <ccoutant@google.com>
4649
4f95c8b4
CC
4650 * gold.cc (queue_initial_tasks): Move option checks ...
4651 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4652 some options; make others fatal.
4653
235061c2
CC
46542011-09-26 Cary Coutant <ccoutant@google.com>
4655
4656 gcc PR lto/47247
4657 * plugin.cc (get_symbols_v2): New function.
4658 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4659 (is_referenced_from_outside): New function.
4660 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4661 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4662 (get_symbols): Pass version parameter.
4663 (get_symbols_v2): New function.
4664 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4665 parameter.
4666 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4667 (onload): Add LDPT_GET_SYMBOLS_V2.
4668 (all_symbols_read_hook): Use get_symbols_v2; check for
4669 LDPR_PREVAILING_DEF_IRONLY_EXP.
4670 * testsuite/plugin_test_3.sh: Update expected results.
4671
dc87f620
ILT
46722011-09-23 Simon Baldwin <simonb@google.com>
4673
4674 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4675 configuration options.
4676 * configure: Regenerate.
4677 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4678 * Makefile.in: Regenerate.
4679 * testsuite/Makefile.in: Regenerate.
4680
a8279f82
ST
46812011-09-19 Sriraman Tallam <tmsriram@google.com>
4682
4683 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4684
0c9350c8
CC
46852011-09-19 Cary Coutant <ccoutant@google.com>
4686
4687 * incremental.cc (can_incremental_update): Fix typo in comment.
4688 * incremental.h (can_incremental_update): Likewise.
4689
aa06ae28
CC
46902011-09-18 Cary Coutant <ccoutant@google.com>
4691
4692 * incremental.cc (can_incremental_update): New function.
4693 * incremental.h (can_incremental_update): New function.
4694 * layout.cc (Layout::init_fixed_output_section): Call it.
4695 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4696 * object.cc (Sized_relobj_file::do_layout): Call
4697 can_incremental_update.
4698
ebb300b2
CC
46992011-09-13 Cary Coutant <ccoutant@google.com>
4700
4701 * configure.ac: Check for glibc support for gnu_indirect_function
4702 support with static linking, setting automake conditional
4703 IFUNC_STATIC.
4704 * Makefile.in: Regenerate.
4705 * configure: Regenerate.
4706
4707 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4708 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4709 for IFUNC_STATIC.
4710 * testsuite/Makefile.in: Regenerate.
4711
1206d0d5
CC
47122011-09-13 Cary Coutant <ccoutant@google.com>
4713
4714 * incremental.cc (Sized_relobj_incr::do_layout): Call
4715 report_comdat_group for kept comdat sections.
4716 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4717 * testsuite/Makefile.in: Regenerate.
4718 * testsuite/incr_comdat_test_1.cc: New source file.
4719 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4720 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4721 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4722
40b29874
ILT
47232011-09-13 Ian Lance Taylor <iant@google.com>
4724
4725 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4726 variable external_symbols_offset.
4727
1b045aac
ILT
47282011-09-12 Ian Lance Taylor <iant@google.com>
4729
4730 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4731 triggered if object has no symbols.
4732
24c6c55a
DM
47332011-09-09 David S. Miller <davem@davemloft.net>
4734
4735 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4736 (Output_fill_debug_line::do_write): Likewise.
4737
66570254
CC
47382011-08-29 Cary Coutant <ccoutant@google.com>
4739
4740 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4741 casts to match formatting specs.
4742 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4743
8ea8cd50
CC
47442011-08-26 Cary Coutant <ccoutant@google.com>
4745
4746 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4747 remaining hole size when allocating.
4748 (Layout::make_output_section): Set fill methods for debug sections.
4749 * layout.h (Free_list::Free_list_node): Move from private to
4750 public.
4751 (Free_list::set_min_hole_size): New function.
4752 (Free_list::begin, Free_list::end): New functions.
4753 (Free_list::min_hole_): New data member.
4754 * output.cc: Include dwarf.h.
4755 (Output_fill_debug_info::do_minimum_hole_size): New function.
4756 (Output_fill_debug_info::do_write): New function.
4757 (Output_fill_debug_line::do_minimum_hole_size): New function.
4758 (Output_fill_debug_line::do_write): New function.
4759 (Output_section::Output_section): Initialize new data member.
4760 (Output_section::set_final_data_size): Ensure patch space is larger
4761 than minimum hole size.
4762 (Output_section::do_write): Fill holes in debug sections.
4763 * output.h (Output_fill): New class.
4764 (Output_fill_debug_info): New class.
4765 (Output_fill_debug_line): New class.
4766 (Output_section::set_free_space_fill): New function.
4767 (Output_section::free_space_fill_): New data member.
4768 * testsuite/Makefile.am (incremental_test_3): Add
4769 --incremental-patch option.
4770 (incremental_test_4): Likewise.
4771 (incremental_test_5): Likewise.
4772 (incremental_test_6): Likewise.
4773 (incremental_copy_test): Likewise.
4774 (incremental_common_test_1): Likewise.
4775 * testsuite/Makefile.in: Regenerate.
4776
7cf80422
NC
47772011-08-26 Nick Clifton <nickc@redhat.com>
4778
4779 * po/es.po: Updated Spanish translation.
4780
c3f7b0e5
CC
47812011-08-01 Cary Coutant <ccoutant@google.com>
4782
4783 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4784 * gold/testsuite/Makefile.in: Regenerate.
4785 * gold/testsuite/justsyms_exec.c: New source file.
4786 * gold/testsuite/justsyms_lib.c: New source file.
4787
9590bf25
CC
47882011-08-01 Cary Coutant <ccoutant@google.com>
4789
4790 * layout.cc (Layout::set_segment_offsets): Don't realign text
4791 segment if -Ttext was specified.
4792 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4793 file type.
4794 * object.h (Sized_relobj_file::e_type): New function.
4795 (Sized_relobj_file::e_type_): New data member.
4796 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4797 base address for ET_EXEC files.
4798 * target.cc (Target::do_make_elf_object_implementation): Allow
4799 ET_EXEC files with --just-symbols option.
4800
dcd8d12e
CC
48012011-07-28 Cary Coutant <ccoutant@google.com>
4802
4803 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4804 Add thread_number parameter.
4805 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4806 * workqueue-threads.cc
4807 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4808 current thread if its thread number is greater than desired thread
4809 count.
4810 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4811 Add thread_number parameter.
4812 (Workqueue::should_cancel_thread): Likewise.
4813 (Workqueue::find_runnable_or_wait): Pass thread_number to
4814 should_cancel_thread.
4815 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4816 parameter.
4817
804eb480
ST
48182011-07-22 Sriraman Tallam <tmsriram@google.com>
4819
4820 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4821 only after checking if it cannot be forced local.
4822 * symtab.h (is_externally_visible): Check if the symbol is not forced
4823 local.
4824
f1ddb600
ILT
48252011-07-15 Ian Lance Taylor <iant@google.com>
4826
4827 * options.h (class General_options): Add --print-output-format.
4828 Move -EL next to -EB, for better --help output.
4829 * target-select.cc: Include <cstdio>, "options.h", and
4830 "parameters.h".
4831 (Target_selector::do_target_bfd_name): New function.
4832 (print_output_format): New function.
4833 * target-select.h (class Target_selector): Update declarations.
4834 (Target_selector::target_bfd_name): New function.
4835 (print_output_format): Declare.
4836 * main.cc: Include "target-select.h".
4837 (main): Handle --print-output-format.
4838 * gold.cc: Include "target-select.h".
4839 (queue_initial_tasks): Handle --print-output-format when there are
4840 no input files.
4841 * parameters.cc (parameters_force_valid_target): Give a better
4842 error message if -EB/-EL does not match target.
4843 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4844 function.
4845
7d172687
ILT
48462011-07-15 Ian Lance Taylor <iant@google.com>
4847
4848 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4849 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4850 (Output_data_plt_i386::do_write): Write address of .dynamic
4851 section to first entry in .got.plt section.
4852 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4853 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4854 Initialize layout_.
4855 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4856 section to first entry in .got.plt section.
4857 * layout.h (Layout::dynamic_section): New function.
4858
e9552f7e
ST
48592011-07-13 Sriraman Tallam <tmsriram@google.com>
4860
4861 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4862 to claim_file call.
4863 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4864 input_section_position_, and input_section_glob_.
4865 (read_layout_from_file): Call function section_ordering_specified.
4866 * layout.h (is_section_ordering_specified): New function.
4867 (section_ordering_specified): New function.
4868 (section_ordering_specified_): New boolean member.
4869 * main.cc(main): Call load_plugins after layout object is defined.
4870 * output.cc (Output_section::add_input_section): Use
4871 function section_ordering_specified to check if section ordering is
4872 needed.
4873 * output.cc (Output_section::add_relaxed_input_section): Use
4874 function section_ordering_specified to check if section ordering is
4875 needed.
4876 (Output_section::update_section_layout): New function.
4877 (Output_section::sort_attached_input_sections): Check if input section
4878 must be reordered.
4879 * output.h (Output_section::update_section_layout): New function.
4880 * plugin.cc (get_section_count): New function.
4881 (get_section_type): New function.
4882 (get_section_name): New function.
4883 (get_section_contents): New function.
4884 (update_section_order): New function.
58797674 4885 (allow_section_ordering): New function.
e9552f7e
ST
4886 (Plugin::load): Add the new interfaces to the transfer vector.
4887 (Plugin_manager::load_plugins): New parameter.
4888 (Plugin_manager::all_symbols_read): New parameter.
4889 (Plugin_manager::claim_file): New parameter. Save the elf object for
4890 unclaimed objects.
4891 (Plugin_manager::get_elf_object): New function.
4892 (Plugin_manager::get_view): Change to directly use the bool to check
4893 if get_view is called from claim_file_hook.
4894 * plugin.h (input_objects): New function
4895 (Plugin__manager::load_plugins): New parameter.
4896 (Plugin_manager::claim_file): New parameter.
4897 (Plugin_manager::get_elf_object): New function.
4898 (Plugin_manager::in_claim_file_handler): New function.
4899 (Plugin_manager::in_claim_file_handler_): New member.
4900 (layout): New function.
4901 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4902 handler with an extra parameter. Make the elf object before calling
4903 claim_file handler.
4904 * testsuite/plugin_test.c (get_section_count): New function pointer.
4905 (get_section_type): New function pointer.
4906 (get_section_name): New function pointer.
4907 (get_section_contents): New function pointer.
4908 (update_section_order): New function pointer.
4909 (allow_section_ordering): New function pointer.
4910 (onload): Check if the new interfaces exist.
4911
9446efde
ILT
49122011-07-13 Ian Lance Taylor <iant@google.com>
4913
4914 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4915 relro section.
4916 * x86_64.cc (Target_x86_64::got_section): Likewise.
4917 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4918 (relro_now_test_SOURCES): New variable.
4919 (relro_now_test_DEPENDENCIES): New variable.
4920 (relro_now_test_LDFLAGS): New variable.
4921 (relro_now_test_LDADD): New variable.
4922 (relro_now_test.so): New target.
4923 * testsuite/Makefile.in: Rebuild.
4924
07aa62f2
ILT
49252011-07-12 Ian Lance Taylor <iant@google.com>
4926
4927 PR gold/12980
4928 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4929 GLOB_DAT relocation rather than a RELATIVE relocation for a
4930 protected symbol when creating a shared library.
4931 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4932 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4933 * testsuite/protected_main_1.cc (main): Test that protected
4934 function has same address.
4935
e2153196
ILT
49362011-07-11 Ian Lance Taylor <iant@google.com>
4937
4938 PR gold/12979
4939 * options.h (class General_options): Add -Bgroup.
4940 * options.cc (General_options::finalize): If -Bgroup is set,
4941 default to --unresolved-symbols=report-all.
4942 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4943 * target-reloc.h (issue_undefined_symbol_error): Handle
4944 --unresolved-symbols=report-all.
4945
6daf5215
ILT
49462011-07-08 Ian Lance Taylor <iant@google.com>
4947
4948 PR gold/11985
4949 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4950 if linker script discards key sections.
4951 (Layout::create_dynamic_symtab): Likewise.
4952 (Layout::assign_local_dynsym_offsets): Likewise.
4953 (Layout::sized_create_version_sections): Likewise.
4954 (Layout::create_interp): Likewise.
4955 (Layout::finish_dynamic_section): Likewise.
4956 (Layout::set_dynamic_symbol_size): Likewise.
4957
beabb2c6
ILT
49582011-07-08 Ian Lance Taylor <iant@google.com>
4959
4960 PR gold/12386
4961 * options.h (class General_options): Add --unresolved-symbols.
4962 * target-reloc.h (issue_undefined_symbol_error): Check
4963 --unresolved-symbols. Add comments.
4964
9c16daf1
ILT
49652011-07-08 Ian Lance Taylor <iant@google.com>
4966
4967 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4968 expression more complex.
4969
191f1a2d
ILT
49702011-07-08 Ian Lance Taylor <iant@google.com>
4971
4972 PR gold/11317
4973 * target-reloc.h (issue_undefined_symbol_error): New inline
4974 function, broken out of relocate_section.
4975 (relocate_section): Call issue_undefined_symbol_error.
4976 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4977 there is no TLS segment if we are about to issue an undefined
4978 symbol error.
4979 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4980
62855347
ILT
49812011-07-08 Ian Lance Taylor <iant@google.com>
4982
4983 PR gold/12279
4984 * resolve.cc (Symbol_table::should_override): Add fromtype
4985 parameter. Change all callers. Give error when linking together
4986 TLS and non-TLS symbol.
4987 (Symbol_table::should_override_with_special): Add fromtype
4988 parameter. Change all callers.
4989 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4990 there is no TLS segment if we have reported some errors.
4991 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4992
67181c72
ILT
49932011-07-08 Ian Lance Taylor <iant@google.com>
4994
4995 PR gold/12372
4996 * target.h (Target::plt_address_for_global): New function.
4997 (Target::plt_address_for_local): New function.
4998 (Target::plt_section_for_global): Remove.
4999 (Target::plt_section_for_local): Remove.
5000 (Target::do_plt_address_for_global): New virtual function.
5001 (Target::do_plt_address_for_local): New virtual function.
5002 (Target::do_plt_section_for_global): Remove.
5003 (Target::do_plt_section_for_local): Remove.
5004 (Target::register_global_plt_entry): Add Symbol_table and Layout
5005 parameters.
5006 * output.cc (Output_data_got::Got_entry::write): Use
5007 plt_address_for_global and plt_address_for_local.
5008 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5009 address of output section.
5010 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5011 got_irelative_, and irelative_count_ fields. Update
5012 declarations.
5013 (Output_data_plt_i386::has_irelative_section): New function.
5014 (Output_data_plt_i386::entry_count): Add irelative_count_.
5015 (Output_data_plt_i386::set_final_data_size): Likewise.
5016 (class Target_i386): Add got_irelative_ and rel_irelative_
5017 fields. Update declarations.
5018 (Target_i386::Target_i386): Initialize new fields.
5019 (Target_i386::do_plt_address_for_global): New function replacing
5020 do_plt_section_for_global.
5021 (Target_i386::do_plt_address_for_local): New function replacing
5022 do_plt_section_for_local.
5023 (Target_i386::got_section): Create got_irelative_.
5024 (Target_i386::rel_irelative_section): New function.
5025 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5026 fields. Don't define __rel_iplt_{start,end}.
5027 (Output_data_plt_i386::add_entry): Add symtab and layout
5028 parameters. Change all callers. Use different PLT and GOT for
5029 IFUNC symbols.
5030 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5031 layout parameters. Change all callers. Use different PLT and
5032 GOT.
5033 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5034 (Output_data_plt_i386::rel_irelative): New function.
5035 (Output_data_plt_i386::address_for_global): New function.
5036 (Output_data_plt_i386::address_for_local): New function.
5037 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5038 IRELATIVE GOT when changing IFUNC GOT entries.
5039 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5040 reloc.
5041 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5042 if we didn't create an IRELATIVE GOT.
5043 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5044 plt_address_for_local.
5045 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5046 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5047 got_irelative_, and irelative_count_ fields. Update
5048 declarations.
5049 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5050 Initialize new fields. Remove symtab parameter. Change all
5051 callers.
5052 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5053 irelative_count_.
5054 (Output_data_plt_x86_64::has_irelative_section): New function.
5055 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5056 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5057 fields. Update declarations.
5058 (Target_x86_64::Target_x86_64): Initialize new fields.
5059 (Target_x86_64::do_plt_address_for_global): New function replacing
5060 do_plt_section_for_global.
5061 (Target_x86_64::do_plt_address_for_local): New function replacing
5062 do_plt_section_for_local.
5063 (Target_x86_64::got_section): Create got_irelative_.
5064 (Target_x86_64::rela_irelative_section): New function.
5065 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5066 all callers. Don't create __rel_iplt_{start,end}.
5067 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5068 parameters. Change all callers. Use different PLT and GOT for
5069 IFUNC symbols.
5070 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5071 layout parameters. Change all callers. Use different PLT and
5072 GOT.
5073 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5074 parameters. Change all callers. Use different PLT and GOT for
5075 IFUNC symbols.
5076 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5077 (Output_data_plt_x86_64::rela_irelative): New function.
5078 (Output_data_plt_x86_64::address_for_global): New function.
5079 (Output_data_plt_x86_64::address_for_local): New function.
5080 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5081 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5082 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5083 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5084 parameters.
5085 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5086 reloc.
5087 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5088 symbols if we didn't create an IRELATIVE GOT.
5089 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5090 plt_address_for_local.
5091 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5092 * testsuite/ifuncvar1.c: New test file.
5093 * testsuite/ifuncvar2.c: New test file.
5094 * testsuite/ifuncvar3.c: New test file.
5095 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5096 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5097 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5098 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5099 * testsuite/Makefile.in: Rebuild.
5100
33c15b45
CC
51012011-07-07 Cary Coutant <ccoutant@google.com>
5102
5103 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5104 (two_file_test_1_ndebug.o): Likewise.
5105 (two_file_test_1b_ndebug.o): Likewise.
5106 (two_file_test_2_ndebug.o): Likewise.
5107 (two_file_test_main_ndebug.o): Likewise.
5108 (incremental_test_2): Link with no-debug versions.
5109
f48b5fb7
CC
51102011-07-06 Cary Coutant <ccoutant@google.com>
5111
5112 * gold/incremental.cc
5113 (Output_section_incremental_inputs::write_info_blocks): Check for
5114 hidden and internal symbols.
5115
221597a5
CC
51162011-07-06 Cary Coutant <ccoutant@google.com>
5117
5118 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5119 Check disposition for startup file.
5120 (Incremental_inputs::report_command_line): Ignore
5121 --incremental-startup-unchanged option.
5122 * options.cc (General_options::parse_incremental_startup_unchanged):
5123 New function.
5124 (General_options::General_options): Initialize new data member.
5125 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5126 (General_options): Add --incremental-startup-unchanged option.
5127 (General_options::incremental_startup_disposition): New function.
5128 (General_options::incremental_startup_disposition_): New data member.
5129
e24719f6
CC
51302011-07-06 Cary Coutant <ccoutant@google.com>
5131
5132 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5133 input file index to Script_info ctor.
5134 (Sized_incremental_binary::do_file_has_changed): Find the
5135 command-line argument for files named in scripts.
5136 * incremental.h (Script_info::Script_info): New ctor
5137 with input file index.
5138 (Script_info::input_file_index): New function.
5139 (Script_info::input_file_index_): New data member.
5140 (Incremental_binary::get_library): Add const.
5141 (Incremental_binary::get_script_info): Add const.
5142 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5143 * testsuite/Makefile.am (incremental_test_5): New test case.
5144 (incremental_test_6): New test case.
5145 * testsuite/Makefile.in: Regenerate.
5146
8f7c81e8
CC
51472011-07-06 Cary Coutant <ccoutant@google.com>
5148
5149 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5150 debug output when command lines differ.
5151
9fbd3822
CC
51522011-07-06 Cary Coutant <ccoutant@google.com>
5153
5154 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5155 --incremental-patch option.
5156 * layout.cc (Free_list::allocate): Extend allocation beyond original
5157 end if enabled.
5158 (Layout::make_output_section): Mark sections that should get
5159 patch space.
5160 * options.cc (parse_percent): New function.
5161 * options.h (parse_percent): New function.
5162 (DEFINE_percent): New macro.
5163 (General_options): Add --incremental-patch option.
5164 * output.cc (Output_section::Output_section): Initialize new data
5165 members.
5166 (Output_section::add_input_section): Print section name when out
5167 of patch space.
5168 (Output_section::add_output_section_data): Likewise.
5169 (Output_section::set_final_data_size): Add patch space when
5170 doing --incremental-full.
5171 (Output_section::do_reset_address_and_file_offset): Remove patch
5172 space.
5173 (Output_segment::set_section_list_addresses): Print debug output
5174 only if --incremental-update.
5175 * output.h (Output_section::set_is_patch_space_allowed): New function.
5176 (Output_section::is_patch_space_allowed_): New data member.
5177 (Output_section::patch_space_): New data member.
5178 * parameters.cc (Parameters::incremental_full): New function.
5179 * parameters.h (Parameters::incremental_full): New function
5180 * testsuite/Makefile.am (incremental_test_2): Add test for
5181 --incremental-patch option.
5182 * testsuite/Makefile.in: Regenerate.
5183 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5184 (t18): Remove function body.
5185
f6cccc2c
DK
51862011-07-05 Doug Kwan <dougkwan@google.com>
5187
5188 PR gold/12771
5189 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5190 Arm_Address type for relocation result.
5191 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5192 overflow check.
5193 (Arm_relocate_functions::abs32): Use unaligned access.
5194 (Arm_relocate_functions::rel32): Ditto.
5195 (Arm_relocate_functions::prel31): Ditto.
5196 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5197 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5198 static data relocations.
5199 * testsuite/Makefile.in: Regnerate.
5200 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5201
28a13fec
ILT
52022011-07-05 Ian Lance Taylor <iant@google.com>
5203
5204 PR gold/12392
5205 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5206 symbols if necessary.
5207 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5208
24d47b34
ILT
52092011-07-05 Ian Lance Taylor <iant@google.com>
5210
5211 PR gold/12952
5212 * resolve.cc (Symbol::override_base_with_special): Simply override
5213 version with special symbol version, ignoring previous version.
5214
41f9cbbe
ILT
52152011-07-05 Ian Lance Taylor <iant@google.com>
5216
5217 * object.cc (Sized_relobj_file::include_section_group): Add
5218 information to comment about signature location.
5219
886288f1
ILT
52202011-07-02 Ian Lance Taylor <iant@google.com>
5221
5222 PR gold/12957
5223 * options.h (class General_options): Add -f and -F.
5224 * options.cc (General_options::finalize): Fatal error if -f/-F
5225 are used without -shared.
5226 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5227
ae3a6d4f
ILT
52282011-07-02 Ian Lance Taylor <iant@google.com>
5229
5230 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5231
21131061
ILT
52322011-07-01 Ian Lance Taylor <iant@google.com>
5233
5234 PR gold/12525
5235 PR gold/12952
5236 * resolve.cc (Symbol::override_base_with_special): Don't override
5237 the version if the overriding symbol has a different name.
5238 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5239 all callers. If we give an error about an undefined version,
5240 define the base version if necessary.
5241 * dynobj.h (class Versions): Update declaration.
5242 * testsuite/weak_alias_test_5.cc: New file.
5243 * testsuite/weak_alias_test.script: New file.
5244 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5245 and versioned_alias have the right value, and call t2.
5246 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5247 weak_alias_test_5.so.
5248 (weak_alias_test_LDADD): Likewise.
5249 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5250 * testsuite/Makefile.in: Rebuild.
5251
611062c0
ILT
52522011-07-01 Ian Lance Taylor <iant@google.com>
5253
5254 PR gold/12525
5255 * options.h (class General_options): Support -z notext.
5256 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5257 -Wl,-z,notext.
5258 (two_file_shared_nonpic.so): Likewise.
5259 (two_file_shared_mixed.so): Likewise.
5260 (two_file_shared_mixed_1.so): Likewise.
5261 (weak_undef_lib_nonpic.so): Likewise.
5262 (alt/weak_undef_lib_nonpic.so): Likewise.
5263 (tls_test_shared_nonpic.so): Likewise.
5264 * testsuite/Makefile.in: Rebuild.
5265
328c7c2f
ILT
52662011-07-01 Ian Lance Taylor <iant@google.com>
5267
5268 PR gold/12525
5269 * configure.ac: Test whether static linking works, setting
5270 the automake conditional HAVE_STATIC.
5271 * testsuite/Makefile.am: Disable tests using -static if
5272 HAVE_STATIC is not true.
5273 * configure, testsuite/Makefile.in: Rebuild.
5274
02d7cd44
ILT
52752011-07-01 Ian Lance Taylor <iant@google.com>
5276
5277 PR gold/12525
5278 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5279 Assert if we see DW_EH_PE_indirect.
5280 * target.h (Target::ehframe_datarel_base): New function.
5281 (Target::do_ehframe_datarel_base): New target function.
5282 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5283 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5284 function.
5285
07a60597
ILT
52862011-07-01 Ian Lance Taylor <iant@google.com>
5287
5288 PR gold/12571
5289 * options.h (class General_options): Add
5290 --ld-generated-unwind-info.
5291 * ehframe.cc (Fde::write): Add address parameter. Change all
5292 callers. If associated with PLT, fill in address and size.
5293 (Cie::set_output_offset): Only add merge mapping if there is an
5294 object.
5295 (Cie::write): Add address parameter. Change all callers.
5296 (Eh_frame::add_ehframe_for_plt): New function.
5297 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5298 input_offset_ fields into union u_, with new plt field.
5299 (Fde::Fde): Adjust for new union field.
5300 (Fde::Fde) [Output_data version]: New constructor.
5301 (Fde::add_mapping): Only add merge mapping if there is an object.
5302 (class Cie): Update declarations.
5303 (class Eh_frame): Declare add_ehframe_for_plt.
5304 * layout.cc (Layout::layout_eh_frame): Break out code into
5305 make_eh_frame_section, and call it.
5306 (Layout::make_eh_frame_section): New function.
5307 (Layout::add_eh_frame_for_plt): New function.
5308 * layout.h (class Layout): Update declarations.
5309 * merge.cc (Merge_map::add_mapping): Add assertion.
5310 * i386.cc: Include "dwarf.h".
5311 (class Output_data_plt_i386): Make first_plt_entry,
5312 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5313 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5314 and plt_eh_frame_fde.
5315 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5316 boundary. Call add_eh_frame_for_plt if appropriate.
5317 * x86_64.cc: Include "dwarf.h".
5318 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5319 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5320 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5321 and plt_eh_frame_fde.
5322 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5323 appropriate.
5324
14788a3f
ILT
53252011-06-29 Ian Lance Taylor <iant@google.com>
5326
5327 PR gold/12629
5328 * object.cc (Sized_relobj_file::layout_section): Change shdr
5329 parameter to be const.
5330 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5331 out of do_layout.
5332 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5333 appropriate. Call layout_eh_frame_section.
5334 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5335 sections.
5336 * object.h (class Sized_relobj_file): Update declarations.
5337
6c21fce1
ILT
53382011-06-29 Ian Lance Taylor <iant@google.com>
5339
37e41b03 5340 PR gold/12652
6c21fce1
ILT
5341 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5342 modifier.
5343 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5344
4d5e4e62
ILT
53452011-06-29 Ian Lance Taylor <iant@google.com>
5346
5347 PR gold/12675
5348 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5349 SHT_X86_64_UNWIND.
5350 * layout.cc (Layout::layout_eh_frame): Likewise.
5351
886f533a
ILT
53522011-06-29 Ian Lance Taylor <iant@google.com>
5353
5354 PR gold/12695
5355 * layout.cc (Layout::symtab_section_shndx): New function.
5356 * layout.h (class Layout): Declare symtab_section_shndx.
5357 * output.cc (Output_section::write_header): Call it.
5358
f3ae1b28
ILT
53592011-06-29 Ian Lance Taylor <iant@google.com>
5360
5361 PR gold/12818
5362 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5363 symbols which are not used in a relocation.
5364
aecf301f
ILT
53652011-06-28 Ian Lance Taylor <iant@google.com>
5366
5367 PR gold/12898
5368 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5369 script create indistinguishable segments.
5370 (Layout::set_segment_offsets): Use stable_sort when sorting
5371 segments. Pass this to Compare_segments constructor.
5372 * layout.h (class Layout): Make segment_precedes non-static.
5373 (class Compare_segments): Change from struct to class. Add
5374 layout_ field. Add constructor.
5375 * script-sections.cc
5376 (Script_sections::attach_sections_using_phdrs_clause): Rename
5377 local orphan to is_orphan. Don't report failure to put empty
5378 section in segment. On attachment failure, report name of
5379 section, and attach to first PT_LOAD segment.
5380
03ef7571
ILT
53812011-06-28 Ian Lance Taylor <iant@google.com>
5382
5383 PR gold/12934
5384 * target-select.cc (Target_selector::Target_selector): Add
5385 emulation parameter. Change all callers.
5386 (select_target_by_bfd_name): Rename from select_target_by_name.
5387 Change all callers.
5388 (select_target_by_emulation): New function.
5389 (supported_emulation_names): New function.
5390 * target-select.h (class Target_selector): Add emulation_ field.
5391 Update declarations.
5392 (Target_selector::recognize_by_bfd_name): Rename from
5393 recognize_by_name. Change all callers.
5394 (Target_selector::supported_bfd_names): Rename from
5395 supported_names. Change all callers.
5396 (Target_selector::recognize_by_emulation): New function.
5397 (Target_selector::supported_emulations): New function.
5398 (Target_selector::emulation): New function.
5399 (Target_selector::do_recognize_by_bfd_name): Rename from
5400 do_recognize_by_name. Change all callers.
5401 (Target_selector::do_supported_bfd_names): Rename from
5402 do_supported_names. Change all callers.
5403 (Target_selector::do_recognize_by_emulation): New function.
5404 (Target_selector::do_supported_emulations): New function.
5405 (select_target_by_bfd_name): Change name in declaration.
5406 (select_target_by_emulation): Declare.
5407 (supported_emulation_names): Declare.
5408 * parameters.cc (parameters_force_valid_target): Try to find
5409 target based on emulation from -m option.
5410 * options.h (class General_options): Change doc string for -m.
5411 * options.cc (help): Print emulations.
5412 (General_options::parse_V): Likewise.
5413 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5414 Add emulation parameter. Change all callers.
5415
200b2bb9
ILT
54162011-06-28 Ian Lance Taylor <iant@google.com>
5417
5418 * target.h (class Target): Add osabi_ field.
5419 (Target::osabi): New function.
5420 (Target::set_osabi): New function.
5421 (Target::Target): Initialize osabi_.
5422 (Target::do_adjust_elf_header): Make pure virtual.
5423 (Sized_target::do_adjust_elf_header): Declare.
5424 * target.cc (Sized_target::do_adjust_elf_header): New function.
5425 (class Sized_target): Instantiate all versions.
5426 * freebsd.h (class Target_freebsd): Remove.
5427 (Target_selector_freebsd::do_recognize): Call set_osabi on
5428 Target.
5429 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5430 (Target_selector_freebsd::set_osabi): Remove.
5431 * i386.cc (class Target_i386): Inherit from Sized_target rather
5432 than Target_freebsd.
5433 * x86_64.cc (class Target_x86_64): Likewise.
5434
b3ce541e
ILT
54352011-06-28 Ian Lance Taylor <iant@google.com>
5436
5437 * target.h (Target::can_check_for_function_pointers): Rewrite.
5438 Make non-virtual.
5439 (Target::can_icf_inline_merge_sections): Likewise.
5440 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5441 (Target::Target_info): Add can_icf_inline_merge_sections field.
5442 (Target::do_can_check_for_function_pointers): New virtual
5443 function.
5444 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5445 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5446 from can_check_for_function_pointers, move in file.
5447 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5448 section_may_have_icf_unsafe_poineters, move in file.
5449 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5450 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5451 Rename from can_check_for_function_pointers, move in file.
5452 (Target_i386::can_icf_inline_merge_sections): Remove.
5453 (Target_i386::i386_info): Initialize
5454 can_icf_inline_merge_sections.
5455 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5456 Initialize can_icf_inline_merge_sections.
5457 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5458 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5459 Rename from can_check_for_function_pointers, move in file.
5460 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5461 (Target_x86_64::x86_64_info): Initialize
5462 can_icf_inline_merge_sections.
5463 * testsuite/testfile.cc (Target_test::test_target_info):
5464 Likewise.
5465 * icf.cc (get_section_contents): Correct formatting.
5466
6d1c4efb
ILT
54672011-06-27 Ian Lance Taylor <iant@google.com>
5468
5469 * symtab.cc (Symbol::versioned_name): New function.
5470 (Symbol_table::add_to_final_symtab): Use versioned_name when
5471 appropriate.
5472 (Symbol_table::sized_write_symbol): Likewise.
5473 * symtab.h (class Symbol): Declare versioned_name.
5474 * stringpool.h (class Stringpool_template): Add variant of add
5475 which takes a std::basic_string.
5476 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5477 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5478 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5479 (ver_test_12.o): New target.
5480 * testsuite/Makefile.in: Rebuild.
5481
57eb9b50
DK
54822011-06-27 Doug Kwan <dougkwan@google.com>
5483
5484 * arm.cc (Arm_relocate_functions::thm_jump8,
5485 Arm_relocate_functions::thm_jump11): Use a wider signed
5486 type to compute offset.
5487 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5488 arm_thm_jump8.
5489 * testsuite/Makefile.in: Regenerate.
5490 * testsuite/arm_branch_in_range.sh: Check test results of
5491 arm_thm_jump11 and arm_thm_jump8.
5492 * testsuite/arm_thm_jump11.s: New test source file.
5493 * testsuite/arm_thm_jump11.t: New linker script.
5494 * testsuite/arm_thm_jump8.s: New test source file.
5495 * testsuite/arm_thm_jump8.t: New linker script.
5496
487b39df
ILT
54972011-06-24 Ian Lance Taylor <iant@google.com>
5498
5499 * layout.cc: Include "object.h".
5500 (ctors_sections_in_init_array): New static variable.
5501 (Layout::is_ctors_in_init_array): New function.
5502 (Layout::layout): Add entry to ctors_sections_in_init_array if
5503 appropriate.
5504 * layout.h (class Layout): Declare is_ctors_in_init_array.
5505 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5506 is_ctors_reverse_view is set.
5507 (Sized_relobj_file::write_sections): Add layout parameter. Change
5508 all callers. Set is_ctors_reverse_view field of View_size.
5509 (Sized_relobj_file::reverse_words): New function.
5510 * object.h (Sized_relobj_file::View_size): Add
5511 is_ctors_reverse_view field.
5512 (class Sized_relobj_file): Update declarations.
5513 * testsuite/initpri3.c: New test.
5514 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5515 initpri3b.
5516 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5517 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5518 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5519 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5520 * testsuite/Makefile.in: Rebuild.
5521
472076e4
CC
55222011-06-24 Cary Coutant <ccoutant@google.com>
5523
5524 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5525 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5526 (debug_msg_cdebug.err): New targets.
5527 * testsuite/Makefile.in: Regenerate.
5528 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5529 Fix checks for link with shared library.
5530
a60af0db
DK
55312011-06-24 Doug Kwan <dougkwan@google.com>
5532
5533 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5534 skip empty text sections.
5535 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5536
5393d741
ILT
55372011-06-22 Ian Lance Taylor <iant@google.com>
5538
5539 PR gold/12910
5540 * options.h (class General_options): Add --ctors-in-init-array.
5541 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5542 friends as SHT_PROGBITS for merging sections.
5543 (Layout::layout): Remove special handling of .init_array and
5544 friends. Don't sort if doing relocatable link. Sort for .ctors
5545 and .dtors if ctors_in_init_array.
5546 (Layout::make_output_section): Force correct section types for
5547 .init_array and friends. Don't sort if doing relocatable link,
5548 Don't sort .ctors and .dtors if ctors_in_init_array.
5549 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5550 (Layout::output_section_name): Add relobj parameter. Change all
5551 callers. Handle .ctors. and .dtors. in code rather than table.
5552 Handle .ctors and .dtors if ctors_in_init_array.
5553 (Layout::match_file_name): New function, moved from output.cc.
5554 * layout.h (class Layout): Update declarations.
5555 * output.cc: Include "layout.h".
5556 (Input_section_sort_entry::get_priority): New function.
5557 (Input_section_sort_entry::match_file_name): Just call
5558 Layout::match_file_name.
5559 (Output_section::Input_section_sort_init_fini_compare::operator()):
5560 Handle .ctors and .dtors. Sort by explicit priority rather than
5561 by name.
5562 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5563 * testsuite/initpri2.c: New test.
5564 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5565 (check_PROGRAMS): Add initpri2.
5566 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5567 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5568 * configure, testsuite/Makefile.in: Rebuild.
5569
e1f74f98
ILT
55702011-06-19 Ian Lance Taylor <iant@google.com>
5571
5572 PR gold/12880
5573 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5574 .interp section to a PT_INTERP segment even if we have seen a
5575 --dynamic-linker option. Don't do it if we have seen a PHDRS
5576 clause in a linker script.
5577 (Layout::finalize): Don't create a .interp section if we've
5578 already create a PT_INTERP segment.
5579 (Layout::create_interp): Always call choose_output_section (revert
5580 patch of 2011-06-17). Don't create PT_INTERP segment.
5581 * script-sections.cc
5582 (Script_sections::create_note_and_tls_segments): Add a .interp
5583 section to a PT_INTERP segment even if we have seen a
5584 --dynamic-linker option.
5585
766f91bb
ILT
55862011-06-18 Ian Lance Taylor <iant@google.com>
5587
5588 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5589 merely because a non-PT_LOAD segment has a dynamic reloc.
5590
0d212c3a
ILT
55912011-06-18 Ian Lance Taylor <iant@google.com>
5592
5593 * layout.cc (Layout::finish_dynamic_section): Don't create
5594 DT_FLAGS entry if not needed.
5595
911a5072
ILT
55962011-06-18 Ian Lance Taylor <iant@google.com>
5597
5598 PR gold/12745
5599 * layout.cc (Layout::layout_eh_frame): Correct handling of
5600 writable .eh_frame section.
5601
534b4e5f
ILT
56022011-06-17 Ian Lance Taylor <iant@google.com>
5603
5604 PR gold/12893
5605 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5606 symbol is redefined with the exact same object and value.
5607
10b4f102
ILT
56082011-06-17 Ian Lance Taylor <iant@google.com>
5609
5610 PR gold/12880
5611 * layout.h (class Layout): Add interp_segment_ field.
5612 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5613 (Layout::attach_allocated_section_to_segment): If making shared
5614 library, put .interp section in PT_INTERP segment.
5615 (Layout::finalize): Also call create_interp if -dynamic-linker
5616 option was used.
5617 (Layout::create_interp): Assert that there is no PT_INTERP
5618 segment. If not using a SECTIONS clause, use make_output_section.
5619 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5620 * script-sections.cc
5621 (Script_sections::create_note_and_tls_segments): If making shared
5622 library, put .interp section in PT_INTERP segment.
5623
a29b0dad
ILT
56242011-06-17 Ian Lance Taylor <iant@google.com>
5625
e588ea8d
ILT
5626 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5627 when making a shared library.
5628
56292011-06-17 Ian Lance Taylor <iant@google.com>
5630
5631 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5632 parameter. Change all callers. Don't issue warning about PC32
5633 against locally defined symbol.
a29b0dad 5634
9d3b0698
ILT
56352011-06-16 Ian Lance Taylor <iant@google.com>
5636
5637 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5638 occurs in same object.
5639
85b0f90c
AM
56402011-06-14 Alan Modra <amodra@gmail.com>
5641
5642 * po/POTFILES.in: Regenerate.
5643
a94907d9
ILT
56442011-06-09 Ian Lance Taylor <iant@google.com>
5645
5646 * script-sections.cc
5647 (Orphan_output_section::set_section_addresses): For a relocatable
5648 link set address to 0.
5649
4fb3a1c3
CC
56502011-06-09 Cary Coutant <ccoutant@google.com>
5651
5652 PR gold/12804
5653 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5654 used with --compress-debug-sections.
5655 * gold/object.cc (Sized_relobj_file::do_layout): Report
5656 uncompressed size of compressed input sections.
5657
61220854
CC
56582011-06-08 Cary Coutant <ccoutant@google.com>
5659
5660 PR gold/12804
5661 * testsuite/two_file_test_2_v1.cc: Change initialization of
5662 v2 to keep it in .data.
5663
e6455dfb
CC
56642011-06-07 Cary Coutant <ccoutant@google.com>
5665
5666 * common.cc (Symbol_table::do_allocate_commons_list): Call
5667 gold_fallback.
5668 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5669 (Errors::fallback): New function.
5670 (gold_fallback): New function.
5671 * errors.h (Errors::fallback): New function.
5672 * gold.cc (gold_exit): Change status parameter to enum; adjust
5673 all callers.
5674 (queue_initial_tasks): Call gold_fallback.
5675 * gold.h: Include cstdlib.
5676 (Exit_status): New enum type.
5677 (gold_exit): Change status parameter to enum.
5678 (gold_fallback): New function.
5679 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5680 (Layout::create_symtab_sections): Likewise.
5681 (Layout::create_shdrs): Likewise.
5682 * main.cc (main): Adjust call to gold_exit.
5683 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5684 (Output_data_got::add_got_entry_pair): Likewise.
5685 (Output_section::add_input_section): Likewise.
5686 (Output_section::add_output_section_data): Likewise.
5687 (Output_segment::set_section_list_addresses): Likewise.
5688 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5689
fb0e076f
CC
56902011-06-07 Cary Coutant <ccoutant@google.com>
5691
5692 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5693 for incremental links.
5694 * output.cc (Output_segment::set_section_list_addresses): Remove
5695 FIXME and test for TLS or BSS.
5696
a5ee4d5d
CC
56972011-06-07 Cary Coutant <ccoutant@google.com>
5698
5699 * testsuite/Makefile.am: Add incremental_copy_test,
5700 incremental_common_test_1.
5701 * testsuite/Makefile.in: Regenerate.
5702 * testsuite/common_test_1_v1.c: New source file.
5703 * testsuite/common_test_1_v2.c: New source file.
5704 * testsuite/copy_test_v1.cc: New source file.
5705
5146f448
CC
57062011-06-07 Cary Coutant <ccoutant@google.com>
5707
5708 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5709 update, allocate common from bss section's free list.
5710 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5711 linker-defined symbols.
5712 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5713 Skip GOT and PLT entries that are no longer referenced.
5714 (Output_section_incremental_inputs::write_info_blocks): Mark
5715 linker-defined symbols.
5716 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5717 * output.cc (Output_section::allocate): New function.
5718 * output.h (Output_section::allocate): New function.
5719 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5720 linker-defined symbols.
5721 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5722 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5723 (Symbol::init_base_output_data): Likewise.
5724 (Symbol::init_base_output_segment): Likewise.
5725 (Symbol::init_base_constant): Likewise.
5726 (Sized_symbol::init_output_data): Likewise.
5727 (Sized_symbol::init_output_segment): Likewise.
5728 (Sized_symbol::init_constant): Likewise.
5729 (Symbol_table::do_define_in_output_data): Likewise.
5730 (Symbol_table::do_define_in_output_segment): Likewise.
5731 (Symbol_table::do_define_as_constant): Likewise.
5732 * symtab.h (Symbol::is_predefined): New function.
5733 (Symbol::init_base_output_data): Add is_predefined parameter.
5734 (Symbol::init_base_output_segment): Likewise.
5735 (Symbol::init_base_constant): Likewise.
5736 (Symbol::is_predefined_): New data member.
5737 (Sized_symbol::init_output_data): Add is_predefined parameter.
5738 (Sized_symbol::init_output_segment): Likewise.
5739 (Sized_symbol::init_constant): Likewise.
5740 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5741
26d3c67d
CC
57422011-06-07 Cary Coutant <ccoutant@google.com>
5743
5744 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5745 instead of emit_copy_reloc.
5746 (Copy_relocs::emit_copy_reloc): Refactor.
5747 (Copy_relocs::make_copy_reloc): New function.
5748 (Copy_relocs::add_copy_reloc): Remove.
5749 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5750 section.
5751 (Copy_relocs::make_copy_reloc): New function.
5752 (Copy_relocs::add_copy_reloc): Remove.
5753 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5754 unchanged input files.
5755 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5756 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5757 Reserve BSS space for COPY relocations.
5758 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5759 (Output_section_incremental_inputs::write_info_blocks): Record
5760 whether a symbol is copied from a shared object.
5761 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5762 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5763 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5764 (Incremental_input_entry_reader::get_output_symbol_index): Add
5765 is_copy parameter.
5766 (Incremental_binary::emit_copy_relocs): New function.
5767 (Incremental_binary::do_emit_copy_relocs): New function.
5768 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5769 new data member.
5770 (Sized_incremental_binary::add_copy_reloc): New function.
5771 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5772 (Sized_incremental_binary::Copy_reloc): New struct.
5773 (Sized_incremental_binary::Copy_relocs): New typedef.
5774 (Sized_incremental_binary::copy_relocs_): New data member.
5775 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5776 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5777 * target.h (Sized_target::emit_copy_reloc): New function.
5778 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5779
7cdb37d9
CC
57802011-06-02 Cary Coutant <ccoutant@google.com>
5781
5782 PR gold/12163
5783 * gold/archive.cc (Archive::Archive): Initialize new data member.
5784 (Archive::include_all_members): Return if archive has already been
5785 included.
5786 * gold/archive.h (Archive::include_all_members_): New data member.
5787
cc643b88
NC
57882011-06-02 Nick Clifton <nickc@redhat.com>
5789
5790 * dynobj.h: Fix spelling mistake in comment.
5791 * output.cc: Likewise.
5792
f62a3ca7 57932011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5794 Asier Llano
f62a3ca7
DK
5795
5796 PR gold/12826
cc643b88 5797 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5798 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5799 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5800 redundant arm_exidx_test.so.
5801 * testsuite/Makefile.in: Regenerate.
5802 (check_SCRIPTS): Add pr12826.sh
5803 (check_DATA): Add pr12826.stdout
5804 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5805 * testsuite/pr12826.sh: New file.
5806 * testsuite/pr12826_1.s: Ditto.
5807 * testsuite/pr12826_1.s: Ditto.
5808
8dbe1edc
ILT
58092011-05-30 Ian Lance Taylor <iant@google.com>
5810
5811 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5812 sections.
5813
c49875be
ILT
58142011-05-29 Ian Lance Taylor <iant@google.com>
5815
5816 PR gold/12804
5817 * testsuite/Makefile.am: Use different file name for two_file_test
5818 temporary file for each incremental test.
5819 * testsuite/Makefile.in: Rebuild.
5820
69d53f7a
ILT
58212011-05-29 Ian Lance Taylor <iant@google.com>
5822
5823 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5824 binary input file is empty.
5825
41d0ab5f
ILT
58262011-05-27 Ian Lance Taylor <iant@google.com>
5827
5828 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5829 (ver_test_9.so): Likewise.
5830 * testsuite/Makefile.in: Rebuild.
5831
89d8a36b
CC
58322011-05-26 Cary Coutant <ccoutant@google.com>
5833
5834 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5835 * incremental.cc (Incremental_inputs::report_input_section): Fix
5836 comment, indentation.
5837 (Incremental_inputs::report_comdat_group): New function.
5838 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5839 of data for incremental input file entry.
5840 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5841 group count, COMDAT group signatures.
5842 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5843 an unchanged input file.
5844 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5845 Initialize new data member.
5846 (Incremental_object_entry::add_comdat_group): New function.
5847 (Incremental_object_entry::get_comdat_group_count): New function.
5848 (Incremental_object_entry::get_comdat_signature_key): New function.
5849 (Incremental_object_entry::groups_): New data member.
5850 (Incremental_inputs::report_comdat_group): New function.
5851 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5852 data for incremental input file entry.
5853 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5854 (Incremental_input_entry_reader::get_input_section): Adjust size of
5855 data for incremental input file entry.
5856 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5857 (Incremental_input_entry_reader::get_comdat_group_signature): New
5858 function.
5859 * object.cc (Sized_relobj::include_section_group): Report kept
5860 COMDAT groups for incremental links.
5861
1706a06f
ILT
58622011-05-24 David Meyer <pdox@google.com>
5863
5864 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5865 with name parameter. Add found_name parameter.
5866 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5867 * dirsearch.h (class Dirsearch): Update declaration.
5868
a10ae760
ILT
58692011-05-24 Ian Lance Taylor <iant@google.com>
5870
5871 * archive.cc (Library_base::should_include_member): Pull in object
5872 from archive if it defines the entry symbol.
5873 * parameters.cc (Parameters::entry): New function.
5874 * parameters.h (class Parameters): Declare entry.
5875 * output.h (class Output_file_header): Remove entry_ field.
5876 * output.cc (Output_file_header::Output_file_header): Remove entry
5877 parameter. Change all callers.
5878 (Output_file_header::entry): Use parameters->entry.
5879 * gold.cc (queue_middle_tasks): Likewise.
5880 * plugin.cc (Plugin_hook::run): Likewise.
5881
aa92d6ed
CC
58822011-05-24 Cary Coutant <ccoutant@google.com>
5883
5884 * gold.cc (queue_initial_tasks): Pass incremental base filename
5885 to Output_file::open_base_file; don't print error message.
5886 * incremental-dump.cc (main): Adjust call to
5887 Output_file::open_for_modification.
5888 * incremental-dump.cc (main): Likewise.
5889 * incremental.cc (Incremental_inputs::report_command_line):
5890 Ignore --incremental-base option when comparing command lines.
5891 Ignore parameter when given as separate argument.
5892 * options.h (class General_options): Add --incremental-base.
5893 * output.cc (Output_file::Output_file):
5894 (Output_file::open_base_file): Add base_name and writable parameters;
5895 read base file into new file; print error message here.
5896 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5897 callers.
5898 * output.h (Output_file::open_for_modification): Rename to...
5899 (Output_file::open_base_file): ...this; add base_name and
5900 writable parameters; adjust all callers.
5901 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5902 callers.
5903 * testsuite/Makefile.am (incremental_test_4): Test
5904 --incremental-base.
5905 * testsuite/Makefile.in: Regenerate.
5906
2eedd706
CC
59072011-05-24 Cary Coutant <ccoutant@google.com>
5908
5909 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5910 incremental_test_4.
5911 * testsuite/Makefile.in: Regenerate.
5912 * testsuite/two_file_test_1_v1.cc: New test source file.
5913 * testsuite/two_file_test_1b_v1.cc: New test source file.
5914 * testsuite/two_file_test_2_v1.cc: New test source file.
5915
0f1c85a6
CC
59162011-05-24 Cary Coutant <ccoutant@google.com>
5917
5918 * dynobj.h (Dynobj::do_dynobj): New function.
5919 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5920 flag and soname for shared objects.
5921 * incremental.cc (Incremental_inputs::report_object): Make
5922 either Incremental_object_entry or Incremental_dynobj_entry; add
5923 soname to string table.
5924 (Incremental_inputs::report_input_section): Add assertion.
5925 (Output_section_incremental_inputs::set_final_data_size): Adjust
5926 type of input file entry for shared libraries; adjust size of
5927 shared library info entry.
5928 (Output_section_incremental_inputs::write_input_files): Write
5929 as_needed flag for shared libraries.
5930 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5931 of input file entry for shared libraries; write soname.
5932 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5933 soname from incremental info.
5934 * incremental.h (enum Incremental_input_flags): Add
5935 INCREMENTAL_INPUT_AS_NEEDED.
5936 (Incremental_input_entry::Incremental_input_entry): Initialize new
5937 data member.
5938 (Incremental_input_entry::set_as_needed): New function.
5939 (Incremental_input_entry::as_needed): New function.
5940 (Incremental_input_entry::do_dynobj_entry): New function.
5941 (Incremental_input_entry::as_needed_): New data member.
5942 (Incremental_object_entry::Incremental_object_entry): Don't check
5943 for shared library.
5944 (Incremental_object_entry::do_type): Likewise.
5945 (class Incremental_dynobj_entry): New class.
5946 (Incremental_input_entry_reader::as_needed): New function.
5947 (Incremental_input_entry_reader::get_soname): New function.
5948 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5949 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5950 size of shared library info entry.
58797674 5951 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5952 incremental link when adding DT_NEEDED entries.
5953 * object.h (Object::Object): Initialize new data member.
5954 (Object::dynobj): New function.
5955 (Object::set_as_needed): New function.
5956 (Object::as_needed): New function.
5957 (Object::do_dynobj): New function.
5958 (Object::as_needed_): New data member.
5959
6fa2a40b
CC
59602011-05-24 Cary Coutant <ccoutant@google.com>
5961
5962 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5963 info; adjust display of GOT entries.
5964 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5965 vector of input objects; remove file_status_.
5966 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5967 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5968 got_plt reader; call target hooks to reserve GOT entries.
5969 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5970 of input file info header and GOT info entry.
5971 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5972 relocation info.
5973 (Got_plt_view_info::got_descriptor): Remove.
5974 (Got_plt_view_info::sym_index): New data member.
5975 (Got_plt_view_info::input_index): New data member.
5976 (Local_got_offset_visitor::visit): Write input file index.
5977 (Global_got_offset_visitor::visit): Write 0 for input file index.
5978 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5979 with sym_index and input_index.
5980 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5981 incremental info GOT entry; replace got_descriptor with input_index.
5982 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5983 map from input file index to object.
5984 (Sized_relobj_incr::do_layout): Replace direct data member reference
5985 with accessor function.
5986 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5987 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5988 Adjust size of input file info header.
5989 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5990 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5991 (Incremental_input_entry_reader::get_input_section): Adjust size of
5992 input file info header.
5993 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5994 of incremental info GOT entry.
5995 (Incremental_got_plt_reader::get_got_desc): Remove.
5996 (Incremental_got_plt_reader::get_got_symndx): New function.
5997 (Incremental_got_plt_reader::get_got_input_index): New function.
5998 (Sized_incremental_binary::Sized_incremental_binary): Remove
5999 file_status_; add input_objects_.
6000 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6001 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6002 (Sized_incremental_binary::file_is_unchanged): Remove.
6003 (Sized_incremental_binary::set_input_object): New function.
6004 (Sized_incremental_binary::input_object): New function.
6005 (Sized_incremental_binary::file_status_): Remove.
6006 (Sized_incremental_binary::input_objects_): New data member.
6007 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6008 references.
6009 (Sized_relobj_incr::invalid_address): Move to base class.
6010 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6011 class.
6012 (Sized_relobj_incr::do_output_section_offset): Likewise.
6013 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6014 (Sized_relobj_incr::section_offsets_): Likewise.
6015 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6016 function.
6017 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6018 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6019 with accessor function.
6020 (Sized_relobj_file::do_layout): Likewise.
6021 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6022 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6023 (Sized_relobj_file::compute_final_local_value): Replace refs to
6024 section_offsets_ with accessor function.
6025 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6026 * object.h (Relobj::Relobj): Initialize new data members.
6027 (Relobj::add_dyn_reloc): New function.
6028 (Relobj::first_dyn_reloc): New function.
6029 (Relobj::dyn_reloc_count): New function.
6030 (Relobj::first_dyn_reloc_): New data member.
6031 (Relobj::dyn_reloc_count_): New data member.
6032 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6033 references.
6034 (Sized_relobj::Address): New typedef.
6035 (Sized_relobj::invalid_address): Move here from child class.
6036 (Sized_relobj::Sized_relobj): Initialize new data members.
6037 (Sized_relobj::sized_relobj): New function.
6038 (Sized_relobj::is_output_section_offset_invalid): Move here from
6039 child class.
6040 (Sized_relobj::get_output_section_offset): Likewise.
6041 (Sized_relobj::local_has_got_offset): Likewise.
6042 (Sized_relobj::local_got_offset): Likewise.
6043 (Sized_relobj::set_local_got_offset): Likewise.
6044 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6045 (Sized_relobj::clear_got_offsets): New function.
6046 (Sized_relobj::section_offsets): Move here from child class.
6047 (Sized_relobj::do_output_section_offset): Likewise.
6048 (Sized_relobj::do_set_section_offset): Likewise.
6049 (Sized_relobj::Local_got_offsets): Likewise.
6050 (Sized_relobj::local_got_offsets_): Likewise.
6051 (Sized_relobj::section_offsets_): Likewise.
6052 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6053 references.
6054 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6055 class.
6056 (Sized_relobj_file::sized_relobj): New function
6057 (Sized_relobj_file::local_has_got_offset): Move to base class.
6058 (Sized_relobj_file::local_got_offset): Likewise.
6059 (Sized_relobj_file::set_local_got_offset): Likewise.
6060 (Sized_relobj_file::get_output_section_offset): Likewise.
6061 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6062 (Sized_relobj_file::do_output_section_offset): Likewise.
6063 (Sized_relobj_file::do_set_section_offset): Likewise.
6064 (Sized_relobj_file::Local_got_offsets): Likewise.
6065 (Sized_relobj_file::local_got_offsets_): Likewise.
6066 (Sized_relobj_file::section_offsets_): Likewise.
6067 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6068 (all constructors).
6069 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6070 (Output_reloc::get_symbol_index): Likewise.
6071 (Output_reloc::local_section_offset): Likewise.
6072 (Output_reloc::get_address): Likewise.
6073 (Output_reloc::symbol_value): Likewise.
6074 (Output_data_got::reserve_slot): Move to class definition.
6075 (Output_data_got::reserve_local): New function.
6076 (Output_data_got::reserve_slot_for_global): Remove.
6077 (Output_data_got::reserve_global): New function.
6078 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6079 (all constructors, two instantiations).
6080 (Output_reloc::get_relobj): New function (two instantiations).
6081 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6082 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6083 (Output_data_reloc::add_global): Adjust type of relobj.
6084 (Output_data_reloc::add_global_relative): Likewise.
6085 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6086 (Output_data_reloc::add_local): Likewise.
6087 (Output_data_reloc::add_local_relative): Likewise.
6088 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6089 (Output_data_reloc::add_local_section): Likewise.
6090 (Output_data_reloc::add_output_section): Likewise.
6091 (Output_data_reloc::add_absolute): Likewise.
6092 (Output_data_reloc::add_target_specific): Likewise.
6093 (Output_data_got::reserve_slot): Move definition here.
6094 (Output_data_got::reserve_local): New function.
6095 (Output_data_got::reserve_global): New function.
6096 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6097 section_offsets_ with accessor function.
6098 (Sized_relobj_file::write_sections): Likewise.
6099 (Sized_relobj_file::do_relocate_sections): Likewise.
6100 * target.h (Sized_target::reserve_local_got_entry): New function.
6101 (Sized_target::reserve_global_got_entry): New function.
6102 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6103 (Target_x86_64::reserve_global_got_entry): New function.
6104 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6105
4829d394
CC
61062011-05-23 Cary Coutant <ccoutant@google.com>
6107
6108 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6109 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6110 bit when checking got_type.
6111 * incremental.cc (Sized_incremental_binary::setup_readers):
6112 Store symbol table and string table locations; initialize bit vector
6113 of file status flags.
6114 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6115 unchanged files.
6116 (Sized_incremental_binary::do_process_got_plt): New function.
6117 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6118 (Output_section_incremental_inputs::set_final_data_size): Record
6119 file index for each input file.
6120 (Output_section_incremental_inputs::write_got_plt): Store file index
6121 instead of input entry offset for each GOT entry.
6122 * incremental.h
6123 (Incremental_input_entry::Incremental_input_entry): Initialize new
6124 data member.
6125 (Incremental_input_entry::set_offset): Store file index.
6126 (Incremental_input_entry::get_file_index): New function.
6127 (Incremental_input_entry::file_index_): New data member.
6128 (Incremental_binary::process_got_plt): New function.
6129 (Incremental_binary::do_process_got_plt): New function.
6130 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6131 data members.
6132 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6133 (Sized_incremental_binary::set_file_is_unchanged): New function.
6134 (Sized_incremental_binary::file_is_unchanged): New function.
6135 (Sized_incremental_binary::do_process_got_plt): New function.
6136 (Sized_incremental_binary::file_status_): New data member.
6137 (Sized_incremental_binary::main_symtab_loc_): New data member.
6138 (Sized_incremental_binary::main_strtab_loc_): New data member.
6139 * output.cc (Output_data_got::Got_entry::write): Add case
6140 RESERVED_CODE.
6141 (Output_data_got::add_global): Call add_got_entry.
6142 (Output_data_got::add_global_plt): Likewise.
6143 (Output_data_got::add_global_with_rel): Likewise.
6144 (Output_data_got::add_global_with_rela): Likewise.
6145 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6146 (Output_data_got::add_global_pair_with_rela): Likewise.
6147 (Output_data_got::add_local): Call add_got_entry.
6148 (Output_data_got::add_local_plt): Likewise.
6149 (Output_data_got::add_local_with_rel): Likewise.
6150 (Output_data_got::add_local_with_rela): Likewise.
6151 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6152 (Output_data_got::add_local_pair_with_rela): Likewise.
6153 (Output_data_got::reserve_slot): New function.
6154 (Output_data_got::reserve_slot_for_global): New function.
6155 (Output_data_got::add_got_entry): New function.
6156 (Output_data_got::add_got_entry_pair): New function.
6157 (Output_section::add_output_section_data): Edit FIXME.
6158 * output.h
6159 (Output_section_data_build::Output_section_data_build): New
6160 constructor with size parameter.
6161 (Output_data_space::Output_data_space): Likewise.
6162 (Output_data_got::Output_data_got): Initialize new data member; new
6163 constructor with size parameter.
6164 (Output_data_got::add_constant): Call add_got_entry.
6165 (Output_data_got::reserve_slot): New function.
6166 (Output_data_got::reserve_slot_for_global): New function.
6167 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6168 (Output_data_got::add_got_entry): New function.
6169 (Output_data_got::add_got_entry_pair): New function.
6170 (Output_data_got::free_list_): New data member.
6171 * target.h (Sized_target::init_got_plt_for_update): New function.
6172 (Sized_target::register_global_plt_entry): New function.
6173 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6174 Initialize new data member; call init; add constructor with PLT count.
6175 (Output_data_plt_x86_64::init): New function.
6176 (Output_data_plt_x86_64::add_relocation): New function.
6177 (Output_data_plt_x86_64::reserve_slot): New function.
6178 (Output_data_plt_x86_64::free_list_): New data member.
6179 (Target_x86_64::init_got_plt_for_update): New function.
6180 (Target_x86_64::register_global_plt_entry): New function.
6181 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6182 incremental updates.
6183 (Output_data_plt_x86_64::add_relocation): New function.
6184 * testsuite/object_unittest.cc (Object_test): Set default options.
6185
ec69d6da
ILT
61862011-05-16 Ian Lance Taylor <iant@google.com>
6187
6188 * options.h (class General_options): Make -i a synonym for -r.
6189
732e31de
ILT
61902011-05-16 Ian Lance Taylor <iant@google.com>
6191
6192 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6193
403676b5
CC
61942011-05-10 Cary Coutant <ccoutant@google.com>
6195
6196 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6197 strip_all (-s).
6198
5b7b7d6e
ILT
61992011-05-06 Ian Lance Taylor <iant@google.com>
6200
6201 * layout.cc (Layout::layout): If the output section flags change,
6202 update the ordering.
6203
f0f9babf
CC
62042011-04-25 Cary Coutant <ccoutant@google.com>
6205
6206 * incremental-dump.cc (dump_incremental_inputs): Print local
6207 symbol info for each input file.
6208 * incremental.cc
6209 (Output_section_incremental_inputs::set_final_data_size): Add local
6210 symbol info to input file entries in incremental info.
6211 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6212 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6213 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6214 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6215 implementation.
6216 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6217 (Sized_incr_relobj::do_relocate): Write the local symbols.
6218 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6219 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6220 Adjust size of input file header.
6221 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6222 (Incremental_inputs_reader::get_local_symbol_count): New function.
6223 (Incremental_inputs_reader::get_input_section): Adjust size of input
6224 file header.
6225 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6226 (Sized_incr_relobj::This): New typedef.
6227 (Sized_incr_relobj::sym_size): New const data member.
6228 (Sized_incr_relobj::Local_symbol): New struct.
6229 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6230 (Sized_incr_relobj::do_local_symbol_offset): New function.
6231 (Sized_incr_relobj::local_symbol_count_): New data member.
6232 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6233 (Sized_incr_relobj::local_symbol_index_): New data member.
6234 (Sized_incr_relobj::local_symbol_offset_): New data member.
6235 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6236 (Sized_incr_relobj::local_symbols_): New data member.
6237 * object.h (Relobj::output_local_symbol_count): New function.
6238 (Relobj::local_symbol_offset): New function.
6239 (Relobj::do_output_local_symbol_count): New function.
6240 (Relobj::do_local_symbol_offset): New function.
6241 (Sized_relobj::do_output_local_symbol_count): New function.
6242 (Sized_relobj::do_local_symbol_offset): New function.
6243
d0a9ace3
ILT
62442011-04-22 Vladimir Simonov <sv@sw.ru>
6245
6246 * descriptors.cc (set_close_on_exec): New function.
6247 (Descriptors::open): Use set_close_on_exec.
6248 * output.cc (S_ISLNK): Define if not defined.
6249
94a3fc8b
CC
62502011-04-22 Cary Coutant <ccoutant@google.com>
6251
6252 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6253 global symbol map.
6254 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6255 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6256 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6257 relocations.
6258 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6259 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6260 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6261 * incremental.h
6262 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6263 function.
6264 (Incremental_binary::apply_incremental_relocs): New function.
6265 (Incremental_binary::do_apply_incremental_relocs): New function.
6266 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6267 data member.
6268 (Sized_incremental_binary::add_global_symbol): New function.
6269 (Sized_incremental_binary::global_symbol): New function.
6270 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6271 (Sized_incremental_binary::symbol_map_): New data member.
6272 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6273 * target.h (Sized_target::apply_relocation): New function.
6274 * target-reloc.h (apply_relocation): New function.
6275 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6276
c87e4302
DK
62772011-04-22 Doug Kwan <dougkwan@google.com>
6278
6279 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6280 flag of a SHT_ARM_EXIDX section.
2e702c99 6281 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6282 * testsuite/Makefile.in: Regenerate.
6283 * testsuite/arm_exidx_test.s: New file.
6284 * testsuite/arm_exidx_test.sh: Same.
6285
e7782cf6
CC
62862011-04-20 Cary Coutant <ccoutant@google.com>
6287
6288 PR gold/12689
6289 * archive.h (Incremental_archive_entry::Archive_member):
6290 Initialize arg_serial_ (second constructor).
6291
308ecdc7
ILT
62922011-04-17 Ian Lance Taylor <iant@google.com>
6293
6294 * object.cc (Relocate_info::location): Simplify location string.
6295 * errors.cc (Errors::error_at_location): Don't print program
6296 name.
6297 (Errors::warning_at_location): Likewise.
6298 (Errors::undefined_symbol): Likewise.
6299 * testsuite/debug_msg.sh: Update accordingly.
6300
bec5b579
CC
63012011-04-14 Cary Coutant <ccoutant@google.com>
6302
6303 * gold/layout.cc (Layout::symtab_section_offset): New function.
6304 * gold/layout.h (Layout::symtab_section_offset): New function.
6305 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6306
88597d34
ILT
63072011-04-12 Ian Lance Taylor <iant@google.com>
6308
6309 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6310 with MREMAP_MAYMOVE.
6311 * output.h (class Output_file): Add map_is_allocated_ field.
6312 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6313 not available, provide stubs. If mremap is not available, #define
6314 it to gold_mremap.
6315 (MREMAP_MAYMOVE): Define if not defined.
6316 (Output_file::Output_file): Initialize map_is_allocated_.
6317 (Output_file::resize): Check map_is_allocated_.
6318 (Output_file::map_anonymous): If mmap fails, use malloc.
6319 (Output_file::unmap): Don't do anything for an anonymous map.
6320 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6321 is not available, provide stubs.
6322 (File_read::View::~View): Use free rather than delete[].
6323 (File_read::make_view): Use malloc rather than new[]. If mmap
6324 fails, use malloc.
6325 (File_read::find_or_make_view): Use malloc rather than new[].
6326 * gold.h: Remove HAVE_REMAP code.
6327 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6328 exists. Rename mremap to gold_mremap. If mmap is not available
6329 don't do anything.
6330 * configure, config.in: Rebuild.
6331
11e361bc
ILT
63322011-04-11 Ian Lance Taylor <iant@google.com>
6333
6334 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6335 initialize local variable v.
6336
cdc29364
CC
63372011-04-11 Cary Coutant <ccoutant@google.com>
6338
6339 * archive.cc (Archive::include_member): Adjust call to
6340 report_object.
6341 (Add_archive_symbols::run): Track argument serial numbers.
6342 (Lib_group::include_member): Likewise.
6343 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6344 * archive.h (Incremental_archive_entry::Archive_member):
6345 Initialize arg_serial_.
6346 (Archive_member::arg_serial_): New data member.
6347 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6348 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6349 incremental link.
6350 (Sized_dynobj::do_for_all_local_got_entries): New function.
6351 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6352 function.
6353 * fileread.cc (get_mtime): New function.
6354 * fileread.h (get_mtime): New function.
6355 * gold.cc (queue_initial_tasks): Check for incremental update.
6356 (process_incremental_input): New function.
6357 (queue_middle_tasks): Don't force valid target for incremental
6358 update.
6359 * incremental-dump.cc (find_input_containing_global): Adjust
6360 size of symbol info entry.
6361 (dump_incremental_inputs): Dump argument serial number and
6362 in_system_directory flag; bias shndx by 1; print symbol names
6363 when dumping per-file symbol lists; use new symbol info readers.
6364 * incremental.cc
6365 (Output_section_incremental_inputs:update_data_size): New function.
6366 (Sized_incremental_binary::setup_readers): Setup input readers
6367 for each input file; build maps for files added from libraries
6368 and scripts.
6369 (Sized_incremental_binary::check_input_args): New function.
6370 (Sized_incremental_binary::do_check_inputs): Build map of argument
6371 serial numbers to input arguments.
6372 (Sized_incremental_binary::do_file_has_changed): Rename
6373 do_file_is_unchanged to this; compare file modification times.
6374 (Sized_incremental_binary::do_init_layout): New function.
6375 (Sized_incremental_binary::do_reserve_layout): New function.
6376 (Sized_incremental_binary::do_get_input_reader): Remove.
6377 (Sized_incremental_binary::get_symtab_view): New function.
6378 (Incremental_checker::can_incrementally_link_output_file): Remove.
6379 (Incremental_inputs::report_command_line): Exclude --debug options.
6380 (Incremental_inputs::report_archive_begin): Add parameter; track
6381 argument serial numbers; don't put input file entry for archive
6382 before archive members.
6383 (Incremental_inputs::report_archive_end): Put input file entry
6384 for archive after archive members.
6385 (Incremental_inputs::report_object): Add parameter; track argument
6386 serial numbers and in_system_directory flag.
6387 (Incremental_inputs::report_script): Add parameter; track argument
6388 serial numbers.
6389 (Output_section_incremental_inputs::set_final_data_size): Adjust
6390 size of symbol info entry; check for forwarding symbols.
6391 (Output_section_incremental_inputs::write_input_files): Write
6392 in_system_directory flag and argument serial number.
6393 (Output_section_incremental_inputs::write_info_blocks): Map section
6394 indices between incremental info and original input file; store
6395 input section index for each symbol.
6396 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6397 change operator() to visit().
6398 (class Global_got_offset_visitor): Likewise.
6399 (class Global_symbol_visitor_got_plt):
6400 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6401 classes.
6402 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6403 (Sized_incr_relobj::do_read_symbols): New function.
6404 (Sized_incr_relobj::do_layout): New function.
6405 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6406 (Sized_incr_relobj::do_add_symbols): New function.
6407 (Sized_incr_relobj::do_should_include_member): New function.
6408 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6409 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6410 (Sized_incr_relobj::do_section_size): New function.
6411 (Sized_incr_relobj::do_section_name): New function.
6412 (Sized_incr_relobj::do_section_contents): New function.
6413 (Sized_incr_relobj::do_section_flags): New function.
6414 (Sized_incr_relobj::do_section_entsize): New function.
6415 (Sized_incr_relobj::do_section_address): New function.
6416 (Sized_incr_relobj::do_section_type): New function.
6417 (Sized_incr_relobj::do_section_link): New function.
6418 (Sized_incr_relobj::do_section_info): New function.
6419 (Sized_incr_relobj::do_section_addralign): New function.
6420 (Sized_incr_relobj::do_initialize_xindex): New function.
6421 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6422 (Sized_incr_relobj::do_read_relocs): New function.
6423 (Sized_incr_relobj::do_gc_process_relocs): New function.
6424 (Sized_incr_relobj::do_scan_relocs): New function.
6425 (Sized_incr_relobj::do_count_local_symbols): New function.
6426 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6427 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6428 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6429 (Sized_incr_relobj::do_relocate): New function.
6430 (Sized_incr_relobj::do_set_section_offset): New function.
6431 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6432 (Sized_incr_dynobj::do_read_symbols): New function.
6433 (Sized_incr_dynobj::do_layout): New function.
6434 (Sized_incr_dynobj::do_add_symbols): New function.
6435 (Sized_incr_dynobj::do_should_include_member): New function.
6436 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6437 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6438 (Sized_incr_dynobj::do_section_size): New function.
6439 (Sized_incr_dynobj::do_section_name): New function.
6440 (Sized_incr_dynobj::do_section_contents): New function.
6441 (Sized_incr_dynobj::do_section_flags): New function.
6442 (Sized_incr_dynobj::do_section_entsize): New function.
6443 (Sized_incr_dynobj::do_section_address): New function.
6444 (Sized_incr_dynobj::do_section_type): New function.
6445 (Sized_incr_dynobj::do_section_link): New function.
6446 (Sized_incr_dynobj::do_section_info): New function.
6447 (Sized_incr_dynobj::do_section_addralign): New function.
6448 (Sized_incr_dynobj::do_initialize_xindex): New function.
6449 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6450 (make_sized_incremental_object): New function.
6451 (Incremental_library::copy_unused_symbols): New function.
6452 (Incremental_library::do_for_all_unused_symbols): New function.
6453 * incremental.h (enum Incremental_input_flags): New type.
6454 (class Incremental_checker): Remove.
6455 (Incremental_input_entry::Incremental_input_entry): Add argument
6456 serial number.
6457 (Incremental_input_entry::arg_serial): New function.
6458 (Incremental_input_entry::set_is_in_system_directory): New function.
6459 (Incremental_input_entry::is_in_system_directory): New function.
6460 (Incremental_input_entry::arg_serial_): New data member.
6461 (Incremental_input_entry::is_in_system_directory_): New data member.
6462 (class Script_info): Move here from script.h.
6463 (Script_info::Script_info): Add filename parameter.
6464 (Script_info::filename): New function.
6465 (Script_info::filename_): New data member.
6466 (Incremental_script_entry::Incremental_script_entry): Add argument
6467 serial number.
6468 (Incremental_object_entry::Incremental_object_entry): Likewise.
6469 (Incremental_object_entry::add_input_section): Build list of input
6470 sections with map to original shndx.
6471 (Incremental_object_entry::get_input_section_index): New function.
6472 (Incremental_object_entry::shndx_): New data member.
6473 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6474 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6475 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6476 serial number.
6477 (Incremental_inputs::report_archive_begin): Likewise.
6478 (Incremental_inputs::report_object): Likewise.
6479 (Incremental_inputs::report_script): Likewise.
6480 (class Incremental_global_symbol_reader): New class.
6481 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6482 and store flags and input file type.
6483 (Incremental_input_entry_reader::arg_serial): New function.
6484 (Incremental_input_entry_reader::type): Extract type from flags.
6485 (Incremental_input_entry_reader::is_in_system_directory): New function.
6486 (Incremental_input_entry_reader::get_input_section_count): Call
6487 accessor function for type.
6488 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6489 function for type; adjust size of global symbol entry.
6490 (Incremental_input_entry_reader::get_global_symbol_count): Call
6491 accessor function for type.
6492 (Incremental_input_entry_reader::get_object_count): Likewise.
6493 (Incremental_input_entry_reader::get_object_offset): Likewise.
6494 (Incremental_input_entry_reader::get_member_count): Likewise.
6495 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6496 (Incremental_input_entry_reader::get_member_offset): Likewise.
6497 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6498 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6499 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6500 (Incremental_input_entry_reader::get_global_symbol_reader): New
6501 function.
6502 (Incremental_input_entry_reader::get_output_symbol_index): New
6503 function.
6504 (Incremental_input_entry_reader::type_): Remove.
6505 (Incremental_input_entry_reader::flags_): New data member.
6506 (Incremental_inputs_reader::input_file_offset): New function.
6507 (Incremental_inputs_reader::input_file_index): New function.
6508 (Incremental_inputs_reader::input_file): Call input_file_offset.
6509 (Incremental_inputs_reader::input_file_at_offset): New function.
6510 (Incremental_relocs_reader::get_r_type): Reformat.
6511 (Incremental_relocs_reader::get_r_shndx): Reformat.
6512 (Incremental_relocs_reader::get_r_offset): Reformat.
6513 (Incremental_relocs_reader::data): New function.
6514 (Incremental_binary::Incremental_binary): Initialize new data members.
6515 (Incremental_binary::check_inputs): Add cmdline parameter.
6516 (Incremental_binary::file_is_unchanged): Remove.
6517 (Input_reader::arg_serial): New function.
6518 (Input_reader::get_unused_symbol_count): New function.
6519 (Input_reader::get_unused_symbol): New function.
6520 (Input_reader::do_arg_serial): New function.
6521 (Input_reader::do_get_unused_symbol_count): New function.
6522 (Input_reader::do_get_unused_symbol): New function.
6523 (Incremental_binary::input_file_count): New function.
6524 (Incremental_binary::get_input_reader): Change signature to use
6525 index instead of filename.
6526 (Incremental_binary::file_has_changed): New function.
6527 (Incremental_binary::get_input_argument): New function.
6528 (Incremental_binary::get_library): New function.
6529 (Incremental_binary::get_script_info): New function.
6530 (Incremental_binary::init_layout): New function.
6531 (Incremental_binary::reserve_layout): New function.
6532 (Incremental_binary::output_file): New function.
6533 (Incremental_binary::do_check_inputs): New function.
6534 (Incremental_binary::do_file_is_unchanged): Remove.
6535 (Incremental_binary::do_file_has_changed): New function.
6536 (Incremental_binary::do_init_layout): New function.
6537 (Incremental_binary::do_reserve_layout): New function.
6538 (Incremental_binary::do_input_file_count): New function.
6539 (Incremental_binary::do_get_input_reader): Change signature.
6540 (Incremental_binary::input_args_map_): New data member.
6541 (Incremental_binary::library_map_): New data member.
6542 (Incremental_binary::script_map_): New data member.
6543 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6544 new data members.
6545 (Sized_incremental_binary::output_section): New function.
6546 (Sized_incremental_binary::inputs_reader): Add const.
6547 (Sized_incremental_binary::symtab_reader): Add const.
6548 (Sized_incremental_binary::relocs_reader): Add const.
6549 (Sized_incremental_binary::got_plt_reader): Add const.
6550 (Sized_incremental_binary::get_symtab_view): New function.
6551 (Sized_incremental_binary::Inputs_reader): New typedef.
6552 (Sized_incremental_binary::Input_entry_reader): New typedef.
6553 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6554 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6555 (Sized_incremental_binary::do_file_has_changed): New function.
6556 (Sized_incremental_binary::do_init_layout): New function.
6557 (Sized_incremental_binary::do_reserve_layout): New function.
6558 (Sized_input_reader::Inputs_reader): Remove.
6559 (Sized_input_reader::Input_entry_reader): Remove.
6560 (Sized_input_reader::do_arg_serial): New function.
6561 (Sized_input_reader::do_get_unused_symbol_count): New function.
6562 (Sized_input_reader::do_get_unused_symbol): New function.
6563 (Sized_incremental_binary::do_input_file_count): New function.
6564 (Sized_incremental_binary::do_get_input_reader): Change signature;
6565 use index instead of filename.
6566 (Sized_incremental_binary::section_map_): New data member.
6567 (Sized_incremental_binary::input_entry_readers_): New data member.
6568 (class Sized_incr_relobj): New class.
6569 (class Sized_incr_dynobj): New class.
6570 (make_sized_incremental_object): New function.
6571 (class Incremental_library): New class.
6572 * layout.cc (Free_list::num_lists): New static data member.
6573 (Free_list::num_nodes): New static data member.
6574 (Free_list::num_removes): New static data member.
6575 (Free_list::num_remove_visits): New static data member.
6576 (Free_list::num_allocates): New static data member.
6577 (Free_list::num_allocate_visits): New static data member.
6578 (Free_list::init): New function.
6579 (Free_list::remove): New function.
6580 (Free_list::allocate): New function.
6581 (Free_list::dump): New function.
6582 (Free_list::print_stats): New function.
6583 (Layout_task_runner::run): Resize output file for incremental updates.
6584 (Layout::Layout): Initialize new data members.
6585 (Layout::set_incremental_base): New function.
6586 (Layout::init_fixed_output_section): New function.
6587 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6588 incremental updates.
6589 (Layout::create_gold_note): Do not create gold note section for
6590 incremental updates.
6591 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6592 for incremental updates.
6593 (Layout::set_section_offsets): For incremental updates, allocate space
6594 from free list.
6595 (Layout::create_symtab_sections): Layout with offsets relative to
6596 start of section; for incremental updates, allocate space from free
6597 list.
6598 (Layout::create_shdrs): For incremental updates, allocate space from
6599 free list.
6600 (Layout::finish_dynamic_section): For incremental updates, do not
6601 check --as-needed (fixed in subsequent patch).
6602 * layout.h (class Free_list): New class.
6603 (Layout::set_incremental_base): New function.
6604 (Layout::incremental_base): New function.
6605 (Layout::init_fixed_output_section): New function.
6606 (Layout::allocate): New function.
6607 (Layout::incremental_base_): New data member.
6608 (Layout::free_list_): New data member.
6609 * main.cc (main): Print Free_list statistics.
6610 * object.cc (Relobj::finalize_incremental_relocs): Add
6611 clear_counts parameter; clear counts only when clear_counts is set.
6612 (Sized_relobj::Sized_relobj): Initialize new base class.
6613 (Sized_relobj::do_layout): Don't report special sections.
6614 (Sized_relobj::do_for_all_local_got_entries): New function.
6615 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6616 symtab_off to all symbol table offsets.
6617 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6618 * object.h (class Got_offset_list): Move to top of file.
6619 (Object::Object): Allow case where input_file == NULL.
6620 (Object::~Object): Likewise.
6621 (Object::input_file): Assert that input_file != NULL.
6622 (Object::lock): Allow case where input_file == NULL.
6623 (Object::unlock): Likewise.
6624 (Object::is_locked): Likewise.
6625 (Object::token): Likewise.
6626 (Object::release): Likewise.
6627 (Object::is_incremental): New function.
6628 (Object::get_mtime): New function.
6629 (Object::for_all_local_got_entries): New function.
6630 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6631 (Object::set_is_in_system_directory): New function.
6632 (Object::is_in_system_directory): New function.
6633 (Object::do_is_incremental): New function.
6634 (Object::do_get_mtime): New function.
6635 (Object::do_for_all_local_got_entries): New function.
6636 (Object::is_in_system_directory_): New data member.
6637 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6638 (class Sized_relobj_base): New class.
6639 (class Sized_relobj): Derive from Sized_relobj_base.
6640 (class Sized_relobj::Symbols): Redeclare from base class.
6641 (class Sized_relobj::local_got_offset_list): Remove.
6642 (class Sized_relobj::Output_sections): Redeclare from base class.
6643 (class Sized_relobj::do_for_all_local_got_entries): New function.
6644 (class Sized_relobj::write_local_symbols): Add offset parameter.
6645 (class Sized_relobj::local_symbol_offset_): Update comment.
6646 (class Sized_relobj::local_dynsym_offset_): Update comment.
6647 * options.cc (Input_arguments::add_file): Remove const.
6648 * options.h (Input_file_argument::Input_file_argument):
6649 Initialize arg_serial_ (all constructors).
6650 (Input_file_argument::set_arg_serial): New function.
6651 (Input_file_argument::arg_serial): New function.
6652 (Input_file_argument::arg_serial_): New data member.
6653 (Input_arguments::Input_arguments): Initialize file_count_.
6654 (Input_arguments::add_file): Remove const.
6655 (Input_arguments::number_of_input_files): New function.
6656 (Input_arguments::file_count_): New data member.
6657 (Command_line::number_of_input_files): Call
6658 Input_arguments::number_of_input_files.
6659 * output.cc (Output_segment_headers::Output_segment_headers):
6660 Set current size.
6661 (Output_section::Input_section::current_data_size): New function.
6662 (Output_section::Output_section): Initialize new data members.
6663 (Output_section::add_input_section): Don't do merge sections for
6664 an incremental link; allocate space from free list for an
6665 incremental update.
6666 (Output_section::add_output_section_data): Allocate space from
6667 free list for an incremental update.
6668 (Output_section::update_data_size): New function.
6669 (Output_section::set_fixed_layout): New function.
6670 (Output_section::reserve): New function.
6671 (Output_segment::set_section_addresses): Remove const.
6672 (Output_segment::set_section_list_addresses): Remove const; allocate
6673 space from free list for an incremental update.
6674 (Output_segment::set_offset): Adjust size of RELRO segment for an
6675 incremental update.
6676 * output.h (Output_data::current_data_size): Move here from
6677 child classes.
6678 (Output_data::pre_finalize_data_size): New function.
6679 (Output_data::update_data_size): New function.
6680 (Output_section_headers::update_data_size): new function.
6681 (Output_section_data_build::current_data_size): Move to Output_data.
6682 (Output_data_strtab::update_data_size): New function.
6683 (Output_section::current_data_size): Move to Output_data.
6684 (Output_section::set_fixed_layout): New function.
6685 (Output_section::has_fixed_layout): New function.
6686 (Output_section::reserve): New function.
6687 (Output_section::update_data_size): New function.
6688 (Output_section::has_fixed_layout_): New data member.
6689 (Output_section::free_list_): New data member.
6690 (Output_segment::set_section_addresses): Remove const.
6691 (Output_segment::set_section_list_addresses): Remove const.
6692 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6693 New function.
6694 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6695 New function.
6696 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6697 parameter when calling Add_symbols constructor; store argument
6698 serial number for members of a lib group.
6699 (Add_symbols::locks): Allow case where token == NULL.
6700 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6701 (Read_member::~Read_member): New function.
6702 (Read_member::is_runnable): New function.
6703 (Read_member::locks): New function.
6704 (Read_member::run): New function.
6705 (Check_script::~Check_script): New function.
6706 (Check_script::is_runnable): New function.
6707 (Check_script::locks): New function.
6708 (Check_script::run): New function.
6709 (Check_library::~Check_library): New function.
6710 (Check_library::is_runnable): New function.
6711 (Check_library::locks): New function.
6712 (Check_library::run): New function.
6713 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6714 (Add_symbols::library_): New data member.
6715 (class Read_member): New class.
6716 (class Check_script): New class.
6717 (class Check_library): New class.
6718 * reloc.cc (Read_relocs::is_runnable): Allow case where
6719 token == NULL.
6720 (Read_relocs::locks): Likewise.
6721 (Scan_relocs::locks): Likewise.
6722 (Relocate_task::locks): Likewise.
6723 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6724 to clear counters.
6725 (Sized_relobj::incremental_relocs_scan): Fix comment.
6726 (Sized_relobj::do_relocate): Pass output file offset to
6727 write_local_symbols.
6728 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6729 from class declaration.
6730 * script.cc (read_input_script): Allocate Script_info; pass
6731 argument serial number to report_script.
6732 * script.h (class Script_info): Move to incremental.h.
6733 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6734 * symtab.h (Symbol_table::add_from_incrobj): New function.
6735 (Symbol_table::set_file_offset): New function.
6736
b961d0d7
CC
67372011-04-05 Cary Coutant <ccoutant@google.com>
6738
6739 * incremental-dump.cc (dump_incremental_inputs): Change signature
6740 to take a Sized_incremental_binary; change caller. Use readers
6741 in Sized_incremental_binary.
6742 * incremental.cc
6743 (Sized_incremental_binary::find_incremental_inputs_sections):
6744 Rename do_find_incremental_inputs_sections to this.
6745 (Sized_incremental_binary::setup_readers): New function.
6746 (Sized_incremental_binary::do_check_inputs): Check
6747 has_incremental_info_ flag; move setup code to setup_readers;
6748 use input readers.
6749 (Sized_incremental_binary::do_file_is_unchanged): New function.
6750 (Sized_incremental_binary::do_get_input_reader): New function.
6751 * incremental.h (class Incremental_binary): Move to end of file.
6752 (Incremental_binary::file_is_unchanged): New function.
6753 (Incremental_binary::do_file_is_unchanged): New function.
6754 (Incremental_binary::Input_reader): New class.
6755 (Incremental_binary::get_input_reader): New function.
6756 (class Sized_incremental_binary): Move to end of file.
6757 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6758 input section reader classes.
6759 (Sized_incremental_binary::has_incremental_info): New function.
6760 (Sized_incremental_binary::inputs_reader): New function.
6761 (Sized_incremental_binary::symtab_reader): New function.
6762 (Sized_incremental_binary::relocs_reader): New function.
6763 (Sized_incremental_binary::got_plt_reader): New function.
6764 (Sized_incremental_binary::do_file_is_unchanged): New function.
6765 (Sized_incremental_binary::Sized_input_reader): New class.
6766 (Sized_incremental_binary::get_input_reader): New function.
6767 (Sized_incremental_binary::find_incremental_inputs_sections):
6768 Rename do_find_incremental_inputs_sections to this.
6769 (Sized_incremental_binary::setup_readers): New function.
6770 (Sized_incremental_binary::has_incremental_info_): New data member.
6771 (Sized_incremental_binary::inputs_reader_): New data member.
6772 (Sized_incremental_binary::symtab_reader_): New data member.
6773 (Sized_incremental_binary::relocs_reader_): New data member.
6774 (Sized_incremental_binary::got_plt_reader_): New data member.
6775 (Sized_incremental_binary::current_input_file_): New data member.
6776
a869183f
PP
67772011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6778
6779 PR gold/12640
6780 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6781 violation.
6782
67832011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6784
6785 * archive.cc (Archive::include_member): Adjust call to report_object.
6786 (Add_archive_symbols::run): Add script_info to call to
6787 report_archive_begin.
6788 (Lib_group::include_member): Adjust call to report_object.
6789 (Add_lib_group_symbols::run): Adjust call to report_object.
6790 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6791 blocks. Add object count for script input files.
6792 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6793 script_info parameter; change all callers.
6794 (Incremental_inputs::report_object): Add script_info parameter;
6795 change all callers.
6796 (Incremental_inputs::report_script): Store backpointer to
6797 incremental info entry.
6798 (Output_section_incremental_inputs::set_final_data_size): Record
6799 additional information for scripts.
6800 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6801 * incremental.h (Incremental_script_entry::add_object): New function.
6802 (Incremental_script_entry::get_object_count): New function.
6803 (Incremental_script_entry::get_object): New function.
6804 (Incremental_script_entry::objects_): New data member; adjust
6805 constructor.
6806 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6807 (Incremental_inputs::report_object): Add script_info parameter.
6808 (Incremental_inputs_reader::get_object_count): New function.
6809 (Incremental_inputs_reader::get_object_offset): New function.
6810 * options.cc (Input_arguments::add_file): Return reference to
6811 new input argument.
6812 * options.h (Input_argument::set_script_info): New function.
6813 (Input_argument::script_info): New function.
6814 (Input_argument::script_info_): New data member; adjust all
6815 constructors.
6816 (Input_file_group::add_file): Return reference to new input argument.
6817 (Input_file_lib::add_file): Likewise.
6818 (Input_arguments::add_file): Likewise.
6819 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6820 * script.cc (Parser_closure::Parser_closure): Add script_info
6821 parameter; adjust all callers.
6822 (Parser_closure::script_info): New function.
6823 (Parser_closure::script_info_): New data member.
6824 (read_input_script): Report scripts earlier to incremental info.
6825 (script_add_file): Set script_info in Input_argument.
6826 (script_add_library): Likewise.
6827 * script.h (Script_options::Script_info): Rewrite class.
6828
a869183f 68292011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6830
6831 * archive.cc (Library_base::should_include_member): Move
6832 method here from class Archive.
6833 (Archive::Archive): Initialize base class.
6834 (Archive::should_include_member): Move to base class.
6835 (Archive::do_for_all_unused_symbols): New function.
6836 (Add_archive_symbols::run): Remove redundant access to
6837 incremental_inputs.
6838 (Lib_group::Lib_group): Initialize base class.
6839 (Lib_group::do_filename): New function.
6840 (Lib_group::include_member): Pass pointer to Lib_group to
6841 report_object.
6842 (Lib_group::do_for_all_unused_symbols): New function.
6843 (Add_lib_group_symbols::run): Report archive information for
6844 incremental links.
6845 * archive.h (class Library_base): New base class.
6846 (class Archive): Derive from Library_base.
6847 (Archive::filename): Move to base class.
6848 (Archive::set_incremental_info): Likewise.
6849 (Archive::incremental_info): Likewise.
6850 (Archive::Should_include): Likewise.
6851 (Archive::should_include_member): Likewise.
6852 (Archive::Armap_entry): Remove.
6853 (Archive::Unused_symbol_iterator): Remove.
6854 (Archive::unused_symbols_begin): Remove.
6855 (Archive::unused_symbols_end): Remove.
6856 (Archive::do_filename): New function.
6857 (Archive::do_get_mtime): New function.
6858 (Archive::do_for_all_unused_symbols): New function.
6859 (Archive::task_): Move to base class.
6860 (Archive::incremental_info_): Likewise.
6861 (class Lib_group): Derive from Library_base.
6862 (Lib_group::do_filename): New function.
6863 (Lib_group::do_get_mtime): New function.
6864 (Lib_group::do_for_all_unused_symbols): New function.
6865 (Lib_group::task_): Move to base class.
6866 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6867 function.
6868 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6869 function.
6870 * incremental.cc (Incremental_inputs::report_archive_begin):
6871 Use Library_base; call library's get_mtime; add incremental inputs
6872 entry before members.
6873 (class Unused_symbol_visitor): New class.
6874 (Incremental_inputs::report_archive_end): Use Library_base; use
6875 visitor class to record unused symbols; don't add incremental inputs
6876 entry after members.
6877 (Incremental_inputs::report_object): Use Library_base.
6878 * incremental.h
6879 (Incremental_archive_entry::Incremental_archive_entry): Remove
6880 unused Archive parameter.
6881 (Incremental_inputs::report_archive_begin): Use Library_base.
6882 (Incremental_inputs::report_archive_end): Likewise.
6883 (Incremental_inputs::report_object): Likewise.
6884 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6885 function.
6886 * object.h (Object::for_all_global_symbols): New function.
6887 (Object::do_for_all_global_symbols): New function.
6888 (Sized_relobj::do_for_all_global_symbols): New function.
6889 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6890 function.
6891 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6892 function.
6893
61ab3e40
ILT
68942011-03-27 Ian Lance Taylor <iant@google.com>
6895
6896 * archive.cc (Archive::interpret_header): Return -1 if something
6897 goes wrong. Change callers accordingly.
6898
30e1f9e6
CC
68992011-03-25 Cary Coutant <ccoutant@google.com>
6900
6901 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6902 * testsuite/Makefile.in: Regenerate.
6903
9370ce59 69042011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6905
6906 * plugin.cc (get_view): New.
6907 (Plugin::load): Pass get_view to the plugin.
6908 (Plugin_manager::get_view): New.
6909
9312bb0a
ILT
69102011-03-21 Ian Lance Taylor <iant@google.com>
6911
6912 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6913 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6914
7e12ba9e
ST
69152011-03-21 Sriraman Tallam <tmsriram@google.com>
6916
6917 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6918 Change == to -eq.
6919 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6920 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6921 Change == to -eq.
6922 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6923 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6924
fd7a005d
ILT
69252011-03-14 Ian Lance Taylor <iant@google.com>
6926
6927 * script-sections.cc (Sort_output_sections::script_compare):
6928 Rename from is_before, change return type.
6929 (Sort_output_sections::operator()): Adjust accordingly.
6930
ed16fd1b
ILT
69312011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6932
6933 PR gold/12572
6934 * testsuite/odr_violation2.cc: Add comment to make all error line
6935 numbers double digits.
6936 * testsuite/debug_msg.sh: Adjust expected errors.
6937
71ff8986
ILT
69382011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6939
6940 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6941 but mark earlier ones as non-canonical
6942 (offset_to_iterator): Update search target and example
6943 (do_addr2line): Return extra lines in a vector*
6944 (format_file_lineno): Extract from do_addr2line
6945 (one_addr2line): Add vector* out-param
6946 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6947 when a lineno entry appeared last for its instruction
6948 (Dwarf_line_info): Add vector* out-param
6949 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6950 * symtab.cc (Odr_violation_compare): Include the lineno in the
6951 comparison again.
6952 (linenos_from_loc): New. Combine the canonical line for an
6953 address with its other lines.
6954 (True_if_intersect): New. Helper functor to make
6955 std::set_intersection a query.
6956 (detect_odr_violations): Compare sets of lines instead of just
6957 one line for each function. This became less deterministic, but
6958 has fewer false positives.
6959 * symtab.h: Declarations.
6960 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6961 mix an optimized and non-optimized object in the same binary
6962 (odr_violation2.so): Same.
6963 * testsuite/Makefile.in: Regenerate from Makefile.am.
6964 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6965 * testsuite/debug_msg.sh: Update line numbers and add
6966 assertions.
6967 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6968 non-optimized context.
6969 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6970 isn't inlined, and use OdrDerived in an optimized context.
6971 * testsuite/odr_header1.h: Defines OdrDerived, where
6972 optimization will change the
6973 first-instruction-in-the-destructor's file and line number.
6974 * testsuite/odr_header2.h: Defines OdrBase.
6975
a19fefdc
ILT
69762011-03-09 Ian Lance Taylor <iant@google.com>
6977
6978 * fileread.cc (File_read::clear_views): Don't delete the whole
6979 file view.
6980
ecb351e9
ILT
69812011-03-08 Ian Lance Taylor <iant@google.com>
6982
6983 PR gold/12525
6984 * fileread.cc: #include <climits>.
6985 (GOLD_IOV_MAX): Define.
6986 (File_read::read_multiple): Limit number of entries by iov_max.
6987 * fileread.h (class File_read): Always set max_readv_entries to
6988 128.
6989
b821d13c
ILT
69902011-03-07 Ian Lance Taylor <iant@google.com>
6991
6992 PR gold/12525
6993 * options.h (class General_options): Add -dy and -dn.
6994
89243142
CC
69952011-03-02 Cary Coutant <ccoutant@google.com>
6996
6997 * testsuite/script_test_9.t: Add TLS segment.
6998
d0773f31
ILT
69992011-03-02 Simon Baldwin <simonb@google.com>
7000
7001 * configure.ac: Add check for gnu_indirect_function support in
7002 the toolchain building binutils.
7003 * configure: Rebuild.
7004
9370ce59 70052011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7006
7007 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7008 plugin only symbols.
7009 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7010 in plugin files as not needed in the symbol table.
7011
4cf7a849
ST
70122011-02-11 Sriraman Tallam <tmsriram@google.com>
7013
7014 * output.cc (Output_section::add_input_section): Delay fill
7015 generation for section ordering.
7016
b578bd7d
ILT
70172011-02-09 Ian Lance Taylor <iant@google.com>
7018
7019 PR gold/12316
7020 * object.h (class Sized_relobj): Remove clear_local_symbols.
7021 * reloc.cc (Sized_relobj::do_relocate): Don't call
7022 clear_local_symbols.
7023
9370ce59 70242011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7025
7026 * plugin.cc (is_visible_from_outside): Return true for symbols
7027 in the -u option.
7028
55382fb7
ILT
70292011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7030
7031 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7032 filename.
7033
4e271fff
ST
70342011-02-02 Sriraman Tallam <tmsriram@google.com>
7035
7036 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7037 to std::string.
4e271fff 7038 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7039 section_name to be std::string.
4e271fff
ST
7040 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7041
d433c3ac
ILT
70422011-01-25 Ian Lance Taylor <iant@google.com>
7043
7044 * script.cc (script_add_extern): Rewrite to use
7045 add_symbol_reference.
7046
880473a6
DK
70472011-01-25 Doug Kwan <dougkwan@google.com>
7048
d433c3ac 7049 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7050
f30f86fa
ILT
70512011-01-24 Ian Lance Taylor <iant@google.com>
7052
7053 * options.h (class General_options): Accept
7054 --no-detect-odr-violations.
7055
8e51a0b9
ILT
70562011-01-24 Ian Lance Taylor <iant@google.com>
7057
7058 * version.cc (version_string): Bump to 1.11.
7059
0f3b89d8
ILT
70602011-01-24 Ian Lance Taylor <iant@google.com>
7061
7062 * plugin.cc (class Plugin_rescan): Define new class.
7063 (Plugin_manager::claim_file): Set any_claimed_.
7064 (Plugin_manager::save_archive): New function.
7065 (Plugin_manager::save_input_group): New function.
7066 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7067 necessary.
7068 (Plugin_manager::new_undefined_symbol): New function.
7069 (Plugin_manager::rescan): New function.
7070 (Plugin_manager::rescannable_defines): New function.
7071 (Plugin_manager::add_input_file): Set any_added_.
7072 * plugin.h (class Plugin_manager): define new fields rescannable_,
7073 undefined_symbols_, any_claimed_, and any_added_. Declare
7074 Plugin_rescan as friend. Declare new functions.
7075 (Plugin_manager::Rescannable): Define type.
7076 (Plugin_manager::Rescannable_list): Define type.
7077 (Plugin_manager::Undefined_symbol_list): Define type.
7078 (Plugin_manager::Plugin_manager): Initialize new fields.
7079 * archive.cc (Archive::defines_symbol): New function.
7080 (Add_archive_symbols::run): Pass archive to plugins if any.
7081 * archive.h (class Archive): Declare defines_symbol.
7082 * readsyms.cc (Input_group::~Input_group): New function.
7083 (Finish_group::run): Pass input_group to plugins if any.
7084 * readsyms.h (class Input_group): Declare destructor.
7085 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7086 any.
7087
3bb951e5
ILT
70882011-01-10 Ian Lance Taylor <iant@google.com>
7089
7090 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7091 section as relro.
7092 (Layout::set_segment_offsets): Reset increase_relro before calling
7093 set_section_addresses a second time.
7094
0aa45fac
CC
70952011-01-04 Cary Coutant <ccoutant@google.com>
7096
7097 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7098 sections before NOBITS sections.
7099
0db46eb4
L
71002011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7101
7102 * version.cc (print_version): Update copyright to 2011.
7103
829c9745
CC
71042010-12-23 Cary Coutant <ccoutant@google.com>
7105
7106 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7107 of OS to this->add. Add OD parameter to second form of the function.
7108
7500420b
ILT
71092010-12-20 Ian Lance Taylor <iant@google.com>
7110
7111 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7112 second of two consecutive entries with same offset.
7113
f8e9a930
RW
71142010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7115
7116 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7117 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7118 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7119 to avoid unneeded links against $(LDADD).
7120 * testsuite/Makefile.in: Regenerate.
7121
2fbb4320
ILT
71222010-12-15 Ian Lance Taylor <iant@google.com>
7123
7124 PR gold/12324
7125 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7126 for R_X86_64_32 and R_X86_64_PC32.
7127 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7128 ver_matching_def_pic.o.
7129 (ver_matching_def_pic.o): New target.
7130
fedb228d
RW
71312010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7132
7133 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7134 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7135 Move definition before File_read::View member definitions.
7136 (File_read::View::~View): Initialize and hold lock before
7137 updating current_mapped_bytes.
7138
9b547ce6
RW
71392010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7140
7141 * dwarf_reader.cc: Remove outdated comment.
7142 * gold-threads.cc: Fix typo in error message.
7143 * archive.cc: Fix typos in comments.
7144 * archive.h: Likewise.
7145 * arm-reloc-property.cc: Likewise.
7146 * arm-reloc-property.h: Likewise.
7147 * arm-reloc.def: Likewise.
7148 * arm.cc: Likewise.
7149 * attributes.h: Likewise.
7150 * cref.cc: Likewise.
7151 * ehframe.cc: Likewise.
7152 * fileread.h: Likewise.
7153 * gold.h: Likewise.
7154 * i386.cc: Likewise.
7155 * icf.cc: Likewise.
7156 * incremental.h: Likewise.
7157 * int_encoding.cc: Likewise.
7158 * layout.h: Likewise.
7159 * main.cc: Likewise.
7160 * merge.h: Likewise.
7161 * object.cc: Likewise.
7162 * object.h: Likewise.
7163 * options.cc: Likewise.
7164 * readsyms.cc: Likewise.
7165 * reduced_debug_output.cc: Likewise.
7166 * reloc.cc: Likewise.
7167 * script-sections.cc: Likewise.
7168 * sparc.cc: Likewise.
7169 * symtab.h: Likewise.
7170 * target-reloc.h: Likewise.
7171 * target.cc: Likewise.
7172 * target.h: Likewise.
7173 * timer.cc: Likewise.
7174 * timer.h: Likewise.
7175 * x86_64.cc: Likewise.
7176
83e17bd5
CC
71772010-12-09 Cary Coutant <ccoutant@google.com>
7178
7179 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7180 stack.
7181 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7182 parameter; change all callers.
7183 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7184 * options.h (warn_execstack): New option.
7185
017257f8
DK
71862010-12-07 Doug Kwan <dougkwan@google.com>
7187
7188 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7189 like function call relocations.
7190
c20cbc06
ILT
71912010-12-07 Ian Lance Taylor <iant@google.com>
7192
7193 * archive.cc (Archive::get_elf_object_for_member): Permit
7194 punconfigured to be NULL.
7195 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7196 (Archive::include_member): Pass NULL to get_elf_object_for_member
7197 if we searched for the archive and this is the first included
7198 object.
7199
4dbfafcc
ILT
72002010-12-01 Ian Lance Taylor <iant@google.com>
7201
7202 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7203 track_relocs_type_ field.
7204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7205 Set track_relocs_type_.
7206 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7207 contents when using RELA relocs.
7208 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7209 reloc_map_.
7210 * reloc.cc (Track_relocs::next_addend): New function.
7211 * reloc.h (class Track_relocs): Declare next_addend.
7212
e5e19edd
ILT
72132010-12-01 Ian Lance Taylor <iant@google.com>
7214
7215 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7216 virtual destructor.
7217
9a5ce24c
ILT
72182010-12-01 Ian Lance Taylor <iant@google.com>
7219
7220 * README: Update compilers known to work and fail.
7221
c7791212
NC
72222010-11-23 Matthias Klose <doko@ubuntu.com>
7223
7224 * configure.in: For --enable-gold, handle value `default' instead of
7225 `both*'. Always install ld as ld.bfd, install as ld if gold is
7226 not the default.
7227 * configure: Regenerate.
7228
0ad220c9
DK
72292010-11-18 Doug Kwan <dougkwan@google.com>
7230
7231 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7232 and right_alignment to be zero. Store result alignment only if it is
7233 greater than existing alignment.
7234
ab8056e0
CC
72352010-11-16 Cary Coutant <ccoutant@google.com>
7236
7237 PR gold/12220
7238 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7239 Check for ".zdebug_line".
7240
fd064a5b
CC
72412010-11-16 Doug Kwan <dougkwan@google.com>
7242 Cary Coutant <ccoutant@google.com>
7243
7244 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7245 by reference; adjust all callers.
7246 * output.cc (Output_segment::set_section_addresses): Adjust references
7247 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7248 list is empty.
7249 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7250 end at page boundary.
7251
6fc6ea19
CC
72522010-11-16 Cary Coutant <ccoutant@google.com>
7253
7254 PR gold/12220
7255 * layout.cc (Layout::choose_output_section): Transform names of
7256 compressed sections even when using a script with a SECTIONS clause.
7257 (Layout::output_section_name): Remove code to transform
7258 compressed debug section names.
7259 * output.cc (Output_section::add_input_section): Use uncompressed
7260 section size when tracking input sections.
7261
95a2c8d6
RS
72622010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7263
7264 * symtab.h (Symbol::NON_PIC_REF): Remove.
7265 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7266 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7267 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7268 (Symbol::use_plt_offset): Take a flags argument and pass it
7269 directly to needs_dynamic_reloc. Restrict check for undefined
7270 weak symbols to function calls.
7271 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7272 (Target_arm::Scan::global): Use it.
7273 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7274 (Target_arm::Relocate::relocate): Likewise.
7275 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7276 parameter with an r_type parameter. Use get_reference_flags
7277 to get the flags.
7278 (Target_arm::Relocate::relocate): Update accordingly.
7279 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7280 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7281 (Target_i386::Scan::global): Likewise.
7282 (Target_i386::Relocate::relocate): Likewise.
7283 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7284 parameter with an r_type parameter. Use get_reference_flags
7285 to get the flags.
7286 (Target_i386::Relocate::relocate): Update accordingly.
7287 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7288 (Target_powerpc::Scan::global): Use it.
7289 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7290 (Target_powerpc::Relocate::relocate): Likewise.
7291 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7292 (Target_sparc::Scan::global): Use it.
7293 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7294 (Target_sparc::Relocate::relocate): Likewise.
7295 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7296 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7297 (Target_x86_64::Scan::global): Likewise.
7298 (Target_x86_64::Relocate::relocate): Likewise.
7299
f625ae50
DK
73002010-11-08 Doug Kwan <dougkwan@google.com>
7301 Cary Coutant <ccoutant@google.com>
7302
7303 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7304 (Arm_exidx_merge_section::section_contents_): New data member.
7305 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7306 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7307 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7308 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7309 in parameters instead of calling Object::section_contents without
7310 locking.
7311 (Arm_output_section::group_section): New parameter TASK. Pass it
7312 to callees that need locking objects.
7313 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7314 to lock EXIDX input sections. Fix a formatting issue. Call
7315 Arm_exidx_merged_section::build_contents to create merged section
7316 contents.
7317 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7318 to lock object of stub table owner.
7319 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7320 TEXT_SIZE to initialize data member TEXT_SIZE_.
7321 (Arm_exidx_input_section::addralign): Fix typo in comment.
7322 (Arm_exidx_input_section::text_size): New method.
7323 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7324 that require locking objects. Lock objects before scanning for stubs
7325 and updating local symbols.
7326 (Arm_input_section<big_endian>::init): Copy contents of original
7327 input section.
2e702c99 7328 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7329 original input section instead of calling Object::section_contents
7330 without locking.
7331 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7332 size without calling Object::section_size().
7333 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7334 for size. Allocate a buffer for merged EXIDX entries.
7335 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7336 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7337 building code to Arm_exidx_merged_section::build_contetns. Write
7338 out contetns in buffer instead of building it on the fly.
7339 (Arm_relobj::make_exidx_input_section): Also pass text section size
7340 to Arm_exidx_input_section constructor.
7341 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7342 (Arm_dynobj::do_read_symbols): Fix memory leak.
7343 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7344 * target.h: (class Task): Add forward declaration.
7345 (Target::relax): Add new parameter TASK and pass it to
7346 Target::do_relax().
7347 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7348
5f9bcf58
CC
73492010-11-05 Cary Coutant <ccoutant@google.com>
7350
7351 PR gold/10708
7352 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7353 object when reading from the file.
7354 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7355 second layout pass.
7356 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7357 when reading section contents.
7358 (get_section_contents): Likewise.
7359 (icf::find_identical_sections): Likewise.
7360 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7361 object when reading from the file.
7362 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7363 the object when doing deferred section layout.
7364
e597fa08
NC
73652010-11-03 Nick Clifton <nickc@redhat.com>
7366
7367 PR gold/12001
7368 * script.h (class Symbol_assignment: name): New member. Returns
7369 the name of the symbol.
7370 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7371 Returns true if the given symbol name is on the list of
7372 assignments wating to be processed.
7373 * archive.cc (should_incldue_member): If the symbol is undefined,
7374 check to see if it is on the list of symbols pending assignment.
7375
3f9a3278
ILT
73762010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7377
7378 * script-sections.cc (Script_sections::find_memory_region): Check
7379 for a NULL output section pointer.
7380
d06fb4d1
DK
73812010-10-29 Doug Kwan <dougkwan@google.com>
7382
7383 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7384 Output_section::add_relaxed_input_section.
7385 * output.cc (Output_section::add_relaxed_input_section): Add new
7386 arguments LAYOUT and NAME. Set section order index.
7387 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7388 Copy section order index.
7389 * output.h (Output_section::add_relaxed_input_section): Add new
7390 arguments LAYOUT and NAME.
7391
90e24de5
ILT
73922010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7393
7394 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7395 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7396 * testsuite/Makefile.in: Regenerate.
7397
c9484ea5
DK
73982010-10-20 Doug Kwan <dougkwan@google.com>
7399
7400 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7401 without SHF_LINK_ORDER flags.
7402 * layout.cc (Layout::choose_output_section): Do not filter
7403 SHF_LINK_ORDER flag in a relocatable link.
7404
5bc2f5be
CC
74052010-10-17 Cary Coutant <ccoutant@google.com>
7406
7407 * output.h (Output_segment::set_section_addresses): Change function
7408 signature. Update all callers.
7409 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7410 sections.
7411 (Output_segment::set_section_addresses): Align after last TLS
7412 section. Add padding before last relro section instead of after.
7413
0c91cf04
DK
74142010-10-17 Doug Kwan <dougkwan@google.com>
7415
7416 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7417 GOT output section to be writable.
7418
8c21d9d3
CC
74192010-10-14 Cary Coutant <ccoutant@google.com>
7420
7421 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7422 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7423 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7424 mode.
7425 * incremental.cc (report_command_line): Ignore all forms of
7426 --incremental.
7427 * layout.cc (Layout::Layout): Check parameters for incremental link
7428 mode.
7429 * options.cc (General_options::parse_incremental): New function.
7430 (General_options::parse_no_incremental): New function.
7431 (General_options::parse_incremental_full): New function.
7432 (General_options::parse_incremental_update): New function.
7433 (General_options::incremental_mode_): New data member.
7434 (General_options::finalize): Check incremental_mode_.
7435 * options.h (General_options): Update help text for --incremental.
7436 Add --no-incremental, --incremental-full, --incremental-update.
7437 (General_options::Incremental_mode): New enum type.
7438 (General_options::incremental_mode): New function.
7439 (General_options::incremental_mode_): New data member.
7440 * parameters.cc (Parameters::incremental_mode_): New data member.
7441 (Parameters::set_options): Set incremental_mode_.
7442 (Parameters::set_incremental_full): New function.
7443 (Parameters::incremental): New function.
7444 (Parameters::incremental_update): New function.
7445 (set_parameters_incremental_full): New function.
7446 * parameters.h (Parameters::set_incremental_full): New function.
7447 (Parameters::incremental): New function.
7448 (Parameters::incremental_update): New function.
7449 (Parameters::incremental_mode_): New data member.
7450 (set_parameters_incremental_full): New function.
7451 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7452 incremental link mode.
7453 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7454 (Sized_relobj::do_relocate_sections): Likewise.
7455 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7456 option.
7457 * testsuite/Makefile.in: Regenerate.
7458 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7459
bb32aa18 74602010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7461
7462 * script-sections.h (class Script_sections): Make
7463 Sections_elements typedef public.
7464 * script-sections.cc (class Sort_output_sections): Add elements_
7465 field. Add constructor which sets it; change all callers.
7466 (Sort_output_sections::is_before): New function.
7467 (Sort_output_sections::operator()): Call is_before.
7468 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7469 conditional.
7470 * testsuite/script_test_10.sh: New test. Test script section
7471 order.
7472 * testsuite/script_test_10.t: Likewise.
7473 * testsuite/script_test_10.s: Likewise.
7474 * testsuite/Makefile.am: Wrap the cross linker tests and the
7475 common tests into NATIVE_OR_CROSS_LINKER.
7476 (check_SCRIPTS): Add script_test_10.sh.
7477 (check_DATA): Add script_test_10.stdout.
7478 (script_test_10.o, script_test_10): New targets.
7479 (script_test_10.stdout): New target.
7480 * configure, testsuite/Makefile.in: Regenerate.
7481
3cef7179
ILT
74822010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7483
7484 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7485 error for the deprecated relocations.
7486 (Target_arm::Scan::global): Likewise.
7487 (Target_arm::Relocate::relocate): Likewise.
7488
7411e9a8
RS
74892010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7490
7491 * fileread.cc (Input_file::find_file): Initialize *found_name
7492 and *namep when using the fallback search for case 4.
7493
6a9da32a
CC
74942010-10-11 Cary Coutant <ccoutant@google.com>
7495
7496 * options.h (class General_options): Redefine -z lazy as an alias for
7497 the negation of -z now.
7498
ac897c20
ILT
74992010-10-11 Ian Lance Taylor <iant@google.com>
7500
7501 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7502 binding.
7503
ea5cae92
NC
75042010-10-06 Nick Clifton <nickc@redhat.com>
7505
7506 * script-sections.cc(class Memory_region): Remove
7507 current_lma_offset_ field. Rename current_vma_offset_ to
7508 current_offset_. Add last_section_ field.
7509 (Memory_region::get_current_vma_address): Rename to
7510 get_current_address.
7511 (Memory_region::get_current_lma_address): Delete.
7512 (Memory_region::increment_vma_offset): Rename to
7513 increment_offset.
7514 (Memory_region::increment_lma_offset): Delete.
7515 (Memory_region::attributes_compatible): New method. Returns
7516 true if the provided section is compatible with the region.
7517 (Memory_region::get_last_section): New method. Returns the last
7518 section to use the region.
7519 (Memory_region::set_last_section): New method. Stores the last
7520 section to use the region.
7521 (Script_sections::block_in_region): New method. Returns true if
7522 a block of memory is contained within a region.
7523 (Script_sections::find_memory_region): New method. Locates a
7524 memory region to be used to set a VMA or LMA address.
7525 (Output_section_definition::set_section_addresses): Add code to
7526 check for addresses set by memory regions.
7527 (Output_segment::set_section_addresses): Remove memory region
7528 walking code.
7529 (Script_sections::create_segment): Add a warning if a header
7530 segment is created outside of any region.
7531 * script-sections.h (class Script_sections): Add prototypes for
7532 find_memory_region and block_in_region methods.
7533 * testsuite/memory_test.s: Use .long instead of .word.
7534 * testsuite/memory_test.t: Add some more output sections.
7535 * testsuite/memory_test.sh: Update expected output.
7536
a9bfd952
DK
75372010-10-02 Doug Kwan <dougkwan@google.com>
7538
7539 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7540 defintion to symtab.h
7541 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7542 declaration to defintion.
7543
bacff3ab
NC
75442010-10-01 Nick Clifton <nickc@redhat.com>
7545
7546 * expression.cc (eval): Replace dummy argument with NULL.
7547 (eval_maybe_dot): Check for a NULL result section pointer.
7548 (Symbol_expression::value): Likewise.
7549 (Dot_expression::value): Likewise.
7550 (BINARY_EXPRESSION): Likewise.
7551 (Max_expression::value): Likewise.
7552 (Min_expression::value): Likewise.
7553 (Absolute_expression::value): Likewise.
7554 (Addr_expression::value_from_output_section): Likewise.
7555 (Loaddddr_expression::value_from_output_section): Likewise.
7556 (Segment_start_expression::value): Likewise.
7557 * script-sections.cc
7558 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7559 argument with NULL.
7560 (Sections_elememt_dot_assignment::set_section_addresses):
7561 Likewise.
7562 (Output_data_expression::do_write_to_buffer): Likewise.
7563 (Output_section_definition::finalize_symbols): Likewise.
7564 (Output_section_definition::set_section_addresses): Likewise.
7565
f81bc8b5
DK
75662010-09-30 Doug Kwan <dougkwan@google.com>
7567
7568 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7569
c95e9f27
ST
75702010-09-28 Sriraman Tallam <tmsriram@google.com>
7571
7572 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7573 function.
c95e9f27
ST
7574 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7575 virtual function.
7576 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7577 virtual function.
7578 * icf.cc (get_section_contents): Inline merge sections only when
7579 target allows it.
7580
3cac54d2
RW
75812010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7582
7583 * configure: Regenerate.
7584
2904037a
ILT
75852010-09-17 Ian Lance Taylor <iant@google.com>
7586
7587 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7588 * testsuite/Makefile.am (memory_test.o): New target.
7589 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7590 memory_test.t.
7591 * testsuite/Makefile.in: Rebuild.
2904037a 7592
bca7fb63
DK
75932010-09-17 Doug Kwan <dougkwan@google.com>
7594
7595 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7596 defintion if relocation uses GOT entries of the symbol.
7597 * testsuite/icf_safe_test.sh: Fix test.
7598 * testsuite/icf_safe_so_test.sh: Fix test.
7599
4ef28648
CC
76002010-09-16 Cary Coutant <ccoutant@google.com>
7601
7602 * script_sections.cc (class Memory_region): Remove "NULL" from
7603 vector initializations.
7604
793990de
CC
76052010-09-15 Cary Coutant <ccoutant@google.com>
7606
7607 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7608 Resolve forwarding symbols.
7609
81e015e2
DK
76102010-09-15 Doug Kwan <dougkwan@google.com>
7611
7612 * gold/testsuite/script_test_3.t: Add ARM special sections.
7613 * gold/testsuite/script_test_4.t: Same.
7614 * gold/testsuite/script_test_5.t: Same.
7615 * gold/testsuite/script_test_6.t: Same.
7616 * gold/testsuite/script_test_7.t: Same.
7617 * gold/testsuite/script_test_7.t: Same.
7618 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7619
36171d64
CC
76202010-09-14 Cary Coutant <ccoutant@google.com>
7621
7622 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7623 (Target_x86_64::Relocate::relocate_tls): Replace check for
7624 saw_tls_block_reloc_ with test for executable section.
7625
d89051bd
CC
76262010-09-12 Cary Coutant <ccoutant@google.com>
7627
7628 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7629 position-independent executables to shared libraries need dynamic
7630 relocations.
7631 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7632 position-independent executables.
7633 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7634 * testsuite/Makefile.in: Regenerate.
7635
fca41f0f
NC
76362010-09-10 Nick Clifton <nickc@redhat.com>
7637
7638 PR gold/11997
7639 * testsuite/memory_test.t: Discard any sections that are not
7640 needed.
7641
6695e4b3
L
76422010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7643
7644 PR gold/11996
7645 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7646 "This::" to work around a bug in gcc 4.2.
7647
7648 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7649
0f72bf6f
RÁE
76502010-09-09 Rafael Espindola <espindola@google.com>
7651
7652 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7653 sections with different PF_X flags in the same segment.
7654 (Layout::find_first_load_seg): Search all segments to find the first
7655 one.
7656 * options.h (rosegment): New.
7657
76582010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7659
05a79166 7660 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7661
aa98ff75
DK
76622010-09-08 Doug Kwan <dougkwan@google.com>
7663
7664 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7665 (Arm_relobj::do_relocate_sections): Add new parameter for output
7666 file to match the parent.
7667 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7668 of local symbols instead of input values. Update code to track
7669 changes in gold::relocate_section.
7670 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7671 (Sized_relobj::compute_final_local_value_internal): New methods.
7672 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7673 body into private version of Sized_relobj::compute_final_local_value.
7674 Call the inline method.
7675 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7676 merged symbol value if there is one.
7677 (Symbol_value::has_output_value): New method defintiion.
7678 (Sized_relobj::Compute_final_local_value_status): New enum type.
7679 (Sized_relobj::compute_final_local_value): New methods.
7680 (Sized_relobj::compute_final_local_value_internal): New methods.
7681 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7682 and arm_cortex_a8.sh.
7683 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7684 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7685 New tests.
7686 * Makefile.in: Regenerate.
7687 * testsuite/arm_bl_out_of_range.s: Update test.
7688 * testsuite/thumb_bl_out_of_range.s: Ditto.
7689 * testsuite/thumb_blx_out_of_range.s: Ditto.
7690 * testsuite/arm_branch_out_of_range.sh: New file.
7691 * testsuite/arm_cortex_a8.sh: Ditto.
7692 * testsuite/arm_cortex_a8_b.s: Ditto.
7693 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7694 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7695 * testsuite/arm_cortex_a8_bl.s: Ditto.
7696 * testsuite/arm_cortex_a8_blx.s: Ditto.
7697 * testsuite/arm_cortex_a8_local.s: Ditto.
7698 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7699 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7700
05a79166
L
77012010-09-08 Rafael Espindola <espindola@google.com>
7702
7703 * Makefile.am (memory_test.stdout): Run readelf with -W.
7704 * Makefile.in: Regenerate.
7705 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7706 64 bit output.
7707
33dbc701
RÁE
77082010-09-08 Rafael Espindola <espindola@google.com>
7709
7710 * script-sections.cc (Script_sections::add_memory_region): Convert
7711 field precision to int.
7712 * script.cc (script_set_section_region, script_set_section_region):
7713 Convert field precision to int.
7714
731ca54a
RÁE
77152010-09-08 Rafael Espindola <espindola@google.com>
7716
7717 * arm.cc (do_finalize_sections): Create the __exidx_start and
7718 __exdix_end symbols even when the section is missing.
7719
7f8cd844
NC
77202010-09-08 Nick Clifton <nickc@redhat.com>
7721
7722 * README: Remove claim that MEMORY is not supported.
7723 * expression.cc (script_exp_function_origin)
7724 (script_exp_function_length): Move from here to ...
7725 * script.cc: ... here.
7726 (script_set_section_region, script_add_memory)
7727 (script_parse_memory_attr, script_include_directive): New
7728 functions.
7729 * script-sections.cc
7730 (class Memory_region): New class.
7731 (class Output_section_definition): Add set_memory_region,
7732 set_section_vma, set_section_lma and get_section_name methods.
7733 (class Script_Sections): Add add_memory_region,
7734 find_memory_region, find_memory_region_origin,
7735 find_memory_region_length and set_memory_region methods.
7736 Have set_section_addresses method walk the list of set memory
7737 regions.
7738 Extend the print methos to display memory regions.
7739 * script-sections.h: Add prototypes for new methods.
7740 Add enum for MEMORY region attributes.
7741 * yyscript.y: Add support for parsing MEMORY regions.
7742 * script-c.h: Add prototypes for new functions.
7743 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7744 * testsuite/Makefile.in: Regenerate.
7745 * testsuite/memory_test.sh: New script.
7746 * testsuite/memory_test.s: New assembler source file.
7747 * testsuite/memory_test.t: New linker script.
7748
a4649286
DK
77492010-08-27 Doug Kwan <dougkwan@google.com>
7750
7751 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7752 reference override an existing dynamic weak reference.
7753 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7754 * testsuite/Makefile.in: Regenerate.
7755 * testsuite/dyn_weak_ref.sh: New file.
7756 * testsuite/dyn_weak_ref_1.c: Ditto.
7757 * testsuite/dyn_weak_ref_2.c: Ditto.
7758
b56648ad
ILT
77592010-08-27 Ian Lance Taylor <iant@google.com>
7760
7761 * incremental.h (class Incremental_input_entry): Add virtual
7762 destructor.
7763
809313cb
ILT
77642010-08-27 Ian Lance Taylor <iant@google.com>
7765
7766 * testsuite/start_lib_test_3.c: Mark t3 as used.
7767
11e32464
NC
77682010-08-27 Nick Clifton <nickc@redhat.com>
7769
7770 * options.cc (version_script): Fix small typo in previous
7771 whitespace tidyup.
7772
ca09d69a
NC
77732010-08-25 Nick Clifton <nickc@redhat.com>
7774
7775 * archive.cc: Formatting fixes: Remove whitespace between
7776 typename and following asterisk. Remove whitespace between
7777 function name and opening parenthesis.
7778 * archive.h: Likewise.
7779 * arm.cc: Likewise.
7780 * attributes.cc: Likewise.
7781 * attributes.h: Likewise.
7782 * common.cc: Likewise.
7783 * copy-relocs.cc: Likewise.
7784 * dirsearch.h: Likewise.
7785 * dynobj.cc: Likewise.
7786 * ehframe.cc: Likewise.
7787 * ehframe.h: Likewise.
7788 * expression.cc: Likewise.
7789 * fileread.cc: Likewise.
7790 * fileread.h: Likewise.
7791 * gc.h: Likewise.
7792 * gold-threads.cc: Likewise.
7793 * gold.cc: Likewise.
7794 * i386.cc: Likewise.
7795 * icf.h: Likewise.
7796 * incremental-dump.cc: Likewise.
7797 * incremental.cc: Likewise.
7798 * layout.cc: Likewise.
7799 * layout.h: Likewise.
7800 * main.cc: Likewise.
7801 * merge.cc: Likewise.
7802 * merge.h: Likewise.
7803 * object.cc: Likewise.
7804 * object.h: Likewise.
7805 * options.cc: Likewise.
7806 * options.h: Likewise.
7807 * output.cc: Likewise.
7808 * output.h: Likewise.
7809 * plugin.cc: Likewise.
7810 * plugin.h: Likewise.
7811 * powerpc.cc: Likewise.
7812 * reloc.cc: Likewise.
7813 * script-c.h: Likewise.
7814 * script-sections.cc: Likewise.
7815 * script.cc: Likewise.
7816 * stringpool.cc: Likewise.
7817 * symtab.cc: Likewise.
7818 * symtab.h: Likewise.
7819 * target.cc: Likewise.
7820 * timer.cc: Likewise.
7821 * timer.h: Likewise.
7822 * version.cc: Likewise.
7823 * x86_64.cc: Likewise.
7824
b8fa8750
NC
78252010-08-24 Nick Clifton <nickc@redhat.com>
7826
7827 PR 11899
7828 * layout.cc (segment_precedes): Sort segments by their physical
7829 addresses, if they have been set.
7830
9919d93b
CC
78312010-08-23 Cary Coutant <ccoutant@google.com>
7832
7833 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7834 symbols data.
7835 (Lib_group::include_member): Unlock object after deleting its
7836 symbols data.
7837 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7838 the bug fixed here.
7839
97b4be1c
CC
78402010-08-19 Neil Vachharajani <nvachhar@google.com>
7841 Cary Coutant <ccoutant@google.com>
7842
7843 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7844 constructor, and set_blocker.
7845 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7846 readsyms_blocker_.
7847 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7848 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7849 * testsuite/Makefile.am (start_lib_test): New test case.
7850 * testsuite/Makefile.in: Regenerate.
7851 * testsuite/start_lib_test_main.c: New file.
7852 * testsuite/start_lib_test_1.c: New file.
7853 * testsuite/start_lib_test_2.c: New file.
7854 * testsuite/start_lib_test_3.c: New file.
7855
dd0b1884
ILT
78562010-08-19 Ian Lance Taylor <iant@google.com>
7857
7858 * Makefile.in: Rebuild with automake 1.11.1.
7859 * aclocal.m4: Likewise.
7860 * testsuite/Makefile.in: Likewise.
7861
7223e9ca
ILT
78622010-08-19 Ian Lance Taylor <iant@google.com>
7863
7864 PR 10893
7865 * i386.cc (class Output_data_plt_i386): Update declarations.
7866 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7867 local_ifuncs_ fields.
7868 (Target_i386::do_plt_section_for_global): New function.
7869 (Target_i386::do_plt_section_for_local): New function.
7870 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7871 parameter; change all callers. Initialize global_ifuncs_ and
7872 local_ifuncs_. If doing a static link define __rel_iplt_start and
7873 __rel_iplt_end.
7874 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7875 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7876 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7877 symbols.
7878 (Target_i386::make_plt_section): New function, broken out of
7879 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7880 (Target_i386::make_plt_entry): Call make_plt_section.
7881 (Target_i386::make_local_ifunc_plt_entry): New function.
7882 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7883 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7884 R_386_IRELATIVE to switch.
7885 (Target_i386::Scan::global): Likewise.
7886 (Target_i386::Relocate::relocate): Likewise.
7887 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7888 switch.
7889 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7890 (Target_x86_64::do_plt_section_for_global): New function.
7891 (Target_x86_64::do_plt_section_for_local): New function.
7892 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7893 parameter; change all callers. If doing a static link define
7894 __rela_iplt_start and __rela_iplt_end.
7895 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7896 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7897 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7898 to point to .plt.
7899 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7900 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7901 switch.
7902 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7903 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7904 R_X86_64_IRELATIVE to switch.
7905 (Target_x86_64::Scan::global): Likewise.
7906 (Target_x86_64::Relocate::relocate): Likewise.
7907 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7908 switch.
7909 * target.h (class Target): Add plt_section_for_global and
7910 plt_section_for_local functions. Add do_plt_section_for_global
7911 and do_plt_section_for_local virtual functions.
7912 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7913 clarifying comments.
7914 (Symbol::use_plt_offset): Handle IFUNC symbol.
7915 * object.cc (Sized_relobj::Sized_relobj): Initialize
7916 local_plt_offsets_.
7917 (Sized_relobj::local_has_plt_offset): New function.
7918 (Sized_relobj::local_plt_offset): New function.
7919 (Sized_relobj::set_local_plt_offset): New function.
7920 (Sized_relobj::do_count): Handle IFUNC symbol.
7921 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7922 a bit away from input_shndx_ field. Add set_is_func_symbol and
7923 is_ifunc_symbol functions.
7924 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7925 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7926 local_plt_offsets_ field.
7927 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7928 * output.h (class Output_section_data): Add non-const
7929 output_section function.
7930 (class Output_data_got): Update declarations.
7931 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7932 Add use_plt_offset parameter to global and local constructors.
7933 Change all callers. Change local_sym_index_ field to 31 bits.
7934 Change GSYM_CODE and CONSTANT_CODE accordingly.
7935 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7936 doing a static link don't set sh_link field.
7937 (Output_data_got::Got_entry::write): Use PLT offset if
7938 appropriate.
7939 (Output_data_got::add_global_plt): New function.
7940 (Output_data_got::add_local_plt): New function.
7941 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7942 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7943 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7944 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7945 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7946 IFUNC conditional.
7947 * testsuite/ifunc-sel.h: New file.
7948 * testsuite/ifuncmain1.c: New file.
7949 * testsuite/ifuncmain1vis.c: New file.
7950 * testsuite/ifuncmod1.c: New file.
7951 * testsuite/ifuncdep2.c: New file.
7952 * testsuite/ifuncmain2.c: New file.
7953 * testsuite/ifuncmain3.c: New file.
7954 * testsuite/ifuncmod3.c: New file.
7955 * testsuite/ifuncmain4.c: New file.
7956 * testsuite/ifuncmain5.c: New file.
7957 * testsuite/ifuncmod5.c: New file.
7958 * testsuite/ifuncmain6pie.c: New file.
7959 * testsuite/ifuncmod6.c: New file.
7960 * testsuite/ifuncmain7.c: New file.
7961 * configure, testsuite/Makefile.in: Rebuild.
7962
56f75c03
ILT
79632010-08-18 Ian Lance Taylor <iant@google.com>
7964
7965 * incremental.cc
7966 (Output_section_incremental_inputs::write_input_files): Add cast
7967 to avoid signed/unsigned comparison warning.
7968 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7969
55455f89
CC
79702010-08-12 Cary Coutant <ccoutant@google.com>
7971
7972 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7973
e2054bcb
ILT
79742010-08-13 Ian Lance Taylor <iant@google.com>
7975
7976 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7977
74f67560
DK
79782010-08-12 Cary Coutant <ccoutant@google.com>
7979 Doug Kwan <dougkwan@google.com>
7980
7981 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7982 defintion overrides non-weak undef, remember that the original undef
7983 is not weak.
7984 * symtab.cc (Symbol_table::sized_write_global): For undef without
7985 an original weak binding, set binding to global in output.
7986 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7987 * testsuite/Makefile.in: Regenerate.
7988 * testsuite/strong_ref_weak_def.sh: New file.
7989 * testsuite/strong_ref_weak_def_1.c: Ditto.
7990 * testsuite/strong_ref_weak_def_2.c: Ditto.
7991
d1238d12
CC
79922010-08-12 Cary Coutant <ccoutant@google.com>
7993
7994 * testsuite/incremental_test.sh: Rewrite.
7995 * testsuite/incremental_test_1.c: Rewrite.
7996 * testsuite/incremental_test_2.c: Rewrite.
7997
0e70b911
CC
79982010-08-12 Cary Coutant <ccoutant@google.com>
7999
8000 * arm.cc (Target_arm::got_size): Add const.
8001 (Target_arm::got_entry_count): New function.
8002 (Target_arm::plt_entry_count): New function.
8003 (Target_arm::first_plt_entry_offset): New function.
8004 (Target_arm::plt_entry_size): New function.
8005 (Output_data_plt_arm::entry_count): New function.
8006 (Output_data_plt_arm::first_plt_entry_offset): New function.
8007 (Output_data_plt_arm::get_plt_entry_size): New function.
8008 * i386.cc (Target_i386::got_size): Add const.
8009 (Target_i386::got_entry_count): New function.
8010 (Target_i386::plt_entry_count): New function.
8011 (Target_i386::first_plt_entry_offset): New function.
8012 (Target_i386::plt_entry_size): New function.
8013 (Output_data_plt_i386::entry_count): New function.
8014 (Output_data_plt_i386::first_plt_entry_offset): New function.
8015 (Output_data_plt_i386::get_plt_entry_size): New function.
8016 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8017 find_incremental_inputs_sections. Dump incremental_got_plt section.
8018 * incremental.cc: Include target.h.
8019 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8020 parameter. Adjust all callers. Find incremental_got_plt section.
8021 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8022 section.
8023 (Output_section_incremental_inputs::set_final_data_size): Calculate
8024 size of incremental_got_plt section.
8025 (Output_section_incremental_inputs::do_write): Write the
8026 incremental_got_plt section.
8027 (Got_plt_view_info): New struct.
8028 (Local_got_offset_visitor): New class.
8029 (Global_got_offset_visitor): New class.
8030 (Global_symbol_visitor_got_plt): New class.
8031 (Output_section_incremental_inputs::write_got_plt): New function.
8032 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8033 Add parameter. Adjust all callers.
8034 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8035 (Incremental_inputs::got_plt_section): New function.
8036 (Incremental_inputs::got_plt_section_): New data member.
8037 (Incremental_got_plt_reader): New class.
8038 * layout.cc (Layout::create_incremental_info_sections): Add the
8039 incremental_got_plt section.
8040 * object.h (Got_offset_list::get_list): New function.
8041 (Got offset_list::for_all_got_offsets): New function.
8042 (Sized_relobj::local_got_offset_list): New function.
8043 * powerpc.cc (Target_powerpc::got_size): Add const.
8044 (Target_powerpc::got_entry_count): New function.
8045 (Target_powerpc::plt_entry_count): New function.
8046 (Target_powerpc::first_plt_entry_offset): New function.
8047 (Target_powerpc::plt_entry_size): New function.
8048 (Output_data_plt_powerpc::entry_count): New function.
8049 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8050 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8051 * sparc.cc (Target_sparc::got_size): Add const.
8052 (Target_sparc::got_entry_count): New function.
8053 (Target_sparc::plt_entry_count): New function.
8054 (Target_sparc::first_plt_entry_offset): New function.
8055 (Target_sparc::plt_entry_size): New function.
8056 (Output_data_plt_sparc::entry_count): New function.
8057 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8058 (Output_data_plt_sparc::get_plt_entry_size): New function.
8059 * symtab.h (Symbol::got_offset_list): New function.
8060 (Symbol_table::for_all_symbols): New function.
8061 * target.h (Sized_target::got_entry_count): New function.
8062 (Sized_target::plt_entry_count): New function.
8063 (Sized_target::plt_entry_size): New function.
8064 * x86_64.cc (Target_x86_64::got_size): Add const.
8065 (Target_x86_64::got_entry_count): New function.
8066 (Target_x86_64::plt_entry_count): New function.
8067 (Target_x86_64::first_plt_entry_offset): New function.
8068 (Target_x86_64::plt_entry_size): New function.
8069 (Output_data_plt_x86_64::entry_count): New function.
8070 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8071 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8072
09ec0418
CC
80732010-08-12 Cary Coutant <ccoutant@google.com>
8074
8075 * archive.cc: Include incremental.h.
8076 (Archive::Archive): Initialize incremental_info_.
8077 (Archive::include_member): Record archive members in incremental info.
8078 (Add_archive_symbols::run): Record begin and end of an archive in
8079 incremental info.
8080 (Lib_group::include_member): Record objects in incremental info.
8081 * archive.h (Incremental_archive_entry): Forward declaration.
8082 (Archive::set_incremental_info): New member function.
8083 (Archive::incremental_info): New member function.
8084 (Archive::Unused_symbol_iterator): New class.
8085 (Archive::unused_symbols_begin): New member function.
8086 (Archive::unused_symbols_end): New member function.
8087 (Archive::incremental_info_): New data member.
8088 * incremental-dump.cc (find_input_containing_global): New function.
8089 (dump_incremental_inputs): Dump new incremental info sections.
8090 * incremental.cc: Include symtab.h.
8091 (Output_section_incremental_inputs): New class.
8092 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8093 new incremental info sections.
8094 (Sized_incremental_binary::do_check_inputs): Likewise.
8095 (Incremental_inputs::report_archive): Remove.
8096 (Incremental_inputs::report_archive_begin): New function.
8097 (Incremental_inputs::report_archive_end): New function.
8098 (Incremental_inputs::report_object): New function.
8099 (Incremental_inputs::finalize_inputs): Remove.
8100 (Incremental_inputs::report_input_section): New function.
8101 (Incremental_inputs::report_script): Rewrite.
8102 (Incremental_inputs::finalize): Do nothing but finalize string table.
8103 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8104 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8105 (Incremental_inputs::create_data_sections): New function.
8106 (Incremental_inputs::relocs_entsize): New function.
8107 (Output_section_incremental_inputs::set_final_data_size): New function.
8108 (Output_section_incremental_inputs::do_write): New function.
8109 (Output_section_incremental_inputs::write_header): New function.
8110 (Output_section_incremental_inputs::write_input_files): New function.
8111 (Output_section_incremental_inputs::write_info_blocks): New function.
8112 (Output_section_incremental_inputs::write_symtab): New function.
8113 * incremental.h (Incremental_script_entry): Forward declaration.
8114 (Incremental_object_entry): Forward declaration.
8115 (Incremental_archive_entry): Forward declaration.
8116 (Incremental_inputs): Forward declaration.
8117 (Incremental_inputs_header_data): Remove.
8118 (Incremental_inputs_header): Remove.
8119 (Incremental_inputs_header_write): Remove.
8120 (Incremental_inputs_entry_data): Remove.
8121 (Incremental_inputs_entry): Remove.
8122 (Incremental_inputs_entry_write): Remove.
8123 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8124 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8125 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8126 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8127 Likewise.
8128 (Incremental_input_entry): New class.
8129 (Incremental_script_entry): New class.
8130 (Incremental_object_entry): New class.
8131 (Incremental_archive_entry): New class.
8132 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8133 (Incremental_inputs::report_inputs): Remove.
8134 (Incremental_inputs::report_archive): Remove.
8135 (Incremental_inputs::report_archive_begin): New function.
8136 (Incremental_inputs::report_archive_end): New function.
8137 (Incremental_inputs::report_object): Change prototype.
8138 (Incremental_inputs::report_input_section): New function.
8139 (Incremental_inputs::report_script): Change prototype.
8140 (Incremental_inputs::get_reloc_count): New function.
8141 (Incremental_inputs::set_reloc_count): New function.
8142 (Incremental_inputs::create_data_sections): New function.
8143 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8144 (Incremental_inputs::inputs_section): New function.
8145 (Incremental_inputs::symtab_section): New function.
8146 (Incremental_inputs::relocs_section): New function.
8147 (Incremental_inputs::get_stringpool): Add const.
8148 (Incremental_inputs::command_line): Add const.
8149 (Incremental_inputs::inputs): Remove.
8150 (Incremental_inputs::command_line_key): New function.
8151 (Incremental_inputs::input_file_count): New function.
8152 (Incremental_inputs::input_files): New function.
8153 (Incremental_inputs::relocs_entsize): New function.
8154 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8155 (Incremental_inputs::finalize_inputs): Remove.
8156 (Incremental_inputs::Input_info): Remove.
8157 (Incremental_inputs::lock_): Remove.
8158 (Incremental_inputs::inputs_): Change type.
8159 (Incremental_inputs::inputs_map_): Remove.
8160 (Incremental_inputs::current_object_entry_): New data member.
8161 (Incremental_inputs::inputs_section_): New data member.
8162 (Incremental_inputs::symtab_section_): New data member.
8163 (Incremental_inputs::relocs_section_): New data member.
8164 (Incremental_inputs::reloc_count_): New data member.
8165 (Incremental_inputs_reader): New class.
8166 (Incremental_symtab_reader): New class.
8167 (Incremental_relocs_reader): New class.
8168 * layout.cc (Layout::finalize): Move finalization of incremental info
8169 and creation of incremental info sections to follow finalization of
8170 symbol table. Set offsets for postprocessing sections.
8171 (Layout::create_incremental_info_sections): Call
8172 Incremental_inputs::create_data_sections. Add incremental symtab
8173 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8174 sections to layout after input sections.
8175 * layout.h (struct Timespec): Forward declaration.
8176 (Layout::incremental_inputs): Add const.
8177 (Layout::create_incremental_info_sections): Add parameter.
8178 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8179 * object.cc: Include incremental.h.
8180 (Relobj::finalize_incremental_relocs): New function.
8181 (Sized_relobj::do_layout): Record input sections in incremental info.
8182 * object.h (Object::output_section): New function.
8183 (Object::output_section_offset): Moved from Relobj.
8184 (Object::get_incremental_reloc_base): New function.
8185 (Object::get_incremental_reloc_count): New function.
8186 (Object::do_output_section): New function.
8187 (Object::do_output_section_offset): Moved from Relobj.
8188 (Object::do_get_incremental_reloc_base): New function.
8189 (Object::do_get_incremental_reloc_count): New function.
8190 (Object::Object): Initialize new data members.
8191 (Relobj::output_section): Renamed do_output_section and moved to
8192 protected.
8193 (Relobj::output_section_offset): Moved to Object.
8194 (Relobj::do_get_incremental_reloc_base): New function.
8195 (Relobj::do_get_incremental_reloc_count): New function.
8196 (Relobj::allocate_incremental_reloc_counts): New function.
8197 (Relobj::count_incremental_reloc): New function.
8198 (Relobj::finalize_incremental_relocs): New function.
8199 (Relobj::next_incremental_reloc_index): New function.
8200 (Relobj::reloc_counts_): New data member.
8201 (Relobj::reloc_bases_): New data member.
8202 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8203 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8204 (Sized_relobj::incremental_relocs_scan): New function.
8205 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8206 (Sized_relobj::incremental_relocs_write): New function.
8207 (Sized_relobj::incremental_relocs_write_reltype): New function.
8208 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8209 incremental link.
8210 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8211 archives and object files elsewhere.
8212 (Add_symbols::run): Report object files here.
8213 (Finish_group::run): Report end of archive at end of group.
8214 * reloc.cc: Include layout.h, incremental.h.
8215 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8216 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8217 (Sized_relobj::incremental_relocs_scan): New function.
8218 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8219 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8220 (Sized_relobj::incremental_relocs_write): New function.
8221 (Sized_relobj::incremental_relocs_write_reltype): New function.
8222 * script.cc (read_input_script): Rewrite test for incremental link.
8223 Change call to Incremental_inputs::report_script.
8224 * symtab.h (Symbol_table::first_global_index): New function.
8225 (Symbol_table::output_count): New function.
8226
ce0d1972
DK
82272010-08-12 Doug Kwan <dougkwan@google.com>
8228
8229 * arm.cc (Target_arm::merge_object_attributes): Check command line
8230 options --no-wchar-size-warning and --no-enum-size-warning.
8231 * options.h (General_options): Add ld-compatible options
8232 --no-enum-size-warning and --no-wchar-size-warning.
8233
6e5710ce
ILT
82342010-08-04 Ian Lance Taylor <iant@google.com>
8235
8236 * x86_64.cc (Target_x86_64::Scan::local): Use
8237 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8238 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8239 (Target_x86_64::Scan::global): Likewise.
8240 (Target_x86_64::Relocate::relocate): Likewise.
8241 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8242 Likewise.
8243
fef830db
CC
82442010-08-03 Cary Coutant <ccoutant@google.com>
8245
8246 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8247 to reserve space in merged_strings vector. Keep total input size
8248 for stats.
8249 (Output_merge_string::do_print_merge_stats): Print total input size.
8250 * merge.h (Output_merge_string): Add input_size_ field.
8251 * stringpool.cc (Stringpool_template::string_length): Move
8252 implementations out of Stringpool_template class and place in
8253 stringpool.h.
8254 * stringpool.h (string_length): Move out of Stringpool_template.
8255
1e3811b0
ILT
82562010-08-03 Ian Lance Taylor <iant@google.com>
8257
8258 PR 11712
8259 * layout.cc (relaxation_loop_body): If address of load segment is
8260 set, adjust address to include headers if possible.
8261
7af0c620
ILT
82622010-08-03 Ian Lance Taylor <iant@google.com>
8263
8264 * version.cc (version_string): Bump to 1.10.
8265
22f0da72
ILT
82662010-08-03 Ian Lance Taylor <iant@google.com>
8267
8268 PR 11805
8269 * layout.h (enum Output_section_order): Define.
8270 (class Layout): Update declarations.
8271 * layout.cc (Layout::get_output_section): Add order parameter.
8272 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8273 is_first_non_relro parameters. Change all callers.
8274 (Layout::choose_output_section): Likewise.
8275 (Layout::add_output_section_data): Likewise.
8276 (Layout::make_output_section): Likewise. Set order.
8277 (Layout::default_section_order): New function.
8278 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8279 * output.cc (Output_section::Output_section): Initialize order_.
8280 Don't initialize deleted fields.
8281 (Output_segment::Output_segment): Don't initialize deleted
8282 fields.
8283 (Output_segment::add_output_section_to_load): New function
8284 replacing add_output_section. Change all callers to call this or
8285 add_output_section_to_nonload.
8286 (Output_segment::add_output_section_to_nonload): New function.
8287 (Output_segment::remove_output_section): Rewrite.
8288 (Output_segment::add_initial_output_data): Likewise.
8289 (Output_segment::has_any_data_sections): Likewise.
8290 (Output_segment::is_first_section_relro): Likewise.
8291 (Output_segment::maximum_alignment): Likewise.
8292 (Output_segment::has_dynamic_reloc): New function replacing
8293 dynamic_reloc_count. Change all callers.
8294 (Output_segment::has_dynamic_reloc_list): New function replacing
8295 dynamic_reloc_count_list. Change all callers.
8296 (Output_segment::set_section_addresses): Rewrite.
8297 (Output_segment::set_offset): Rewrite.
8298 (Output_segment::find_first_and_last_list): Remove.
8299 (Output_segment::set_tls_offsets): Rewrite.
8300 (Output_segment::first_section_load_address): Likewise.
8301 (Output_segment::output_section_count): Likewise.
8302 (Output_segment::section_with_lowest_load_address): Likewise.
8303 (Output_segment::write_section_headers): Likewise.
8304 (Output_segment::print_sections_to_map): Likewise.
8305 * output.h (class Output_data): Remove dynamic_reloc_count_
8306 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8307 (Output_data::add_dynamic_reloc): Rewrite.
8308 (Output_data::has_dynamic_reloc): New function.
8309 (Output_data::dynamic_reloc_count): Remove.
8310 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8311 is_last_relro_, is_first_non_relro_, is_interp_,
8312 is_dynamic_linker_section_ fields. Add order and set_order
8313 functions. Remove is_relro_local, set_is_relro_local,
8314 is_last_relro, set_is_last_relro, is_first_non_relro,
8315 set_is_first_non_relro functions, is_interp, set_is_interp,
8316 is_dynamic_linker_section, and set_is_dynamic_linker_section
8317 functions.
8318 (class Output_segment): Change Output_data_list from std::list to
8319 std:;vector. Add output_lists_ field. Remove output_data_ and
8320 output_bss_ fields. Update declarations.
8321
3ff2ccb0
ILT
83222010-08-02 Ian Lance Taylor <iant@google.com>
8323
8324 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8325 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8326 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8327
88a4108b
ILT
83282010-08-02 Ian Lance Taylor <iant@google.com>
8329
8330 PR 11855
8331 * script.cc (Script_options::Script_options): Initialize
8332 symbol_definitions_ and symbol_references_.
8333 (Script_options::add_symbol_assignment): Update
8334 symbol_definitions_ and symbol_references_.
8335 (Script_options::add_symbol_reference): New function.
8336 (script_symbol): New function.
8337 * script.h (class Script_options): Add symbol_definitions_ and
8338 symbol_references_ fields.
8339 (Script_options::referenced_const_iterator): New type.
8340 (Script_options::referenced_begin): New function.
8341 (Script_options::referenced_end): New function.
8342 (Script_options::is_referenced): New function.
8343 (Script_options::any_unreferenced): New function.
8344 * script-c.h (script_symbol): Declare.
8345 * yyscript.y (exp): Call script_symbol.
8346 * symtab.cc: Include "script.h".
8347 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8348 Change all callers. Check symbols referenced by scripts.
8349 (Symbol_table::add_undefined_symbols_from_command_line): Add
8350 layout parameter. Change all callers.
8351 (Symbol_table::do_add_undefined_symbols_from_command_line):
8352 Likewise. Break out loop body. Check symbols referenced by
8353 scripts.
8354 (Symbol_table::add_undefined_symbol_from_command_line): New
8355 function broken out of
8356 do_add_undefined_symbols_from_command_line.
8357 * symtab.h (class Symbol_table): Update declarations.
8358 * archive.cc: Include "layout.h".
8359 (Archive::should_include_member): Add layout parameter. Change
8360 all callers. Check for symbol mentioned in expression.
8361 * archive.h (class Archive): Update declaration.
8362 * object.cc (Sized_relobj::do_should_include_member): Add layout
8363 parameter.
8364 * object.h (Object::should_include_member): Add layout parameter.
8365 Change all callers.
8366 (Object::do_should_include_member): Add layout parameter.
8367 (class Sized_relobj): Update declaration.
8368 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8369 parameter.
8370 * dynobj.h (class Sized_dynobj): Update declaration.
8371 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8372 layout parameter.
8373 * plugin.h (class Sized_pluginobj): Update declaration.
8374
5f1ab67a
ILT
83752010-08-02 Ian Lance Taylor <iant@google.com>
8376
8377 PR 11866
8378 * output.cc (Output_segment::set_offset): Search for the first and
8379 last sections rather than assuming that the list is in order.
8380 (Output_segment::find_first_and_last_list): New function.
8381 * output.h (class Output_segment): Update declarations.
8382 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8383 (relro_strip_test_SOURCES): New variable.
8384 (relro_strip_test_DEPENDENCIES): New variable.
8385 (relro_strip_test_LDFLAGS): New variable.
8386 (relro_strip_test_LDADD): New variable.
8387 (relro_strip_test.so): New target.
8388
a8df5856
ILT
83892010-08-02 Ian Lance Taylor <iant@google.com>
8390
8391 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8392 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8393 (Target_i386::got_tlsdesc_section): New function.
8394 (Target_i386::got_section): Create space for GOT entries for
8395 TLSDESC relocations.
8396 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8397 R_386_TLS_GOTDESC.
8398 (Target_i386::Scan::global): Likewise.
8399 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8400 using TLSDESC GOT.
8401 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8402 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8403 (Target_x86_64::got_tlsdesc_section): New function.
8404 (Target_x86_64::got_section): Create space for GOT entries for
8405 TLSDESC relocations.
8406 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8407 R_386_TLS_GOTDESC.
8408 (Target_x86_64::Scan::global): Likewise.
8409 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8410 using TLSDESC GOT.
8411
0c10a0a6
ILT
84122010-08-02 Ian Lance Taylor <iant@google.com>
8413
8414 * testsuite/final_layout.sh: Use dc to convert from hex to
8415 decimal.
8416
41cbeecc
ST
84172010-07-29 Sriraman Tallam <tmsriram@google.com>
8418
8419 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8420 paramter to the call to gold::gc_process_relocs.
8421 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8422 paramter to the call to gold::gc_process_relocs.
8423 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8424 parameter to the call to gold::gc_process_relocs.
8425 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8426 template parameter to the call to gold::gc_process_relocs.
8427 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8428 paramter to the call to gold::gc_process_relocs.
8429 * gc.h (get_embedded_addend_size): New function.
8430 (gc_process_relocs): Save the size of the reloc for use by ICF.
8431 * icf.cc (get_section_contents): Get the addend from the text section
8432 for SHT_REL relocation sections.
8433 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8434 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8435 * int_encoding.h (read_from_pointer): New overloaded function.
8436 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8437 * testsuite/icf_sht_rel_addend_test.sh: New file.
8438 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8439 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8440
6ea55b82
RW
84412010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8442
8443 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8444 * Makefile.in: Regenerate.
8445 * testsuite/Makefile.in: Regenerate.
8446
9691462b
ILT
84472010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8448
8449 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8450 * gold/testsuite/debug_msg.cc: Likewise.
8451 * gold/testsuite/odr_violation1.cc
8452 * gold/testsuite/odr_violation2.cc
8453
76897331
CC
84542010-07-21 Cary Coutant <ccoutant@google.com>
8455
8456 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8457 string, and length fields.
8458 (Output_merge_string::Merged_strings_list): New type.
8459 (Output_merge_string::Merged_strings_lists): New typedef.
8460 (Output_merge_string): Replace merged_strings_ with
8461 merged_strings_lists_.
8462 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8463 Merged_strings_list per input object and section. Don't store pointer
8464 to the string. Don't store length with each merged string entry.
8465 (Output_merge_string::finalize_merged_data): Loop over list of merged
8466 strings lists. Recompute length of each merged string.
8467
78384e8f
CC
84682010-07-15 Cary Coutant <ccoutant@google.com>
8469
8470 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8471 here.
8472
783659f9
ILT
84732010-07-14 Ian Lance Taylor <iant@google.com>
8474
8475 * descriptors.cc (Descriptors::open): Report correct name in error
8476 message.
8477
131687b4
DK
84782010-07-13 Doug Kwan <dougkwan@google.com>
8479
8480 * arm.cc (Arm_input_section::Arm_input_section): For a
8481 SHT_ARM_EXIDX section, always keeps the input sections.
8482 (Arm_input_section::set_exidx_section_link): New method.
8483 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8484 has_errors_ to false.
8485 (Arm_exidx_input_section::has_errors,
8486 Arm_exidx_input_section::set_has_errors): New methods.
8487 (Arm_exidx_input_section::has_errors_): New data member.
8488 (Arm_relobj::get_exidx_shndx_list): New method.
8489 (Arm_output_section::append_text_sections_to_list): Do not skip
8490 section without SHF_EXECINSTR.
8491 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8492 errors.
2e702c99 8493 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8494 section header. Make error messages more verbose. Check for
8495 a non-executable section linked to an EXIDX section.
8496 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8497 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8498 check that there is no deferred EXIDX section if we exit early.
8499 Instead of not making an EXIDX section in case of an error, make one
8500 and set the has_errors flag of it.
8501 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8502 in a relocatable link.
8503 (Target_arm::do_relax): Look for the EXIDX output section instead of
8504 assuming that it is called .ARM.exidx.
2e702c99 8505 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8506 section list. Do not check for SHF_EXECINSTR section flags but
8507 skip any input section with errors.
8508 * output.cc (Output_section::Output_section): Initialize
8509 always_keeps_input_sections_ to false.
8510 (Output_section::add_input_section): Check for
8511 always_keeps_input_sections_.
8512 * output.h (Output_section::always_keeps_input_sections,
8513 Output_section::set_always_keeps_input_sections): New methods.
8514 (Output_section::always_keeps_input_sections): New data member.
8515
69517287
RÁE
85162010-07-13 Rafael Espindola <espindola@google.com>
8517
8518 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8519 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8520
82742395
ILT
85212010-07-13 Philip Herron <herron.philip@googlemail.com>
8522 Ian Lance Taylor <iant@google.com>
8523
8524 * output.h (Output_section_lookup_maps::add_merge_section):
8525 Correct check of whether value was inserted.
8526 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8527 (Output_section_lookup_maps::add_relaxed_input_section):
8528 Likewise.
8529 * arm.cc (Target_arm::got_section): Remove used local os.
8530 * i386.cc (Target_i386::got_section): Likewise.
8531 * x86_64.cc (Target_x86_64::got_section): Likewise.
8532 * sparc.cc (Target_sparc::got_section): Likewise.
8533 (Target_sparc::relocate): Remove unused local have_got_offset.
8534 * powerpc.cc (Target_powerpc::relocate): Likewise.
8535
f2d707b5
ILT
85362010-07-13 Ian Lance Taylor <iant@google.com>
8537
241531d6
ILT
8538 * compressed_output.cc (zlib_decompress): Fix signature in
8539 !HAVE_ZLIB_H case.
8540
f2d707b5
ILT
8541 * archive.cc (Archive::include_member): Unlock an external member
8542 of a thin archive. Don't bother to delete an object we know is
8543 NULL.
8544
a2e47362
CC
85452010-07-12 Cary Coutant <ccoutant@google.com>
8546
8547 * compressed_output.cc (zlib_decompress): New function.
8548 (get_uncompressed_size): New function.
8549 (decompress_input_section): New function.
8550 * compressed_output.h (get_uncompressed_size): New function.
8551 (decompress_input_section): New function.
8552 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8553 Handle compressed debug sections.
8554 * layout.cc (is_compressed_debug_section): New function.
8555 (Layout::output_section_name): Map compressed section names to
8556 canonical names.
8557 * layout.h (is_compressed_debug_section): New function.
8558 (is_debug_info_section): Recognize compressed debug sections.
8559 * merge.cc: Include compressed_output.h.
8560 (Output_merge_data::do_add_input_section): Handle compressed
8561 debug sections.
8562 (Output_merge_string::do_add_input_section): Handle compressed
8563 debug sections.
8564 * object.cc: Include compressed_output.h.
8565 (Sized_relobj::Sized_relobj): Initialize new data members.
8566 (build_compressed_section_map): New function.
8567 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8568 * object.h (Object::section_is_compressed): New method.
8569 (Object::do_section_is_compressed): New method.
8570 (Sized_relobj::Compressed_section_map): New type.
8571 (Sized_relobj::do_section_is_compressed): New method.
8572 (Sized_relobj::compressed_sections_): New data member.
8573 * output.cc (Output_section::add_input_section): Handle compressed
8574 debug sections.
8575 * reloc.cc: Include compressed_output.h.
8576 (Sized_relobj::write_sections): Handle compressed debug sections.
8577
ce279a62
CC
85782010-07-08 Cary Coutant <ccoutant@google.com>
8579
8580 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8581 weak when resolving to a dynamic def.
8582 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8583 for weak undef/dynamic def cases. Adjust callers.
8584 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8585 undef_binding_weak_.
8586 (Symbol_table::sized_write_globals): Adjust symbol binding.
8587 (Symbol_table::sized_write_symbol): Add binding parameter.
8588 * symtab.h (Symbol::set_undef_binding): New method.
8589 (Symbol::is_undef_binding_weak): New method.
8590 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8591 (Symbol_table::should_override): Add new parameter.
8592 (Symbol_table::sized_write_symbol): Add new parameter.
8593
8594 * testsuite/weak_undef_file1.cc: Add new test case.
8595 * testsuite/weak_undef_file2.cc: Fix header comment.
8596 * testsuite/weak_undef_test.cc: Add new test case.
8597
b2286c10
DK
85982010-06-29 Doug Kwan <dougkwan@google.com>
8599
8600 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8601 Initialize USE_SYMBOL_.
8602 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8603 definition.
8604 (Arm_reloc_property::uses_symbol_): New data member declaration.
8605 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8606 uses symbol value and symbol is undefined but not weakly undefined.
8607
4802450a
RÁE
86082010-06-28 Rafael Espindola <espindola@google.com>
8609
8610 * plugin.cc (Plugin::load): Use dlerror.
8611
e5ca47ba
ILT
86122010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8613
8614 * symtab.cc (detect_odr_violations): When reporting an ODR
8615 violation, report an object where the symbol is defined.
8616
8a75a161
DK
86172010-06-25 Doug Kwan <dougkwan@google.com>
8618
8619 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8620 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8621 definition.
8622 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8623 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8624 target hook to detect function points.
8625 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8626 * icf.h (Icf::check_section_for_function_pointers): Change type of
8627 parameter SECTION_NAME to const reference to std::string. Use
8628 target hook to determine if section may have unsafe pointers.
8629 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8630 method definition.
8631
42218b9f
RÁE
86322010-06-21 Rafael Espindola <espindola@google.com>
8633
8634 * fileread.cc (Input_file::find_fie): New
8635 (Input_file::open): Use Input_file::find_fie.
8636 * fileread.h (Input_file::find_fie): New
8637 * plugin.cc (set_extra_library_path): New.
8638 (Plugin::load): Add set_extra_library_path to the transfer vector.
8639 (Plugin_manager::set_extra_library_path): New.
8640 (Plugin_manager::add_input_file): Use the extra search path if set.
8641 (set_extra_library_path(): New.
8642 * plugin.h (Plugin_manager): Add set_extra_library_path and
8643 extra_search_path_.
8644
a0506cca
CC
86452010-06-19 Cary Coutant <ccoutant@google.com>
8646
8647 * layout.cc (gdb_sections): Add .debug_types.
8648 (lines_only_debug_sections): Likewise.
8649
6508b958
RÁE
86502010-06-18 Rafael Espindola <espindola@google.com>
8651
8652 * plugin.cc (add_input_file,add_input_library)
8653 (Plugin_manager::add_input_file): Make filename arguments const.
8654 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8655 const.
8656
3e235302
DK
86572010-06-16 Doug Kwan <dougkwan@google.com>
8658
8659 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8660 .ARM.attributes section if we have not merged any input
8661 attributes sections.
8662
106e8a6c
DK
86632010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8664
8665 * arm.cc: Allow combining objects with no EABI version
8666 information.
8667
91ff43fe
RÁE
86682010-06-15 Rafael Espindola <espindola@google.com>
8669
8670 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8671
68ed838c
ILT
86722010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8673
8674 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8675 (struct iovec): Correct !HAVE_READV definition.
8676
f3a2388f
CC
86772010-06-10 Cary Coutant <ccoutant@google.com>
8678
8679 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8680 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8681 reloc sections.
8682 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8683
8684 PR 11683
8685 * symtab.h (Symbol::is_placeholder): New member function.
8686 * target-reloc.h (relocate_section): Check for placeholder symbols.
8687
8688 * testsuite/Makefile.am (plugin_test_8): New test.
8689 (plugin_test_9): New test.
8690 * testsuite/Makefile.in: Regenerate.
8691
e1df38aa
NC
86922010-06-09 Nick Clifton <nickc@redhat.com>
8693
8694 * yyscript.y (input_list_element): Allow strings prefixed with
8695 the '-' character. Treat these as libraries.
8696 * script.cc (script_add_library): New function. Adds a library
8697 specified by "-l<name>" found in an input script.
8698 * script-c.h: Add prototype for script_add_library.
8699
25bbe950
DK
87002010-06-07 Doug Kwan <dougkwan@google.com>
8701
8702 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8703 Restrict stub-group size to be within long conditional branch
8704 range when working around cortex-A8 erratum.
8705
0f32ea4c
ILT
87062010-06-07 Damien Diederen <dd@crosstwine.com>
8707
8708 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8709 #ifdef typo.
8710
8fe2a369
ST
87112010-06-03 Sriraman Tallam <tmsriram@google.com>
8712
8713 PR gold/11658
8714 * output.cc
8715 (Output_section::Input_section_sort_entry::compare_section_ordering):
8716 Change to return non-zero correctly.
8717 (Output_section::Input_section_sort_section_order_index_compare
8718 ::operator()): Change to fix ambiguity in comparisons.
8719
6e9ba2ca
ST
87202010-06-01 Sriraman Tallam <tmsriram@google.com>
8721
8722 * gold.h (is_wildcard_string): New function.
8723 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8724 (Layout::layout_eh_frame): Ditto.
8725 (Layout::find_section_order_index): New method.
8726 (Layout::read_layout_from_file): New method.
8727 * layout.h (Layout::find_section_order_index): New method.
8728 (Layout::read_layout_from_file): New method.
8729 (Layout::input_section_position_): New private member.
8730 (Layout::input_section_glob_): New private member.
8731 * main.cc (main): Call read_layout_from_file here.
8732 * options.h (--section-ordering-file): New option.
8733 * output.cc (Output_section::input_section_order_specified_): New
8734 member.
8735 (Output_section::Output_section): Initialize new member.
8736 (Output_section::add_input_section): Add new parameter.
8737 Keep input sections when --section-ordering-file is used.
8738 (Output_section::set_final_data_size): Sort input sections when
8739 section ordering file is specified.
8740 (Output_section::Input_section_sort_entry): Add new parameter.
8741 Check sorting type.
8742 (Output_section::Input_section_sort_entry::compare_section_ordering):
8743 New method.
8744 (Output_section::Input_section_sort_compare::operator()): Change to
8745 consider section_order_index.
8746 (Output_section::Input_section_sort_init_fini_compare::operator()):
8747 Change to consider section_order_index.
8748 (Output_section::Input_section_sort_section_order_index_compare
8749 ::operator()): New method.
8750 (Output_section::sort_attached_input_sections): Change to sort
8751 according to section order when specified.
e1df38aa
NC
8752 (Output_section::add_input_section<32, true>): Add new parameter.
8753 (Output_section::add_input_section<64, true>): Add new parameter.
8754 (Output_section::add_input_section<32, false>): Add new parameter.
8755 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8756 * output.h (Output_section::add_input_section): Add new parameter.
8757 (Output_section::input_section_order_specified): New
8758 method.
8759 (Output_section::set_input_section_order_specified): New method.
8760 (Input_section::Input_section): Initialize section_order_index_.
8761 (Input_section::section_order_index): New method.
8762 (Input_section::set_section_order_index): New method.
8763 (Input_section::section_order_index_): New member.
8764 (Input_section::Input_section_sort_section_order_index_compare): New
8765 struct.
8766 (Output_section::input_section_order_specified_): New member.
8767 * script-sections.cc (is_wildcard_string): Delete and move modified
8768 method to gold.h.
8769 (Output_section_element_input::Output_section_element_input): Modify
8770 call to is_wildcard_string.
8771 (Output_section_element_input::Input_section_pattern
8772 ::Input_section_pattern): Ditto.
8773 (Output_section_element_input::Output_section_element_input): Ditto.
8774 * testsuite/Makefile.am (final_layout): New test case.
8775 * testsuite/Makefile.in: Regenerate.
8776 * testsuite/final_layout.cc: New file.
8777 * testsuite/final_layout.sh: New file.
8778
3537c84b
RÁE
87792010-06-01 Rafael Espindola <espindola@google.com>
8780
8781 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8782
105b6afd
RÁE
87832010-06-01 Rafael Espindola <espindola@google.com>
8784
8785 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8786 visibility of symbols.
8787
29e11421
DK
87882010-05-27 Doug Kwan <dougkwan@google.com>
8789
8790 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8791 from start of output section instead of address for a local symbol
8792 in a merged or relaxed section when doing a relocatable link.
8793
5e0f337e
RÁE
87942010-05-26 Rafael Espindola <espindola@google.com>
8795
703d02da 8796 PR 11604
5e0f337e
RÁE
8797 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8798 adding sections the garbage collector removed.
8799 * gold/testsuite/Makefile.am: Add test.
8800 * gold/testsuite/Makefile.in: Regenerate.
8801 * gold/testsuite/plugin_test_7.sh: New.
8802 * gold/testsuite/plugin_test_7_1.c: New.
8803 * gold/testsuite/plugin_test_7_2.c: New.
8804
f4187277
RÁE
88052010-05-26 Rafael Espindola <espindola@google.com>
8806
8807 * script-sections.cc (Output_section_definition::set_section_addresses):
8808 Check for --section-start.
8809
5c388529
DK
88102010-05-26 Doug Kwan <dougkwan@google.com>
8811
8812 * arm.cc (Arm_scan_relocatable_relocs): New class.
8813 (Target_arm::relocate_special_relocatable): New method.
8814 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8815 (Arm_relocate_functions::thumb_branch_common): Same.
8816 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8817 instead of Default_scan_relocatable_relocs.
8818 * target-reloc.h (relocate_for_relocatable): Let target handle
8819 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8820 * target.h (Sized_target::relocate_special_relocatable): New method.
8821
bca1c3ae
ILT
88222010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8823
8824 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8825
0439c796
DK
88262010-05-23 Doug Kwan <dougkwan@google.com>
8827
8828 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8829 instead of a cast.
8830 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8831 with a direct branch, not a conditional branch, to a stub.
8832 * merge.cc (Output_merge_base::record_input_section): New method
8833 defintion.
8834 (Output_merge_data::do_add_input_section): Record input section if
8835 keeps-input-sections flag is set.
8836 (Output_merge_string::do_add_input_section): Ditto.
8837 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8838 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8839 INPUT_SECTIONS_.
8840 (Output_merge_base::keeps_input_sections,
8841 Output_merge_base::set_keeps_input_sections,
8842 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8843 method definitions.
8844 (Output_merge_base::Input_sections): New type declaration.
8845 (Output_merge_base::input_sections_begin,
8846 Output_merge_base::input_sections_end,
8847 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8848 (Output_merge_base::bool keeps_input_sections_,
8849 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8850 Output_merge_base::input_sections_): New data members.
8851 (Output_merge_data::do_set_keeps_input_sections): New method
8852 defintion.
8853 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8854 * output.cc (Output_section::Input_section::relobj): Move method
8855 defintion from class declaration to here and handle merge sections.
8856 (Output_section::Input_section::shndx): Ditto.
8857 (Output_section::Output_section): Remove initializations of removed
8858 data members and initialize new data member LOOKUP_MAPS_.
8859 (Output_section::add_input_section): Set keeps-input-sections flag
8860 for a newly created merge output section as appropriate. Adjust code
8861 to use Output_section_lookup_maps class.
8862 (Output_section::add_relaxed_input_section): Adjst code for lookup
8863 maps code refactoring.
2e702c99 8864 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8865 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8866 class. If adding input section to a newly created merge output
8867 section fails, remove the new merge section.
8868 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8869 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8870 (Output_section::find_merge_section): Ditto.
0439c796 8871 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8872 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8873 Output_section_lookup_maps class.
8874 (Output_section::get_input_sections): Export merge sections. Adjust
8875 code to use Output_section_lookup_maps class.
8876 (Output_section:::add_script_input_section): Adjust code to use
8877 Output_section_lookup_maps class. Update lookup maps for merge
8878 sections also.
8879 (Output_section::discard_states): Use Output_section_lookup_maps.
8880 (Output_section::restore_states): Same.
8881 * output.h (Merge_section_properties): Move class defintion out of
8882 Output_section.
8883 (Output_section_lookup_maps): New class.
8884 (Output_section::Input_section::is_merge_section): New method
8885 defintion.
8886 (Output_section::Input_section::relobj): Move defintion out of class
8887 defintion. Declare method only.
8888 (Output_section::Input_section::shndx): Ditto.
8889 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8890 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8891 (Output_section::Merge_section_by_properties_map,
8892 Output_section::Output_section_data_by_input_section_map,
8893 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8894 Remove types.
2e702c99 8895 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8896 KEEPS_INPUT_SECTIONS.
8897 (Output_section::build_lookup_maps): New method declaration.
8898 (Output_section::merge_section_map_,
8899 Output_section::merge_section_by_properties_map_,
8900 Output_section::relaxed_input_section_map_,
8901 Output_section::is_relaxed_input_section_map_valid_): Remove data
8902 members.
8903 (Output_section::lookup_maps_): New data member.
8904
76295588
L
89052010-05-21 Doug Kwan <dougkwan@google.com>
8906
8907 PR gold/11619
8908 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8909 avoid a compilation error.
8910
d103a984
RÁE
89112010-05-19 Rafael Espindola <espindola@google.com>
8912
8913 * script-sections.cc (Output_section_definition::allocate_to_segment):
8914 Update the phdrs_list even when the output section is NULL.
8915 * testsuite/Makefile.am: Add test.
8916 * testsuite/Makefile.in: Regenerate.
8917 * testsuite/script_test_9.cc: New.
8918 * testsuite/script_test_9.sh: New.
8919 * testsuite/script_test_9.t: New.
8920
6625d24e
DK
89212010-05-19 Doug Kwan <dougkwan@google.com>
8922
8923 * arm.cc (Arm_input_section::original_size): New method.
8924 (Arm_input_section::do_addralign): Add a cast.
8925 (Arm_input_section::do_output_offset): Remove static cast.
8926 (Arm_input_section::original_addralign,
8927 Arm_input_section::original_size_): Change type to uint32_t.
8928 (Arm_input_section::init): Add safe casts for section alignment
8929 and size.
8930 (Arm_input_section::set_final_data_size): Do not set address and
8931 offset of stub table.
8932 (Arm_output_section::fix_exidx_coverage): Change use of of
8933 Output_section::Simple_input_section to that of
8934 Output_section::Input_section.
8935 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8936 except for the first pass.
8937 * output.cc (Output_section::get_input_sections): Change type of
8938 input_sections to std::list<Input_section>.
8939 (Output_section::add_script_input_section): Rename from
8940 Output_section::add_simple_input_section. Change type of SIS
8941 parameter from Simple_input_section to Input_section.
8942 * output.h (Output_section::Simple_input_section): Remove class.
8943 (Output_section::Input_section): Change class visibility to public.
8944 (Output_section::Input_section::addralign): Use stored alignments
8945 for special input sections if set.
8946 (Output_section::Input_section::set_addralign): New method.
8947 (Output_section::get_input_sections): Change parameter type from
8948 list of Simple_input_section to list of Input_section.
8949 (Output_section::add_script_input_section): Rename from
8950 Output_section::add_simple_input_section. Change first parameter's
8951 type from Simple_input_section to Input_section and remove the
8952 second and third parameters.
8953 * script-sections.cc (Input_section::Input_section_list): Change
8954 type to list of Output_section::Input_section/
8955 (Input_section_info::Input_section_info): Change parameter type of
8956 INPUT_SECTION to Output_section::Input_section.
8957 (Input_section_info::input_section): Change return type.
8958 (Input_section_info::input_section_): Change type to
8959 Output_section::Input_section.
8960 (Output_section_element_input::set_section_addresses): Adjust code
8961 to use Output_section::Input_section instead of
8962 Output_section::Simple_input_section. Adjust code for renaming
8963 of Output_section::add_simple_input_section.
8964 (Orphan_output_section::set_section_addresses): Ditto.
8965
e1e82ea4
RW
89662010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8967
8968 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8969 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8970
91e75c8a
RÁE
89712010-05-18 Rafael Espindola <espindola@google.com>
8972
8973 * options.cc (General_options::finalize): Handle -nostdlib.
8974 * options.h (nostdlib): New option.
8975 * script.cc (script_add_search_dir): Handle -nostdlib.
8976
da59ad79
DK
89772010-05-12 Doug Kwan <dougkwan@google.com>
8978
8979 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8980 attributes section only if there no attributes section after merging.
8981 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8982 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8983 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8984 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8985 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8986 and arm_attr_merge_7.stdout.
8987 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8988 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8989 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8990 arm_attr_merge_7b.o): New rules.
8991 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8992 arm_attr_merge_7
8993 * testsuite/Makefile.in: Regenerate.
8994 * testsuite/arm_attr_merge.sh: New file.
8995 * testsuite/arm_attr_merge_[67][ab].s: Same.
8996
3e01a7fd
NC
89972010-05-05 Nick Clifton <nickc@redhat.com>
8998
8999 * po/es.po: Updated Spanish translation.
9000
7ad2014a
L
90012010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9002
9003 * Makefile.am (install-exec-local): Properly install gold as
9004 default cross linker.
9005 * Makefile.in: Regenerated.
9006
4fda8867
NC
90072010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9008 Nick Clifton <nickc@redhat.com>
9009
9010 * configure.ac (install_as_default): Define and set to false
9011 unless --enable-gold or --enable-gold=both/gold has been
9012 specified.
9013 * configure: Regenerate.
9014
9015 * Makefile.am (install-exec-local): Install the executable as
9016 'ld.gold'. If install_as_default is true then also install it as
9017 'ld'.
9018 * Makefile.in: Regenerated.
9019
bd288ea2
ILT
90202010-04-24 Ian Lance Taylor <iant@google.com>
9021
9022 * layout.cc (Layout::layout_reloc): In relocatable link don't
9023 combine reloc sections for grouped sections.
9024
ef38fd8a
ST
90252010-04-23 Sriraman Tallam <tmsriram@google.com>
9026
9027 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9028 sections that are not ordinary to icf.
9029 * icf.cc (get_section_contents): Handle relocation pointing to section
9030 with no object or shndx information.
9031 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9032 * testsuite/Makefile.in: Regenerate.
9033 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9034 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9035
f6973bdc
ILT
90362010-04-22 Ian Lance Taylor <iant@google.com>
9037
9038 * expression.cc (Expression::Expression_eval_info): Add
9039 result_alignment_pointer field.
9040 (Expression::eval_with_dot): Add result_alignment_pointer
9041 parameter. Change all callers.
9042 (Expression::eval_maybe_dot): Likewise.
9043 (class Binary_expression): Add alignment_pointer parameter to
9044 left_value and right_value. Change all callers.
9045 (BINARY_EXPRESSION): Set result alignment.
9046 (class Trinary_expression): Add alignment_pointer parameter to
9047 arg2_value and arg3_value. Change all callers.
9048 (Trinary_cond::value): Set result alignment.
9049 (Max_expression::value, Min_expression::value): Likewise.
9050 (Align_expression::value): Likewise.
9051 * script-sections.cc (class Sections_element): Add dot_alignment
9052 parameter to set_section_addresses virtual function. Update
9053 instantiations.
9054 (class Output_section_element): Likewise.
9055 (Script_sections::create_segments): Add dot_alignment parameter.
9056 Change all callers.
9057 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9058 (Script_sections::set_phdrs_clause_addresses): Likewise.
9059 * script-sections.h: Update declarations.
9060 * script.h: Update declarations.
9061 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9062 min_p_align.
9063 * testsuite/script_test_3.t: Set large alignment.
9064 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9065 segment has expected alignment.
9066
9c9c98a5
NC
90672010-04-22 Nick Clifton <nickc@redhat.com>
9068
9069 * po/gold.pot: Updated by the Translation project.
9070 * po/vi.po: Updated Vietnamese translation.
9071
2253bfba
L
90722010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9073
9074 * testsuite/Makefile.am (check_PROGRAMS): Add
9075 icf_virtual_function_folding_test.
9076 * testsuite/Makefile.in: Regenerated.
9077
85fdf906
AH
90782010-04-15 Andrew Haley <aph@redhat.com>
9079
9080 * options.h (merge_exidx_entries): New option.
9081 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9082 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9083 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9084 (Target_arm::merge_exidx_entries): New function.
9085 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9086 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9087 to Arm_exidx_fixup constructor.
9088 Add new arg, merge_exidx_entries.
9089 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9090 Arm_output_section::fix_exidx_coverage.
9091
ce97fa81
ST
90922010-04-18 Sriraman Tallam <tmsriram@google.com>
9093
9094 * icf.cc (get_section_contents): Check for preemptible functions.
9095 Ignore addend when appropriate.
9096 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9097 section folded.
9098 (add_from_relobj): Check for section folded.
9099 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9100 * symtab.h (should_add_dynsym_entry): Add new parameter.
9101 * target-reloc.h (scan_relocs): Check for section folded.
9102 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9103 Check reloc types for function pointers in shared objects.
9104 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9105 case.
9106 (icf_preemptible_functions_test): New test case.
9107 (icf_string_merge_test): New test case.
9108 * testsuite.Makefile.in: Regenerate.
9109 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9110 bar_glob. Refactor code.
9111 * testsuite/icf_preemptible_functions_test.cc: New file.
9112 * testsuite/icf_preemptible_functions_test.sh: New file.
9113 * testsuite/icf_string_merge_test.cc: New file.
9114 * testsuite/icf_string_merge_test.sh: New file.
9115 * testsuite/icf_virtual_function_folding_test.cc: New file.
9116 * testsuite/icf_virtual_function_folding_test.sh: New file.
9117
04ceb17c
DK
91182010-04-14 Doug Kwan <dougkwan@google.com>
9119
9120 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9121 for local symbol recounting if we remove a section due to ICF.
9122 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9123 there are no regular objects in input.
9124
153e7da4
DK
91252010-04-13 Doug Kwan <dougkwan@google.com>
9126
9127 * arm.cc (Arm_input_section::set_final_data_size): Compute
9128 accurate final data size instead of using current data size.
9129
4dbd9faf
DK
91302010-04-09 Doug Kwan <dougkwan@google.com>
9131
9132 * layout.cc (Layout::choose_output_section): Handle script section
9133 types.
9134 (Layout::make_output_section_for_script): Add section type parameter.
9135 Handle script section types.
9136 * layout.h (Layout::make_output_section_for_script): Add section
9137 type parameter.
9138 * output.cc (Output_section::Output_section): Initialize data member
9139 is_noload_.
9140 (Output_section::do_reset_address_and_file_offset): Do not set address
9141 to 0 if section is a NOLOAD section.
9142 * output.h (Output_section::is_noload): New method.
9143 (Output_section::set_is_noload): Ditto.
9144 (Output_section::is_noload_): New data member.
9145 * script-c.h (Script_section_type): New enum type.
9146 (struct Parser_output_section_header): Add new file section_type.
9147 * script-sections.cc (Sections_element::output_section_name): Add
9148 parameter for returning script section type.
9149 (Output_section_definition::output_section_name): Ditto.
9150 (Output_section_definition::section_type)P; New method.
9151 (Output_section_definiton::script_section_type_name): Ditto.
9152 (Output_section_definition::script_section_type_): New data member.
9153 (Output_section_definition::Output_section_definition): Initialize
9154 data member Output_section_definition::script_section_type_.
9155 (Output_section_definition::create_sections): Pass script section type
9156 to Layout::make_output_section_for_script.
9157 (Output_section_definition::output_section_name): Return script
9158 section type to caller.
9159 (Output_section_definition::set_section_address): Do not advance
9160 dot value and load address if section type is NOLOAD. Set address
9161 of NOLOAD sections regardless of section flags.
9162 (Output_section_definition::print): Print section type if it is
9163 not SCRIPT_SECTION_TYPE_NONE.
9164 (Output_section_definition::section_type): New method.
9165 (Output_section_definition::script_section_type_name): Ditto.
9166 (Script_sections::output_section_name): Add new parameter
9167 PSECTION_TYPE for returning script section type. Pass it to
9168 section elements. Handle discard sections.
9169 (Sort_output_sections::operator()): Handle NOLOAD sections.
9170 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9171 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9172 returning script section type.
9173 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9174 INFO and NOLOAD.
9175 * yyscript.y (union): Add new field SECTION_TYPE.
9176 (COPY, DSECT, INFO, NOLOAD): New tokens.
9177 (opt_address_and_section_type): Change type to output_section_header.
9178 (section_type): New non-terminal
9179 (section_header): Handle section type.
2253bfba 9180 (opt_address_and_section_type): Return section type value.
4dbd9faf 9181
721ea635
L
91822010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9183
9184 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9185 * testsuite/plugin_common_test_2.c (foo): Likewise.
9186
6bf924b0
DK
91872010-04-08 Doug Kwan <dougkwan@google.com>
9188
9189 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9190 Output_merge_data.
9191 * output.cc (Output_section::add_merge_input_section): Simplify
9192 code and return status of Output_merge_base::add_input_section.
e1df38aa 9193 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9194 returns true.
9195
24af6f92
DK
91962010-04-07 Doug Kwan <dougkwan@google.com>
9197
9198 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9199 if section is marked as containing instructions but has no mapping
9200 symbols.
9201 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9202 correct section index.
9203 (Arm_relobj::find_linked_text_section): Ditto.
9204
00698fc5
CC
92052010-04-07 Cary Coutant <ccoutant@google.com>
9206
9207 * archive.cc (include_member): Destroy Read_symbols_data object before
9208 releasing file.
9209 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9210 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9211 (Read_symbols_data::~Read_symbols_data) New destructor.
9212 (Section_relocs::Section_relocs) New constructor.
9213 (Section_relocs::~Section_relocs) New destructor.
9214 (Read_relocs_data::Read_relocs_data) New constructor.
9215 (Read_relocs_data::~Read_relocs_data) New destructor.
9216 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9217 pointers to NULL after deleting.
9218
7296d933
DK
92192010-04-07 Doug Kwan <dougkwan@google.com>
9220
9221 * arm.cc: Replace "endianity" with "endianness" in comments.
9222 (Arm_exidx_cantunwind): Ditto.
9223 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9224 (Arm_relobj::merge_flags_and_attributes): New method.
9225 (Arm_relobj::merge_flags_and_attributes_): New data member.
9226 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9227 (Arm_relobj::scan_sections_for_stubs): Ditto.
9228 (Arm_relobj::do_read_symbols): Check to see if we really want to
9229 merge processor-specific flags and attributes. Exit early if
9230 an object is empty except for section names and the undefined symbol.
9231 (Target_arm::do_finalize_sections): Move check for ELF format to
9232 Arm_relobj::do_read_symbols. Merge processor specific flags and
9233 attributes from a regular object only when we have determined that
9234 it is aapropriate. Do not create an .ARM.attributes section in
9235 output if there is no regular input object.
9236 (Target_arm::merge_processor_specific_flags): Check
9237 --warn-mismatch before printing any error.
9238 (Target_arm::merge_object_attributes): Ditto.
9239 * gold.cc (queue_middle_tasks): Handle the case in which there is
9240 no regular object in input.
9241 * options.cc (General_options::parse_EB): New method.
9242 (General_options::parse_EL): Same.
9243 (General_options::General_options): Initialize endianness_.
9244 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9245 New options.
9246 (General_options::Endianness): New enum.
9247 (General_options::endianness): New method.
9248 (General_options::endianness_): New data member.
9249 * parameters.cc (Parameters::set_options): Check target endianness.
9250 (Parameters::set_target_once): Ditto.
9251 (Parameters::check_target_endianness): New method.
9252 (parameters_force_valid_target): If either -EL or -EB is specified,
9253 use it to define endianness of default target.
9254 * parameters.h (Parameters::check_target_endianness): New method
9255 declaration.
9256 * target.h (class Target): Change "endianity" to "endianness"
9257 in comments.
9258
efc8d4f2
RW
92592010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9260
9261 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9262 * configure: Regenerate.
9263 * Makefile.in: Regenerate.
9264 * testsuite/Makefile.in: Regenerate.
9265
be234d88
CC
92662010-04-06 Cary Coutant <ccoutant@google.com>
9267
9268 gcc PR lto/42757
9269 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9270 prevailing definitions of common symbols.
9271 * testsuite/plugin_test_6.sh: New test case.
9272 * testsuite/plugin_common_test_1.c: New test case.
9273 * testsuite/plugin_common_test_2.c: New test case.
9274 * testsuite/Makefile.am (plugin_test_6): New test case.
9275 * testsuite/Makefile.in: Regenerate.
9276
bd32c6bd
NC
92772010-04-06 Nick Clifton <nickc@redhat.com>
9278
9279 * po/vi.po: New Vietnamese translation.
9280
323c532f
DK
92812010-03-30 Doug Kwan <dougkwan@google.com>
9282
9283 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9284
4fcd97eb
DK
92852010-03-25 Doug Kwan <dougkwan@google.com>
9286
9287 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9288 to avoid a conversion warning on a 32-bit host.
9289
4ebf39db
ILT
92902010-03-24 Ian Lance Taylor <iant@google.com>
9291
9292 * testsuite/script_test_3.t: Add a TLS segment.
9293 * testsuite/Makefile.am (check_PROGRAMS): Add
9294 tls_phdrs_script_test.
9295 (tls_phdrs_script_test_SOURCES): Define.
9296 (tls_phdrs_script_test_DEPENDENCIES): Define.
9297 (tls_phdrs_script_test_LDFLAGS): Define.
9298 (tls_phdrs_script_test_LDADD): Define.
9299 * testsuite/Makefile.in: Rebuild.
9300
4a599bdd
CC
93012010-03-23 Cary Coutant <ccoutant@google.com>
9302
9303 * fileread.cc (find_or_make_view): Fix comment.
9304
6c93b22c
ILT
93052010-03-23 Ian Lance Taylor <iant@google.com>
9306
9307 * script-sections.cc (class Orphan_section_placement): Define
9308 PLACE_TLS and PLACE_TLS_BSS.
9309 (Orphan_section_placement::Orphan_section_placement): Initialize
9310 new places.
9311 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9312 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9313 (tls_script_test_SOURCES): Define.
9314 (tls_script_test_DEPENDENCIES): Define.
9315 (tls_script_test_LDFLAGS): Define.
9316 (tls_script_test_LDADD): Define.
9317 * testsuite/Makefile.in: Rebuild.
9318
a2c7281b
DK
93192010-03-22 Doug Kwan <dougkwan@google.com>
9320
9321 * arm.cc (Arm_relocate_functions::abs8,
9322 Arm_relocate_functions::abs16): Use correct check for overflow
9323 specified in the ARM ELF specs.
9324 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9325 target of a BLX instruction specially.
9326 (Reloc_stub::stub_type_for_reloc): Ditto.
9327 (Relocate::relocate): Use symbolic names instead of numeric relocation
9328 codes to report error.
9329 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9330 workaround.
9331 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9332 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9333 thumb2_blx_out_of_range.stdout
9334 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9335 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9336 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9337 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9338 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9339 thumb2_blx_in_range, thumb2_blx_in_range.o,
9340 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9341 thumb2_blx_out_of_range.o): New rules.
2e702c99 9342 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9343 thumb2_blx_in_range and thumb2_blx_out_of_range.
9344 * testsuite/Makefile.in: Regenerate.
9345 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9346 * testsuite/thumb_blx_in_range.s: New file.
9347 * testsuite/thumb_blx_out_of_range.s: New file.
9348
b0193076
RÁE
93492010-03-22 Rafael Espindola <espindola@google.com>
9350
9351 * archive.cc (Should_include): Move to archive.h.
9352 (should_include_member): Make it a member of Archive.
9353 (Lib_group): New.
9354 (Add_lib_group_symbols): New.
9355 * archive.h: Include options.h.
9356 (Archive_member): Moved from Archive.
9357 (Should_include): Moved from archive.cc.
9358 (Lib_group): New.
9359 (Add_lib_group_symbols): New.
9360 * dynobj.cc (do_should_include_member): New.
9361 * dynobj.h (do_should_include_member): New.
9362 * gold.cc (queue_initial_tasks): Update call to queue.
9363 * main.cc (main): Print lib group stats.
9364 * object.cc (do_should_include_member): New.
9365 * object.h: Include archive.h.
9366 (Object::should_include_member): New.
9367 (Object::do_should_include_member): New.
9368 (Sized_relobj::do_should_include_member): New.
9369 * options.cc (General_options::parse_start_lib): New.
9370 (General_options::parse_end_lib): New.
9371 (Input_arguments::add_file): Handle lib groups.
9372 (Input_arguments::start_group): Check we are not in a lib.
9373 (Input_arguments::start_lib): New.
9374 (Input_arguments::end_lib): New.
9375 * options.h (General_options): Add start_lib and end_lib.
9376 (Input_argument::lib_): New.
9377 (Input_argument::lib): New.
9378 (Input_argument::is_lib): New.
9379 (Input_file_lib): New.
9380 (Input_arguments::in_lib_): New.
9381 (Input_arguments::in_lib): New.
9382 (Input_arguments::start_lib): New.
9383 (Input_arguments::end_lib_): New.
9384 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9385 in unused members as preempted.
9386 (Sized_pluginobj::do_should_include_member): New.
9387 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9388 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9389 return the blocker.
9390 (Read_symbols::do_whole_lib_group): New.
9391 (Read_symbols::do_lib_group): New.
9392 (Read_symbols::do_read_symbols): Handle lib groups.
9393 (Read_symbols::get_name): Handle lib groups.
9394 * readsyms.h (Read_symbols): Add an archive member pointer.
9395 (Read_symbols::do_whole_lib_group): New.
9396 (Read_symbols::do_lib_group): New.
9397 (Read_symbols::member_): New.
9398 * script.cc (read_input_script): Update call to queue_soon.
9399
d099120c
DK
94002010-03-19 Doug Kwan <dougkwan@google.com>
9401
9402 * arm.cc (Stub_table::Stub_table): Initialize new data members
9403 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9404 (Stub_table::add_reloc_stub): Assign stub offset and update
9405 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9406 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9407 New data members.
2e702c99 9408 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9409 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9410 instead of going over all reloc stubs.
2e702c99 9411 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9412 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9413 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9414 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9415 Stringpool_template::offset_.
9416 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9417 Stringpool_template::offset_ to zero.
9418
1aa37384
DK
94192010-03-15 Doug Kwan <dougkwan@google.com>
9420
9421 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9422 offset_.
9423 (Stringpool_template::new_key_offset): New method.
9424 (Stringpool_template::add_string): Assign offsets when adding new
9425 strings.
9426 (Stringpool_template::set_string_offsets): Do not set string offsets
9427 when not optimizing.
9428 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9429 member size_.
2e702c99
RM
9430 (Chunked_vector::clear): Clear size_.
9431 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9432 (Chunked_vector::size): Return size_.
9433 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9434 (Chunked_vector::size_): New data member.
1aa37384
DK
9435 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9436 (Stringpool_template::new_key_offset): New method declaration.
9437 (Stringpool_template::offset_): New data member.
9438
b672b057
RÁE
94392010-03-15 Rafael Espindola <espindola@google.com>
9440
9441 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9442 Add_symbols' constructor.
9443 * readsyms.h (Add_symbols): Remove the input_group member.
9444
b6848d3c
ILT
94452010-03-10 Ian Lance Taylor <iant@google.com>
9446
9447 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9448 target to ask whether a reference to a symbol requires a stack
9449 split.
9450 * target.h (Target::is_call_to_non_split): New function.
9451 (Target::do_is_call_to_non_split): Declare virtual function.
9452 * target.cc: Include "symtab.h".
9453 (Target::do_is_call_to_non_split): New function.
9454 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9455
a2a5469e
CC
94562010-03-10 Cary Coutant <ccoutant@google.com>
9457
9458 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9459 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9460 (File_read::open[2]): Add whole_file_view_ to list of views.
9461 (File_read::make_view): Remove test of whole_file_view_.
9462 (File_read::find_or_make_view): Create whole_file_view_ if
9463 necessary.
9464 (File_read::clear_views): Replace bool parameter with enum;
9465 adjust all callers. Don't delete views with permanent data;
9466 do delete cached views and views from archives if
9467 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9468 if clearing the corresponding view.
9469 * fileread.h (File_read::Clear_views_mode): New enum.
9470 (File_read::View::is_permanent_view): New method.
9471 (File_read::clear_views): Replace bool parameter
9472 with enum; adjust all callers.
9473 * options.h (General_options): Change keep_files_mapped option;
9474 add map_whole_files.
9475 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9476 releasing the file.
9477 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9478 the file.
9479
8861f32b
DM
94802010-03-10 David S. Miller <davem@davemloft.net>
9481
9482 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9483
d62d0f5f
ST
94842010-03-09 Sriraman Tallam <tmsriram@google.com>
9485
9486 * icf.cc (get_section_contents): Add '@' marker after processing the
9487 merge reloc.
9488
9177756d
DK
94892010-03-08 Doug Kwan <dougkwan@google.com>
9490
9491 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9492 due to a conversion warning.
9493 (Arm_relobj::update_output_local_symbol_count): Check for local
9494 symbol with unset output index.
9495
9e9e071b
ILT
94962010-03-05 Ian Lance Taylor <iant@google.com>
9497
9498 * options.h (class General_options): Add --spare-dynamic-tags.
9499 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9500 --spare-dynamic-tags.
9501
a81ee015
ILT
95022010-03-05 Ian Lance Taylor <iant@google.com>
9503
9504 * incremental.cc: Include "libiberty.h".
9505
44ec90b9
RO
95062010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9507
9508 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9509 function, is_info_ member.
9510 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9511 (Versions::Versions): Update caller.
9512 (Versions::define_base_version): Likewise.
9513 (Versions::add_def): Likewise.
9514
0897ed3b
ST
95152010-03-03 Sriraman Tallam <tmsriram@google.com>
9516
9517 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9518 (Scan::possible_function_pointer_reloc): New function.
9519 (Scan::local_reloc_may_be_function_pointer): Change to call
9520 possible_function_pointer_reloc.
9521 (Scan::global_reloc_may_be_function_pointer): Ditto.
9522 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9523 relocations in ".data.rel.ro._ZTV" section.
9524 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9525 * testsuite/icf_safe_so_test.cc: Ditto.
9526 * testsuite/icf_safe_test.cc: Ditto.
9527 * testsuite/icf_safe_test.sh: Ditto.
9528
d3bbad62
ILT
95292010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9530 Ian Lance Taylor <iant@google.com>
9531
9532 * target-reloc.h (relocate_section): Check the symbol table index
9533 for -1U before setting the local symbol index.
9534 (scan_relocatable_relocs): If copying the relocation, record that
9535 the local symbol is required.
9536 * object.h (Symbol_value::is_output_symtab_index_set): New
9537 function.
9538 (Symbol_value::may_be_discarded_from_output_symtab): New
9539 function.
9540 (Symbol_value::has_output_symtab_entry): New function.
9541 (Symbol_value::needs_output_symtab_entry): Remove.
9542 (Symbol_value::output_symtab_index): Make sure the symbol index is
9543 set.
9544 (Symbol_value::set_output_symtab_index): Make sure the symbol
9545 index is not set. Make sure the new index is valid.
9546 (Symbol_value::set_must_have_output_symtab_entry): New function.
9547 (Symbol_value::has_output_dynsym_entry): New function.
9548 (Symbol_value::set_output_dynsym_index): Make sure the new index
9549 is valid.
9550 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9551 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9552 local symbol if permitted.
9553 (Sized_relobj::do_finalize_local_symbols): Call
9554 is_output_symtab_index_set rather than needs_output_symtab_entry.
9555 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9556 rather than needs_output_symtab_entry. Call
9557 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9558 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9559 is_output_symtab_index_set rather than needs_output_symtab_entry.
9560 * testsuite/discard_locals_relocatable_test.c: New file.
9561 * testsuite/discard_locals_test.sh: Test -r.
9562 * testsuite/Makefile.am (check_DATA): Add
9563 discard_locals_relocatable_test1.syms,
9564 discard_local_relocatable_test2.syms.
9565 (MOSTLYCLEANFILES): Likewise. Also add
9566 discard_locals_relocatable_test1.lout and
9567 discard_locals_relocatable_test2.out.
9568 (discard_locals_relocatable_test1.syms): New target.
9569 (discard_locals_relocatable_test.o): New target.
9570 (discard_locals_relocatable_test1.out): New target.
9571 (discard_locals_relocatable_test2.syms): New target.
9572 (discard_locals_relocatable_test2.out): New target.
9573 (various): Add missing ../ld-new dependencies.
9574 * testsuite/Makefile.in: Rebuild.
9575
7e8ccf26
NC
95762010-03-03 Nick Clifton <nickc@redhat.com>
9577
9578 * po/fi.po: New Finnish translation.
9579
2a0ff005
DK
95802010-03-01 Doug Kwan <dougkwan@google.com>
9581
9582 * layout.cc (Layout::Layout): Force section types of .init_array*,
9583 .preinit_array* and .fini_array* sections.
9584 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9585 Fix check of return value of std::string::find.().
9586 (Output_section::Input_section_sort_compare::operator()): Remove
9587 comment about .init_array.
9588 (Output_section::Input_section_sort_init_fini_compare::operator()):
9589 New method.
9590 (Output_section::sort_attached_input_sections): Handle .init_array
9591 and .fini_array specially.
9592 * output.h (Output_section::Inut_section_sort_compare): Update
9593 comment.
9594 (Output_section::Input_section_sort_init_fini_compare): New struct.
9595
c3e4ae29
DK
95962010-02-26 Doug Kwan <dougkwan@google.com>
9597
9598 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9599 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9600 * testsuite/debug_msg.sh: Avoid matching source line number for
9601 use of global variable undef_int.
9602
2fd9ae7a
DK
96032010-02-26 Doug Kwan <dougkwan@google.com>
9604
9605 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9606 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9607 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9608 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9609 * options.cc (General_options::General_options): Initialize member
9610 fix_v4bx_.
9611 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9612 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9613 and rm_no_fix_v4bx.stdout
9614 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9615 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9616 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9617 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9618 and arm_no_fix_v4bx.
9619 * Makefile.in: Regenerate.
9620 * testsuite/arm_fix_v4bx.s: New file.
9621 * testsuite/arm_fix_v4bx.sh: Ditto.
9622
67ec7d0b
DK
96232010-02-24 Doug Kwan <dougkwan@google.com>
9624
9625 * arm.cc (Target_arm::got_section): Make the .got section the first
9626 non RELRO section in the data segment.
9627 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9628 suffixes of section names.
9629
10165461
DK
96302010-02-24 Doug Kwan <dougkwan@google.com>
9631
9632 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9633 flags and attributes merging if an input file is a binary file.
9634 * fileread.cc (Input_file::open): Record format of original file.
9635 * fileread.h (Input_file::Format): New enum type.
2e702c99 9636 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9637 (Input_file::format): New method definition.
9638 (Input_file::format_):: New data member.
9639
4a54abbb
DK
96402010-02-24 Doug Kwan <dougkwan@google.com>
9641
9642 * arm.cc (Arm_output_data_got): New class.
9643 (ARM_TCB_SIZE): New constant
9644 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9645 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9646 If user uses a script with a SECTIONS clause, issue only a warning
9647 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9648 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9649 garbage collection.
9650 (Target_arm::got_mode_index_entry): Handle static linking.
9651 (Target_arm::Scan::local): Ditto.
9652 (Target_arm::Scan::global): Ditto.
9653 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9654 all incorrectly implemented relocations.
e1df38aa 9655 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9656 Arm_output_section::fix_exidx_coverage.
9657 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9658 from ".ARM.exidx." and ".ARM.extab.".
9659
ca419a6f
ILT
96602010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9661
9662 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9663 section if it does not already exist.
9664 * attributes.cc (Attributes_section_data::Attributes_section_data):
9665 Don't crash if size is zero.
9666
135b9c78
ILT
96672010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9668 Ian Lance Taylor <iant@google.com>
9669
9670 * gold.cc (queue_middle_tasks): If no input files were opened,
9671 exit.
9672 * workqueue.h (Task_function::Task_function): Assert that there is
9673 a blocker.
9674
bb0bfe4f
DK
96752010-02-22 Doug Kwan <dougkwan@google.com>
9676
9677 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9678 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9679 types to avoid warnings due to different uint64_t implementations
9680 on different hosts.
9681
2a2b6d42
DK
96822010-02-21 Doug Kwan <dougkwan@google.com>
9683
9684 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9685 handling of the maximum backward branch offset.
2e702c99 9686 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9687 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9688 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9689 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9690 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9691 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9692 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9693 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9694 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9695 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9696 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9697 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9698 thumb2_bl_out_of_range.o): New rules.
9699 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9700 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9701 thumb2_bl_out_of_range
9702 * testsuite/Makefile.in: Regenerate.
9703 * testsuite/arm_bl_in_range.s: New file.
9704 * testsuite/arm_bl_out_of_range.s: Ditto.
9705 * testsuite/arm_branch_in_range.sh: Ditto.
9706 * testsuite/arm_branch_range.t: Ditto.
9707 * testsuite/thumb2_branch_range.t: Ditto.
9708 * testsuite/thumb_bl_in_range.s: Ditto.
9709 * testsuite/thumb_bl_out_of_range.s: Ditto.
9710 * testsuite/thumb_branch_range.t: Ditto.
9711
b487ad64
ST
97122010-02-20 Sriraman Tallam <tmsriram@google.com>
9713
9714 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9715 Add reloc offset information.
9716 * icf.cc (get_section_contents): Change iterators to point to the new
9717 vectors. Add reloc offset information to the contents.
9718 * icf.h (Icf::Sections_reachable_info): New typedef.
9719 (Icf::Sections_reachable_list): New typedef.
9720 (Icf::Offset_info): New typedef.
9721 (Icf::Reloc_info): New struct typedef.
9722 (Icf::Reloc_info_list): New typedef.
9723 (Icf::symbol_reloc_list): Delete method.
9724 (Icf::addend_reloc_list): Delete method.
9725 (Icf::section_reloc_list): Delete method.
9726 (Icf::reloc_info_list): New method.
9727 (Icf::reloc_info_list_): New member.
9728
f96accdf
DK
97292010-02-19 Doug Kwan <dougkwan@google.com>
9730
9731 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9732 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9733 * arm.cc (Arm_relocation_functions): New forward declaration.
9734 (Target_arm::Target_arm): Initialize new data members
9735 got_mod_index_offset_ and tls_base_symbol_defined_.
9736 (Target_arm::Relocate::relocate_tls): New method.
9737 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9738 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9739 New methods.
2e702c99 9740 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9741 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9742 (Target_arm::got_mod_index_offset_,
9743 Target_arm::tls_base_symbol_defined_): New data members.
9744 (Target_arm::Scan::local, Target::Scan::global,
9745 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9746 relocations.
9747
c8761b9a
DK
97482010-02-18 Doug Kwan <dougkwan@google.com>
9749
9750 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9751 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9752 text section as a parameter becuase some broken tools may not set
9753 the link in section header.
9754 (Target_arm::has_got_section): New method.
9755 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9756 without any mapping symbol as data only. Remove warning.
9757 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9758 link in its section header, try to discover the link by inspecting the
9759 REL31 relocation at the beginning of the section.
9760 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9761 in error message.
9762 (Target_arm::Scan::global): Treat any reference to the symbol
9763 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9764
21bb3914
ST
97652010-02-12 Sriraman Tallam <tmsriram@google.com>
9766
9767 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9768 (Scan::global_reloc_may_be_function_pointer): New function.
9769 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9770 (Scan::global_reloc_may_be_function_pointer): New function.
9771 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9772 (Scan::global_reloc_may_be_function_pointer): New function.
9773 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9774 (Scan::global_reloc_may_be_function_pointer): New function.
9775 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9776 (Scan::global_reloc_may_be_function_pointer): New function.
9777 (Scan::possible_function_pointer_reloc): New function.
9778 (Target_x86_64::can_check_for_function_pointers): New function.
9779 * gc.h (gc_process_relocs): Scan relocation types to determine if
9780 function pointers were taken for targets that support it.
9781 * icf.cc (Icf::find_identical_sections): Include functions for
9782 folding in safe ICF whose pointer is not taken.
9783 * icf.h (Secn_fptr_taken_set): New typedef.
9784 (fptr_section_id_): New member.
9785 (section_has_function_pointers): New function.
9786 (set_section_has_function_pointers): New function.
9787 (check_section_for_function_pointers): New function.
9788 * options.h: Fix comment for safe ICF option.
9789 * target.h (can_check_for_function_pointers): New function.
9790 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9791 Modify icf_safe_test for X86-64.
9792 * testsuite/Makefile.in: Regenerate.
9793 * testsuite/icf_safe_so_test.cc: New file.
9794 * testsuite/icf_safe_so_test.sh: New file.
9795 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9796 (main): Change to take pointer to function kept_func_3.
9797 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9798 folding is done correctly for X86-64.
9799
0da6fa6c
DM
98002010-02-12 David S. Miller <davem@davemloft.net>
9801
9802 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9803 is_symbolless parameter.
9804 (Output_reloc<SHT_REL>::is_symbolless): New.
9805 (Output_reloc<SHT_REL>::is_symbolless_): New.
9806 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9807 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9808 (Output_reloc<SHT_RELA>::is_symbolless): New.
9809 (Output_data_reloc::add_global): Handle is_symbolless.
9810 (Output_data_reloc::add_global_relative): Likewise.
9811 (Output_data_reloc::add_local): Likewise.
9812 (Output_data_reloc::add_local_relative): Likewise.
9813 (Output_data_reloc::add_symbolless_global_addend): New.
9814 (Output_data_reloc::add_symbolless_local_addend): New.
9815 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9816 is_symbolless.
9817 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9818 instead of ->is_relative_
9819 (Output_reloc::write): Likewise.
9820 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9821 (Output_reloc::write_rel): Simplify.
9822
9823 * sparc.cc (Target_sparc::Scan::local): Use
9824 ->add_symbolless_local_addend as needed.
9825 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9826 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9827 based upon relocation offset.
9828
e4782e83
DK
98292010-02-11 Doug Kwan <dougkwan@google.com>
9830
9831 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9832 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9833 beginning of function.
9834 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9835 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9836 parameter is_32bit in calls to should_apply_static_reloc.
9837 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9838 (check_DATA): Add arm_abs_global.stdout.
9839 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9840 arm_abs_global.stdout): New rules.
9841 (MOSTLLYCLEANFILES): Add arm_abs_global
9842 * Makefile.in: Regenerate.
9843 * testsuite/arm_abs_global.s: New file.
9844 * testsuite/arm_abs_global.sh: Ditto.
9845 * testsuite/arm_abs_lib.s: Ditto.
9846
93ceb764
ILT
98472010-02-11 Ian Lance Taylor <iant@google.com>
9848
9849 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9850 Read_relocs task.
9851 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9852 Allocate_commons_task first.
9853 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9854 task, rather than symtab_lock_.
9855 (Gc_process_relocs::~Gc_process_relocs): New function.
9856 (Gc_process_relocs::is_runnable): Check this_blocker_.
9857 (Gc_process_relocs::locks): Use next_blocker_ rather than
9858 blocker_.
9859 (Scan_relocs::~Scan_relocs): New function.
9860 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9861 symtab_lock_.
9862 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9863 next_blocker_.
9864 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9865 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9866 constructor accordingly.
9867 (class Gc_process_relocs): Likewise.
9868 (class Scan_relocs): Likewise.
9869 * common.h (class Allocate_commons_task): Remove symtab_lock_
9870 field, and corresponding constructor parameter.
9871 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9872 symtab_lock_.
9873 (Allocate_commons_task::locks): Likewise.
9874
114dfbe1
ILT
98752010-02-11 Ian Lance Taylor <iant@google.com>
9876
9877 * gold-threads.h (class Once): Define.
9878 (class Initialize_lock): Rewrite as child of Once.
9879 * gold-threads.cc (class Once_initialize): Define.
9880 (once_pointer_control): New static variable.
9881 (once_pointer, once_arg): New static variables.
9882 (c_run_once): New static function.
9883 (Once::Once, Once::run_once, Once::internal_run): New functions.
9884 (class Initialize_lock_once): Remove.
9885 (initialize_lock_control): Remove.
9886 (initialize_lock_pointer): Remove.
9887 (initialize_lock_once): Remove.
9888 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9889 (Initialize_lock::initialize): Rewrite.
9890 (Initialize_lock::do_run_once): New function.
9891 * archive.cc (Archive::interpret_header): Only clear name if it is
9892 not already empty.
9893 * fileread.cc: Include "gold-threads.h"
9894 (file_counts_lock): New static variable.
9895 (file_counts_initialize_lock): Likewise.
9896 (File_read::release): Only increment counts when using --stats.
9897 Use a lock around the increment.
9898 * parameters.cc (class Set_parameters_target_once): Define.
9899 (set_parameters_target_once): New static variable.
9900 (Parameters::Parameters): Move here from parameters.h.
9901 (Parameters::set_target): Rewrite.
9902 (Parameters::set_target_once): New function.
9903 (Parameters::clear_target): Move here and rewrite.
9904 * parameters.h (class Parameters): Update declarations. Add
9905 set_parameters_target_once_ field.
9906 (Parameters::Parameters): Move to parameters.cc.
9907 (Parameters::clear_target): Likewise.
9908 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9909 task.
9910 (Start_group::~Start_group): New function.
9911 (Start_group::is_runnable): New function.
9912 (Start_group::locks, Start_group::run): New functions.
9913 (Finish_group::run): Change saw_undefined to size_t.
9914 * readsyms.h (class Start_group): Define.
9915 (class Finish_group): Change saw_undefined_ field to size_t.
9916 (Finish_group::Finish_group): Remove saw_undefined and
9917 this_blocker parameters. Change all callers.
9918 (Finish_group::set_saw_undefined): New function.
9919 (Finish_group::set_blocker): New function.
9920 * symtab.h (class Symbol_table): Change saw_undefined to return
9921 size_t. Change saw_undefined_ field to size_t.
9922 * target-select.cc (Set_target_once::do_run_once): New function.
9923 (Target_selector::Target_selector): Initialize set_target_once_
9924 field. Don't initialize lock_ and initialize_lock_ fields.
9925 (Target_selector::instantiate_target): Rewrite.
9926 (Target_selector::set_target): New function.
9927 * target-select.h (class Set_target_once): Define.
9928 (class Target_selector): Update declarations. Make
9929 Set_target_once a friend. Remove lock_ and initialize_lock_
9930 fields. Add set_target_once_ field.
9931
fa17a3f4
ILT
99322010-02-10 Ian Lance Taylor <iant@google.com>
9933
9934 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9935 queueing any tasks.
9936 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9937 (queue_middle_tasks): Add all blockers before queueing any tasks.
9938 (queue_final_tasks): Likewise.
9939 * token.h (Task_token::add_blockers): New function.
9940 * object.h (Input_objects::number_of_relobjs): New function.
9941
c7177d31
ILT
99422010-02-10 Ian Lance Taylor <iant@google.com>
9943
5de0e392
ILT
9944 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9945 shared, not if not position independent.
9946 * x86_64.cc (Relocate::relocate_tls): Likewise.
9947 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9948 (tls_pie_pic_test): New target.
9949 * testsuite/Makefile.in: Rebuild.
9950
c7177d31
ILT
9951 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9952 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9953 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9954 * testsuite/Makefile.in: Rebuild.
9955
684b268a
DM
99562010-02-09 David S. Miller <davem@davemloft.net>
9957
9958 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9959 R_SPARC_RELATIVE using ->add_local_relative().
9960 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9961
612a8d3d
DM
9962 * output.h (Output_data_dynamic::add_section_size): New method
9963 that takes two Output_data objects.
9964 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9965 entry param. Handle it in initializers.
9966 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9967 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9968 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9969 arg.
9970 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9971 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9972 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9973 for dynrel_includes_plt.
9974 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9975 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9976 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9977 before .rela.plt
9978 (Target_sparc::do_finalize_sections): Update to pass true for
9979 dynrel_includes_plt.
9980 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9981 output before .rela.plt
9982 (Target_powerpc::do_finalize_sections): Update to pass true for
9983 dynrel_includes_plt when 32-bit.
9984
cb1be87e
DK
99852010-02-08 Doug Kwan <dougkwan@google.com>
9986
9987 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9988 method.
9989 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9990 Arm_relobj::scan_section_for_cortex_a8_stubs,
9991 Arm_relobj::do_relocation_section): Instead of calling
9992 Output_section::output_address, use faster
9993 Arm_relobj::simple_input_section_output_address.
9994
705b5121
DM
99952010-02-08 David S. Miller <davem@davemloft.net>
9996
9997 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9998 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9999 relocation helper function.
10000
024c4466
DM
10001 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10002 just like R_SPARC_GOT{10,13,22}.
10003 (Target_sparc::Scan::local): Likewise.
10004 (Target_sparc::Relocate:relocate): Likewise.
10005
9109c078
ILT
100062010-02-06 Ian Lance Taylor <iant@google.com>
10007
10008 * configure.ac: Rewrite targetobjs duplicate removal code to use
10009 only shell constructs.
10010 * configure: Rebuild.
10011
cf846138
DK
100122010-02-05 Doug Kwan <dougkwan@google.com>
10013
10014 PR 11247
10015 * arm.cc (Arm_relobj::section_is_scannable): New method.
10016 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10017 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10018
6cfaf60b
DK
100192010-02-04 Doug Kwan <dougkwan@google.com>
10020
10021 PR 11247
10022 * arm-reloc-property.cc (cstdio): Include.
10023 * configure.ac (targetobjs): Remove duplicates.
10024 * configure: Regenerate.
10025 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10026 big and little endian version for a given address size.
10027
5c57f1be
DK
100282010-02-03 Doug Kwan <dougkwan@google.com>
10029
10030 * arm-reloc-property.cc
10031 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10032 definition.
10033 * arm-reloc-property.h
10034 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10035 New method definition.
10036 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10037 declaration.
10038 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10039 overflow to N.
10040 (GOT_PREL): Change implemented to Y.
10041 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10042 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10043 (Arm_relocate_functions::movw_abs_nc): Remove method.
10044 (Arm_relocate_functions::movt_abs): Ditto.
10045 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10046 (Arm_relocate_functions::thm_movt_abs): Ditto.
10047 (Arm_relocate_functions::movw_rel_nc): Ditto.
10048 (Arm_relocate_functions::movw_rel): Ditto.
10049 (Arm_relocate_functions::movt_rel): Ditto.
10050 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10051 (Arm_relocate_functions:thm_movw_rel): Ditto.
10052 (Arm_relocate_functions:thm_movt_rel): Ditto.
10053 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10054 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10055 New method definitions.
10056 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10057 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10058 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10059 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10060 (Target_arm::Relocate::relocate): Check for non-static or
10061 unimplemented relocation code and exit early. Change calls to
10062 Target_arm::reloc_uses_thumb_bit and
10063 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10064 instead. Refactor code to handle similar relocations to increase
10065 code sharing. Remove check for unsupported relocation code in switch
10066 statement.
10067 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10068 relocation property table to find out size. Change error message to
10069 print out the name of a relocation code instead of the numeric value.
10070 (Target_arm::scan_reloc_for_stub): Use relocation property table
10071 instead of calling Target_arm::reloc_uses_thumb_bit().
10072
218c5831
DK
100732010-02-02 Doug Kwan <dougkwan@google.com>
10074
10075 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10076 types of relaxed input section.
10077
0d31c79d
DK
100782010-02-02 Doug Kwan <dougkwan@google.com>
10079
10080 * Makefile.am (HFILES): Add arm-reloc-property.h.
10081 (DEFFILES): New.
2e702c99
RM
10082 (TARGETSOURCES): Add arm-reloc-property.cc
10083 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10084 (libgold_a_SOURCES): $(DEFFILES)
10085 * Makefile.in: Regenerate.
10086 * arm-reloc-property.cc: New file.
10087 * arm-reloc-property.h: New file.
10088 * arm-reloc.def: New file.
10089 * arm.cc: Update comments.
10090 (arm-reloc-property.h): New included header.
10091 (arm_reloc_property_table): New global variable.
10092 (Target_arm::do_select_as_default_target): New method definition.
10093 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10094 arm-reloc-property to targ_extra_obj.
10095 * parameters.cc (set_parameters_target): Call
10096 Target::select_as_default_target().
10097 * target.h (Target::select_as_default_target): New method definition.
10098 (Target::do_select_as_default_target): Same.
10099
546c7457
DK
101002010-02-01 Doug Kwan <dougkwan@google.com>
10101
10102 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10103 first_output_text_section_.
10104 (Arm_exidx_fixup::first_output_text_section): New method definition.
10105 (Arm_exidx_fixup::first_output_text_section_): New data member.
10106 (Arm_exidx_fixup::process_exidx_section): Record the first text
10107 output section seen.
10108 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10109 and entsize in output section header.
10110
11b861d5
DK
101112010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10112
10113 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10114 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10115 (Arm_relocate_functions::thm_alu11): New Method.
10116 (Arm_relocate_functions::thm_pc8): New Method.
10117 (Arm_relocate_functions::thm_pc12): New Method.
10118 (Target_arm::Scan::local): Handle the relocations.
10119 (Target_arm::Scan::global): Likewise.
10120 (Target_arm::Relocate::relocate): Likewise.
10121 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10122
c9a2c125
DK
101232010-01-29 Doug Kwan <dougkwan@google.com>
10124
10125 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10126 of relocation types as ld.
10127
1521477a
DK
101282010-01-29 Doug Kwan <dougkwan@google.com>
10129
10130 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10131 to public.
10132 (Arm_relocate_functions::thumb_branch_common): Ditto.
10133 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10134 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10135 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10136 Arm_relocate_functions::jump24): Remove.
10137 (Target_arm::Relocate::relocate): Adjust code to call
10138 Arm_relocation_functions::arm_branch_common and
10139 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10140 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10141
e7eca48c
DK
101422010-01-29 Doug Kwan <dougkwan@google.com>
10143
10144 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10145 output_local_symbol_count_needs_update_.
10146 (Arm_relobj::output_local_symbol_count_needs_update,
10147 Arm_relobj::set_output_local_symbol_count_needs_update,
10148 Arm_relobj::update_output_local_symbol_count): New methods.
10149 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10150 member.
10151 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10152 of pointed function as in a R_ARM_PREL31 relocation.
10153 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10154 for output local symbol count updating.
10155 (Target_arm::do_relax): Update output local symbol counts in objects
10156 if necessary.
10157 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10158
02961d7e
ILT
101592010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10160
10161 * arm.cc: Added support for the ARM relocations:
10162 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10163 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10164 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10165 movw_prel_nc).
10166 (Arm_relocate_functions::movw_rel): New method.
10167 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10168 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10169 thm_movw_prel_nc).
10170 (Arm_relocate_functions::thm_movw_rel): New method.
10171 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10172 thm_movt_prel).
10173 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10174 relocations.
10175 (Target_arm::Scan::global): Likewise.
10176 (Target_arm::Relocate::relocate): Likewise.
10177 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10178 Likewise.
10179
b10d2873
ILT
101802010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10181
10182 * arm.cc: Added support for ARM group relocations.
10183 (Target_arm::reloc_needs_sym_origin): New method.
10184 (Arm_relocate_functions::calc_grp_kn): New method.
10185 (Arm_relocate_functions::calc_grp_residual): New method.
10186 (Arm_relocate_functions::calc_grp_gn): New method.
10187 (Arm_relocate_functions::arm_grp_alu): New Method.
10188 (Arm_relocate_functions::arm_grp_ldr): New Method.
10189 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10190 (Arm_relocate_functions::arm_grp_ldc): New Method.
10191 (Target_arm::Scan::local): Handle the ARM group relocations.
10192 (Target_arm::Scan::global): Likewise.
10193 (Target_arm::Relocate::relocate): Likewise.
10194 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10195 Likewise.
10196
2b328d4e
DK
101972010-01-26 Doug Kwan <dougkwan@google.com>
10198
10199 * arm.cc (set): Include.
10200 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10201 pointer type.
2e702c99 10202 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10203 (Arm_output_section::append_text_sections_to_list): New method.
10204 (Arm_output_section::fix_exidx_coverage): Ditto.
10205 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10206 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10207 Relobj::set_section_offset() instead of
10208 Sized_relobj::invalidate_section_offset().
2e702c99 10209 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10210 parameter for section headers. Ignore relocation sections for
10211 unallocated sections and EXIDX sections.
10212 (Target_arm::fix_exidx_coverage): New method.
10213 (Target_arm::output_section_address_less_than): New type.
10214 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10215 linked text section instead of the EXIDX section.
10216 (Arm_output_section::create_stub_group): Add an assertion to check
10217 that this is not an EXIDX output section.
10218 (Arm_output_section::append_text_sections_to_list): New method.
10219 (Arm_output_section::fix_exidx_coverage): Ditto.
10220 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10221 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10222 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10223 first pass.
10224 (Target_arm::fix_exidx_coverage): New method.
10225 * object.h (Relobj::set_output_section): New method.
10226 (Sized_relobj::invalidate_section_offset): Remove method.
10227 (Sized_relobj::do_invalidate_section_offset): Remove method.
10228 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10229
c7f3c371
DK
102302010-01-25 Doug Kwan <dougkwan@google.com>
10231
10232 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10233 Fix warning due to signed and unsigned comparison on a 32-bit host.
10234
8923b24c
DK
102352010-01-22 Doug Kwan <dougkwan@google.com>
10236
10237 * arm.cc (Target_arm::do_relax): Record an output section for section
10238 offset adjustment it contains any stub table that has changed.
10239 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10240 offsets in an output section if necessary.
10241 * output.cc (Output_section::Output_section): Initialize
10242 section_offsets_need_adjustments_.
10243 (Output_section::add_input_section_for_script): Renamed to
10244 Output_section::add_simple_input_section.
10245 (Output_section::save_states): Add a comment.
10246 (Output_section::discard_states): New method defintion.
10247 (Output_section::adjust_section_offsets): Same.
10248 * output.h (Output_section::add_input_section_for_script): Renamed to
10249 Output_section::add_simple_input_section.
10250 (Output_section::discard_states): New method declaration.
10251 (Output_section::adjust_section_offsets): Same.
10252 (Output_section::section_offsets_need_adjustment,
10253 Output_section::set_section_offsets_need_adjustment): New method
10254 definitions.
10255 (Output_section::section_offsets_need_adjustment_): New data member.
10256 * script-sections.cc
10257 (Output_section_element_input::set_section_address): Adjust code for
10258 renaming of Output_section::add_input_section_for_script.
10259 (Orphan_output_section::set_section_address): Same.
10260
9b2fd367
DK
102612010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10262
10263 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10264 Fix_v4bx enum values .
10265 * gold/options.h (General_options): New option definitions.
10266 (General_options::fix_v4bx): New method.
10267 (General_options::Fix_v4bx): New enum.
10268 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10269 (General_options::parse_fix_v4bx_interworking): New method.
10270
80d0d023
DK
102712010-01-22 Doug Kwan <dougkwan@google.com>
10272
10273 * arm.cc (Arm_exidx_fixup): New class.
10274
af2cdeae
DK
102752010-01-21 Doug Kwan <dougkwan@google.com>
10276
10277 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10278 classes.
10279 (Arm_exidx_section_offset_map): New type.
10280
993d07c1
DK
102812010-01-21 Doug Kwan <dougkwan@google.com>
10282
10283 * arm.cc (Arm_exidx_input_section): New class.
10284 (Arm_relobj::exidx_input_section_by_link,
10285 Arm_relobj::exidx_input_section_by_shndx,
10286 Arm_relobj::make_exidx_input_section): New methods.
10287 (read_arm_attributes_section): Remove.
10288 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10289 information about them.
10290 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10291 to here.
10292
5ac169d4
DK
102932010-01-20 Doug Kwan <dougkwan@google.com>
10294
10295 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10296 Input_section_specifier to Section_id.
10297 (Target_arm::new_arm_input_section: Adjust code for change of key
10298 type.
10299 (Target_arm::find_arm_input_section): Ditto.
10300 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10301 (Section_id): Remove.
10302 (Garbage_collection::Section_id_hash): Remove.
10303 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10304 (Section_id): Remove.
10305 (Icf::Section_id_hash): Remove.
10306 * object.h (Section_id, Const_section_id, Section_id_hash,
10307 Const_section_id_hash): New type definitions.
10308 * output.cc (Output_section::add_relaxed_input_section): Change to
10309 use Const_section_id instead of Input_section_specifier as key type.
10310 (Output_section::add_merge_input_section): Ditto.
10311 (Output_section::build_relaxation_map): Change to use Section_id
10312 instead of Input_section_specifier as key type.
2e702c99 10313 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10314 Ditto.
10315 (Output_section::convert_input_sections_to_relaxed_sections): Change
10316 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10317 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10318 (Output_section::find_relaxed_input_section): Ditto.
10319 * output.h (Input_section_specifier): Remove class.
10320 (Output_section::Output_section_data_by_input_section_map): Change
10321 key type to Const_section_id.
10322 (Output_section::Output_relaxed_input_section_by_input_section_map):
10323 Ditto.
10324 (Output_section::Relaxation_map): Change key type to Section_id.
10325
a2162063
ILT
103262010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10327
10328 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10329 (class Arm_v4bx_stub): New class.
10330 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10331 (Stub_factory::make_arm_v4bx_stub): New method.
10332 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10333 (Stub_table::empty): Handle v4bx stubs.
10334 (Stub_table::add_arm_v4bx_stub): New method.
10335 (Stub_table::find_arm_v4bx_stub): New method.
10336 (Arm_relocate_functions::v4bx): New method.
10337 (Target_arm::fix_v4bx): New method.
10338 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10339 (Stub_table::relocate_stubs): Likewise.
10340 (Stub_table::do_write): Likewise.
10341 (Stub_table::update_data_size_and_addralign): Likewise.
10342 (Stub_table::finalize_stubs): Likewise.
10343 (Target_arm::Scan::local): Likewise.
10344 (Target_arm::Scan::global): Likewise.
10345 (Target_arm::do_finalize_sections): Likewise.
10346 (Target_arm::Relocate::relocate): Likewise.
10347 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10348 Likewise.
10349 (Target_arm::scan_reloc_for_stub): Likewise.
10350 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10351
5696ab0b
ILT
103522010-01-19 Ian Lance Taylor <iant@google.com>
10353
10354 * output.cc (Output_section_headers::do_sized_write): Write large
10355 segment count to sh_info field.
10356 (Output_file_header::do_sized_write): For large segment count,
10357 write PN_XNUM to e_phnum field.
10358
800d0f56
ILT
103592010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10360
10361 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10362 (Arm_relocate_functions::thm_jump8): New function.
10363 (Arm_relocate_functions::thm_jump11): New function.
10364 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10365 R_ARM_THM_JUMP11.
10366 (Target_arm::Scan::global): Likewise.
10367 (Target_arm::Relocate::relocate): Likewise.
10368 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10369 Likewise.
10370
41263c05
DK
103712010-01-14 Doug Kwan <dougkwan@google.com>
10372
10373 * arm.cc (map, utility): Include headers.
10374 (Target_arm::apply_cortex_a8_workaround): New method.
10375 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10376 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10377 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10378 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10379 the --[no-]fix-cortex-a8 command line options.
10380 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10381 (Target_arm::relocate_stub): Use addend in instruction template.
10382 * options.h (DEFINE_bool): Set the user-set flag.
10383 (General_options): Add --[no-]-fix-cortex options.
10384 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10385 : Update fast look-up map after conversion.
41263c05 10386
459e9b03
ST
103872010-01-14 Sriraman Tallam <tmsriram@google.com>
10388
10389 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10390 in the first pass of do_layout.
10391
b521dfe4
DK
103922010-01-13 Doug Kwan <dougkwan@google.com>
10393
10394 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10395 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10396 apparent compiler problem of not folding static constant integral
10397 data members of elfcpp::Elf_sizes<32>.
10398
44272192
DK
103992010-01-13 Doug Kwan <dougkwan@google.com>
10400
10401 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10402 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10403 Arm_relobj::scan_section_for_cortex_a8_erratum,
10404 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10405 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10406 sections to scan for relocation stubs into a new method
10407 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10408 relocation and Cortex-A8 stub scanning.
10409 (Target_arm::do_relax): Force stubs to be after stubbed sections
10410 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10411 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10412 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10413
44b71ece
ILT
104142010-01-12 Ian Lance Taylor <iant@google.com>
10415
10416 * target-reloc.h (visibility_error): New inline function.
10417 (relocate_section): Call visibility_error.
10418 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10419 (MOSTLYCLEANFILES): Likewise.
10420 (protected_4_pic.o, protected_3.err): New targets.
10421 * testsuite/protected_4.cc: New file.
10422
a120bc7f
DK
104232010-01-12 Doug Kwan <dougkwan@google.com>
10424
10425 * arm.cc (Cortex_a8_reloc): New class.
10426 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10427 and cortex_a8_relocs_info_.
10428 (Target_arm::fix_cortex_a8): New method definition.
10429 (Target_arm::Cortex_a8_relocs_info): New type.
10430 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10431 New data member declarations.
10432 (Target_arm::scan_reloc_for_stub): Record information about
10433 relocations for THUMB branches that might be exempted from the
10434 Cortex-A8 workaround.
10435 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10436 at the beginning of a relaxation pass.
10437
20138696
DK
104382010-01-12 Doug Kwan <dougkwan@google.com>
10439
10440 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10441 (Arm_relobj::Mapping_symbol_position,
10442 Arm_reloj::Mapping_symbol_position_less,
10443 Arm_relobj::Mapping_symbols_info): New types.
10444 (Target_arm::is_mapping_symbol_name): New method definition.
10445 (Arm_relobj::do_count_local_symbols): Save information about mapping
10446 symbols.
10447
089d69dc
DK
104482010-01-11 Doug Kwan <dougkwan@google.com>
10449
10450 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10451 Arm_relocate_functions::thumb32_branch_upper,
10452 Arm_relocate_functions::thumb32_branch_lower,
10453 Arm_relocate_functions::thumb32_cond_branch_offset,
10454 Arm_relocate_functions::thumb32_cond_branch_upper,
10455 Arm_relocate_functions::thumb32_cond_branch_lower,
10456 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10457 branch offset encoding.
10458 (Arm_relocate_functions::thumb_branch_common): Use new branch
10459 offset encoding methods to avoid code duplication.
10460 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10461 (Stub_addend_reader::operator()): Use new branch encoding method
10462 to avoid code duplication.
10463
99e5bff2
DK
104642010-01-11 Doug Kwan <dougkwan@google.com>
10465
10466 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10467 (Target_arm::do_finalize_sections): Define special EXIDX section
10468 symbols only if referenced.
10469 * gc.h (Garbage_collection::add_reference): New method.
10470 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10471 code duplication.
10472
98e090bd
ILT
104732010-01-11 Ian Lance Taylor <iant@google.com>
10474
d0a91bd8
ILT
10475 * script.cc (Version_script_info::build_expression_list_lookup):
10476 Change complaing about duplicate wildcard match from error to
10477 warning.
10478
98e090bd
ILT
10479 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10480 of 2009-12-30.
10481 (Version_script_info::Version_script_info): Initialize globs_,
10482 default_version_, default_is_global_, and exact_. Don't
10483 initialize globals_ or locals_.
10484 (Version_script_info::build_lookup_tables): Build local symbols
10485 first.
10486 (Version_script_info::unquote): New function.
10487 (Version_script_info::add_exact_match): New function.
10488 (Version_script_info::build_expression_list_lookup): Remove lookup
10489 parameter. Add is_global parameter. Change all callers. Handle
10490 wildcard pattern specially. Unquote pattern. Call
10491 add_exact_match.
10492 (Version_script_info::get_name_to_match): New function.
10493 (Version_script_info::get_symbol_version): New function.
10494 (Version_script_info::get_symbol_version_helper): Remove.
10495 (Version_script_info::check_unmatched_names): Call unquote.
10496 * script.h (class Version_script_info): Change get_symbol_version
10497 to be non-inline and add is_global parameter; change all callers.
10498 Rewrite symbol_is_local. Update declarations. Define struct
10499 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10500 Remove globals_ and locals_ members. Add exact_, globs_,
10501 default_version_, is_global_.
10502 (Version_script_info::Glob): Remove pattern, add expression and
10503 is_global. Update constructor. Change all callers.
10504 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10505 default version.
10506 (Versions::symbol_section_contents): If a symbol is undefined, or
10507 defined in a dynamic object, set the version index to
10508 VER_NDX_LOCAL.
10509 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10510 symbol_is_local.
10511 (Symbol_table::add_from_pluginobj): Likewise.
10512 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10513
d56962d3
DK
105142010-01-11 Doug Kwan <dougkwan@google.com>
10515
10516 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10517 (incremental_dump_LDADD): Add linking option for libintl.
10518 * Makefile.in: Regenerate.
10519
94e6ee91
L
105202010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10521
10522 PR gold/11144
10523 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10524 instead of -Ds.
10525 * testsuite/Makefile.in: Regenerated.
10526
e96c574b
DK
105272010-01-10 Doug Kwan <dougkwan@google.com>
10528
10529 * options.h (DEFINE_var): Use parentheses around argument varname__
10530 in macro body to avoid any unintended subsequent substitutions.
10531
7198066b
ILT
105322010-01-10 Ian Lance Taylor <iant@google.com>
10533
ba4d53bf
ILT
10534 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10535 candidates before doing symbol resolution.
10536
7198066b
ILT
10537 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10538 ODR candidates if only one is weak.
10539
a2beed37
ILT
105402010-01-08 Ian Lance Taylor <iant@google.com>
10541
10542 * script.cc (Version_script_info::build_expression_list_lookup):
10543 Don't warn about ambiguous version, just record the ambiguity.
10544 (Version_script_info::get_symbol_version_helper): Give error if
10545 version is ambiguous.
10546
2fb7225c
DK
105472010-01-08 Doug Kwan <dougkwan@google.com>
10548
10549 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10550 prev_data_size_ and prev_addralign_. Remove initializer for
10551 deleted data member has_been_changed_.
10552 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10553 to determine if the table is empty.
10554 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10555 Remove.
10556 (Stub_table::add_reloc_stub): Define method in class definition
10557 instead of just declaring it there.
10558 (Stub_table::add_cortex_a8_stub): New method definition.
10559 (Stub_table::update_data_size_and_addralign): Ditto.
10560 (Stub_table::finalize_stubs): Ditto.
10561 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10562 (Stub_table::do_addralign_): Return address alignment in the
10563 (Stub_table::do_reset_address_and_file_offset): Define method in
10564 class definition instead of declaring it there. Set current data
10565 size to be the data size of the previous pass.
10566 (Stub_table::set_final_data_size): Use current data size as the
10567 final data size.
10568 (Stub_table::relocate_stub): Change parameter type of stub from
10569 Reloc_stub pointer to Stub pointer.
10570 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10571 (Stub_table::Cortex_a8_stub_list): New typedef.
10572 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10573 Stub_table::prev_addralign_): New data member.
10574 (Arm_relobj::Arm_relobj): Initialize data member
10575 section_has_cortex_a8_workaround_.
10576 (Arm_relobj::section_has_cortex_a8_workaround,
10577 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10578 definitions.
10579 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10580 declarations.
10581 (Target_arm::relocate_stub): Change parameter type of stub from
10582 Reloc_stub pointer to Stub pointer.
10583 (Insn_template::size, Insn_template::alignment): Handle
10584 THUMB16_SPECIAL_TYPE.
10585 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10586 Stub_table::update_data_size_and_addralign,
10587 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10588 definitions.
10589 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10590 (Stub_table::do_write): Ditto.
10591 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10592
880cd20d
ILT
105932010-01-08 Ian Lance Taylor <iant@google.com>
10594
10595 PR 11108
10596 * symtab.h (class Symbol): Remove fields is_target_special_ and
10597 has_plt_offset_. Add field is_defined_in_discarded_section_.
10598 (Symbol::is_defined_in_discarded_section): New function.
10599 (Symbol::set_is_defined_in_discarded_section): New function.
10600 (Symbol::has_plt_offset): Rewrite.
10601 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10602 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10603 Don't initialize is_target_special_ or has_plt_offset_.
10604 Initialize is_defined_in_discarded_section_.
10605 (Symbol_table::add_from_relobj): If appropriate, set
10606 is_defined_in_discarded_section.
10607 * resolve.cc (Symbol::override_base_with_special): Don't test
10608 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10609 * target-reloc.h (relocate_section): Do special handling for
10610 symbols defined in discarded sections for global symbols as well
10611 as local symbols.
10612
2703e3eb
ILT
106132010-01-08 Ian Lance Taylor <iant@google.com>
10614
10615 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10616 the SHT_SYMTAB case.
10617
339d40a3
ILT
106182010-01-08 Ian Lance Taylor <iant@google.com>
10619
10620 * object.cc (Sized_relobj::do_layout): Don't get confused if
10621 layout_eh_frame returns NULL.
10622
abecea76
ILT
106232010-01-08 Ian Lance Taylor <iant@google.com>
10624
10625 PR 11084
10626 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10627 dynamic symbol table, use the normal symbol table.
10628 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10629 symbol table.
10630
6b7dd3f3
ILT
106312010-01-08 Ian Lance Taylor <iant@google.com>
10632
10633 PR 11072
10634 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10635 sections.
10636
36c50e63
L
106372010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10638
10639 * version.cc (print_version): Change to "Copyright 2010".
10640
e291e7b9
ILT
106412010-01-08 Ian Lance Taylor <iant@google.com>
10642
10643 PR 10287
10644 PR 11063
10645 * i386.cc (class Target_i386): Change return type of plt_section
10646 to be non-const.
10647 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10648 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10649 tls_desc_rel_ field.
10650 (Output_data_plt_i386::rel_tls_desc): New function.
10651 (Target_i386::rel_tls_desc_section): New function.
10652 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10653 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10654 R_386_TLS_DESC reloc in rel_tls_desc_section.
10655 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10656 Define struct Tlsdesc_info.
10657 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10658 (Target_x86_64::do_reloc_symbol_index): New function.
10659 (Target_x86_64::add_tlsdesc_info): New function.
10660 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10661 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10662 tlsdesc_rel_ field.
10663 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10664 all callers.
10665 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10666 (Target_x86_64::rela_tlsdesc_section): New function.
10667 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10668 handling.
10669 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10670 (Target_x86_64::do_reloc_addend): New function.
10671 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10672 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10673 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10674 (Output_reloc::type): New function.
10675 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10676 (Output_reloc::is_target_specific): New function.
10677 (Output_reloc::target_arg): New function.
10678 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10679 absolute relocs and target specific relocs.
10680 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10681 add_target_specific.
10682 (class Output_data_reloc) [SHT_RELA]: Likewise.
10683 * output.cc (Output_reloc::Output_reloc): Add four new versions
10684 for absolute relocs and target specific relocs.
10685 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10686 (Output_reloc::get_symbol_index): Likewise.
10687 (Output_reloc::local_section_offset): Check that local_sym_index_
10688 is not TARGET_CODE or 0.
10689 (Output_reloc::symbol_value): Likewise.
10690 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10691 reloc.
10692 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10693 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10694 functions.
10695 * layout.cc (add_target_dynamic_tags): Use output section for
10696 DT_PLTRELSZ and DT_JMPREL.
10697
3a44184e
ILT
106982010-01-07 Ian Lance Taylor <iant@google.com>
10699
10700 PR 11061
10701 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10702 function.
10703 (class Output_data_reloc_generic): Define.
10704 (class Output_data_reloc_base): Change base class to
10705 Output_data_reloc_generic. Change add() method to call
10706 bump_relative_reloc_count for a relative reloc. Remove
10707 sort_relocs_ field.
10708 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10709 to sort_relocs().
10710 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10711 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10712 appropriate.
10713 * layout.h (class Layout): Update declaration.
10714
ea715a34
ILT
107152010-01-07 Ian Lance Taylor <iant@google.com>
10716
10717 * output.h (class Output_data): Add const version of
10718 output_section and do_output_section.
10719 (class Output_section_data): Add const version of
10720 do_output_section.
10721 (class Output_section): Likewise.
10722 * layout.cc (Layout::add_target_dynamic_tags): New function.
10723 * layout.h (class Layout): Update declarations.
10724 * arm.cc (Target_arm::do_finalize_sections): Use
10725 add_target_dynamic_tags.
10726 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10727 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10728 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10729 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10730
659948a4
ILT
107312010-01-07 Ian Lance Taylor <iant@google.com>
10732
10733 PR 11042
10734 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10735 object as needed.
10736
9d3b86f6
ILT
107372010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10738 Ian Lance Taylor <iant@google.com>
10739
10740 PR 11019
10741 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10742 Xindex::read_symtab_xindex.
10743
bb0d3eb0
DK
107442010-01-07 Doug Kwan <dougkwan@google.com>
10745
10746 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10747 (Insn_template::thumb16_bcond_insn): New method declaration.
10748 (Insn_template): Fix spelling.
10749 (Stub::thumb16_special): New method declaration.
10750 (Stub::do_write): Define virtual method which was previously pure
10751 virtual.
10752 (Stub::do_thumb16_special): New method declaration.
10753 (Stub::do_fixed_endian_write): New template member.
10754 (Reloc_stub::do_write): Remove.
10755 (Reloc_stub::do_fixed_endian_write): Remove.
10756 (Cortex_a8_stub): New class definition.
10757 (Stub_factory::make_cortex_a8_stub): New method definition.
10758 (Stub_factory::Stub_factory): Add missing static storage class
10759 qualifier for elf32_arm_stub_a8_veneer_blx.
10760
ffeef7df
ILT
107612010-01-07 Ian Lance Taylor <iant@google.com>
10762
dc3f80fe
ILT
10763 PR 10980
10764 * options.h (class General_options): Add --warn-unresolved-symbols
10765 and --error-unresolved-symbols.
10766 * errors.cc (Errors::undefined_symbol): Implement
10767 --warn-unresolved-symbols.
10768
ffeef7df
ILT
10769 * options.h (class General_options): Add -z text and -z textoff.
10770 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10771
f1ec9ded
ST
107722010-01-06 Sriraman Tallam <tmsriram@google.com>
10773
10774 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10775 (Garbage_collection::cident_sections): New function.
10776 (Garbage_collection::add_cident_section): New function.
10777 (Garbage_collection::cident_sections_): New member.
10778 (gc_process_relocs): Add references to sections whose names are C
10779 identifiers.
10780 * gold.h (cident_section_start_prefix): New constant.
10781 (cident_section_stop_prefix): New constant.
10782 (is_cident): New function.
10783 * layout.cc (Layout::define_section_symbols): Replace string constants
10784 with the newly defined constants.
10785 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10786 C identifiers.
10787 * testsuite/Makefile.am: Add gc_orphan_section_test.
10788 * testsuite/Makefile.in: Regenerate.
10789 * testsuite/gc_orphan_section_test.cc: New file.
10790 * testsuite/gc_orphan_section_test.sh: New file.
10791
6eda8c29
ILT
107922010-01-06 Ian Lance Taylor <iant@google.com>
10793
b9674e17
ILT
10794 PR 10980
10795 * options.h (class General_options): Add --warn-shared-textrel.
10796 * layout.cc (Layout::finish_dynamic_section): Implement
10797 --warn-shared-textrel.
10798
6eda8c29
ILT
10799 PR 10980
10800 * options.h (class General_options): Add --warn-multiple-gp.
10801
32dcd44e
ILT
108022010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10803
10804 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10805 $(THREADSLIB) and $(LIBDL).
10806 * Makefile.in: Rebuild.
10807
a192ba05
ILT
108082010-01-06 Ian Lance Taylor <iant@google.com>
10809
10810 PR 10980
10811 * options.cc (General_options::parse_section_start): New function.
10812 (General_options::section_start): New function.
10813 (General_options::General_options): Initialize all members.
10814 * options.h: Include <map>
10815 (class General_options): Add --section-start. Add section_starts_
10816 member.
10817 * layout.cc (Layout::attach_allocated_section_to_segment): If
10818 --section-start was used, set the address of the segment. Remove
10819 local sort_sections.
10820 (Layout::relaxation_loop_body): If the address of the load segment
10821 has been set by --section-start, don't use it.
10822 * output.h (Output_segment::update_flags_for_output_section): New
10823 function.
10824 * output.cc (Output_segment::add_output_section): Call
10825 update_flags_for_output_section.
10826
dde3f402
ILT
108272010-01-05 Ian Lance Taylor <iant@google.com>
10828
62dfdd4d
ILT
10829 PR 10980
10830 * options.h (class General_options): Add --undefined-version.
10831 * script.cc (struct Version_expression): Add was_matched_by_symbol
10832 field.
10833 (Version_script_info::matched_symbol): New function.
10834 (Version_script_info::get_symbol_version_helper): Call
10835 matched_symbol.
10836 (Version_script_info::check_unmatched_names): New function.
10837 * script.h (class Version_script_info): Update declarations.
10838 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10839
9c4ae156
ILT
10840 * options.h (class General_options): Use DEFINE_bool_alias for
10841 allow_multiple_definition.
10842 * resolve.cc (Symbol_table::should_override): Don't test
10843 allow_multiple_definition.
10844
dde3f402
ILT
10845 PR 10980
10846 * options.h (class General_options): Add --cref.
10847 * main.cc (main): Print cref table if --cref. Don't close mapfile
10848 until after printing cref table.
10849 * cref.cc: Include "symtab.h".
10850 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10851 (Cref_table_compare::operator()): New function.
10852 (Cref_inputs::gather_cref): New function.
10853 (filecol): New static const.
10854 (Cref_inputs::print_cref): New function.
10855 (Cref::print_cref): New function.
10856 * cref.h: Include <cstdio>.
10857 (class Cref): Update declarations.
10858 * mapfile.h (Mapfile::file): New function.
10859 * object.h (class Object): Define Symbols. Declare virtual
10860 do_get_global_symbols.
10861 (Object::get_global_symbols): New function.
10862 * object.cc (Input_objects::add_object): Pass object to cref_ if
10863 --cref.
10864 (Input_objects::archive_start): Likewise.
10865 (Input_objects::archive_stop): Likewise.
10866 (Input_objects::print_cref): New function.
10867 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10868 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10869 --cref.
10870 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10871 function.
10872 * plugin.h (class Sized_pluginobj): Update declarations.
10873
8781f709
ILT
108742010-01-05 Ian Lance Taylor <iant@google.com>
10875
10876 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10877 to is_default_version. Rename insdef to insdefault.
10878 (Symbol_table::add_from_relobj): Rename def to is_default_version
10879 and local to is_forced_local.
10880 (Symbol_table::add_from_pluginobj): Likewise.
10881 (Symbol_table::add_from_dynobj): Likewise.
10882 (Symbol_table::define_special_symbol): Rename insdef to
10883 insdefault.
10884
fe35d28d
ILT
108852010-01-04 Ian Lance Taylor <iant@google.com>
10886
30bc8c46
ILT
10887 PR 10980
10888 * options.h (class General_options): Add
10889 --allow-multiple-definition and -z muldefs.
10890 * resolve.cc (Symbol_table::should_override): Don't warn about a
10891 multiple symbol definition if --allow-multiple-definition or -z
10892 muldefs.
10893
7eaea549
ILT
10894 PR 10980
10895 * options.h (class General_options): Add --add-needed and
10896 --copy-dt-needed-entries. Tweak --as-needed help entry.
10897 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10898 error if --copy-dt-needed-entries aka --add-needed is used and
10899 would cause a change in behaviour.
10900
fe35d28d
ILT
10901 PR 10980
10902 * options.h (class General_options): Add -G as a short version of
10903 --shared. Add no-op options -assert, -g, and -i.
10904
55a2bb35
ST
109052010-01-04 Sriraman Tallam <tmsriram@google.com>
10906
10907 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10908 check for .text or .gnu.linkonce.t sections.
10909 * icf.cc (Icf::find_identical_sections): Ditto.
10910 Change the detection for mangled function name within the section
10911 name.
10912 * icf.h (is_section_foldable_candidate): New function.
10913
719328e1
ILT
109142009-12-30 Ian Lance Taylor <iant@google.com>
10915
10916 PR 10980
10917 * options.h (class General_options): Permit two dashes with
10918 --retain-symbols-file.
10919
d7bb5745
ILT
109202009-12-30 Ian Lance Taylor <iant@google.com>
10921
403a15dd
ILT
10922 PR 10979
10923 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10924 don't put the file header and segment headers in the text
10925 segment.
10926
eda294df
ILT
10927 PR 10979
10928 * common.cc (Sort_commons::operator()): Stabilize sort when both
10929 entries are NULL.
10930 (Symbol_table::do_allocate_commons_list): When allocating common
10931 symbols, skip a symbol which is no longer common.
10932 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10933 an object before checking its type.
10934 * testsuite/common_test_2.c: New file.
10935 * testsuite/common_test_3.c: New file.
10936 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10937 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10938 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10939 (common_test_2_pic.o, common_test_2.so): New targets.
10940 (common_test_3_pic.o, common_test_3.so): New targets.
10941 * testsuite/Makefile.in: Rebuild.
10942
d7bb5745
ILT
10943 PR 10979
10944 * script.cc (read_input_script): If we see a new SECTIONS clause,
10945 and we have added an input section, give an error.
10946 * layout.h (class Layout): Add have_added_input_section function.
10947 Add have_added_input_section_ field.
10948 * layout.cc (Layout::Layout): Initialize
10949 have_added_input_section_.
10950 (Layout::layout): Set have_added_input_section_.
10951 (Layout::layout_eh_frame): Likewise.
10952
fc59c572
ILT
109532009-12-30 Ian Lance Taylor <iant@google.com>
10954
10955 PR 10931
10956 * options.h (class General_options): Add --sort-common option.
10957 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10958 * common.cc (Sort_common): Add sort_order parameter to
10959 constructor. Add sort_order_ field.
10960 (Sort_commons::operator): Check sort_order_.
10961 (Symbol_table::allocate_commons): Determine the sort order.
10962 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10963 Change all callers.
10964 (Symbol_table::do_allocate_commons_list): Likewise.
10965
1c74fab0
ILT
109662009-12-30 Ian Lance Taylor <iant@google.com>
10967
10968 PR 10916
10969 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10970 symbols from this object, don't change the visibility of an
10971 undefined symbol.
10972 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10973
6affe781
ILT
109742009-12-30 Ian Lance Taylor <iant@google.com>
10975
10976 PR 10861
10977 * script.h (class Version_script_info): Define Language enum.
10978 Update declarations. Define Glob, Exact, and Lookup types. Add
10979 new fields globals_, locals_, and is_finalized_.
10980 * script.cc: Various formatting fixes.
10981 (class Parser_closure): Change language_stack_ from a vector of
10982 std::string to one of Version_script_info::Language. Adjust all
10983 uses accordingly.
10984 (class Lazy_demangler): Remove.
10985 (struct Version_expression): Change language from std::string to
10986 Version_script_info::Language.
10987 (Version_script_info::Version_script_info): New function.
10988 (Version_script_info::~Version_script_info): Don't call clear.
10989 (Version_script_info::finalize): New function.
10990 (Version_script_info::build_lookup_tables): New function.
10991 (Version_script_info::build_expression_list_lookup): New
10992 function.
10993 (Version_script_info::get_symbol_version_helper): Rewrite to use
10994 lookup tables.
10995 (Version_script_info::print_expression_list): Adjust to use
10996 Version_script_info::Language.
10997 (script_push_lex_into_version_mode): Check that the version script
10998 has not been finalized.
10999 (version_script_push_lang): Change language string to
11000 Version_script_info::Language.
11001 * options.cc (Command_line::version_script): New function.
11002 * options.h (class General_options): Add finalize_dynamic_list
11003 function. Change version_script from declaration to definition.
11004 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11005 * testsuite/version_script.map: Remove duplicate def of foo.
11006 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11007 version_script.map.
11008 * testsuite/Makefile.in: Rebuild.
11009
818bf354
ILT
110102009-12-30 Ian Lance Taylor <iant@google.com>
11011
11012 PR 10843
11013 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11014 if the input symbol index is 0, make the output symbol index 0.
11015
ebcc8304
ILT
110162009-12-30 Ian Lance Taylor <iant@google.com>
11017
11018 PR 10670
11019 * options.h (class General_options): Add -x/--discard-all.
11020 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11021 --discard-all. If the local symbol needs a dynamic entry, check
11022 that before handling --discard-locals.
11023
176fe33f
ILT
110242009-12-30 Ian Lance Taylor <iant@google.com>
11025
bb321bb1
ILT
11026 PR 10450
11027 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11028 flags to PF_R.
11029 (Output_segment::add_output_section): Don't change the flags if
11030 the type is PT_TLS.
11031
176fe33f
ILT
11032 PR 10450
11033 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11034 GNU hash table if they need a dynamic value. Otherwise, don't add
11035 them if they are defined in a dynamic object or are forced local.
11036
e8cd95c7
ILT
110372009-12-29 Ian Lance Taylor <iant@google.com>
11038
1b81fb71
ILT
11039 PR 10450
11040 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11041 .gnu.hash table for a 32-bit target.
11042
8d6d383d
ILT
11043 PR 10450
11044 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11045 regular and a dynamic object only needs a dynamic symbol table
11046 entry if it is externally visible.
11047
e785ec03
ILT
11048 PR 10450
11049 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11050 constructor. Add global_offset_table_ field.
11051 (Target_i386::got_section): Set global_offset_table_.
11052 (Target_i386::do_finalize_sections): Set global_offset_table_
11053 size.
11054 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11055 in constructor. Add global_offset_table_ field.
11056 (Target_x86_64::got_section): Set global_offset_table_.
11057 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11058 size.
11059
1a2dff53
ILT
11060 * layout.cc (Layout::Layout): Initialize increase_relro_.
11061 (Layout::get_output_section): Add is_relro, is_last_relro, and
11062 is_first_non_relro parameters. Change all callers.
11063 (Layout::choose_output_section): Likewise.
11064 (Layout::add_output_section_data): Likewise.
11065 (Layout::make_output_section): Likewise.
11066 (Layout::set_segment_offsets): Clear increase_relro when using a
11067 linker script.
11068 * layout.h (class Layout): Add increase_relro method. Add
11069 increase_relro_ field. Update declarations.
11070 * output.cc (Output_section::Output_section): Initialize
11071 is_last_relro_ and is_first_non_relro_.
11072 (Output_segment::add_output_section): Group relro sections is
11073 do_sort is true. Handle is_last_relro and is_first_non_relro.
11074 (Output_segment::maximum_alignment): Remove relro handling.
11075 (Output_segment::set_section_addresses): Add increase_relro
11076 parameter. Change all callers. Add initial alignment to align
11077 relro sections on separate page. Remove old relro handling.
11078 (Output_segment::set_section_list_addresses): Remove in_relro
11079 parameter. Change all callers.
11080 (Output_segment::set_offset): Add increase parameter. Change all
11081 callers. Remove old relro handling.
11082 * output.h (class Output_section): Add new methods: is_last_relro,
11083 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11084 Add is_last_relro_ and is_first_non_relro_ fields.
11085 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11086 Create separate .got.plt section. Call increase_relro.
11087 * x86_64.cc (Target_x86_64::got_section): Likewise.
11088 * testsuite/relro_script_test.t: Add .got.plt.
11089
f0ba79e2
ILT
11090 PR 10450
11091 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11092 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11093 (Layout::finalize): Call set_dynamic_symbol_size.
11094 (Layout::set_dynamic_symbol_size): New function.
11095 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11096 set_dynamic_symbol_size.
11097
e8cd95c7
ILT
11098 PR 10450
11099 * output.h (class Output_section): Add is_entsize_zero_ field.
11100 * output.cc (Output_section::Output_section): Initialize
11101 is_entsize_zero_.
11102 (Output_section::set_entsize): If two different entsizes are
11103 requested, force it to zero.
11104 (Output_section::add_input_section): Set flags for .debug_str
11105 before updating section flags. Set entsize.
11106 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11107 and SHF_STRING if all input sections have those flags.
11108
3e1b9a8a
RÁE
111092009-12-29 Rafael Espindola <espindola@google.com>
11110
11111 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11112 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11113 reporting.
3e1b9a8a 11114
3dcad376
ST
111152009-12-29 Sriraman Tallam <tmsriram@google.com>
11116
11117 * options.cc (General_options::parse_version): Allow -v to exit
11118 without an error if there is nothing to link.
11119
084e2665
ILT
111202009-12-29 Ian Lance Taylor <iant@google.com>
11121
11122 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11123 using a version of gcc before 4.1.
11124 * configure: Rebuild.
11125
250acde3
CD
111262009-12-28 Chris Demetriou <cgd@google.com>
11127
11128 * attributes.cc (Output_attributes_section_data::do_write): Use
11129 std::vector::front rather than std::vector::data.
11130
99fff23b
ILT
111312009-12-28 Ian Lance Taylor <iant@google.com>
11132
11133 * symtab.h (class Symbol_table): Add enum Defined.
11134 * resolve.cc (Symbol_table::should_override): Add defined
11135 parameter. Change all callers. Test whether object is NULL
11136 before calling a method on it.
11137 (Symbol_table::report_resolve_problem): Add defined parameter.
11138 Change all callers.
11139 (Symbol_table::should_override_with_special): Likewise.
11140 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11141 parameter. Change all callers.
11142 (Symbol_table::do_define_in_output_data): Likewise.
11143 (Symbol_table::define_in_output_segment): Likewise.
11144 (Symbol_table::do_define_in_output_segment): Likewise.
11145 (Symbol_table::define_as_constant): Likewise.
11146 (Symbol_table::do_define_as_constant): Likewise.
11147 * script.h (class Symbol_assignment): Add is_defsym parameter to
11148 constructor; change all callers.
11149 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11150 parameter. Change all callers. Add is_defsym_ field.
11151 (class Parser_closure): Add parsing_defsym parameter to
11152 constructor; change all callers. Add parsing_defsym accessor
11153 function. Add parsing_defsym_ field.
11154
556bd683
ILT
111552009-12-28 Ian Lance Taylor <iant@google.com>
11156
11157 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11158 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11159
1782c879
ILT
111602009-12-23 Ian Lance Taylor <iant@google.com>
11161
11162 * i386.cc (Target_i386::do_calls_non_split): Recognize
11163 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11164 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11165 -fsplit-stack prologue when using %r11.
1782c879 11166
329ca2b1
ST
111672009-12-21 Sriraman Tallam <tmsriram@google.com>
11168
11169 * options.cc (General_options::parse_version): Make -v continue and do
11170 the link like GNU ld does.
11171
d675ff46
RÁE
111722009-12-17 Rafael Avila de Espindola <espindola@google.com>
11173
11174 * Makefile.am (CCFILES): Add timer.cc.
11175 (HFILES): Add timer.h.
11176 * configure.ac: Check for sysconf and times.
11177 * main.cc: include timer.h.
11178 (main): Use Timer instead of get_run_time.
11179 * timer.cc: New.
11180 * timer.h: New.
11181 * workqueue.cc: include timer.h.
11182 (Workqueue::find_and_run_task):
11183 Report user, sys and wall time.
11184 * Makefile.in: Regenerate.
11185 * config.in: Regenerate.
11186 * configure: Regenerate.
11187
d6344fb5
DK
111882009-12-16 Doug Kwan <dougkwan@google.com>
11189
11190 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11191 sections.
11192 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11193 relaxed input sections.
11194 * output.cc (Output_section::find_relaxed_input_section): Change
11195 return type to Output_relaxed_input_section pointer. Adjust code
11196 for new type of relaxed_input_section_map_.
11197 * output.h (Output_section::find_relaxed_input_section): Change
11198 return type to Output_relaxed_input_section pointer.
11199 (Output_section::Output_relaxed_input_section_by_input_section_map):
11200 New type.
11201 (Output_section::relaxed_input_section_map_): Change type to
11202 Output_section::Output_relaxed_input_section_by_input_section_map.
11203 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11204 input section.
11205
0e0d5469
ILT
112062009-12-15 Ian Lance Taylor <iant@google.com>
11207
11208 * layout.cc (Layout::create_shstrtab): Only write out after input
11209 sections if we are compressing debug sections.
11210
0649a889
ILT
112112009-12-15 Ian Lance Taylor <iant@google.com>
11212
11213 * archive.cc (Archive::add_symbols): Only look up a symbol without
11214 a version if there is, in fact, a version.
11215
2ea97941
ILT
112162009-12-14 Ian Lance Taylor <iant@google.com>
11217
11218 Revert -Wshadow changes, all changes from:
11219 2009-12-11 Doug Kwan <dougkwan@google.com>
11220 2009-12-11 Nick Clifton <nickc@redhat.com>
11221 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11222
b0eec2cc
DK
112232009-12-11 Doug Kwan <dougkwan@google.com>
11224
11225 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11226 due to -Wshadow.
11227 * attributes.cc (Object_attribute::size): Ditto.
11228 (Attributes_section_data::size): Ditto.
11229 (Attributes_section_data::Attributes_section_data): Ditto.
11230 (Output_attributes_section_data::do_write): Ditto.
11231 * attributes.h (Object_attribute::set_type): Ditto.
11232 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11233
91d6fa6a
NC
112342009-12-11 Nick Clifton <nickc@redhat.com>
11235
11236 * archive.cc: Fix shadowed variable warnings.
11237 * arm.cc: Likewise.
11238 * compressed_output.cc: Likewise.
11239 * compressed_output.h: Likewise.
11240 * configure: Likewise.
11241 * dwarf_reader.cc: Likewise.
11242 * dynobj.cc: Likewise.
11243 * dynobj.h: Likewise.
11244 * ehframe.cc: Likewise.
11245 * ehframe.h: Likewise.
11246 * errors.cc: Likewise.
11247 * expression.cc: Likewise.
11248 * fileread.cc: Likewise.
11249 * fileread.h: Likewise.
11250 * freebsd.h: Likewise.
11251 * i386.cc: Likewise.
11252 * icf.cc: Likewise.
11253 * incremental.h: Likewise.
11254 * layout.cc: Likewise.
11255 * layout.h: Likewise.
11256 * mapfile.cc: Likewise.
11257 * merge.cc: Likewise.
11258 * merge.h: Likewise.
11259 * object.cc: Likewise.
11260 * object.h: Likewise.
11261 * options.h: Likewise.
11262 * output.cc: Likewise.
11263 * output.h: Likewise.
11264 * parameters.cc: Likewise.
11265 * plugin.cc: Likewise.
11266 * powerpc.cc: Likewise.
11267 * reduced_debug_output.cc: Likewise.
11268 * reduced_debug_output.h: Likewise.
11269 * reloc.cc: Likewise.
11270 * reloc.h: Likewise.
11271 * resolve.cc: Likewise.
11272 * script-sections.cc: Likewise.
11273 * script.cc: Likewise.
11274 * script.h: Likewise.
11275 * sparc.cc: Likewise.
11276 * symtab.cc: Likewise.
11277 * symtab.h: Likewise.
11278 * target-select.cc: Likewise.
11279 * target-select.h: Likewise.
11280 * token.h: Likewise.
11281 * workqueue.cc: Likewise.
11282 * workqueue.h: Likewise.
11283 * x86_64.cc: Likewise.
11284
a0351a69
DK
112852009-12-10 Doug Kwan <dougkwan@google.com>
11286
11287 * arm.cc (attributes.h): New include.
11288 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11289 (Arm_relobj::~Arm_relobj): Delete object pointed by
11290 attributes_section_data_.
11291 (Arm_relobj::attributes_section_data): New method definition.
11292 (Arm_relobj::attributes_section_data_): New data member declaration.
11293 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11294 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11295 attributes_section_data_.
11296 (Arm_dynobj::attributes_section_data): New method definition.
11297 (Arm_dynobj::attributes_section_data_): New data member declaration.
11298 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11299 initialization value of may_use_blx_ to false.
2e702c99 11300 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11301 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11302 object attributes to compute results instead of hard-coding.
11303 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11304 Target_arm::get_secondary_compatible_arch,
11305 Target_arm::set_secondary_compatible_arch
11306 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11307 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11308 New method declarations.
11309 (Target_arm::get_aeabi_object_attribute): New method definition.
11310 (Target_arm::attributes_section_data_): New data member declaration.
11311 (read_arm_attributes_section): New template definition.
11312 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11313 (Arm_dynobj::do_read_symbols): Ditto.
11314 (Target_arm::do_finalize_sections): Merge attributes sections from
11315 input. Check for BLX use after attributes section merging.
11316 Fix __exidx_start and __exidx_end visibility. Create an
11317 .ARM.attributes section if necessary.
11318 (Target_arm::get_secondary_compatible_arch,
11319 Target_arm::set_secondary_compatible_arch,
11320 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11321 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11322 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11323 New method definitions.
11324
b59befec
ILT
113252009-12-09 Ian Lance Taylor <iant@google.com>
11326
11327 * plugin.cc (Plugin::load): Don't cast from void* to a function
11328 pointer.
11329
1276bc89
ILT
113302009-12-09 Ian Lance Taylor <iant@google.com>
11331
11332 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11333 information fields.
11334
2f2de248
L
113352009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11336
11337 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11338 Replace two_file_shared_1.so with two_file_shared_2.so.
11339 * testsuite/Makefile.in: Regenerated.
11340
4f787271
DK
113412009-12-08 Doug Kwan <dougkwan@google.com>
11342
11343 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11344 (HFILES): Add attributes.h and int_encoding.h.
11345 * Makefile.in: Regenerate.
11346 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11347 function definitions to int_encoding.cc
11348 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11349 prototypes to int_encoding.h
11350 * reduced_debug_output.cc (int_encoding.h): New include.
11351 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11352 function definitions to int_encoding.cc
11353 (insert_into_vector, read_from_pointer): Move template definitions to
11354 int_encoding.h
11355 * attributes.cc: New file.
11356 * attributes.h: New file.
11357 * int_encoding.cc: New file.
11358 * int_encoding.h: New file.
11359
20b52f1a
RÁE
113602009-12-07 Rafael Avila de Espindola <espindola@google.com>
11361
11362 PR gold/11055
11363 * incremental-dump.cc (dump_incremental_inputs): New.
11364 (main): Use dump_incremental_inputs.
11365
53d7974c
L
113662009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11367
11368 PR gold/10893
11369 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11370 checking elfcpp::STT_FUNC.
11371 (Target_i386::Relocate::relocate): Likewise.
11372 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11373
11374 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11375 symbols from shared libraries into normal FUNC symbols.
11376
11377 * symtab.h (Symbol): Add is_func and use it.
11378
05a352e6
DK
113792009-12-05 Doug Kwan <dougkwan@google.com>
11380
11381 * arm.cc (Target_arm::arm_info): Initialize new fields
11382 attributes_section and attributes_vendor.
11383 * i386.cc (Target_i386::i386_info): Same.
11384 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11385 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11386 fields attributes_section and attributes_vendor.
53d7974c 11387 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11388 * target.h (Target::attributes_section, Target::attributes_vendor,
11389 Target::is_attributes_section, Target::attribute_arg_type,
11390 Target::attributes_order): New method definitions.
11391 (Target::Target_info::attributes_section,
11392 Target::Target_info::attributes_vendor): New fields.
11393 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11394 virtual method definitions.
11395 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11396 attributes_section and attributes_vendor.
11397 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11398
f4e5969c
DK
113992009-12-05 Doug Kwan <dougkwan@google.com>
11400
11401 * arm.cc: Update comments about interworking and stub generation.
11402 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11403 considered as non-PIC.
11404 (Arm_relocate_functions::base_abs): Fix formatting.
11405 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11406 of function to use GOT entry address instead of offset.
11407 (Target_arm::Scan::global): Issue an error if a symbol would need a
11408 PLT does not get one because it is untyped. Remove code to create
11409 dynamic symbols for relative branches.
11410 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11411 takes unsigned integer instead of boolean.
11412
1abce4a6
L
114132009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11414
11415 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11416 (two_file_test_LDADD): Likewise.
11417 (common_test_1_LDADD): Likewise.
11418 (exception_test_LDADD) Likewise.
11419 (weak_test_LDADD): Likewise.
11420 (many_sections_test_LDADD): Likewise.
11421 (initpri1_LDADD): Likewise.
11422 (script_test_1_LDADD): Likewise.
11423 (script_test_2_LDADD): Likewise.
11424 (justsyms_LDADD): Likewise.
11425 (binary_test_LDADD): Likewise.
11426 (large_LDADD): Likewise.
11427 * testsuite/Makefile.in: Regenerated.
11428
adcf2816 114292009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11430
adcf2816
L
11431 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11432 (Symbol_table::override_with_special): Likewise.
11433 (Symbol_table::add_from_object): Likewise.
11434
28e67f5d
RÁE
114352009-12-04 Rafael Avila de Espindola <espindola@google.com>
11436
11437 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11438 Don't set the data_offset twice.
11439
ae10a101
RÁE
114402009-12-04 Rafael Avila de Espindola <espindola@google.com>
11441
11442 * testsuite/Makefile.in: Regenerate.
11443
f59f41f3
DK
114442009-12-03 Doug Kwan <dougkwan@google.com>
11445
11446 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11447 (Target_arm::do_finalize_sections): Add parameter for symbol table
11448 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11449 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11450 parameter for symbol table pointer.
11451 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11452 an additional parameter for a pointer to symbol table.
11453 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11454 parameter for a symbol table pointer.
11455 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11456 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11457 Ditto.
11458 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11459 parameter for a symbol table pointer.
11460
ca55d848
RÁE
114612009-12-03 Rafael Avila de Espindola <espindola@google.com>
11462
11463 * incremental.cc (Incremental_inputs_header)
11464 (Incremental_inputs_header_write, Incremental_inputs_entry)
11465 (Incremental_inputs_entry_write): Move ...
11466 * incremental.h (Incremental_inputs_header)
11467 (Incremental_inputs_header_write, Incremental_inputs_entry)
11468 (Incremental_inputs_entry_write): here.
11469
3aec4f9c
RÁE
114702009-12-02 Rafael Avila de Espindola <espindola@google.com>
11471
11472 * incremental.cc (make_sized_incremental_binary): Set the target.
11473 Error if it is incompatible.
11474 * output.h (Output_file): Add filename method.
11475
9c0ae74d
RÁE
114762009-12-02 Rafael Avila de Espindola <espindola@google.com>
11477
11478 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11479 from the get_* methods.
11480
a45500ae
RÁE
114812009-12-02 Rafael Avila de Espindola <espindola@google.com>
11482
11483 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11484 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11485 Write 0 for the data_offset of scripts.
11486
325e6408
RÁE
114872009-12-02 Rafael Avila de Espindola <espindola@google.com>
11488
11489 * testsuite/Makefile.am: Add the incremental_test.sh test.
11490 * testsuite/incremental_test.sh: New.
11491 * testsuite/incremental_test_1.c: New.
11492 * testsuite/incremental_test_2.c: New.
11493
954c3e2e
RÁE
114942009-12-01 Rafael Avila de Espindola <espindola@google.com>
11495
703d02da 11496 * incremental-dump.cc (main): Fix typos.
954c3e2e 11497
f8086623
RÁE
114982009-11-27 Rafael Avila de Espindola <espindola@google.com>
11499
11500 PR gold/11025
11501 * incremental-dump.cc (main): Use llu to print 64 bit values.
11502
3b0dd6ac
L
115032009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11504 H.J. Lu <hongjiu.lu@intel.com>
11505
11506 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11507 $(LIBDL).
11508 (incremental_dump_LDADD): Likewise.
11509 * Makefile.in: Regenerated.
11510
a6d1ef57 115112009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11512
a6d1ef57
DK
11513 Revert:
11514
11515 2009-11-25 Doug Kwan <dougkwan@google.com>
11516
11517 * arm.cc (Target_arm::Target_arm): Move method definition
11518 outside of class definition. Add code to handle
11519 --target1-rel, --target1-abs and --target2= options.
11520 (Target_arm::get_reloc_reloc_type): Change method to be
11521 non-static and const.
11522 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11523 New data member declaration.
11524 (Target_arm::Scan::local, Target_arm::Scan::global,
11525 Target_arm::Relocate::relocate,
11526 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11527 Adjust call to Target_arm::get_real_reloc_type.
11528 (Target_arm::get_real_reloc_type): Use command line options
11529 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11530 * options.h (--target1-rel, --target1-abs, --target2): New
11531 ARM-only options.
11532
50aeb7d4
DK
115332009-11-25 Doug Kwan <dougkwan@google.com>
11534
11535 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11536 class definition. Add code to handle --target1-rel, --target1-abs
11537 and --target2= options.
11538 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11539 and const.
11540 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11541 member declaration.
11542 (Target_arm::Scan::local, Target_arm::Scan::global,
11543 Target_arm::Relocate::relocate,
11544 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11545 call to Target_arm::get_real_reloc_type.
11546 (Target_arm::get_real_reloc_type): Use command line options to
11547 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11548 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11549 options.
11550
51938283
DK
115512009-11-25 Doug Kwan <dougkwan@google.com>
11552
11553 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11554 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11555 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11556 formatting.
11557 (Arm_relocate_functions::thm_call): Replace body with a call to
11558 Arm_relocate_functions::thumb_branch_common.
11559 (Arm_relocate_functions::thm_jump24,
11560 Arm_relocate_functions::thm_xpc22): New method definitions.
11561 (Arm_relocate_functions::thumb_branch_common): New method definition.
11562 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11563 operator.
11564 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11565 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11566
e2b8f3c4
RÁE
115672009-11-24 Rafael Avila de Espindola <espindola@google.com>
11568
11569 * Makefile.am: Build incremental-dump
11570 * Makefile.in: Regenerate.
11571 * incremental-dump.cc: New.
11572 * incremental.cc (Incremental_inputs_header_data,
11573 Incremental_inputs_entry_data): Move to incremental.h
11574 * incremental.h: (Incremental_inputs_header_data,
11575 Incremental_inputs_entry_data): Move from incremental.cc
11576
bcba9aec
RÁE
115772009-11-24 Rafael Avila de Espindola <espindola@google.com>
11578
11579 * incremental.cc (Incremental_inputs_header,
11580 Incremental_inputs_header_write, Incremental_inputs_entry,
11581 Incremental_inputs_entry_write): Add a typedef with the data type.
11582
7c3afe08
RÁE
115832009-11-24 Rafael Avila de Espindola <espindola@google.com>
11584
11585 * incremental.cc (Incremental_inputs_header,
11586 Incremental_inputs_header_write, Incremental_inputs_entry,
11587 Incremental_inputs_entry_write): Update comment about which
11588 type has the filed descriptions.
11589
d204b6e9
DK
115902009-11-15 Doug Kwan <dougkwan@google.com>
11591
11592 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11593 (Arm_relocate_functions::arm_branch_common): Change method defintion
11594 in class definition to a method declaration and update list of formal
11595 parameters.
11596 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11597 Arm_relocation_functions::jump24): Adjust call to
11598 Arm_relocate_functions::arm_branch_common. Update list of formal
11599 parameters.
11600 (Arm_relocate_functions::xpc25): New method definition.
11601 (Arm_relocate_functions::arm_branch_common): Move method defintion
11602 out from class definition. Use stubs for mode-switching and extending
11603 branch ranges.
11604 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11605 specially. Change code to enable use of stubs in ARM branches.
11606
43d12afe
DK
116072009-11-10 Doug Kwan <dougkwan@google.com>
11608
11609 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11610 in method declaration.
11611 (Target_arm::relocate_stub): New method declaration.
11612 (Target_arm::default_target): Change to return a pointer instead of
11613 a const reference.
11614 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11615 Target_arm::default_target.
11616 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11617 method definition.
11618 (Target_arm::relocate_section): Adjust view.
11619 (Target_arm::relocate_stub): New method definition.
11620
ac33a407
DK
116212009-11-10 Doug Kwan <dougkwan@google.com>
11622
11623 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11624 a format warning.
11625 * incremental.cc (open_incremental_binary): Initialized local
11626 variables to avoid warnings.
11627 * object.cc (make_elf_object): Ditto.
11628 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11629 a format warning.
e1df38aa 11630
88ee28e9
L
11631009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11632
11633 PR gold/10930
11634 * testsuite/plugin_test.c: Include "config.h".
11635
2daedcd6
DK
116362009-11-09 Doug Kwan <dougkwan@google.com>
11637
11638 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11639 (arm_symbol_value): Remove.
11640 (Arm_relocate_functions::arm_branch_common,
11641 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11642 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11643 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11644 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11645 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11646 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11647 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11648 Arm_relocate_functions::thm_mobw_abs_nc,
11649 Arm_relocate_functions::thm_mov_abs,
11650 Arm_relocate_functions::movw_prel_nc,
11651 Arm_relocate_functions::thm_movt_abs,
11652 Arm_relocate_functions::movt_prel,
11653 Arm_relocate_functions::thm_movw_prel_nc,
11654 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11655 (Target_arm::Relocate::relocate): Only decompose address into two
11656 parts if relocation type uses the thumb-bit and pass the actual
11657 bit instead of a flag indicating that the thumb-bit is used. Adjust
11658 calls to methods in Arm_relocate_functions for this change.
11659
1276bc89 116602009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11661
11662 PR 10925
11663 * reloc.cc: Instantiate
11664 Sized_relobj::initialize_input_to_output_maps and
11665 Sized_relobj:free_input_to_output_maps.
11666
e53ad1b5
ILT
116672009-11-06 Ian Lance Taylor <iant@google.com>
11668
11669 PR 10876
11670 * defstd.cc (in_segment): Set only_if_ref true for "end".
11671
eb44217c
DK
116722009-11-06 Doug Kwan <dougkwan@google.com>
11673
11674 * arm.cc (class Reloc_stub): Correct a comment.
11675 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11676 (Target_arm::scan_section_for_stubs): New method declaration.
11677 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11678 Change methods from private to protected.
11679 (Target_arm::do_may_relax): New method definition.
11680 (Target_arm::do_relax, Target_arm::group_sections,
11681 Target_arm::scan_reloc_for_stub,
11682 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11683 (Target_arm::arm_input_section_map_): New data member declaration.
11684 (Target_arm::scan_reloc_for_stub,
11685 Target_arm::scan_reloc_section_for_stubs,
11686 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11687 Target_arm::do_relax): New method definitions.
11688
5d329b7d
ILT
116892009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11690
11691 * configure.ac: Check for (struct stat)::st_mtim
11692 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11693 * config.in: Regenerate.
11694 * configure: Regenerate.
11695
96a0d71b
ILT
116962009-11-05 Ian Lance Taylor <iant@google.com>
11697
11698 PR 10910
11699 * output.cc (Output_segment::add_output_section): Add missing
11700 return statement.
11701
594c8e5e
ILT
117022009-11-04 Ian Lance Taylor <iant@google.com>
11703
11704 PR 10880
11705 * object.h (class Object): Add is_needed and set_is_needed
11706 methods. Add is_needed_ field. Make bool fields into bitfields.
11707 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11708 defined in a dynamic object and referenced by a regular object,
11709 set is_needed for the dynamic object.
11710 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11711 if the file is marked with as_needed and it is not needed.
11712
22b127cc
ILT
117132009-11-04 Ian Lance Taylor <iant@google.com>
11714
11715 PR 10887
11716 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11717 tags if data is discarded by linker script.
11718 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11719 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11720 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11721 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11722
f5c870d2
ILT
117232009-11-04 Ian Lance Taylor <iant@google.com>
11724
11725 * layout.cc (Layout::get_output_section): Add is_interp and
11726 is_dynamic_linker_section parameters. Change all callers.
11727 (Layout::choose_output_section): Likewise.
11728 (Layout::make_output_section): Likewise.
11729 (Layout::add_output_section_data): Add is_dynamic_linker_section
11730 parameter. Change all callers.
11731 * layout.h (class Layout): Update declarations.
11732 * output.h (class Output_section): Add is_interp, set_is_interp,
11733 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11734 Add is_interp_, is_dynamic_linker_section_ fields. Change
11735 generate_code_fills_at_write_ to a bitfield.
11736 * output.cc (Output_section::Output_sections): Initialize new
11737 fields.
11738 (Output_segment::add_output_section): Add do_sort parameter.
11739 Change all callers.
11740
1ae4d23b
ILT
117412009-11-03 Ian Lance Taylor <iant@google.com>
11742
11743 PR 10860
11744 * options.h (class General_options): Add --warn-common.
11745 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11746 merging two common symbols.
11747 (Symbol_table::should_override): Handle --warn-common when merging
11748 a common symbol with a defined symbol. Use report_resolve_problem
11749 for multiple definitions.
11750 (Symbol_table::report_resolve_problem): New function.
11751 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11752
55da9579
DK
117532009-11-03 Doug Kwan <dougkwan@google.com>
11754
11755 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11756 stub_factory_.
11757 (Target_arm::stub_factory): New method definition.
11758 (Target_arm::new_arm_input_section,
11759 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11760 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11761 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11762 New type definitions.
11763 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11764 member declarations.
11765 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11766 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11767 New method definitions.
11768
37a9ac43
ILT
117692009-11-03 Ian Lance Taylor <iant@google.com>
11770
11771 * options.h (class General_options): Add --warn_constructors.
11772
b3d6a3d4
ILT
117732009-11-03 Ian Lance Taylor <iant@google.com>
11774
11775 PR 10893
11776 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11777 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11778
934b01dd
ILT
117792009-11-03 Ian Lance Taylor <iant@google.com>
11780
11781 PR 10895
11782 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11783 --msgid-bugs-address.
11784 (install-pdf): New target.
11785 (install-data_yes): Look up one directory to find mkinstalldirs.
11786
03c1939b
L
117872009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11788
11789 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11790 tree.
11791
ebd95253
DK
117922009-10-30 Doug Kwan <dougkwan@google.com>
11793
11794 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11795
e9bbb538
DK
117962009-10-30 Doug Kwan <dougkwan@google.com>
11797
11798 * arm.cc (Stub_addend_reader): New struct template definition
11799 and partial specializations.
11800 (Stub_addend_reader::operator()): New method definition for a
11801 partially specialized template.
11802
d5b40221
DK
118032009-10-30 Doug Kwan <dougkwan@google.com>
11804
11805 * arm.cc (Arm_relobj::processor_specific_flags): New method
11806 definition.
11807 (Arm_relobj::do_read_symbols): New method declaration.
11808 (Arm_relobj::processor_specific_flags_): New data member declaration.
11809 (Arm_dynobj): New class definition.
11810 (Target_arm::do_finalize_sections): Add input_objects parameter.
11811 (Target_arm::do_adjust_elf_header): New method declaration.
11812 (Target_arm::are_eabi_versions_compatible,
11813 (Target_arm::merge_processor_specific_flags): New method declaration.
11814 (Target_arm::do_make_elf_object): New overloaded method definitions
11815 and declaration.
11816 (Arm_relobj::do_read_symbols): New method definition.
11817 (Arm_dynobj::do_read_symbols): Ditto.
11818 (Target_arm::do_finalize_sections): Add input_objects parameters.
11819 Merge processor-specific flags from all input objects.
11820 (Target_arm::are_eabi_versions_compatible,
11821 Target_arm::merge_processor_specific_flags,
11822 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11823 New method definitions.
11824 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11825 Input_objects pointer type parameter.
11826 * layout.cc (Layout::finalize): Pass input objects to target's.
11827 finalize_sections function.
11828 * output.cc (Output_file_header::do_sized_write): Set ELF file
11829 header's processor-specific flags.
11830 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11831 Input_objects pointer type parameter.
11832 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11833 * target.h (Input_objects): New forward class declaration.
11834 (Target::processor_specific_flags,
11835 Target::are_processor_specific_flags_sect): New method definitions.
11836 (Target::finalize_sections): Add input_objects parameter.
11837 (Target::Target): Initialize processor_specific_flags_ and
11838 are_processor_specific_flags_set_.
11839 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11840 parameter.
11841 (Target::set_processor_specific_flags): New method definition.
11842 (Target::processor_specific_flags_,
11843 Target::are_processor_specific_flags_set_): New data member
11844 declarations.
11845 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11846 Input_objects pointer type parameter.
11847
ebabffbd
DK
118482009-10-30 Doug Kwan <dougkwan@google.com>
11849
11850 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11851
ad0f2072
ILT
118522009-10-28 Ian Lance Taylor <iant@google.com>
11853
11854 * object.h (class Relobj): Drop options parameter from
11855 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11856 do_scan_relocs, do_relocate. Change all callers.
11857 (class Sized_relobj): Drop options parameters from
11858 do_gc_process_relocs, do_scan_relocs, do_relocate,
11859 do_relocate_sections, relocate_sections, emit_relocs_scan,
11860 emit_relocs_scan_reltype. Change all callers.
11861 (struct Relocate_info): Remove options field and all references to
11862 it.
11863 * reloc.h (class Read_relocs): Remove options constructor
11864 parameter and options_ field. Change all callers.
11865 (class Gc_process_relocs, class Scan_relocs): Likewise.
11866 (class Relocate_task): Likewise.
11867 * target-reloc.h (scan_relocs): Remove options parameter. Change
11868 all callers.
11869 (scan_relocatable_relocs): Likewise.
11870 * target.h (class Sized_target): Remove options parameter from
11871 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11872 all callers.
11873 * gc.h (gc_process_relocs): Remove options parameter. Change all
11874 callers.
11875 * arm.cc: Update functions to remove options parameters.
11876 * i386.cc: Likewise.
11877 * powerpc.cc: Likewise.
11878 * sparc.cc: Likewise.
11879 * x86_64.cc: Likewise.
11880 * testsuite/testfile.cc: Likewise.
11881
8ffa3667
DK
118822009-10-28 Doug Kwan <dougkwan@google.com>
11883
11884 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11885 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11886 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11887 New method definitions.
11888
40f36857
CC
118892009-10-28 Cary Coutant <ccoutant@google.com>
11890
11891 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11892 (Plugin::cleanup_done_): New member.
11893 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11894 (Plugin_manager::cleanup_done_): Remove.
11895 (Plugin_manager::add_input_file): Edit error message.
11896 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11897 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11898
2c849493
ILT
118992009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11900
11901 * fileread.cc: (File_read::View::~View): Use the new
11902 data_ownership_ filed.
11903 (File_read::~File_read): Dispose the new whole_file_view_.
11904 (File_read::open): Mmap the whole file if needed.
11905 (File_read::open): Use whole_file_view_ instead of contents_.
11906 (File_read::find_view): Use whole_file_view_ if applicable.
11907 (File_read::do_read): Use whole_file_view_ instead of contents_.
11908 (File_read::make_view): Use whole_file_view_ instead of contents_,
11909 update File_read::View::View call.
11910 (File_read::find_or_make_view): Update File_read::View::View
11911 call.
11912 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11913 remove contents_
11914 (File_read::View::Data_ownership): New enum.
11915 (File_read::View::View): Replace bool mapped_ with Data_ownership
11916 argument.
11917 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11918 (File_read::View::data_ownership_): New field.
11919 (File_read::contents_): Remove (replaced by whole_file_view_).
11920 (File_read::whole_file_view_): New field.
11921 * options.h (class General_options): Add --keep-files-mapped.
11922
24998053
CC
119232009-10-27 Cary Coutant <ccoutant@google.com>
11924
11925 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11926 * testsuite/Makefile.am (plugin_test_5): New test case.
11927 * testsuite/Makefile.in: Regenerate.
11928
72adc4fa
DK
119292009-10-25 Doug Kwan <dougkwan@google.com>
11930
11931 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11932 from private to protected to allow access by child class.
11933 (Sized_relobj::do_relocate_sections): New method declaration.
11934 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11935 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11936 Sized_relobj::relocate_sections. Instantiate template explicitly
11937 for different target sizes and endianity.
11938
07f508a2
DK
119392009-10-24 Doug Kwan <dougkwan@google.com>
11940
11941 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11942 (Arm_input_section::as_arm_input_section): New method.
11943 (Arm_output_section): New class definition.
11944 (Arm_output_section::create_stub_group,
11945 Arm_output_section::group_sections): New method definitions.
11946
10ad9fe5
DK
119472009-10-22 Doug Kwan <dougkwan@google.com>
11948
11949 * arm.cc (Arm_input_section): New class definition.
11950 (Arm_input_section::init, Arm_input_section:do_write,
11951 Arm_input_section::set_final_data_size,
11952 Arm_input_section::do_reset_address_and_file_offset): New method
11953 definitions.
11954
56ee5e00
DK
119552009-10-21 Doug Kwan <dougkwan@google.com>
11956
11957 * arm.cc (Stub_table, Arm_input_section): New forward class
11958 declarations.
11959 (Stub_table): New class defintion.
11960 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11961 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11962 New method definition.
11963
b569affa
DK
119642009-10-21 Doug Kwan <dougkwan@google.com>
11965
11966 * arm.cc: Update copyright comments.
11967 (Target_arm): New forward class template declaration.
11968 (Arm_address): New type.
11969 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11970 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11971 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11972 constants.
11973 (Insn_template): Same.
11974 (DEF_STUBS): New macro.
11975 (Stub_type): New enum type.
11976 (Stub_template): New class definition.
11977 (Stub): Same.
11978 (Reloc_stub): Same.
11979 (Stub_factory): Same.
11980 (Target_arm::Target_arm): Initialize may_use_blx_ and
11981 should_force_pic_veneer_.
11982 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11983 Target_arm::should_force_pic_veneer,
11984 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11985 Target_arm::using_thumb_only, Target_arm:;default_target): New
11986 method defintions.
11987 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11988 New data member declarations.
11989 (Insn_template::size, Insn_template::alignment): New method defintions.
11990 (Stub_template::Stub_template): New method definition.
11991 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11992 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11993 (Stub_factory::Stub_factory): New method definition.
11994 * gold.h (string_hash): New template.
11995 * output.h (Input_section_specifier::hash_value): Use
11996 gold::string_hash.
11997 (Input_section_specifier::string_hash): Remove.
11998 * stringpool.cc (Stringpool_template::string_hash): Use
11999 gold::string_hash.
12000
6c172549
DK
120012009-10-20 Doug Kwan <dougkwan@google.com>
12002
12003 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12004 symbols of relaxed input sections.
12005 * output.h (Output_section::find_relaxed_input_section): Make
12006 method public.
12007
c5617f2f
DK
120082009-10-16 Doug Kwan <dougkwan@google.com>
12009
12010 * dynobj.cc (Versions::Versions): Initialize version_script_.
12011 Only insert base version symbol definition for a shared object
12012 if version script defines any version versions.
12013 (Versions::define_base_version): New method definition.
12014 (Versions::add_def): Check that base version is not needed.
12015 (Versions::add_need): Define base version lazily.
12016 * dynobj.h (Versions::define_base_version): New method declaration.
12017 (Versions::needs_base_version_): New data member declaration.
12018 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12019 (check_DATA): Add no_version_test.stdout.
12020 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12021 New make rules.
12022 * testsuite/Makefile.in: Regenerate.
12023 * testsuite/no_version_test.c: New file.
12024 * testsuite/no_version_test.sh: Ditto.
12025
3c12dcdb
DK
120262009-10-16 Doug Kwan <dougkwan@google.com>
12027
12028 * expression.cc (class Segment_start_expression): New class definition.
12029 (Segment_start_expression::value): New method definition.
12030 (script_exp_function_segment_start): Return a new
12031 Segment_start_expression.
12032 * gold/script-c.h (script_saw_segment_start_expression): New function
12033 prototype.
12034 * script-sections.cc (Script_sections::Script_sections): Initialize
12035 SAW_SEGMENT_START_EXPRESSION_ to false.
12036 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12037 and -Tbbs options to specify section addresses if given in
12038 command line and no SEGMENT_START expression is seen in a script.
12039 * script-sections.h (Script_sections::saw_segment_start_expression,
12040 Script_sections::set_saw_segment_start_expression): New method
12041 definition.
12042 (Script_sections::saw_segment_start_expression_): New data member
12043 declaration.
12044 * script.cc (script_saw_segment_start_expression): New function.
12045 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12046 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12047 script_test_7.sh and script_test_8.sh.
12048 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12049 script_test_8.stdout.
12050 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12051 (script_test_6, script_test_6.stdout, script_test_7,
12052 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12053 * Makefile.in: Regenerate.
12054 * testsuite/script_test_6.sh: New file.
12055 * testsuite/script_test_6.t: Same.
12056 * testsuite/script_test_7.sh: Same.
12057 * testsuite/script_test_7.t: Same.
12058 * testsuite/script_test_8.sh: Same.
12059
64b1ae37
DK
120602009-10-16 Doug Kwan <dougkwan@google.com>
12061
12062 * output.cc (Output_segment::set_section_list_address): Cast
12063 expressions to unsigned long long type to avoid format warnings.
12064
661be1e2
ILT
120652009-10-15 Ian Lance Taylor <iant@google.com>
12066
12edd763 12067 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12068 dot assignment to script_sections_.
12edd763
ILT
12069 * script-sections.cc (Script_sections::add_dot_assignment):
12070 Initialize if necessary.
12071
68b6574b
ILT
12072 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12073 program headers with no load segment if there is a linker script.
12074
661be1e2
ILT
12075 * layout.cc (Layout::set_segment_offsets): Align the file offset
12076 to the segment aligment for -N or -n with no load segment.
12077 * output.cc (Output_segment::add_output_section): Don't crash if
12078 the first section is a TLS section.
12079 (Output_segment::set_section_list_addresses): Print an error
12080 message if the address moves backward in a linker script.
12081 * script-sections.cc
12082 (Output_section_element_input::set_section_addresses): Don't
12083 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12084 (Orphan_output_section::set_section_addresses): Likewise.
12085
f15f61a7
DK
120862009-10-15 Doug Kwan <dougkwan@google.com>
12087
12088 * layout.cc (Layout::finish_dynamic_section): Generate tags
12089 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12090 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12091 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12092
82bb573a
ILT
120932009-10-14 Ian Lance Taylor <iant@google.com>
12094
12095 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12096 fields.
12097 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12098 data_shdr fields of relinfo.
12099 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12100 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12101 R_386_TLS_LDO_32, adjust based on section flags.
12102 (Target_i386::Relocate::fix_up_ldo): Remove.
12103
374ad285
ILT
121042009-10-13 Ian Lance Taylor <iant@google.com>
12105
12106 Add support for -pie.
12107 * options.h (class General_options): Add -pie and
12108 --pic-executable.
12109 (General_options::output_is_position_independent): Test -pie.
12110 (General_options::output_is_executable): Return true if not shared
12111 and not relocatable.
12112 (General_options::output_is_pie): Remove.
12113 * options.cc (General_options::finalize): Reject incompatible uses
12114 of -pie.
12115 * gold.cc (queue_middle_tasks): A -pie link is not static.
12116 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12117 * symtab.cc (Symbol::final_value_is_known): Return false if
12118 output_is_position_independent.
12119 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12120 output_is_position_independent.
12121 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12122 output_is_position_independent.
12123 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12124 output_is_position_independent.
12125 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12126 two_file_pie_test.
12127 (basic_pie_test.o, basic_pie_test): New targets.
12128 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12129 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12130 (two_file_pie_test): New target.
12131 * testsuite/Makefile.in: Rebuild.
12132 * README: Remove note saying that -pie is not supported.
12133
c6585162
ILT
121342009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12135
12136 * options.h (class General_options): Add -init and -fini.
12137 * layout.cc (Layout::finish_dynamic_section): Emit
12138 given init and fini functions.
12139
032ce4e9
ST
121402009-10-13 Sriraman Tallam <tmsriram@google.com>
12141
12142 * gc.h (gc_process_relocs): Check if icf is enabled using new
12143 function.
12144 * gold.cc (queue_initial_tasks): Likewise.
12145 (queue_middle_tasks): Likewise.
12146 * object.cc (do_layout): Likewise.
12147 * symtab.cc (is_section_folded): Likewise.
12148 * main.cc (main): Likewise.
12149 * reloc.cc (Read_relocs::run): Likewise.
12150 (Sized_relobj::do_scan_relocs): Likewise.
12151 * icf.cc (is_function_ctor_or_dtor): New function.
12152 (Icf::find_identical_sections): Check if function is ctor or dtor when
12153 safe icf is chosen.
12154 * options.h (General_options::icf): Change option to be an enum.
12155 (Icf_status): New enum.
12156 (icf_enabled): New method.
12157 (icf_safe_folding): New method.
12158 (set_icf_status): New method.
12159 (icf_status_): New variable.
12160 * (options.cc) (General_options::finalize): Set icf_status_.
12161 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12162 icf_test and icf_keep_unique_test to use the --icf enum flag.
12163 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12164 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12165
f345227a
ST
121662009-10-12 Sriraman Tallam <tmsriram@google.com>
12167
12168 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12169 includes to gc.h and icf.h.
12170 * arm.cc: Include gc.h.
12171 * gold.cc: Likewise.
12172 * i386.cc: Likewise.
12173 * powerpc.cc: Likewise.
12174 * sparc.cc: Likewise.
12175 * x86_64.cc: Likewise.
12176 * gc.h: Include icf.h.
12177
1c7814ed
ILT
121782009-10-11 Ian Lance Taylor <iant@google.com>
12179
12180 * plugin.cc: Include "gold.h" before other header files.
12181
ae3b5189
CD
121822009-10-10 Chris Demetriou <cgd@google.com>
12183
12184 * options.h (Input_file_argument::Input_file_type): New enum.
12185 (Input_file_argument::is_lib_): Replace with...
12186 (Input_file_argument::type_): New member.
12187 (Input_file_argument::Input_file_argument): Take Input_file_type
12188 'type' rather than boolean 'is_lib' as second argument.
12189 (Input_file_argument::is_lib): Use type_.
12190 (Input_file_argument::is_searched_file): New function.
12191 (Input_file_argument::may_need_search): Handle is_searched_file.
12192 * options.cc (General_options::parse_library): Support -l:filename.
12193 (General_options::parse_just_symbols): Update for Input_file_argument
12194 changes.
12195 (Command_line::process): Likewise.
12196 * archive.cc (Archive::get_file_and_offset): Likewise.
12197 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12198 * script.cc (read_script_file, script_add_file): Likewise.
12199 * fileread.cc (Input_file::Input_file): Likewise.
12200 (Input_file::will_search_for): Handle is_searched_file.
12201 (Input_file::open): Likewise.
12202 * readsyms.cc (Read_symbols::get_name): Likewise.
12203 * testsuite/Makefile.am (searched_file_test): New test.
12204 * testsuite/Makefile.in: Regenerate.
12205 * testsuite/searched_file_test.cc: New file.
12206 * testsuite/searched_file_test_lib.cc: New file.
12207
f3048a1d
ILT
122082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12209 Ian Lance Taylor <iant@google.com>
12210
12211 * descriptor.cc: Include <cstdio> and "binary-io.h".
12212 (Descriptors::open): Open the files in binary mode always.
12213 * script.cc (Lex::get_token): Treat \r as whitespace.
12214
d4780e57
ILT
122152009-10-09 Ian Lance Taylor <iant@google.com>
12216
12217 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12218
d9a893b8
ILT
122192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12220 Ian Lance Taylor <iant@google.com>
12221
12222 * configure.ac: Check for readv function also.
12223 * fileread.cc (readv): Define if not HAVE_READV.
12224 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12225 does not exist.
12226 * config.in: Regenerate.
12227 * configure: Regenerate.
12228
c0a62865
DK
122292009-10-09 Doug Kwan <dougkwan@google.com>
12230
12231 * layout.cc (Layout::make_output_section): Call target hook to make
12232 ordinary output section.
12233 (Layout::finalize): Adjust parameter list of call the
12234 Target::may_relax().
12235 * layout.h (class Layout::section_list): New method.
12236 * merge.h (Output_merge_base::entsize): Change visibility to public.
12237 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12238 New methods.
12239 (Output_merge_string::do_is_string): New method.
12240 * object.cc (Sized_relobj::do_setup): renamed from
12241 Sized_relobj::set_up.
12242 * object.h (Sized_relobj::adjust_shndx,
12243 Sized_relobj::initializ_input_to_output_maps,
12244 Sized_relobj::free_input_to_output_maps): Change visibilities to
12245 protected.
12246 (Sized_relobj::setup): Virtualize.
12247 (Sized_relobj::do_setup): New method declaration.
12248 (Sized_relobj::invalidate_section_offset,
12249 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12250 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12251 * options.cc (parse_int): New function.
12252 * options.h (parse_int): New declaration.
12253 (DEFINE_int): New macro.
12254 (stub_group_size): New option.
12255 * output.cc (Output_section::Output_section): Initialize memebers
12256 merge_section_map_, merge_section_by_properties_map_,
12257 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12258 (Output_section::add_input_section): Handled deferred code-fill
12259 generation and remove an old comment.
12260 (Output_section::add_relaxed_input_section): New method definition.
12261 (Output_section::add_merge_input_section): Use merge section by
12262 properties map to speed to search. Update merge section maps
12263 as appropriate.
12264 (Output_section::build_relaxation_map): New method definition.
12265 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12266 Same.
12267 (Output_section::relax_input_section): Renamed to
12268 Output_section::convert_input_sections_to_relaxed_sections and change
12269 interface to take a vector of pointers to relaxed sections.
12270 (Output_section::find_merge_section,
12271 Output_section::find_relaxed_input_section): New method definitions.
12272 (Output_section::is_input_address_mapped,
12273 Output_section::output_offset, Output_section::output_address):
12274 Use output section data maps to speed up searching.
12275 (Output_section::find_starting_output_address): Add comments.
12276 (Output_section::do_write,
12277 Output_section::write_to_postprocessing_buffer): Do code-fill
12278 generation as appropriate.
12279 (Output_section::get_input_sections): Invalidate relaxed input section
12280 map.
12281 (Output_section::restore_states): Adjust type of checkpoint .
12282 Invalidate relaxed input section map.
12283 * output.h (Output_merge_base): New class declaration.
12284 (Input_section_specifier): New class defintion.
12285 (class Output_relaxed_input_section) Change base class to
12286 Output_section_data_build.
12287 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12288 base class initializer.
12289 (Output_section::add_relaxed_input_section): New method declaration.
12290 (Output_section::Input_section): Change visibility to protected.
2e702c99 12291 (Output_section::Input_section::relobj,
c0a62865
DK
12292 Output_section::Input_section::shndx): Handle relaxed input sections.
12293 Output_section::input_sections) Change visibility to protected. Also
12294 define overload to return a non-const pointer.
12295 (Output_section::Merge_section_properties): New class defintion.
12296 (Output_section::Merge_section_by_properties_map,
12297 Output_section::Output_section_data_by_input_section_map,
12298 Output_section::Relaxation_map): New types.
12299 (Output_section::relax_input_section): Rename method to
12300 Output_section::convert_input_sections_to_relaxed_sections and change
12301 interface to take a vector of relaxed section pointers.
12302 (Output_section::find_merge_section,
12303 Output_section::find_relaxed_input_section,
12304 Output_section::build_relaxation_map,
12305 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12306 New method declarations.
12307 (Output_section::merge_section_map_
12308 Output_section::merge_section_by_properties_map_,
12309 Output_section::relaxed_input_section_map_,
12310 Output_section::is_relaxed_input_section_map_valid_,
12311 Output_section::generate_code_fills_at_write_): New data members.
12312 * script-sections.cc
12313 (Output_section_element_input::set_section_addresses): Call
12314 current_data_size and addralign methods of relaxed input sections.
12315 (Orphan_output_section::set_section_addresses): Call current_data_size
12316 and addralign methods of relaxed input sections.
12317 * symtab.cc (Symbol_table::compute_final_value): Extract template
12318 from the body of Symbol_table::sized_finalize_symbol.
12319 (Symbol_table::sized_finalized_symbol): Call
12320 Symbol_table::compute_final_value.
12321 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12322 (Symbol_table::compute_final_value): New templated method declaration.
12323 * target.cc (Target::do_make_output_section): New method defintion.
12324 * target.h (Target::make_output_section): New method declaration.
12325 (Target::relax): Add more parameters for input objects, symbol table
12326 and layout. Adjust call to do_relax.
12327 (Target::do_make_output_section): New method declaration.
12328 (Target::do_relax): Add parameters for input objects, symbol table
12329 and layout.
12330
d446d6c4
ILT
123312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12332
12333 * pread.c: Include stdio.h.
12334
bc06c745
ILT
123352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12336
12337 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12338 defined.
12339
75aea3d0
ILT
123402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12341
12342 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12343 Change read_shndx type to unsigned int.
12344 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12345 int.
12346 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12347 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12348 Change read_shndx type to unsigned int.
12349 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12350 int.
12351 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12352 * layout.cc (Layout::create_symtab_sections): Cast the result of
12353 local_symcount * symsize to off_t in the gold_assert.
12354
be8fcb75
ILT
123552009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12356
12357 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12358 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12359 R_ARM_BASE_ABS.
12360 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12361 (Arm_relocate_functions::thm_abs5): New function.
12362 (Arm_relocate_functions::abs12): New function.
12363 (Arm_relocate_functions::abs16): New function.
12364 (Arm_relocate_functions::base_abs): New function.
12365 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12366 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12367 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12368 R_ARM_BASE_ABS.
12369 (Scan::global): Likewise.
12370 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12371 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12372 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12373 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12374 R_ARM_BASE_ABS.
12375
c2a122b6
ILT
123762009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12377
12378 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12379 (Arm_relocate_functions::movt_prel): New function.
12380 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12381 (Arm_relocate_functions::thm_movt_prel): New function.
12382 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12383 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12384 (Scan::global, Relocate::relocate): Likewise.
12385 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12386
c4aa1e2d
ILT
123872009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12388
12389 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12390 Incremental_checker.
12391 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12392 unsigned int.
12393 (class Incremental_inputs_header): New class.
12394 (Incremental_inputs_header_writer): Edit comment.
12395 (Incremental_inputs_entry): New class.
12396 (Incremental_inputs_entry_writer): Edit comment.
12397 (Sized_incremental_binary::do_find_incremental_inputs_section):
12398 Add *strtab_shndx parameter, fill it.
12399 (Sized_incremental_binary::do_check_inputs): New method.
12400 (Incremental_checker::can_incrementally_link_output_file): Use
12401 Sized_incremental_binary::check_inputs.
12402 (Incremental_inputs::report_command_line): Save command line in
12403 command_line_.
12404 * incremental.h:
12405 (Incremental_binary::find_incremental_inputs_section): New
12406 method.
12407 (Incremental_binary::do_find_incremental_inputs_section): Add
12408 strtab_shndx parameter.
12409 (Incremental_binary::do_check_inputs): New pure virtual method.
12410 (Sized_incremental_binary::do_check_inputs): Declare.
12411 (Incremental_checker::Incremental_checker): Add incremental_inputs
12412 parameter, use it to initialize incremental_inputs_.
12413 (Incremental_checker::incremental_inputs_): New field.
12414 (Incremental_checker::command_line): New method.
12415 (Incremental_checker::inputs): New method.
12416 (Incremental_checker::command_line_): New field.
12417
c549a694
ILT
124182009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12419
12420 * incremental.cc: Include <cstdarg> and "target-select.h".
12421 (vexplain_no_incremental): New function.
12422 (explain_no_incremental): New function.
12423 (Incremental_binary::error): New method.
12424 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12425 method.
12426 (make_sized_incremental_binary): New function.
12427 (open_incremental_binary): New function.
12428 (can_incrementally_link_file): Add checks if output is ELF and has
12429 inputs section.
12430 * incremental.h: Include "elfcpp_file.h" and "output.h".
12431 (Incremental_binary): New class.
12432 (Sized_incremental_binary): New class.
12433 (open_incremental_binary): Declare.
12434 * object.cc (is_elf_object): Use
12435 elfcpp::Elf_recognizer::is_elf_file.
12436 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12437 * output.h (Output_file::filesize): New method.
12438
fd3c5f0b
ILT
124392009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12440
12441 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12442 New function.
12443 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12444 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12445 function.
12446 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12447 function.
12448 (Arm_relocate_functions::movw_abs_nc): New function.
12449 (Arm_relocate_functions::movt_abs): New function.
12450 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12451 (Arm_relocate_functions::thm_movt_abs): New function.
12452 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12453 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12454 (Scan::global): Likewise.
12455 (Relocate::relocate): Likewise.
12456 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12457
7f5309a5
ILT
124582009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12459
12460 * arm.cc (Arm_relocate_functions::got_prel) New function.
12461 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12462 (Relocate::relocate): Likewise.
12463 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12464
364c7fa5
ILT
124652009-10-06 Ian Lance Taylor <iant@google.com>
12466
12467 * options.h (class General_options): Define
12468 split_stack_adjust_size parameter.
12469 * object.h (class Object): Add uses_split_stack_ and
12470 has_no_split_stack_ fields. Add uses_split_stack and
12471 has_no_split_stack accessor functions. Declare
12472 handle_split_stack_section.
12473 (class Reloc_symbol_changes): Define.
12474 (class Sized_relobj): Define Function_offsets. Declare
12475 split_stack_adjust, split_stack_adjust_reltype, and
12476 find_functions.
12477 * object.cc (Object::handle_split_stack_section): New function.
12478 (Sized_relobj::do_layout): Call handle_split_stack_section.
12479 * dynobj.cc (Sized_dynobj::do_layout): Call
12480 handle_split_stack_section.
12481 * reloc.cc (Sized_relobj::relocate_sections): Call
12482 split_stack_adjust for executable sections in split_stack
12483 objects. Pass reloc_map to relocate_section.
12484 (Sized_relobj::split_stack_adjust): New function.
12485 (Sized_relobj::split_stack_adjust_reltype): New function.
12486 (Sized_relobj::find_functions): New function.
12487 * target-reloc.h: Include "object.h".
12488 (relocate_section): Add reloc_symbol_changes parameter. Change
12489 all callers.
12490 * target.h (class Target): Add calls_non_split method. Declare
12491 do_calls_non_split virtual method. Declare match_view and
12492 set_view_to_nop.
12493 * target.cc: Include "elfcpp.h".
12494 (Target::do_calls_non_split): New function.
12495 (Target::match_view): New function.
12496 (Target::set_view_to_nop): New function.
12497 * gold.cc (queue_middle_tasks): Give an error if mixing
12498 split-stack and non-split-stack objects with -r.
12499 * i386.cc (Target_i386::relocate_section): Add
12500 reloc_symbol_changes parameter.
12501 (Target_i386::do_calls_non_split): New function.
12502 * x86_64.cc (Target_x86_64::relocate_section): Add
12503 reloc_symbol_changes parameter.
12504 (Target_x86_64::do_calls_non_split): New function.
12505 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12506 parameter.
12507 * powerpc.cc (Target_powerpc::relocate_section): Add
12508 reloc_symbol_changes parameter.
12509 * sparc.cc (Target_sparc::relocate_section): Add
12510 reloc_symbol_changes parameter.
12511 * configure.ac: Call AM_CONDITIONAL for the default target.
12512 * configure: Rebuild.
12513 * testsuite/Makefile.am (TEST_AS): New variable.
12514 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12515 (check_DATA): Add split_i386 and split_x86_64 files.
12516 (SPLIT_DEFSYMS): Define.
12517 (split_i386_[1234n].o): New targets.
12518 (split_i386_[124]): New targets.
12519 (split_i386_[1234r].stdout): New targets.
12520 (split_x86_64_[1234n].o): New targets.
12521 (split_x86_64_[124]): New targets.
12522 (split_x86_64_[1234r].stdout): New targets.
12523 (MOSTLYCLEANFILES): Add new executables.
12524 * testsuite/split_i386.sh: New file.
12525 * testsuite/split_x86_64.sh: New file.
12526 * testsuite/split_i386_1.s: New file.
12527 * testsuite/split_i386_2.s: New file.
12528 * testsuite/split_i386_3.s: New file.
12529 * testsuite/split_i386_4.s: New file.
12530 * testsuite/split_i386_n.s: New file.
12531 * testsuite/split_x86_64_1.s: New file.
12532 * testsuite/split_x86_64_2.s: New file.
12533 * testsuite/split_x86_64_3.s: New file.
12534 * testsuite/split_x86_64_4.s: New file.
12535 * testsuite/split_x86_64_n.s: New file.
12536 * testsuite/testfile.cc (Target_test): Update relocation_section
12537 function.
12538 * testsuite/Makefile.in: Rebuild.
12539
e8a9fcda
ILT
125402009-10-06 Ian Lance Taylor <iant@google.com>
12541
12542 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12543 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12544 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12545 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12546 the address on ldo_addrs_.
12547 (Target_i386::Relocate::fix_up_ldo): New function.
12548
e99daf92
ILT
125492009-10-06 Rafael Espindola <espindola@google.com>
12550
12551 * plugin.cc (add_input_library): New.
12552 (Plugin::load): Add add_input_library to tv.
12553 (Plugin_manager::add_input_file): Add the is_lib argument.
12554 (add_input_file): Update call to Plugin_manager::add_input_file.
12555 (add_input_library): New.
12556 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12557
966d4097
DK
125582009-09-30 Doug Kwan <dougkwan@google.com>
12559
12560 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12561 symbol and call Symbol::may_need_copy_reloc to determine if
12562 a copy reloc is needed.
12563 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12564 nocopyreloc is given in command line.
12565 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12566 given in command line.
12567 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12568 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12569 of the removed Target_i386::may_need_copy_reloc.
12570 * options.h (copyreloc): New option with default value false.
12571 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12572 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12573 instead of the removed Target_powerpc::may_need_copy_reloc.
12574 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12575 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12576 instead of the removed Target_sparc::may_need_copy_reloc.
12577 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12578 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12579 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12580 instead of the removed Target_x86_64::may_need_copy_reloc.
12581
029ba973
ILT
125822009-09-30 Ian Lance Taylor <iant@google.com>
12583
12584 * object.h (class Object): Remove target_ field, and target,
12585 sized_target, and set_target methods.
12586 (Object::sized_target): Remove.
12587 (class Sized_relobj): Update declarations. Remove sized_target.
12588 * object.cc (Sized_relobj::setup): Remove target parameter.
12589 Change all callers.
12590 (Input_objects::add_object): Don't do anything with the target.
12591 (make_elf_sized_object): Add punconfigured parameter. Change all
12592 callers. Set or test parameter target.
12593 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12594 Change all callers.
12595 * parameters.cc (Parameters::set_target): Change parameter type to
12596 be non-const.
12597 (Parameters::default_target): Remove.
12598 (set_parameters_target): Change parameter type to be non-const.
12599 (parameters_force_valid_target): New function.
12600 (parameters_clear_target): New function.
12601 * parameters.h (class Parameters): Update declarations. Remove
12602 default_target method. Add sized_target and clear_target
12603 methods. Change target_ to be non-const.
12604 (set_parameters_target): Update declaration.
12605 (parameters_force_valid_target): Declare.
12606 (parameters_clear_target): Declare.
12607 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12608 as NULL if we aren't searching.
12609 (Add_symbols::run): Don't check for compatible target.
12610 * fileread.cc (Input_file::open_binary): Call
12611 parameters_force_valid_target.
12612 * gold.cc (queue_middle_tasks): Likewise.
12613 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12614 set_target on object.
12615 * dynobj.h (class Sized_dynobj): Update declarations.
12616 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12617 make_elf_object returns NULL.
12618 (Archive::include_member): Don't check whether object target is
12619 compatible.
12620 * output.cc (Output_section::add_input_section): Get target from
12621 parameters.
12622 (Output_section::relax_input_section): Likewise.
12623 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12624 parameters.
12625 (Sized_relobj::do_scan_relocs): Likewise.
12626 (Sized_relobj::relocate_sections): Likewise.
12627 * resolve.cc (Symbol_table::resolve): Likewise.
12628 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12629 parameter. Change all callers.
12630 (Symbol_table::add_from_object): Get target from parameters.
12631 (Symbol_table::add_from_relobj): Don't check object target.
12632 (Symbol_table::add_from_dynobj): Likewise.
12633 (Symbol_table::define_special_symbol): Get target from
12634 parameters.
12635 * symtab.h (class Symbol_table): Update declaration.
12636 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12637 parameter. Change all callers. Clear parameter target.
12638 (Binary_test): Test target here.
12639 * testsuite/object_unittest.cc (gold_testsuite): Remove
12640 target_test_pointer parameter. Change all callers.
12641 (Object_test): Test target here.
12642
a6a22b83
ILT
126432009-09-26 Ian Lance Taylor <iant@google.com>
12644
12645 * testsuite/initpri1.c: Don't try to use constructor priorities if
12646 compiling with gcc before 4.3.
12647
6a8f49fe
ILT
126482009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12649
12650 * testsuite/retain_symbols_file_test.sh (check_present): Change
12651 output file name to retain_symbols_file_test.stdout.
12652 (check_absent): Likewise.
12653
8c604651
CS
126542009-09-18 Craig Silverstein <csilvers@google.com>
12655
12656 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12657 * options.cc: Include <cerrno> and <fstream>.
12658 (General_options::finalize): Parse -retain-symbols-file tag.
12659 * options.h: New flag.
12660 (General_options): New method should_retain_symbol, new
12661 variable symbols_to_retain.
12662 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12663 should_retain_symbol map.
12664 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12665 * testsuite/Makefile.in: Regenerate.
12666 * testsuite/retain_symbols_file_test.sh: New file.
12667
ca58b19f
NC
126682009-09-18 Nick Clifton <nickc@redhat.com>
12669
12670 * po/es.po: Updated Spanish translation.
12671
20e6d0d6
DK
126722009-09-17 Doug Kwan <dougkwan@google.com>
12673
12674 * debug.h (DEBUG_RELAXATION): New constant.
12675 (DEBUG_ALL): Add DEBUG_RELAXATION.
12676 (debug_string_to_enum): Add relaxation debug option.
12677 * layout.cc
12678 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12679 Layout::Relaxation_debug_check::read_sections,
12680 Layout::Relaxation_debug_check::read_sections): New method definitions.
12681 (Layout::Layout): Initialize data members
12682 record_output_section_data_from_scrips_,
12683 script_output_section_data_list_ and relaxation_debug_check_.
12684 (Layout::save_segments, Layout::restore_segments,
12685 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12686 Layout::relaxation_loop_body): New method definitions.
12687 (Layout::finalize): Support relaxation. Move section layout code to
12688 Layout::relaxation_loop_body.
12689 (Layout::set_asection_address_from_script): Move code for orphan
12690 section placement out.
12691 (Layout::place_orphan_sections_in_script): New method definition.
12692 * layout.h (Output_segment_headers, Output_file_header):
12693 New forward class declarations.
12694 (Layout::~Layout): Define.
12695 (Layout::new_output_section_data_from_script): New method definition.
12696 (Layout::place_orphan_sections_in_script): New method declaration.
12697 (Layout::Segment_states): New type declaration.
12698 (Layout::save_segments, Layout::restore_segments,
12699 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12700 Layout::relaxation_loop_body): New method declarations.
12701 (Layout::Output_section_data_list): New type declaration.
12702 (Layout::Relaxation_debug_check): New class definition.
12703 (Layout::record_output_section_data_from_script_,
12704 Layout::script_output_section_data_list_, Layout::segment_states_,
12705 Layout::relaxation_debug_check_): New data members.
12706 * output.cc: (Output_section_headers::do_size): New method definition.
12707 (Output_section_headers::Output_section_headers): Move size
12708 computation to Output_section_headers::do_size.
12709 (Output_segment_headers::do_size): New method definition.
e1df38aa 12710 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12711 Output_file_header::do_size and call it.
12712 (Output_file_header::do_size): New method definition.
12713 (Output_data_group::Output_data_group): Adjust call to
12714 Output_section_data.
12715 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12716 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12717 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12718 RELAXED_INPUT_SECTION_CODE.
12719 (Output_section::Output_section): Initialize data member checkpoint_.
12720 (Output_section::~Output_section): Delete checkpoint object pointed
12721 by checkpoint_.
12722 (Output_section::add_input_section): Always add an Input_section if
12723 relaxing.
12724 (Output_section::add_merge_input_section): Add assert.
12725 (Output_section::relax_input_section): New method definition.
12726 (Output_section::set_final_data_size): Set load address to zero for
12727 an unallocated section.
12728 (Output_section::do_address_and_file_offset_have_reset_values):
12729 New method definition.
12730 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12731 Handle relaxed input section.
12732 (Output_section::sort_attached_input_sections): Checkpoint input
12733 section list lazily.
12734 (Output_section::get_input_sections): Change type of input_sections to
12735 list of Simple_input_section pointers. Checkpoint input section list
12736 lazily. Also handle relaxed input sections.
12737 (Output_section::add_input_section_for_script): Take a reference to
12738 a Simple_input_section object instead of Relobj pointer and section
12739 index as parameter. Handle relaxed input sections.
12740 (Output_section::save_states, Output_section::restore_states): New
12741 method definitions.
12742 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12743 (Output_data::is_data_size_fixed): New method definition.
12744 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12745 if it is fixed.
12746 (Output_data::address_and_file_offset_have_reset_values): New method
12747 definition.
12748 (Output_data::do_address_and_file_offset_have_reset_values): New method
12749 definition.
12750 (Output_data::set_data_size): Check that data size is not fixed.
12751 (Output_data::fix_data_size): New method definition.
12752 (Output_data::is_data_size_fixed_): New data member.
12753 (Output_section_headers::set_final_data_size): New method definition.
12754 (Output_section_headers::do_size): New method declaration.
12755 (Output_segment_headers::set_final_data_size): New method definition.
12756 (Output_segment_headers::do_size): New method declaration.
12757 (Output_file_header::set_final_data_size)::New method definition.
12758 (Output_file_header::do_size)::New method declaration.
12759 (Output_section_data::Output_section_data): Add new parameter
12760 is_data_size_fixed and use it to fix data size.
12761 (Output_data_const::Output_data_const): Adjust call to base class
12762 constructor and fix data size.
12763 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12764 base class constructor and fix data size.
12765 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12766 base class constructor and fix data size.
12767 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12768 class constructor and fix data size.
12769 (Output_data_group::set_final_data_size): New method definition.
12770 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12771 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12772 class constructor and fix data size.
12773 (Output_relaxed_input_section): New class definition.
12774 (Output_section::Simple_input_section): New class definition.
12775 (Output_section::get_input_sections): Adjust parameter list.
12776 (Output_section::add_input_section_for_script): Same.
12777 (Output_section::save_states, Output_section::restore_states,
12778 Output_section::do_address_and_file_offset_have_reset_values,
12779 (Output_section::Input_section::Input_section): Handle
12780 RELAXED_INPUT_SECTION_CODE. Add new overload for
12781 Output_relaxed_input_section.
12782 (Output_section::Input_section::is_input_section,
12783 Output_section::Input_section::set_output_section): Handle relaxed
12784 input section.
12785 (Output_section::Input_section::is_relaxed_input_section,
12786 Output_section::Input_section::output_section_data,
12787 Output_section::Input_section::relaxed_input_section): New method
12788 definitions.
12789 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12790 value.
12791 (Output_section::Input_section::u1_): Update comments.
12792 (Output_section::Input_section::u2_): Add new union member poris.
12793 (Output_section::Checkpoint_output_section): New classs definition.
12794 (Output_section::relax_input_section): New method declaration.
12795 (Output_section::checkpoint_): New data member.
12796 (Output_segment): Update comments.
12797 (Output_segment::Output_segment): Un-privatize copy constructor.
12798 (Output_segment::operator=): Un-privatize.
12799 * script-sections.cc (Output_section_element::Input_section_list):
12800 Change element type to Output_section::Simple_input_section.
12801 (Output_section_element_dot_assignment::set_section_addresses):
12802 Register output section data for relaxation clean up.
12803 (Output_data_exression::Output_data_expression): Adjust call to base
12804 constructor to fix data size.
12805 (Output_section_element_data::set_section_addresses): Register
12806 Output_data_expression object for relaxation clean up.
12807 (struct Input_section_info): Replace Relobj pointer and section index
12808 pair with Output_section::Simple_input_section and Convert struct to a
12809 class.
12810 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12811 Input_section_info data member to use accessors.
20e6d0d6
DK
12812 (Output_section_element_input::set_section_addresses): Use layout
12813 parameter. Adjust code to use Output_section::Simple_input_section
12814 and Input_secction_info classes. Register filler for relaxation
12815 clean up.
12816 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12817 and section index pair with Output_section::Simple_input_section
12818 class. Adjust code accordingly.
12819 (Phdrs_element::release_segment): New method definition.
12820 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12821 segment list.
12822 (Script_sections::release_segments): New method definition.
12823 * gold/script-sections.h (Script_sections::release_segments): New
12824 method declaration.
12825 * gold/target.h (Target::may_relax, Target::relax,
12826 Target::do_may_relax, Target::do_relax): New method definitions.
12827
5e445df6
ILT
128282009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12829
12830 * arm.cc (has_signed_unsigned_overflow): New function.
12831 (Arm_relocate_functions::abs8): New function.
12832 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12833 (Target_arm::Scan::global): Likewise.
12834 (Target_arm::relocate::relocate): Likewise.
12835 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12836 Likewise.
12837
8c604651 128382009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12839
12840 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12841 * testsuite/Makefile.in: Regenerate.
12842
1e9cc1c2
NC
128432009-09-11 Nick Clifton <nickc@redhat.com>
12844
12845 * po/gold.pot: Updated by the Translation project.
12846
6a89f575
CC
128472009-09-08 Cary Coutant <ccoutant@google.com>
12848
12849 * output.cc (Output_file::open): Add execute permission to empty file.
12850 * testsuite/Makefile.am (permission_test): New test.
12851 * testsuite/Makefile.in: Regenerate.
12852
fdcac5af
ILT
128532009-09-02 Ian Lance Taylor <iant@google.com>
12854
12855 * output.cc (Output_file::resize): Call map_no_anonymous rather
12856 than map.
12857
44453f85
ILT
128582009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12859
12860 * gold.cc: Include "incremental.h".
12861 (queue_initial_tasks): Call Incremental_checker methods.
12862 * incremental.cc: Include "output.h".
12863 (Incremental_checker::can_incrementally_link_output_file): New
12864 method.
12865 * incremental.h (Incremental_checker): New class.
12866
12867 * output.cc (Output_file::open_for_modification): New method.
12868 (Output_file::map_anonymous): Changed return type to bool. Record
12869 map in base_ field.
12870 (Output_file::map_no_anonymous): New method, broken out of map.
12871 (Output_file::map): Use map_no_anonymous and map_anonymous.
12872 * output.h (class Output_file): Update declarations.
12873
293c1386
CC
128742009-08-24 Cary Coutant <ccoutant@google.com>
12875
12876 * options.h (Command_line::Pre_options): New class.
12877 (Command_line::pre_options): New member.
12878 * options.cc (gold::options::ready_to_register): New variable.
12879 (One_option::register_option): Do nothing if not registering options.
12880 Assert if same short option registered twice.
12881 (General_options::General_options): Turn off option registration when
12882 done constructing.
12883 (Command_line::Pre_options::Pre_options): New constructor.
12884
f773f3d2
CC
128852009-08-24 Cary Coutant <ccoutant@google.com>
12886
06a73cfe
CC
12887 * options.h (General_options::no_keep_memory): Remove incorrect
12888 short option.
f773f3d2 12889
a15af8e2
RW
128902009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12891
12892 * Makefile.am (am__skiplex, am__skipyacc): New.
12893 * Makefile.in: Regenerate.
12894
c462b41b
RW
128952009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12896
14ec8efd
RW
12897 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12898 (INCLUDES): ... this.
12899 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12900 (AM_CPPFLAGS): Renamed from ...
12901 (INCLUDE): ... this.
12902 * Makefile.in, testsuite/Makefile.in: Regenerate.
12903
81ecdfbb
RW
12904 * Makefile.in: Regenerate.
12905 * aclocal.m4: Likewise.
12906 * config.in: Likewise.
12907 * configure: Likewise.
12908 * testsuite/Makefile.in: Likewise.
12909
c462b41b
RW
12910 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12911 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12912 * Makefile.in: Regenerate.
12913 * testsuite/Makefile.in: Regenerate.
12914
2da73f13
CC
129152009-08-19 Cary Coutant <ccoutant@google.com>
12916
12917 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12918 symbols in shared libraries overridden by hidden or internal symbols
12919 in the main program.
12920
2db70501
CD
129212009-08-19 Chris Demetriou <cgd@google.com>
12922
12923 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12924 checking source file names in error messages.
12925
f733487b
DK
129262009-08-18 Doug Kwan <dougkwan@google.com>
12927
12928 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12929 an elcpp::Ehdr as parameter. Adjust call to set_target.
12930 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12931 an elfcpp::Ehdr as parameter.
12932 * object.cc (Object::set_target): Remove the version that looks up
12933 a target and sets it.
12934 (Sized_relobj::setup): Take a Target object instead of
12935 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12936 (make_elf_sized_object): Find target and ask target to
12937 make an ELF object.
12938 * object.h: (Object::set_target): Remove the version that looks up
12939 a target and sets it.
12940 (Sized_relobj::setup): Take a Target object instead of
12941 an elfcpp:Ehdr as parameter.
12942 * target.cc: Include dynobj.h.
12943 (Target::do_make_elf_object_implementation): New.
2e702c99 12944 (Target::do_make_elf_object): New.
f733487b
DK
12945 * target.h (Target::make_elf_object): New template declaration.
12946 (Target::do_make_elf_object): New method declarations.
12947 (Target::do_make_elf_object_implementation): New template declaration.
12948
cc70f101
ILT
129492009-08-14 Ian Lance Taylor <iant@google.com>
12950
12951 * gold.h (FUNCTION_NAME): Define.
12952 (gold_unreachable): Use FUNCTION_NAME.
12953
ef5e0cb1
ST
129542009-08-12 Sriraman Tallam <tmsriram@google.com>
12955
12956 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12957 symbol in the --keep-unique list is not found.
12958
48c187ce
ST
129592009-08-12 Sriraman Tallam <tmsriram@google.com>
12960
12961 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12962 been maked as --keep-unique.
12963 (Icf::unfold_section): New function.
12964 * icf.h (Icf::unfold_section): New function.
12965 * options.h (General_options::keep_unique): New option.
12966 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12967 * testsuite/Makefile.in: Regenerate.
12968 * testsuite/icf_keep_unique_test.sh: New file.
12969 * testsuite/icf_keep_unique_test.cc: New file.
12970
645afe0c
CC
129712009-08-12 Cary Coutant <ccoutant@google.com>
12972
12973 PR 10471
12974 * resolve.cc (Symbol_table::resolve): Check for references from
12975 dynamic objects to hidden and internal symbols.
12976 * testsuite/Makefile.am (hidden_test.sh): New test.
12977 * testsuite/Makefile.in: Regenerate.
12978 * testsuite/hidden_test.sh: New script.
12979 * testsuite/hidden_test_1.c: New test source.
12980 * testsuite/hidden_test_main.c: New test source.
12981
11af873f
DK
129822009-08-11 Doug Kwan <dougkwan@google.com>
12983
12984 * arm.cc: Update comments.
12985 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12986 segment to locate the .ARM.exidx section if present.
12987
b9f7d72d
DK
129882009-08-09 Doug Kwan <dougkwan@google.com>
12989
12990 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12991 patch.
12992
ddd3c53c
ST
129932009-08-07 Sriraman Tallam <tmsriram@google.com>
12994 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12995 compiler warnings.
12996
27721062
ST
129972009-08-06 Sriraman Tallam <tmsriram@google.com>
12998
12999 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13000 valid tls_segment only for non-debug-section relocations.
13001 * testsuite/Makefile.am: Add gc_tls_test.
13002 * testsuite/Makefile.in: Regenerate.
13003 * testsuite/gc_tls_test.cc: New file.
13004 * testsuite/gc_tls_test.sh: New file.
13005
ef15dade 130062009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13007
ef15dade
ST
13008 * icf.cc: New file.
13009 * icf.h: New file.
13010 * Makefile.am (CCFILES): Add icf.cc.
13011 (HFILES): Add icf.h
13012 * Makefile.in: Regenerate.
13013 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13014 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13015 section, symbol and addend information for the relocs.
13016 * gold.cc (queue_middle_tasks): Call identical code folding.
13017 * gold.h: Add defines for multimap.
13018 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13019 to the call of finalize_local_symbols.
13020 * main.cc (main): Create object of class Icf.
13021 * object.cc (Sized_relobj::do_layout): Allow this function to be
13022 called twice during icf.
13023 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13024 to sections marked as identical by icf.
13025 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13026 when available.
13027 (Sized_relobj::do_section_entsize): New function.
13028 * object.h (Object::section_entsize): New function.
13029 (Object::do_section_entsize): New pure virtual function.
13030 (Relobj::finalize_local_symbols): Add new parameter.
13031 (Relobj::do_section_entsize): New function.
13032 * options.h (General_options::icf): New option.
13033 (General_options::icf_iterations): New option.
13034 (General_options::print_icf_sections): New option.
13035 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13036 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13037 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13038 icf.
13039 * symtab.cc (Symbol_table::is_section_folded): New function.
13040 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13041 to sections marked as identical by icf.
13042 * symtab.h (Symbol_table::set_icf): New function.
13043 (Symbol_table::icf): New function.
13044 (Symbol_table::is_section_folded): New function.
13045 (Symbol_table::icf_): New data member.
13046 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13047 * testsuite/Makefile.am: Add commands to build icf_test.
13048 * testsuite/Makefile.in: Regenerate.
13049 * testsuite/icf_test.sh: New file.
13050 * testsuite/icf_test.cc: New file.
13051
c3b65ac4
CD
130522009-07-24 Chris Demetriou <cgd@google.com>
13053
13054 * layout.cc (is_compressible_debug_section): Fix incorrect
13055 comment about compressed section names.
13056
1caf2c51
ILT
130572009-07-20 Ian Lance Taylor <ian@airs.com>
13058
13059 PR 10419
13060 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13061
1ef4d87f
ILT
130622009-07-16 Ian Lance Taylor <iant@google.com>
13063
13064 PR 10400
13065 * layout.h: #include <map>.
13066 (class Kept_section): Change from struct to class. Add accessors
13067 and setters. Add section size to Comdat_group mapping. Change
13068 Comdat_group to std::map. Add is_comdat_ field. Add
13069 linkonce_size field in union.
13070 (class Layout): Update declaration of find_or_add_kept_section.
13071 Don't declare find_kept_object.
13072 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13073 parameter. Add object, shndx, is_comdat, and is_group_name
13074 parameters. Change all callers. Adjust for new Kept_section.
13075 (Layout::find_kept_object): Remove.
13076 * object.cc (Sized_relobj::include_section_group): Update use of
13077 Kept_section. Rename secnum to shndx. Only record
13078 Kept_comdat_section if sections are the same size.
13079 (Sized_relobj::include_linkonce_section): Update use of
13080 Kept_section. Only record Kept_comdat_section if sections are the
13081 same size. Set size of linkonce section.
13082 (Sized_relobj::map_to_kept_section): Update call to
13083 get_kept_comdat_section.
13084 * object.h (class Sized_relobj): Rename fields in
13085 Kept_comdat_section to drop trailing underscores; change object
13086 field to Relobj*. Change Kept_comdat_section_table to store
13087 struct rather than pointer.
13088 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13089 Add kept_object and kept_shndx parameters. Change all callers.
13090 (Sized_relobj::get_kept_comdat_section): Change return type to
13091 bool. Add kept_object and kept_shndx parameters. Change all
13092 callers.
13093 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13094 Layout::find_or_add_kept_section.
13095
37c3b7b0
ILT
130962009-07-09 Ian Lance Taylor <iant@google.com>
13097
13098 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13099 Reserve space in the hash table.
13100
98fa85cb
ILT
131012009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13102
13103 * fileread.cc (File_read::get_mtime): New method.
13104 * fileread.h (Timespec): New structure.
13105 (File_read::get_mtime): New method.
13106 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13107 Renamed from timestamp_nsec.
13108 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13109 Elf_Xword.
e1df38aa 13110 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13111 timestamp_nsec.
e1df38aa 13112 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13113 (Incremental_inputs::report_obejct): Save mtime; style fix.
13114 (Incremental_inputs::report_script): Save mtime; style fix.
13115 (Incremental_inputs::finalize_inputs): Style fix.
13116 (Incremental_inputs::finalize): Style fix.
13117 (Incremental_inputs::create_input_section_data): Store inputs
13118 mtime.
13119 * incremental.h (Incremental_inputs::report_script): Add mtime
13120 argument.
13121 (Incremental_inputs::Input_info::Input_info): Intialize only one
13122 union member.
13123 (Incremental_inputs::Input_info::archive): Move to nameless
13124 union.
13125 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13126 (Incremental_inputs::Input_info::script): Move to nameless union.
13127 (Incremental_inputs::mtime): New field.
13128 * script.cc (read_input_script): Pass file mtime to
13129 Incremental_input.
13130 * script.h (Script_info::inputs): Style fix.
13131
c9d70757
ILT
131322009-07-01 Ian Lance Taylor <ian@airs.com>
13133
13134 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13135 instead of 32.
13136
9c547ec3
ILT
131372009-06-24 Ian Lance Taylor <iant@google.com>
13138
13139 PR 10156
13140 * layout.cc (Layout::choose_output_section): If we find an
13141 existing section, update the flags.
13142 (Layout::create_notes): New function, broken out of
13143 Layout::finalize.
13144 (Layout::finalize): Don't create note sections.
13145 (Layout::create_note): Don't crash if linker script discards
13146 section.
13147 (Layout::create_gold_note): Likewise.
13148 (Layout::create_build_id): Likewise. Don't set
13149 after_input_sections on the section.
13150 (Layout::create_executable_stack_info): Remove target parameter.
13151 Change caller.
13152 * layout.h (class Layout): Declare create_notes. Update
13153 declaration of create_executable_stack_info.
13154 * gold.cc (queue_middle_tasks): Call create_notes.
13155 * output.cc (Output_section::update_flags_for_input_section): Move
13156 here from output.h. If SHF_ALLOC flag is newly set, mark address
13157 invalid.
13158 * output.h (Output_data::mark_address_invalid): New function.
13159 (class Output_section): Only declare, not define,
13160 update_flags_for_input_section. Remove set_flags.
13161
55458500
ILT
131622009-06-24 Ian Lance Taylor <iant@google.com>
13163
13164 * script-sections.cc (Output_section_definition::
13165 set_section_addresses): Rename shadowing local load_address to
13166 laddr.
13167
1307d6cd
ILT
131682009-06-24 Ian Lance Taylor <iant@google.com>
13169
13170 PR 10244
13171 * reloc.cc (relocate_sections): Skip empty relocation sections.
13172
ec3f783e
ILT
131732009-06-23 Ian Lance Taylor <iant@google.com>
13174
13175 PR 10156
13176 * layout.cc (Layout::create_note): Use choose_output_section
13177 rather than make_output_section.
13178
459c9f1c
ILT
131792009-06-23 Ian Lance Taylor <iant@google.com>
13180
13181 PR 10237
13182 * options.cc (General_options::parse_V): Set printed_version_.
13183 (General_options::General_options): Initialize printed_version_.
13184 * options.h (class General_options): Add printed_version_ field.
13185 * gold.cc (queue_initial_tasks): If there are no input files,
13186 don't give a fatal error if we printed the version information.
13187 (queue_middle_tasks): If using -r with a shared object, give a
13188 fatal error rather than an ordinary error.
13189
1518dc8f
ILT
131902009-06-23 Ian Lance Taylor <iant@google.com>
13191
13192 PR 10219
13193 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13194 (Layout::make_output_section): Set have_stabstr_section_ if we see
13195 a .stab*str section.
13196 (Layout::finalize): Call link_stabs_sections.
13197 (Layout::link_stabs_sections): New file.
13198 * layout.h (class Layout): Add have_stabstr_section_ field.
13199 Declare link_stabs_sections.
13200
3d857b98
DK
132012009-06-23 Doug Kwan <dougkwan@google.com>
13202
13203 * Makefile.am (libgold_a_LIBADD): New.
13204 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13205 * Makefile.in: Regenerate.
3d857b98
DK
13206 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13207 * configure: Regenerate.
13208 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13209 * fileread.cc: Include sys/state.h
13210 * gold.h: Declare memmem and strndup if found missing.
13211 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13212
0639a6f6
ILT
132132009-06-23 Ian Lance Taylor <iant@google.com>
13214
13215 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13216 * configure: Rebuild.
13217
8d63875c
ILT
132182009-06-23 Ian Lance Taylor <iant@google.com>
13219
13220 PR 10147
13221 * object.cc (Object::section_contents): Don't try to get a view if
13222 the section has length zero.
13223 (Object::handle_gnu_warning_section): If the section is empty, use
13224 the name of the section as the warning.
13225
f7c8a183
ILT
132262009-06-23 Ian Lance Taylor <iant@google.com>
13227
13228 PR 10133
13229 * stringpool.h (class Stringpool_template): Add optimize_ field.
13230 (Stringpool_template::set_optimize): New function.
13231 * stringpool.cc (Stringpool_template::Stringpool_template):
13232 Initialize optimize_ field.
13233 (Stringpool_template::set_string_offsets): Test local optimize
13234 fild rather than parameter.
13235 * layout.cc (Layout::Layout): Call set_optimize on the section
13236 name stringpool.
13237
e6a307ba
ILT
132382009-06-22 Ian Lance Taylor <iant@google.com>
13239
13240 PR 10030
13241 * yyscript.y: Parse TARGET.
13242 * script.cc (script_set_target): New function.
13243 * script-c.h (script_set_target): Declare.
13244 * options.cc (General_options::string_to_object_format): Rename
13245 from string_to_object_format in anonymous namespace. Change
13246 callers.
13247 * options.h (class General_options): Declare
13248 string_to_object_format.
13249
3ee173de
ILT
132502009-06-22 Ian Lance Taylor <iant@google.com>
13251
13252 * script-sections.cc (Script_sections::create_segments): Don't put
13253 program headers in a PT_LOAD segment if -n or -N.
13254
132552009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13256
13257 PR 10141
13258 * options.h (class General_options): Add -z lazy and -z now. Sort
13259 -z options into alphabetical order.
13260 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13261
cd6739a1 132622009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13263
13264 * layout.cc (Layout::make_output_section): Call
13265 Target::new_output_section.
13266 (Layout::attach_allocated_section_to_segment): Put large section
13267 sections in a separate load segment with the large segment flag
13268 set.
13269 (Layout::segment_precedes): Sort large data segments after other
13270 load segments.
13271 (align_file_offset): New static function.
13272 (Layout::set_segment_offsets): Use align_file_offset.
13273 * output.h (class Output_section): Add is_small_section_ and
13274 is_large_section_ fields.
13275 (Output_section::is_small_section): New function.
13276 (Output_section::set_is_small_section): New function.
13277 (Output_section::is_large_section): New function.
13278 (Output_section::set_is_large_section): New function.
13279 (Output_section::is_large_data_section): New function.
13280 (class Output_segment): Add is_large_data_segment_ field.
13281 (Output_segment::is_large_data_segment): New function.
13282 (Output_segment::set_is_large_data_segment): New function.
13283 * output.cc (Output_section::Output_section): Initialize new
13284 fields.
13285 (Output_segment::Output_segment): Likewise.
13286 (Output_segment::add_output_section): Add assertion that large
13287 data sections always go in large data segments. Force small data
13288 sections to the end of the list of data sections. Force small BSS
13289 sections to the start of the list of BSS sections. For large BSS
13290 sections to the end of the list of BSS sections.
13291 * symtab.h (class Symbol): Declare is_common_shndx.
13292 (Symbol::is_defined): Check Symbol::is_common_shndx.
13293 (Symbol::is_common): Likewise.
13294 (class Symbol_table): Define enum Commons_section_type. Update
13295 declarations. Add small_commons_ and large_commons_ fields.
13296 * symtab.cc (Symbol::is_common_shndx): New function.
13297 (Symbol_table::Symbol_table): Initialize new fields.
13298 (Symbol_table::add_from_object): Put small and large common
13299 symbols in the right list.
13300 (Symbol_table::sized_finalized_symbol): Check
13301 Symbol::is_common_shndx.
13302 (Symbol_table::sized_write_globals): Likewise.
13303 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13304 common symbol lists. Don't call do_allocate_commons_list if the
13305 list is empty.
13306 (Symbol_table::do_allocate_commons_list): Remove is_tls
13307 parameter. Add comons_section_type parameter. Change all
13308 callers. Handle small and large common symbols.
13309 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13310 Symbol::is_common_shndx.
13311 * resolve.cc (symbol_to_bits): Likewise.
13312 * target.h (Target::small_common_shndx): New function.
13313 (Target::small_common_section_flags): New function.
13314 (Target::large_common_shndx): New function.
13315 (Target::large_common_section_flags): New function.
13316 (Target::new_output_section): New function.
13317 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13318 small_common_section_flags, and large_common_section_flags
13319 fields.
13320 (Target::do_new_output_section): New virtual function.
13321 * arm.cc (Target_arm::arm_info): Initialize new fields.
13322 * i386.cc (Target_i386::i386_info): Likewise.
13323 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13324 Likewise.
13325 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13326 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13327 (Target_x86_64::do_new_output_section): New function.
13328 * configure.ac: Define conditional MCMODEL_MEDIUM.
13329 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13330 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13331 (large_LDFLAGS): Define.
13332 * testsuite/large.c: New file.
13333 * testsuite/testfile.cc (Target_test::test_target_info):
13334 Initialize new fields.
13335 * configure, testsuite/Makefile.in: Rebuild.
13336
bb04269c
DK
133372009-06-05 Doug Kwan <dougkwan@google.com>
13338
13339 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13340 * Makefile.in: Regenerate.
bb04269c
DK
13341 * i386.cc (class Target_i386): Define new virtual method to
13342 override do_is_local_label_name in parent.
13343 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13344 local symbols if --discard-locals or -X is given.
13345 * options.h (class General_options): Declare new options
13346 '--discard-locals' and '-X' for discarding locals.
13347 * target.h (class Target): Define new methods is_local_label_name.
13348 Declare new virtual method do_is_local_label_name.
13349 * target.cc: New file.
13350 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13351 (check_SCRIPTS): Add discard_locals_test.sh.
13352 (check_DATA): Add discard_local_tests.syms.
13353 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13354 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13355 * testsuite/Makefile.in: Regenerate.
13356 * testsuite/discard_locals_test.c: New file.
13357 * testsuite/discard_locals_test.sh: Same.
13358
805bb01c
DK
133592009-06-05 Doug Kwan <dougkwan@google.com>
13360
13361 * object.cc (Sized_relobj::Sized_relobj): Initialize
13362 discarded_eh_frame_shndx_ to -1U.
13363 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13364 section.
13365 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13366 a discarded .eh_frame section.
13367 (Sized_relobj::do_finalize_local_symbols): Ditto.
13368 * object.h (class Sized_relobj): Declare new member
13369 discarded_eh_frame_shndx_.
13370 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13371 (local_labels_test.o, local_labels_test): New rules.
13372 * testsuite/Makefile.in: Regenerate.
13373
1dcd334d
DK
133742009-06-04 Doug Kwan <dougkwan@google.com>
13375
13376 * layout.cc (Layout::section_name_mapping): Add mapping for
13377 special ARM sections.
13378
96d49306
DK
133792009-06-03 Doug Kwan <dougkwan@google.com>
13380
13381 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13382 (utils::has_overflow): Same.
13383
dff16297
ILT
133842009-06-03 Ian Lance Taylor <iant@google.com>
13385
13386 * layout.cc (Layout::section_name_mapping): New array, replacing
13387 Layout::linkonce_mapping.
13388 (Layout::section_name_mapping_count): New variable, replacing
13389 Layout::linkonce_mapping_count.
13390 (Layout::linkonce_output_name): Remove.
13391 (Layout::output_section_name): Rewrite.
13392 * layout.h (class Layout): Rename Linkonce_mapping to
13393 Section_name_mapping, linkonce_mapping to section_name_mapping,
13394 linkonce_mapping_count to section_name_mapping_count. Don't
13395 declare linkonce_output_name.
13396
c121c671
DK
133972009-06-03 Doug Kwan <dougkwan@google.com>
13398
13399 * gold/arm.cc (namespace utils): New.
13400 (Target_arm::reloc_is_non_pic): Define new method.
13401 (class Arm_relocate_functions): New.
13402 (Target_arm::Relocate::relocate): Handle relocation types used by
13403 Android.
13404
07800fab
ILT
134052009-06-03 Ian Lance Taylor <iant@google.com>
13406
13407 * arm.cc (Target_arm::scan::global): Use || instead of |.
13408
c121c671
DK
134092009-06-02 Doug Kwan <dougkwan@google.com>
13410
13411 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13412 issued_non_pic_error_.
13413 (class Target_arm::Scan): Declare new method check_non_pic.
13414 Define new method symbol_needs_plt_entry.
13415 Declare new data member issued_non_pic_error_.
13416 (class Target_arm::Relocate): Declare new method
13417 should_apply_static_reloc.
13418 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13419 (Target_arm::Scan::check_non_pic): Define new method.
13420 (Target_arm::Scan::local): Handle a small subset of reloc types used
13421 by Android.
13422 (Target_arm::Scan::local): Same.
13423 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13424
b19b0c6d
ILT
134252009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13426
13427 * incremental.cc (Incremental_inputs::report_command_line): Filter
13428 out --incremental-* options.
13429
94cdfcff
DK
134302009-05-29 Doug Kwan <dougkwan@google.com>
13431
13432 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13433 template class.
13434 (class Target_arm): Update comment.
13435 (Target_arm::Target_arm): Initialize new data members GOT_,
13436 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13437 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13438 and Target_arm::rel_dyn_section.
13439 Declare new_enum Target_arm::Got_type.
13440 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13441 and DYNBSS_.
13442 Update commments for member do_dynsym_value.
13443 (Target_arm::got_size, Target_arm::plt_section,
13444 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13445 new methods inside class defintion.
13446 (Target_arm::got_section): Define new method.
13447 (Target_arm::rel_dyn_section): Same.
13448 (Output_data_plt_arm): New template class.
13449 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13450 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13451 (Output_data_plt_arm::add_entry): Same.
13452 (Output_data_plt_arm::first_plt_entry): Define new
13453 static data member for PLT instruction template.
13454 (Output_data_plt_arm::plt_entry): Same.
13455 (Output_data_plt_arm::do_write): Define new method.
13456 (Target_arm::make_plt_entry): Same.
13457 (Target_arm::do_finalize_sections): Same.
13458 (Target_arm::do_dynsym_value): Same.
13459
4a657b0d
DK
134602009-05-28 Doug Kwan <dougkwan@google.com>
13461
13462 * Makefile.am (TARGETSOURCES): Add arm.cc.
13463 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13464 * Makefile.in: Regenerate.
13465 * arm.cc: New file.
13466 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13467
e7ae8c36
DK
134682009-05-26 Doug Kwan <dougkwan@google.com>
13469
13470 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13471 (General_options::check_excluded_libs): Strip off directories in
13472 archive name before matching like GNU ld does.
13473 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13474 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13475 (exclude_libs_test_LDFLAGS): Add linker option
13476 -Wl,--exclude-libs,libexclude_libs_test_3
13477 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13478 an explicit archive without using -l.
13479 (alt/libexclude_libs_test_3.a): New make rule.
13480 * testsuite/Makefile.in: Regenerate.
13481 * testsuite/exclude_libs_test.c : Declare lib3_default().
13482 (main): Call it.
13483 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13484 * exclude_libs_test_3.c: New file.
13485
f12e7348
NC
134862009-05-26 Nick Clifton <nickc@redhat.com>
13487
13488 * po/id.po: New Indonesian translation.
13489 * po/gold.pot: Updated template file.
13490
4daadc0d
ST
134912009-05-22 Sriraman Tallam <tmsriram@google.com>
13492
e1df38aa 13493 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13494 gc_comdat_test files. Add -Wl,--gc-sections to build
13495 gc_comdat_test.
13496 * testsuite/Makefile.in: Regenerate.
13497 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13498
531813ad
ST
134992009-05-21 Sriraman Tallam <tmsriram@google.com>
13500
13501 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13502 kept comdat section was garbage collected.
13503 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13504 * testsuite/Makefile.in: Regenerate.
13505 * testsuite/gc_comdat_test.sh: New file.
13506 * testsuite/gc_comdat_test_1.cc: New file.
13507 * testsuite/gc_comdat_test_2.cc: New file.
13508
65514900
CC
135092009-05-19 Doug Kwan <dougkwan@google.com>
13510
13511 * archive.cc (Archive::Archive): Move constructor from archive.h
13512 to here. Initialize no_export_.
13513 (Archive::get_elf_object_for_member): Set no_export flag of object.
13514 * archive.h (Archive::Archive): Move constructor body to
13515 archive.cc.
13516 (Archive::no_export): New method.
13517 (Archive::no_export_): New field.
13518 * object.h (Object::Object): Initialize no_export_ to false.
13519 (Object::no_export, Object::set_no_export): New methods.
13520 (Object::no_export_): New field.
13521 * options.cc (General_options::parse_exclude_libs): New method.
13522 (General_options::check_excluded_libs) Same.
13523 * options.h (exclude_libs): New option.
13524 (General_options::check_excluded_libs): New method declaration.
13525 (General_options::excluded_libs_): New field.
13526 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13527 default or protected visibility if an object has no-export flag set.
13528 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13529 (check_SCRIPTS): Add exclude_libs_test.sh.
13530 (check_DATA): Add exclude_libs_test.syms.
13531 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13532 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13533 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13534 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13535 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13536 libexclude_libs_test_2.a): New rules.
13537 * testsuite/Makefile.in: Regenerate.
13538 * testsuite/exclude_libs_test.c: New file.
13539 * testsuite/exclude_libs_test.sh: Ditto.
13540 * testsuite/exclude_libs_test_1.c: Ditto.
13541 * testsuite/exclude_libs_test_2.c: Ditto.
13542
1b77ea50
ILT
135432009-05-15 Ian Lance Taylor <iant@google.com>
13544
13545 * configure.ac: Check for declarations for cases where libiberty.h
13546 checks HAVE_DECL_xxx.
13547 * configure, config.in: Rebuild.
13548
072fe7ce
ILT
135492009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13550
13551 * gold.h (Incremental_argument_list): Remove (invalid) forward
13552 declaration.
13553 * incremental.cc (Incremental_inputs::report_achive): New method.
13554 (Incremental_inputs::report_object): New method.
13555 (Incremental_inputs::report_script): New method.
13556 (Incremental_inputs::finalize_inputs): New method.
13557 (Incremental_inputs::finalize): Call finalize_inputs().
13558 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13559 Create inputs entries.
13560 * incremental.h (Incremental_input_type): New enum.
13561 (Incremental_inputs::Incremental_input): Initialize new fields.
13562 (Incremental_inputs::report_inputs): New method.
13563 (Incremental_inputs::report_achive): New method.
13564 (Incremental_inputs::report_object): New method.
13565 (Incremental_inputs::report_script): New method.
13566 (Incremental_inputs::finalize_inputs): New method.
13567 (Incremental_inputs::Input_info): New struct.
13568 (Incremental_inputs::Input_info_map): New typedef.
13569 (Incremental_inputs::lock_): New field.
13570 (Incremental_inputs::Inputs_): New field.
13571 (Incremental_inputs::Inputs_map): New field.
13572 * main.cc (main): Call Incremental_input::report_inputs.
13573 * options.h (Input_argument_list): Typedef moved from
13574 Input_arguments.
13575 (Input_file_group::Files): Remove, use ::Input_argument_list.
13576 (Input_file_group::Input_argument_list): Remove, use
13577 ::Input_argument_list.
13578 * plugin.cc (Plugin_manager::add_input_file): Add error in
13579 incremental build.
13580 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13581 functions.
13582 * script.cc (read_input_script): Call
13583 Incremental_input::report_script.
13584 * script.h (Script_info): New class.
13585
b0481b0b
ILT
135862009-04-27 Ian Lance Taylor <iant@google.com>
13587
13588 * x86_64.cc (do_adjust_output_section): Set entsize to
13589 plt_entry_size.
13590
b22a5a41 135912009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13592
13593 * output.cc (Output_file::close): After short writes, continue
13594 writing from the correct offset in the buffer being written.
13595
40fde488
CD
135962009-04-23 Chris Demetriou <cgd@google.com>
13597
13598 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13599 * configure: Regenerate.
13600 * config.in: Regenerate.
13601 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13602 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13603
3ce2c28e
ILT
136042009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13605
13606 * incremental.cc (Incremental_inputs_header_data): Renamed from
13607 Incremental_input_header_data.
13608 (Incremental_inputs_header_data::data_size): New field.
13609 (Incremental_inputs_header_data::put_input_file_count): Renamed
13610 from input_file_count.
13611 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13612 from command_line_offset.
13613 (Incremental_inputs_header_data::put_reserved): Renamed from
13614 put_reserved.
13615 (Incremental_inputs_entry_data): Renamed from
13616 Incremental_input_entry_data.
13617 (Incremental_inputs_entry_data::data_size): New field.
13618 (Incremental_inputs::report_command_line): New method.
13619 (Incremental_inputs::finalize): New method.
13620 (Incremental_inputs::create_incremental_inputs_data): New method.
13621 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13622 * incremental.h: New file.
13623 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13624 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13625 incremental builds.
703d02da 13626 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13627 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13628 (Layout::create_incremental_info_sections): New method.
13629 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13630 * main.cc (main): Notify Incremental_input of the command line.
13631
e55bde5e
ILT
136322009-04-01 Ian Lance Taylor <iant@google.com>
13633 Mikolaj Zalewski <mikolajz@google.com>
13634
13635 * gold.h (reserve_unordered_map): Define, three versions, one for
13636 each version of Unordered_map.
13637 * layout.cc (Layout::Layout): Remove options parameter. Add
13638 number_of_input_files parameter. Don't initialize options_.
13639 Initialize number_of_input_files_ and resized_signatures_. Move
13640 sections_are_attached_.
13641 (Layout::layout_group): Reserve space for group_signatures_.
13642 (Layout::find_or_add_kept_section): Change name parameter to be a
13643 reference. Resize signatures_ map when it gets large enough.
13644 (Layout::layout_eh_frame): Use parameters->options() instead of
13645 this->options_.
13646 (Layout::make_output_section): Likewise.
13647 (Layout::attach_allocated_section_to_segment): Likewise.
13648 (Layout::finalize, Layout::create_executable_stack): Likewise.
13649 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13650 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13651 * layout.h (class Layout): Update declarations. Remove options_
13652 field. Add number_of_input_files_ and resized_signatures_
13653 fields. Move sections_are_attached_ field.
13654 * main.cc (main): Pass number of input files to Layout
13655 constructor. Don't pass options.
13656
154b857c
ILT
136572009-03-30 Ian Lance Taylor <iant@google.com>
13658
13659 * ffsll.c (ffsll): Correct implementation.
13660
2f35ab9b
ILT
136612009-03-27 Ian Lance Taylor <iant@google.com>
13662
fd03461a
ILT
13663 * ffsll.c: New file.
13664 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13665 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13666 * ftruncate.c (ftruncate): Declare before definition.
13667 * mremap.c (mremap): Likewise.
13668 * pread.c (pread): Likewise.
13669 * configure, Makefile.in, config.in: Rebuild.
13670
2f35ab9b
ILT
13671 * mremap.c: New file.
13672 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13673 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13674 (mremap): Declare if HAVE_MREMAP is not defined.
13675 * configure, Makefile.in, config.in: Rebuild.
13676
33aea2fd
CC
136772009-03-27 Cary Coutant <ccoutant@google.com>
13678
13679 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13680 position independent.
13681 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13682 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13683
6d479619
CC
136842009-03-24 Cary Coutant <ccoutant@google.com>
13685
13686 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13687 an executable.
13688 (needs_dynamic_reloc): Likewise.
13689
afc06bb8
ILT
136902009-03-24 Ian Lance Taylor <iant@google.com>
13691
13692 * yyscript.y (file_cmd): Recognize EXTERN.
13693 (extern_name_list, extern_name_list_body): New nonterminals.
13694 * script.cc (script_add_extern): Define.
13695 * script-c.h (script_add_extern): Declare.
13696
f6060a4d
ILT
136972009-03-24 Rafael Avila de Espindola <espindola@google.com>
13698
13699 * object.cc (is_elf_object): Define.
13700 * object.h (is_elf_object): Declare.
13701 * archive.cc (Archive::get_elf_object_for_member): Call
13702 is_elf_object.
33aea2fd 13703 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13704
26736d8e
ILT
137052009-03-24 Elliott Hughes <enh@google.com>
13706
13707 * output.cc (Output_file::map_anonymous): Define.
13708 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13709 try an anonymous one. Report the size if the mmap fails.
13710 * output.h (class Output_file): Declare map_anonymous.
13711
22fd9730
ILT
137122009-03-24 Ian Lance Taylor <iant@google.com>
13713
13714 * target-select.cc (instantiate_target): Don't acquire the lock if
13715 the instantiated_target_ field has already been set.
13716
cb010894
ILT
137172009-03-23 Ian Lance Taylor <iant@google.com>
13718
7f055c20
ILT
13719 * gold-threads.h (class Initialize_lock): Define.
13720 * gold-threads.cc (class Initialize_lock_once): Define.
13721 (initialize_lock_control): New static variable.
13722 (initialize_lock_pointer): New static variable.
13723 (initialize_lock_once): New static function.
13724 (Initialize_lock::Initialize_lock): Define.
13725 (Initialize_lock::initialize): Define.
13726 * target-select.h: Include "gold-threads.h".
13727 (class Target_selector): Add lock_ and initialize_lock_ fields.
13728 Don't define instantiate_target, just declare it.
13729 * target-select.cc (Target_selector::Target_selector): Initialize
13730 new fields.
13731 (Target_selector::instantiate_target): Define.
13732 * descriptors.h: Include "gold-threads.h".
13733 (class Descriptors): Add initialize_lock_ field.
13734 * descriptors.cc (Descriptors::Descriptors): Initialize new
13735 field.
13736 (Descriptors::open): Use initialize_lock_ field
13737 * errors.h (class Errors): Add initialize_lock_ field.
13738 * errors.cc (Errors::Errors): Initialize new field.
13739 (Errors::initialize_lock): Use initialize_lock_ field.
13740 * powerpc.cc (class Target_selector_powerpc): Remove
13741 instantiated_target_ field. In do_recognize call
13742 instantiate_target rather than do_instantiate_target. In
13743 do_instantiate_target just allocate a new target.
13744 * sparc.cc (class Target_selector_sparc): Likewise.
13745
36959681
ILT
13746 * freebsd.h: New file.
13747 * i386.cc: Include "freebsd.h".
13748 (Target_i386): Derive from Target_freebsd rather than
13749 Sized_target.
13750 (Target_selector_i386): Derive from Target_selector_freebsd rather
13751 than Target_selector.
13752 * x86_64.cc: Include "freebsd.h".
13753 (Target_x86_64): Derive from Target_freebsd rather than
13754 Sized_target.
13755 (Target_selector_x86_64): Derive from Target_selector_freebsd
13756 rather than Target_selector.
13757 * target.h (class Target): Add adjust_elf_header and
13758 do_adjust_elf_header.
13759 * output.cc (Output_file_header:: do_sized_write): Call target
13760 adjust_elf_header routine.
13761 * configure.tgt: Set targ_osabi.
13762 * configure.ac: Define GOLD_DEFAULT_OSABI.
13763 * parameters.cc (Parameters::default_target): Pass
13764 GOLD_DEFAULT_OSABI to select_target.
13765 * target-select.h (class Target_selector): Make instantiate_target
13766 protected rather than private.
13767 * Makefile.am (HFILES): Add freebsd.h.
13768 * configure, Makefile.in, config.in: Rebuild.
13769
cb010894
ILT
13770 * merge.cc (do_add_input_section): Correct pend value. Change
13771 message about last entry not being null terminated from error to
13772 warning.
13773
0e879927
ILT
137742009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13775
13776 * incremental.cc: New file.
13777 * Makefile.am (CCFILES): Add incremental.cc.
13778 * Makefile.in: Rebuild.
13779
41105937
PP
137802009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13781
13782 * layout.cc (Layout::output_section_name): Preserve names
13783 of '.note.' sections.
e1df38aa 13784
60439920
ILT
137852009-03-19 Ian Lance Taylor <iant@google.com>
13786
13787 * descriptors.cc (Descriptors::open): Check that the options are
13788 valid before using them.
13789
0d371ad3
ILT
137902009-03-18 Ian Lance Taylor <iant@google.com>
13791
13792 * script-sections.h: Include <list>.
13793 (class Script_sections): Change Sections_elements from std::vector
13794 to std::list. Typedef public Elements_iterator. Add
13795 orphan_section_placement_, data_segment_align_start_, and
13796 saw_data_segment_align_ fields. Remove data_segment_align_index_
13797 field.
13798 * script-sections.cc (class Orphan_section_placement): New class.
13799 (class Sections_element): Add virtual functions is_relro and
13800 orphan_section_init. Remove virtual function place_orphan_here.
13801 (class Output_section_definition): Add is_relro and
13802 orphan_section_init. Remove place_orphan_here.
13803 (class Orphan_output_section): Likewise.
13804 (Script_sections::Script_sections): Update for field changes.
13805 (Script_sections::data_segment_align): Set saw_data_segment_align_
13806 and data_segment_align_start_, not data_segment_align_index.
13807 (Script_sections::data_segment_relro_end): Check
13808 saw_data_segment_align_. Use data_segment_align_start_ rather
13809 than data_segment_align_index_.
13810 (Script_sections::place_orphan): Rewrite to use
13811 Orphan_section_placement.
13812
9201d894
ILT
138132009-03-17 Ian Lance Taylor <iant@google.com>
13814
9c5b8369
ILT
13815 * archive.cc (Archive::add_symbols): Check for a version attached
13816 to the symbol name in the archive map.
13817 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13818 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13819 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13820 (ver_test_11.a): New target.
13821 * testsuite/Makefile.in: Rebuild.
13822
9201d894
ILT
13823 * configure.ac: Check for chsize and posix_fallocate. Replace
13824 ftruncate.
13825 * ftruncate.c: New file, from gnulib.
13826 * output.cc (posix_fallocate): Define dummy version if not
13827 HAVE_POSIX_FALLOCATE.
13828 (Output_file::map): Call posix_fallocate rather than lseek and
13829 write.
13830 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13831 * configure, Makefile.in, config.in: Rebuild.
13832
ef4ab7a8 138332009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13834
ef4ab7a8
PP
13835 * layout.h (Layout::create_note): Add section_name parameter.
13836 * layout.cc (Layout::create_note): Likewise.
13837 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13838
8c500701
ILT
138392009-03-17 Ian Lance Taylor <iant@google.com>
13840
e85b18e1
ILT
13841 * descriptors.cc: Include "options.h".
13842 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13843 (Descriptors::open): Always use O_CLOEXEC when opening a new
13844 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13845 then set FD_CLOEXEC.
13846
9efe6174
ILT
13847 * sparc.cc (class Target_sparc): Add has_got_section.
13848 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13849 make sure we have a GOT section.
13850
13851 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13852 (Target_sparc::Scan::local): Likewise.
13853 (Target_sparc::Scan::global): Likewise.
13854 (Target_sparc::Relocate::relocate): Likewise.
13855 (Target_sparc::Relocate::relocate_tls): Likewise.
13856
8c500701
ILT
13857 * symtab.cc (Symbol_table::define_default_version): New function,
13858 broken out of add_from_object.
13859 (Symbol_table::add_from_object): Call define_default_version.
13860 (Symbol_table::define_special_symbol): Add resolve_oldsym
13861 parameter. Change all callers. If the version for a symbol comes
13862 from a version script, resolve it with the symbol with the same
13863 name with no version. Also add the symbol without a version if
13864 appropriate.
13865 (do_define_in_output_data): If resolving with oldsym, don't delete
13866 sym.
13867 (do_define_in_output_segment): Likewise.
13868 (do_define_as_constant): Likewise.
13869 * symtab.h (class Symbol_table): Update declarations.
13870
f1ed28fb
ILT
138712009-03-13 Ian Lance Taylor <iant@google.com>
13872
15f8229b
ILT
13873 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13874 (Read_symbols::requeue): New function.
13875 (Read_symbols::do_read_symbols): If make_elf_object fails because
13876 the target type is not configured, and the file was searched for,
13877 issue a warning and retry with the next directory.
13878 (Add_symbols::run): If the file has an incompatible format, and
13879 it was searched for, requeue the Read_symbols task. On error,
13880 release the object.
13881 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13882 dirindex parameter to constructor. Change all callers. Declare
13883 incompatible_warning and requeue.
13884 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13885 input_argument_ and input_group_ fields. Add them to
13886 constructor. Change all callers.
13887 (class Read_script): Add dirindex_ field. Add it to constructor.
13888 Change all callers.
13889 * archive.cc (Archive::setup): Remove input_objects parameter.
13890 Change all callers.
13891 (Archive::get_file_and_offset): Likewise.
13892 (Archive::read_all_symbols): Likewise.
13893 (Archive::read_symbols): Likewise.
13894 (Archive::get_elf_object_for_member): Remove input_objects
13895 parameter. Add punconfigured parameter. Change all callers.
13896 (Archive::add_symbols): Change return type to bool. Check return
13897 value of include_member.
13898 (Archive::include_all_members): Likewise.
13899 (Archive::include_member): Change return type to bool. Return
13900 false if first included object has incompatible target. Set
13901 included_member_ field.
13902 (Add_archive_symbols::run): If add_symbols returns false, requeue
13903 Read_symbols task.
13904 * archive.h (class Archive): Add included_member_ field.
13905 Initialize it in constructor. Add input_file and searched_for
13906 methods. Update declarations.
13907 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13908 input_argument_ fields. Add them to constructor. Change all
13909 callers.
13910 * script.cc: Include "target-select.h".
13911 (class Parser_closure): Add skip_on_incompatible_target_ and
13912 found_incompatible_target_ fields. Add
13913 skip_on_incompatible_target parameter to constructor. Change all
13914 callers. Add methods skip_on_incompatible_target,
13915 clear_skip_on_incompatible_target, found_incompatible_target, and
13916 set_found_incompatible_target.
13917 (read_input_script): Add dirindex parameter. Change all callers.
13918 If parser finds an incompatible target, requeue Read_symbols
13919 task.
13920 (script_set_symbol): Clear skip_on_incompatible_target in
13921 closure.
13922 (script_add_assertion, script_parse_option): Likewise.
13923 (script_start_sections, script_add_phdr): Likewise.
13924 (script_check_output_format): New function.
13925 * script.h (read_input_script): Update declaration.
13926 * script-c.h (script_check_output_format): Declare.
13927 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13928 (ignore_cmd): Remove OUTPUT_FORMAT.
13929 * fileread.cc (Input_file::Input_file): Add explicit this.
13930 (Input_file::will_search_for): New function.
13931 (Input_file::open): Add pindex parameter. Change all callers.
13932 * fileread.h (class Input_file): Add input_file_argument method.
13933 Declare will_search_for. Update declarations.
13934 * object.cc (make_elf_object): Add punconfigured parameter.
13935 Change all callers.
13936 * object.h (class Object): Make input_file public. Add
13937 searched_for method.
13938 (make_elf_object): Update declaration.
13939 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13940 restart search.
13941 * dirsearch.h (class Dirsearch): Update declaration.
13942 * options.h (class General_options): Add --warn-search-mismatch.
13943 * parameters.cc (Parameters::is_compatible_target): New function.
13944 * parameters.h (class Parameters): Declare is_compatible_target.
13945 * workqueue.cc (Workqueue::add_blocker): New function.
13946 * workqueue.h (class Workqueue): Declare add_blocker.
13947
f1ed28fb
ILT
13948 * fileread.cc (Input_file::open): Remove options parameter.
13949 Change all callers.
13950 (Input_file::open_binary): Likewise.
13951 * script.cc (read_input_script): Likewise.
13952 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13953 options parameter from constructor. Change all callers.
13954 (class Read_script): Likewise.
13955 * fileread.h (class Input_file): Update declarations.
13956 * script.h (read_input_script): Update declaration.
13957
34dd024a
NC
139582009-03-10 Nick Clifton <nickc@redhat.com>
13959
13960 * po/es.po: New Spanish translation.
13961
6d71b17c
CC
139622009-03-06 Cary Coutant <ccoutant@google.com>
13963
13964 * options.cc (parse_short_option): Keep dash_z from registering itself.
13965
031cdbed
ILT
139662009-03-03 Ian Lance Taylor <iant@google.com>
13967
13968 PR 9918
13969 * target-reloc.h (relocate_section): Pass output_section to
13970 relocate.
13971 * i386.cc (Target_i386::should_apply_static_reloc): Add
13972 output_section parameter. Change all callers.
13973 (Target_i386::Relocate::relocate): Add output_section parameter.
13974 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13975 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13976 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13977 * testsuite/two_file_shared.sh: New script.
13978 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13979 (check_DATA): Add two_file_shared.dbg.
13980 (two_file_shared.dbg): New target.
13981 * testsuite/Makefile.in: Rebuild.
13982
15d5fa16
ILT
139832009-03-01 Ian Lance Taylor <iant@google.com>
13984
13985 * configure.ac: Check for byteswap.h.
13986 * configure: Rebuild.
13987 * config.in: Rebuild.
13988
8a4c0b0d
ILT
139892009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13990
13991 * layout.cc (Layout::find_or_add_kept_section): New function.
13992 (Layout::add_comdat): Removed.
13993 * layout.h (struct Kept_section): Move out of class Layout.
13994 Remove trailing underscores from field names. Add group_sections
13995 field. Rename group_ field to is_group. Change all uses.
13996 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13997 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13998 comdat_groups_ field.
13999 (Sized_relobj::include_section_group): Use
14000 find_or_add_kept_section and Kept_section::group_sections.
14001 (Sized_relobj::include_linkonce_section): Likewise.
14002 * object.cc (class Sized_relobj): Don't define Comdat_group or
14003 Comdat_group_table. Remove find_comdat_group and
14004 add_comdat_group. Remove comdat_groups_ field.
14005 * plugin.cc (include_comdat_group): Use
14006 Layout::find_or_add_kept_section.
14007
b4ecf66b
ILT
140082009-02-28 Ian Lance Taylor <iant@google.com>
14009
14359ca0
ILT
14010 * README: --gc-sections and map files are now supported. Document
14011 some build requirements.
14012
b4ecf66b
ILT
14013 PR 6992
14014 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14015 relocatable link set the value of the section symbol to zero.
14016 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14017 relocatable link don't include the section address in the local
14018 symbol value.
14019
0602e05a
ILT
140202009-02-27 Ian Lance Taylor <iant@google.com>
14021
fd9d194f
ILT
14022 PR 6811
14023 * options.h (class Search_directory): Add is_system_directory.
14024 (class General_options): Declare is_in_system_directory.
14025 * options.cc (get_relative_sysroot): Make static.
14026 (get_default_sysroot): Make static.
14027 (General_optoins::is_in_system_directory): New function.
14028 * fileread.cc (Input_file::is_in_system_directory): New function.
14029 * fileread.h (class Input_file): Declare is_in_system_directory.
14030 * object.h (class Object): Add is_in_system_directory.
14031 (class Input_objects): Remove system_library_directory_ field.
14032 * object.cc (Input_objects::add_object): Don't set
14033 system_library_directory_.
14034 (input_objects::found_in_system_library_directory): Remove.
14035 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14036 parameter. Change all callers.
14037 (Symbol_table::sized_write_globals): Likewise.
14038 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14039 Call Object::is_in_system_directory.
14040 * symtab.h (class Symbol_table): Update declarations.
14041
61edd21f
ILT
14042 PR 5990
14043 * descriptors.h (Open_descriptor): Add is_on_stack field.
14044 * descriptors.cc (Descriptors::open): If the descriptor is on the
14045 top of the stack, remove it. Initialize is_on_stack field.
14046 (Descriptors::release): Only add pod to stack if it is not on the
14047 stack already.
14048 (Descriptors::close_some_descriptor): Clear stack_next and
14049 is_on_stack fields.
14050
e29e076a
ILT
14051 PR 7091
14052 * output.cc (Output_section::find_starting_output_address): Rename
14053 from starting_output_address; add PADDR parameter; change return
14054 type.
14055 * output.h (class Output_section): Declare
14056 find_starting_output_address instead of starting_output_address.
14057 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14058 section symbol for which we can't find a merge section.
14059
0602e05a
ILT
14060 PR 9836
14061 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14062 hidden or internal, force the symbol to be local.
14063 * resolve.cc (Symbol::override_visibility): Define.
14064 (Symbol::override_base): Use override_visibility.
14065 (Symbol_table::resolve): Likewise.
14066 (Symbol::override_base_with_special): Likewise.
14067 (Symbol_table::override_with_special): If the visibility is hidden
14068 or internal, force the symbol to be local.
14069 * symtab.h (class Symbol): Add set_visibility and
14070 override_visibility.
14071 * testsuite/ver_test_1.sh: New file.
14072 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14073 (check_DATA): Add ver_test_1.syms.
14074 (ver_test_1.syms): New target.
14075 * testsuite/Makefile.in: Rebuild.
14076
401a9a73
CC
140772009-02-25 Cary Coutant <ccoutant@google.com>
14078
14079 * layout.cc (Layout::choose_output_section): Don't rename sections
14080 when using a linker script that has a SECTIONS clause.
14081 * Makefile.in: Regenerate.
14082
14083 * testsuite/Makefile.am (script_test_5.sh): New test case.
14084 * testsuite/Makefile.in: Regenerate.
14085 * testsuite/script_test_5.cc: New file.
14086 * testsuite/script_test_5.sh: New file.
14087 * testsuite/script_test_5.t: New file.
14088
f488e4b0
CC
140892009-02-13 Rafael Avila de Espindola <espindola@google.com>
14090
14091 * archive.cc (Archive::include_member): Update calls to add_symbols.
14092 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14093 the Layout argument.
14094 * dynobj.h (do_add_symbols): Add the Layout argument.
14095 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14096 Layout argument.
14097 * object.h (Object::add_symbols): Add the Layout argument.
14098 (Object::do_add_symbols): Add the Layout argument.
14099 (Sized_relobj::do_add_symbols): Add the Layout argument.
14100 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14101 Unify the two versions.
14102 (Add_plugin_symbols): Remove.
14103 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14104 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14105 (Add_plugin_symbols): Remove.
14106 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14107 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14108 (Add_symbols::run): Make it work with Pulginobj.
14109
89dd1680
ILT
141102009-02-06 Ian Lance Taylor <iant@google.com>
14111
14112 * object.cc (Sized_relobj::do_layout): Make info message start
14113 with lower case letter.
14114
266d0a74
ILT
141152009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14116
602b464e
ILT
14117 * binary.cc: Fix file comment.
14118
266d0a74
ILT
14119 * options.h (enum Incremental_disposition): Define.
14120 (class General_options): Add new options: --incremental,
14121 --incremental_changed, --incremental_unchanged,
14122 --incremental_unknown. Add incremental_disposition_ and
14123 implicit_incremental_ fields.
14124 (General_options::incremental_disposition): New function.
14125 (class Position_dependent_options): Add incremental_disposition
14126 option.
14127 (Position_dependent_options::copy_from_options): Set incremental
14128 dispositions.
14129 * options.cc (General_options::parse_incremental_changed): New
14130 function.
2e702c99
RM
14131 (General_options::parse_incremental_unchanged): New function.
14132 (General_options::parse_incremental_unknown): New function.
14133 (General_options::General_options): Initialize new fields
266d0a74 14134 incremental_disposition_ and implicit_incremental_.
2e702c99 14135 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14136 without --incremental.
14137
f073bbf7
CD
141382009-02-06 Chris Demetriou <cgd@google.com>
14139
14140 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14141 pointer and to report location as the file name associated with
14142 the symbol.
14143 (gold_undefined_symbol_at_location): New function to replace the
14144 old gold_undefined_symbol functionality.
14145 * target-reloc.h (relocate_section): Update to use
14146 gold_undefined_symbol_at_location.
14147 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14148 Call gold_undefined_symbol function rather than gold_error.
14149 * errors.h (Errors::undefined_symbol): Take location as a
14150 string, rather than calculating it from a relocation.
14151 * errors.cc (Errors::fatal): Print "fatal error:" before the
14152 formatted message.
14153 (Errors::error, Errors::error_at_location): Print "error: "
14154 before the formatted message.
14155 (Errors::undefined_symbol): Take location as a string, rather
14156 than calculating it from a relocation.
14157 (gold_undefined_symbol_at_location): New function akin to
14158 old gold_undefined_symbol, calculates location from relocation.
14159 (gold_undefined_symbol): Change to take only a Symbol pointer
14160 and to report location as the file name associated with the symbol.
14161 * testsuite/debug_msg.sh: Update for changed error messages.
14162 * testsuite/undef_symbol.sh: Likewise.
14163
8e94a90c
ILT
141642009-02-04 Duncan Sands <baldrick@free.fr>
14165
14166 PR 9812
14167 * reduced_debug_output.h
14168 (Output_reduced_debug_abbrev_section::failed): Use format for
14169 gold_warning.
14170 (Output_reduced_debug_info_section::faild): Likewise.
14171
88a0e15b
ILT
141722009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14173
14174 * script.cc (Lazy_demangler): New class.
2e702c99 14175 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14176 symbol only once.
14177
5efc7cd2
CC
141782009-01-29 Cary Coutant <ccoutant@google.com>
14179
14180 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14181 to __tls_get_addr.
14182 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14183
e0ebcf42
ILT
141842009-01-28 Ian Lance Taylor <iant@google.com>
14185
5efc7cd2 14186 * version.cc (version_string): Bump to 1.9.
75fe7426 14187
e0ebcf42
ILT
14188 * gold.h: Include <cstring> and <stdint.h>.
14189 * version.cc: Include <cstdio>.
14190 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14191 warning.
14192 * reduced_debug_output.cc (insert_into_vector): Rename from
14193 Insert_into_vector; change all callers. Use Swap_unaligned to
14194 avoid aliasing issue; remove union since it is unnecessary.
14195
8e2813be 141962009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14197
14198 * Makefile.am (CCFILES): Add gc.cc.
14199 (HFILES): Add gc.h.
14200 * Makefile.in: Regenerate.
14201 * gold.cc (Gc_runner): New class.
14202 (queue_initial_tasks): Call garbage collection related tasks
14203 when corresponding options are invoked.
14204 (queue_middle_gc_tasks): New function.
14205 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14206 processed early before laying out sections during garbage collection.
14207 * gold.h (queue_middle_gc_tasks): New function.
14208 (is_prefix_of): Move from "layout.cc".
14209 * i386.cc (Target_i386::gc_process_relocs): New function.
14210 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14211 * main.cc (main): Create object of class "Garbage_collection".
14212 * object.cc (Relobj::copy_symbols_data): New function.
14213 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14214 (Sized_relobj::do_layout): Allow this function to be called twice
14215 during garbage collection and defer layout of section during the
6d03d481
ST
14216 first call.
14217 * object.h (Relobj::get_symbols_data): New function.
14218 (Relobj::is_section_name_included): New function.
14219 (Relobj::copy_symbols_data): New function.
14220 (Relobj::set_symbols_data): New function.
14221 (Relobj::get_relocs_data): New function.
14222 (Relobj::set_relocs_data): New function.
14223 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14224 (Relobj::gc_process_relocs): New function.
14225 (Relobj::do_gc_process_relocs): New pure virtual function.
14226 (Relobj::sd_): New data member.
14227 (Sized_relobj::is_output_section_offset_invalid): New function.
14228 (Sized_relobj::do_gc_process_relocs): New function.
14229 * options.h (General_options::gc_sections): Modify to not be a no-op.
14230 (General_options::print_gc_sections): New option.
14231 * plugin.cc (Plugin_finish::run): Remove function call to
14232 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14233 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14234 * reloc.cc (Read_relocs::run): Add task to process relocs and
14235 determine unreferenced sections when doing garbage collection.
14236 (Gc_process_relocs): New class.
14237 (Sized_relobj::do_gc_process_relocs): New function.
14238 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14239 sections that are garbage collected.
14240 * reloc.h (Gc_process_relocs): New class.
14241 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14242 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14243 symbols whose corresponding sections are garbage collected.
14244 (Symbol_table::Symbol_table): Add new parameter for the garbage
14245 collection object.
14246 (Symbol_table::gc_mark_undef_symbols): New function.
14247 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14248 (Symbol_table::gc_mark_dyn_syms): New function.
14249 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14250 as garbage.
14251 (Symbol_table::add_from_object): Likewise.
14252 (Symbol_table::add_from_relobj): When building shared objects, do not
14253 treat externally visible symbols as garbage.
14254 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14255 table information for static and relocatable links.
14256 * symtab.h (Symbol_table::set_gc): New function.
14257 (Symbol_table::gc): New function.
14258 (Symbol_table::gc_mark_undef_symbols): New function.
14259 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14260 (Symbol_table::gc_mark_dyn_syms): New function.
14261 (Symbol_table::gc_): New data member.
e1df38aa 14262 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14263 function.
14264 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14265 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14266
3b293544
CF
142672009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14268
14269 * options.h (General_options::gc_sections): Define as a no-op for now.
14270 (General_options::no_keep_memory): Ditto.
14271 (General_options::Bshareable): Define.
14272 * options.cc (General_options::finalize): Honor -Bshareable.
14273
83d22aa8
AS
142742009-01-20 Andreas Schwab <schwab@suse.de>
14275
14276 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14277 read the value in the contents, since we don't use it. Use the
14278 template endianness when writing.
14279 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14280
cd536b21
AS
142812009-01-19 Andreas Schwab <schwab@suse.de>
14282
14283 * configure.tgt (powerpc64-*): Fix targ_obj.
14284
99e9a495
ILT
142852009-01-15 Ian Lance Taylor <iant@google.com>
14286
14287 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14288 local symbols when stripping all symbols.
14289
bbbfea06
CC
142902009-01-14 Cary Coutant <ccoutant@google.com>
14291
99e9a495 14292 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14293
0f7c0701
CC
142942009-01-14 Cary Coutant <ccoutant@google.com>
14295
14296 * archive.cc (Archive::get_elf_object_for_member): Remove call
14297 to File_read::claim_for_plugin.
14298 * descriptors.cc (Descriptors::open): Remove reference to
14299 is_claimed.
14300 (Descriptors::claim_for_plugin): Remove.
14301 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14302 (Descriptors::is_claimed): Remove.
14303 (claim_descriptor_for_plugin): Remove.
14304 * fileread.cc (File_read::claim_for_plugin): Remove.
14305 * fileread.h (File_read::claim_for_plugin): Remove.
14306 (File_read::descriptor): Reopen descriptor if necessary.
14307 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14308 (Plugin_manager::all_symbols_read): Add task parameter. Change
14309 all callers.
14310 (Plugin_manager::get_input_file): New function.
14311 (Plugin_manager::release_input_file): New function.
14312 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14313 corresponding data member.
14314 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14315 and pass to base constructor. Change all callers.
14316 (get_input_file, release_input_file): New functions.
14317 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14318 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14319 (Plugin_manager::all_symbols_read): Add task parameter.
14320 (Plugin_manager::get_input_file): New function.
14321 (Plugin_manager::release_input_file): New function.
14322 (Plugin_manager::task_): New data member.
14323 (Pluginobj::Pluginobj): Add filesize parameter.
14324 (Pluginobj::filename): New function.
14325 (Pluginobj::descriptor): New function.
14326 (Pluginobj::filesize): New function.
14327 (Pluginobj::filesize_): New data member.
14328 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14329 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14330 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14331
14332 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14333 with archive libraries.
14334 * testsuite/Makefile.in: Regenerate.
14335 * testsuite/plugin_test.c (struct sym_info): New type.
14336 (get_input_file, release_input_file): New static variables.
14337 (onload): Capture new transfer vector entries.
14338 (claim_file_hook): Stop reading at end of file according to filesize.
14339 Factor out parsing of readelf output into separate function.
14340 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14341 APIs and get the source file name from the symbol table. Convert
14342 source file name to corresponding object file name. Print info
14343 message when adding new input files.
14344 (parse_readelf_line): New function.
14345 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14346 * testsuite/plugin_test_2.sh: Likewise.
14347 * testsuite/plugin_test_3.sh: Likewise.
14348 * testsuite/plugin_test_4.sh: New test case.
14349
62a6d109
ILT
143502009-01-07 Ian Lance Taylor <iant@google.com>
14351
14352 * version.cc (version_string): Bump to 1.8.
14353
483620e8
CC
143542008-12-23 Cary Coutant <ccoutant@google.com>
14355
14356 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14357 * plugin.cc (Plugin_manager::finish): Rename as
14358 layout_deferred_objects. Move cleanup to separate function.
14359 (Plugin_manager::cleanup): New function.
14360 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14361 separately.
14362 * plugin.h (Plugin_manager::finish): Rename as
14363 layout_deferred_objects.
14364 (Plugin_manager::cleanup): New function.
14365 (Plugin_manager::cleanup_done): New field.
14366
d66a9eb3
CC
143672008-12-23 Cary Coutant <ccoutant@google.com>
14368
14369 * plugin.cc (is_visible_from_outside): New function.
14370 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14371 so we don't return "IR only" status for exported symbols or -r links.
14372
14373 * testsuite/Makefile.am (plugin_test_3): New test case.
14374 * testsuite/Makefile.in: Regenerate.
14375 * testsuite/plugin_test_3.sh: New file.
14376
5995b570
CC
143772008-12-22 Cary Coutant <ccoutant@google.com>
14378
14379 * object.cc (Sized_relobj::layout_section): New function.
14380 (Sized_relobj::do_layout): Defer layout of input sections until after
14381 plugin has provided replacement files.
14382 (Sized_relobj::do_layout_deferred_sections): New function.
14383 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14384 (Relobj::layout_deferred_sections): New function.
14385 (Relobj::do_layout_deferred_sections): New function.
14386 (Sized_relobj::do_layout_deferred_sections): New function.
14387 (Sized_relobj::layout_section): New function.
14388 (Sized_relobj::Deferred_layout): New structure.
14389 (Sized_relobj::deferred_layout_): New field.
14390 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14391 Change all callers. Layout deferred sections.
14392 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14393 references.
14394 (Plugin_hook::run): Move code from do_plugin_hook inline.
14395 (Plugin_hook::do_plugin_hook): Remove.
14396 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14397 (Plugin_manager::finish): Renamed, was cleanup.
14398 (Plugin_manager::should_defer_layout): New function.
14399 (Plugin_manager::add_deferred_layout_object): New function.
14400 (Plugin_manager::Deferred_layout_list): New type.
14401 (Plugin_manager::deferred_layout_objects_): New field.
14402 (Plugin_hook::do_plugin_hook): Remove.
14403
ee769c88
ILT
144042008-12-17 Ian Lance Taylor <iant@google.com>
14405
14406 * options.h (class General_options): Add --no case for
14407 --export-dynamic.
14408
abc8dcba
CC
144092008-12-16 Cary Coutant <ccoutant@google.com>
14410
14411 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14412 vector.
14413 (Plugin_manager::claim_file): Create plugin object even if
14414 plugin did not call the add_symbols callback.
14415 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14416 asking for more symbols than were added.
14417 * testsuite/Makefile.am (plugin_test_1): Add test case with
14418 no global symbols.
14419 (empty.syms): New target.
14420 * testsuite/Makefile.in: Regenerate.
14421 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14422 message. Don't call add_symbols if no globals.
14423 (all_symbols_read_hook): Don't provide replacement for empty
14424 claimed file.
14425
b0074644
ILT
144262008-12-12 Ian Lance Taylor <iant@google.com>
14427
68943102
ILT
14428 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14429 r_type == 0 for a local symbol with r_sym == 0.
14430 (scan_relocatable_relocs): Pass r_sym to
14431 local_non_section_strategy.
14432 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14433 r_sym parameter.
14434
b0074644
ILT
14435 * configure.ac: Update test for TLS descriptors: they are
14436 supported as of glibc 2.9.
14437 * configure: Rebuild.
14438
c2508178
ILT
144392008-12-11 Ian Lance Taylor <iant@google.com>
14440
14441 PR 7091
14442 * target-reloc.h (Default_scan_relocatable_relocs): For each
14443 function, map r_type == 0 to RELOC_DISCARD.
14444
2756a258
CC
144452008-12-10 Cary Coutant <ccoutant@google.com>
14446
14447 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14448 object to override a kept COMDAT group from a plugin object.
14449
bb6f53d3
ILT
144502008-12-09 Ian Lance Taylor <iant@google.com>
14451
fbc558e1
ILT
14452 PR 7088
14453 * yyscript.y (file_cmd): Handle INPUT.
14454
bb6f53d3
ILT
14455 * testsuite/initpri1.c: Change all declarations to be full
14456 prototypes by adding void, to avoid compiler warnings.
14457
4674ecfc
CC
144582008-12-05 Rafael Avila de Espindola <espindola@google.com>
14459
14460 * options.cc (General_options::parse_plugin_opt): New.
14461 (General_options::add_plugin): The argument now is just the filename.
14462 (General_options::add_plugin_option): New.
14463 * options.h (plugin_opt): New.
14464 (add_plugin): Change argument name.
14465 (add_plugin_option): New.
14466 * plugin.cc (Plugin::load): Don't parse the plugin option.
14467 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14468 (Plugin::add_option): New.
14469 (Plugin::args_): Change type.
14470 (Plugin::filename_): New.
14471 (Plugin_manager::add_plugin_option): New.
14472 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14473 * testsuite/Makefile.in: Regenerate.
14474
fd06b4aa
CC
144752008-12-05 Cary Coutant <ccoutant@google.com>
14476
14477 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14478 Handle --strip-lto-sections option.
14479 * options.h (strip_lto_sections): New option.
14480
6c52134c
CC
144812008-12-01 Cary Coutant <ccoutant@google.com>
14482
14483 * plugin.cc (ld_plugin_message): Change format parameter to const.
14484 Fix mismatch between new[] and delete.
14485
a45248e0
CC
144862008-11-14 Cary Coutant <ccoutant@google.com>
14487
14488 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14489 instead of -1U.
14490
c82fbeee
CS
144912008-11-05 Craig Silverstein <csilvers@google.com>
14492
14493 * options.cc (General_options::parse_dynamic_list): New function.
14494 * options.h (General_options): New flags dynamic_list,
14495 dynamic_list_data, dynamic_list_cpp_new, and
14496 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14497 (General_options::in_dynamic_list): New function.
14498 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14499 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14500 (Lex::can_continue_name): Likewise.
14501 (yylex): Likewise.
14502 (read_script_file): New parameter script_options.
14503 (read_dynamic_list): New function.
14504 (Script_options::define_dynamic_list): New function.
14505 (dynamic_list_keyword_parsecodes): New variable.
14506 (dynamic_list_keywords): New variable.
14507 * script.h (Script_options::define_dynamic_list): New function
14508 prototype.
14509 (read_dynamic_list): New function prototype.
14510 * symtab.cc (strprefix): New macro.
14511 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14512 dynamic_list_data, dynamic_list_cpp_new, and
14513 dynamic_list_cpp_typeinfo.
14514 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14515 (dynamic_list_expr): New rule.
14516 (dynamic_list_nodes): Likewise.
14517 (dynamic_list_node): Likewise.
14518 * testsuite/Makefile.am (dynamic_list): New test.
14519 * testsuite/Makefile.in: Regenerated.
14520 * testsuite/dynamic_list.t: New file.
14521 * testsuite/dynamic_list.sh: New file.
14522
e0bb29a5
CS
145232008-11-05 Craig Silverstein <csilvers@google.com>
14524
14525 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14526 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14527 (t11_last): Likewise.
14528 * testsuite/ver_test_6.c (main): Likewise.
14529
4e1e25e0
CC
145302008-10-07 Cary Coutant <ccoutant@google.com>
14531
14532 * options.c (General_options::finalize): Add check for -static and
14533 -shared.
14534 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14535 is not empty.
14536
92f03fcb
CC
145372008-10-02 Cary Coutant <ccoutant@google.com>
14538
14539 * plugin.cc (make_sized_plugin_object): Fix conditional
14540 compilation to work when not all targets are enabled.
14541
fbd8a257
CC
145422008-09-29 Cary Coutant <ccoutant@google.com>
14543
14544 * archive.cc (Archive::get_file_and_offset): Use filename instead
14545 of name to get library path.
14546 (Archive::include_member): Unlock external member of a thin archive.
14547
14548 * testsuite/Makefile.am (TEST_AR): New variable.
14549 (thin_archive_test_1): New test.
14550 (thin_archive_test_2): New test.
81636b3f
CC
14551 * testsuite/Makefile.in: Regenerate.
14552 * testsuite/thin_archive_main.cc: New file.
14553 * testsuite/thin_archive_test_1.cc: New file.
14554 * testsuite/thin_archive_test_2.cc: New file.
14555 * testsuite/thin_archive_test_3.cc: New file.
14556 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14557
eff45813
CC
145582008-09-29 Cary Coutant <ccoutant@google.com>
14559
14560 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14561 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14562 instead of -1U.
14563 (Sized_relobj::do_finalize_local_symbols): Likewise.
14564 (Sized_relobj::map_to_kept_section): Likewise.
14565 * object.h (Sized_relobj::invalid_address): New constant.
14566 (Sized_relobj::do_output_section_offset): Check for invalid_address
14567 and return -1ULL.
14568 * output.cc (Output_reloc::local_section_offset): Use constant
14569 invalid_address instead of -1U.
14570 (Output_reloc::get_address): Likewise.
14571 (Output_section::output_address): Change -1U to -1ULL.
14572 * output.h (Output_reloc::invalid_address): New constant.
14573 * reloc.cc (Sized_relobj::write_sections): Use constant
14574 invalid_address instead of -1U.
14575 (Sized_relobj::relocate_sections): Likewise.
14576 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14577 values for merge sections.
14578 * target-reloc.h (relocate_for_relocatable): Use constant
14579 invalid_address instead of -1U.
14580
89fc3421
CC
145812008-09-19 Cary Coutant <ccoutant@google.com>
14582
14583 Add plugin functionality for link-time optimization (LTO).
14584 * configure.ac (plugins): Add --enable-plugins option.
14585 * configure: Regenerate.
14586 * config.in: Regenerate.
14587 * Makefile.am (LIBDL): New variable.
14588 (CCFILES): Add plugin.cc.
14589 (HFILES): Add plugin.h.
14590 (ldadd_var): Add LIBDL.
14591 * Makefile.in: Regenerate.
14592
14593 * archive.cc: Include "plugin.h".
14594 (Archive::setup): Don't preread archive symbols when using a plugin.
14595 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14596 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14597 files.
14598 (Archive::include_member): Add symbols from plugin objects.
14599 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14600 * descriptors.cc (Descriptors::open): Check for file descriptors
14601 abandoned by plugins.
14602 (Descriptors::claim_for_plugin): New function.
14603 * descriptors.h (Descriptors::claim_for_plugin): New function.
14604 (Open_descriptor::is_claimed): New field.
14605 (claim_descriptor_for_plugin): New function.
14606 * fileread.cc (File_read::claim_for_plugin): New function.
14607 * fileread.h (File_read::claim_for_plugin): New function.
14608 (File_read::descriptor): New function.
14609 * gold.cc: Include "plugin.h".
14610 (queue_initial_tasks): Add task to call plugin hooks for generating
14611 new object files.
14612 * main.cc: Include "plugin.h".
14613 (main): Load plugin libraries.
14614 * object.h (Pluginobj): Declare.
14615 (Object::pluginobj): New function.
14616 (Object::do_pluginobj): New function.
14617 (Object::set_target): New function.
14618 * options.cc: Include "plugin.h".
14619 (General_options::parse_plugin): New function.
14620 (General_options::General_options): Initialize plugins_ field.
14621 (General_options::add_plugin): New function.
14622 * options.h (Plugin_manager): Declare.
14623 (General_options): Add --plugin option.
14624 (General_options::has_plugins): New function.
14625 (General_options::plugins): New function.
14626 (General_options::add_plugin): New function.
14627 (General_options::plugins_): New field.
14628 * plugin.cc: New file.
14629 * plugin.h: New file.
14630 * readsyms.cc: Include "plugin.h".
14631 (Read_symbols::do_read_symbols): Check for archive before checking
14632 for ELF file. Call plugin hooks to claim files.
14633 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14634 from a real object file; force override when processing replacement
14635 files.
14636 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14637 (Symbol::init_base_object): Likewise.
14638 (Symbol::init_base_output_data): Likewise.
14639 (Symbol::init_base_output_segment): Likewise.
14640 (Symbol::init_base_constant): Likewise.
14641 (Symbol::init_base_undefined): Likewise.
14642 (Symbol::output_section): Assert that object is not a plugin.
14643 (Symbol_table::add_from_pluginobj): New function.
14644 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14645 undefined.
14646 (Symbol_table::sized_write_globals): Likewise.
14647 (Symbol_table::add_from_pluginobj): Instantiate template.
14648 * symtab.h (Sized_pluginobj): Declare.
14649 (Symbol::in_real_elf): New function.
14650 (Symbol::set_in_real_elf): New function.
14651 (Symbol::in_real_elf_): New field.
14652 (Symbol_table::add_from_pluginobj): New function.
14653
14654 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14655 (LIBDL): New variable.
14656 (LDADD): Add LIBDL.
14657 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14658 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14659 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14660 (MOSTLYCLEANFILES): Likewise.
14661 * testsuite/Makefile.in: Regenerate.
14662 * testsuite/plugin_test.c: New file.
14663 * testsuite/plugin_test_1.sh: New file.
14664 * testsuite/plugin_test_2.sh: New file.
14665
de31bda5
ILT
146662008-09-16 Ian Lance Taylor <iant@google.com>
14667
9c2d0ef9
ILT
14668 * target-reloc.h (relocate_section): Check whether a symbol is
14669 defined by the ABI before reporting an undefined symbol error.
14670 * target.h (Target::is_defined_by_abi): Make parameter const.
14671 (Target::do_is_defined_by_abi): Likewise.
14672 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14673 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14674 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14675 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14676 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14677 * testsuite/Makefile.in: Rebuild.
14678
de31bda5
ILT
14679 * fileread.cc (make_view): Add casts to avoid warning.
14680
9fa33bee
AO
146812008-09-16 Alexandre Oliva <aoliva@redhat.com>
14682
14683 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14684 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14685
183fd0e3
AO
146862008-09-16 Alexandre Oliva <aoliva@redhat.com>
14687
14688 * options.h (General_options::output_is_executable): New.
14689 (General_options::output_is_pie): New.
14690 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14691 for shared libraries.
14692 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14693
7be8330a
CD
146942008-09-11 Chris Demetriou <cgd@google.com>
14695
14696 * options.h (origin): New -z option.
14697 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14698 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14699 in DT_FLAGS_1.
14700
a9caad02
CC
147012008-09-05 Cary Coutant <ccoutant@google.com>
14702
14703 * fileread.cc (File_read::make_view): Add check for attempt to map
14704 beyond end of file.
14705
ae6dce4d
CC
147062008-09-05 Cary Coutant <ccoutant@google.com>
14707
14708 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14709 explicit instantiations.
14710
d7ab2a47
KVH
147112008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14712
14713 PR gold/6858
14714 * options.cc (General_options::finalize): Allow undefined symbols
14715 in shlibs if linking -shared.
14716
14717 PR gold/6859
14718 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14719 symbols as not needing a dynsym entry.
14720
1e52a9c1
CS
147212008-08-20 Craig Silverstein <csilvers@google.com>
14722
14723 * fileread.cc (File_read::open): Do not lock the file unless it
14724 was successfully opened.
14725
d85c80a3
CC
147262008-08-14 Cary Coutant <ccoutant@google.com>
14727
14728 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14729 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14730 * testsuite/tls_test.cc (struct int128): 128-bit struct
14731 for testing TLS relocs with non-zero addend.
14732 (v12): New TLS variable.
14733 (t12): New test.
14734 (t_last): Add check for v12.
14735 * testsuite/tls_test.h (t12): New function.
14736 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14737
2d924fd9
ILT
147382008-08-13 Ian Lance Taylor <iant@google.com>
14739
14740 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14741 set tls_segment_ or relro_segment_.
14742 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14743 when appropriate.
14744 * output.h (Output_section::clear_is_relro): New function.
14745 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14746 sections specially even when output_data_ is empty.
14747 (Output_segment::maximum_alignment): When first section is relro,
14748 only force alignment for PT_LOAD segments.
14749 * script.cc (script_data_segment_align): New function.
14750 (script_data_segment_relro_end): New function.
14751 * script-c.h (script_data_segment_align): Declare.
14752 (script_data_segment_relro_end): Declare.
14753 * script-sections.h (class Script_sections): Declare
14754 data_segment_align and data_segment_relro_end. Add fields
14755 segment_align_index_ and saw_relro_end_.
14756 * script-sections.cc (class Sections_element): Add set_is_relro
14757 virtual function. Add new bool* parameter to place_orphan_here.
14758 Add get_output_section virtual function.
14759 (class Output_section_definition): Add set_is_relro. Add new
14760 bool* parameter to place_orphan_here. Add get_output_section.
14761 Add is_relro_ field.
14762 (Output_section_definition::Output_section_definition): Initialize
14763 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14764 and is_relro_ fields.
14765 (Output_section_definition::place_orphan_here): Add is_relro
14766 parameter.
14767 (Output_section_definition::set_section_addresses): Set relro for
14768 output section.
14769 (Output_section_definition::alternate_constraint): Likewise.
14770 (class Orphan_output_section): Add new bool* parameter to
14771 place_orphan_here. Add get_output_section.
14772 (Orphan_output_section::place_orphan_here): Add is_relro
14773 parameter.
14774 (Script_sections::Script_sections): Initialize
14775 data_segment_align_index_ and saw_relro_end_.
14776 (Script_sections::data_segment_align): New function.
14777 (Script_sections::data_segment_relro_end): New function.
14778 (Script_sections::place_orphan): Set or clear is_relro.
14779 (Script_sections::set_section_addresses): Force alignment of first
14780 TLS section.
14781 * yyscript.y (exp): Call script_data_segment_align and
14782 script_data_segment_relro_end.
14783 * testsuite/relro_script_test.t: New file.
14784 * testsuite/relro_test.cc (using_script): Declare.
14785 (t1, t2): Test using_script.
14786 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14787 (relro_script_test_SOURCES): Define.
14788 (relro_script_test_DEPENDENCIES): Define.
14789 (relro_script_test_LDFLAGS): Define.
14790 (relro_script_test_LDADD): Define.
14791 (relro_script_test.so): New target.
14792 * testsuite/Makefile.in: Rebuild.
14793
f827c9a9
CC
147942008-08-06 Cary Coutant <ccoutant@google.com>
14795
14796 * archive.cc (Archive::total_archives, Archive::total_members)
14797 (Archive::total_members_loaded): New variables.
14798 (Archive::setup): Add parameter. Add option to preread
14799 archive symbols.
14800 (Archive::read_armap): Add counter.
14801 (Archive::get_file_and_offset): New function.
14802 (Archive::get_elf_object_for_member): New function.
14803 (Archive::read_all_symbols): New function.
14804 (Archive::read_symbols): New function.
14805 (Archive::add_symbols): Add counters.
14806 (Archive::include_all_members): Use armap to find members if it's
14807 already built.
14808 (Archive::include_member): Skip reading symbols if already read.
14809 Factored code into Archive::get_file_and_offset and
14810 Archive::get_elf_object_for_member. Changed call to
14811 Mapfile::report_include_archive_member.
14812 (Archive::print_stats): New function.
14813 * archive.h: Declare Object and Read_symbols_data classes.
14814 (Archive::Archive): Add initializers for new members.
14815 (Archive::setup): Add parameter.
14816 (Archive::print_stats): New function.
14817 (Archive::total_archives, Archive::total_members)
14818 (Archive::total_members_loaded): New variables.
14819 (Archive::get_file_and_offset): New function.
14820 (Archive::get_elf_object_for_member): New function.
14821 (Archive::read_all_symbols): New function.
14822 (Archive::read_symbols): New function.
14823 (Archive::Archive_member): New class.
14824 (Archive::members_): New member.
14825 (Archive::num_members_): New member.
14826 * main.cc: Include archive.h.
14827 (main): Call Archive::print_stats.
14828 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14829 archive parameter; member_name is now the fully-decorated name.
14830 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14831 * options.h: (General_options): Add --preread-archive-symbols option.
14832 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14833 Archive::setup.
14834
de4c45bd
ILT
148352008-08-04 Ian Lance Taylor <iant@google.com>
14836
14837 * symtab.h (Symbol::use_plt_offset): New function.
14838 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14839 * powerpc.cc (Relocate::relocate): Likewise.
14840 * sparc.cc (Relocate::relocate): Likewise.
14841 * x86_64.cc (Relocate::relocate): Likewise.
14842 * testsuite/weak_plt.sh: New test.
14843 * testsuite/weak_plt_main.cc: New test.
14844 * testsuite/weak_plt_shared.cc: New test.
14845 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14846 (check_PROGRAMS): Add weak_plt.
14847 (check_DATA): Add weak_plt_shared.so.
14848 (weak_plt_main_pic.o, weak_plt): New targets.
14849 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14850 * testsuite/Makefile.in: Rebuild.
14851
14852 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14853 gcctestdir/ld.
14854 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14855 * testsuite/Makefile.in: Rebuild.
14856
323ee3f4
AM
148572008-08-04 Alan Modra <amodra@bigpond.net.au>
14858
14859 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14860 * Makefile.in: Regenerate.
14861 * po/POTFILES.in: Regenerate.
14862
7c07ecec
ILT
148632008-07-29 Ian Lance Taylor <iant@google.com>
14864
14865 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14866 symbols before other symbols.
14867 * testsuite/script_test_2.cc (test_addr): Declare.
14868 (test_addr_alias): Declare.
14869 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14870 values.
7c07ecec
ILT
14871 * testsuite/script_test_2.t: Define test_addr_alias and
14872 test_addr.
14873
5778530e
ILT
148742008-07-24 Ian Lance Taylor <iant@google.com>
14875
2a00e4fb
ILT
14876 PR 5990
14877 * descriptors.cc: New file.
14878 * descriptors.h: New file.
14879 * gold-threads.h (class Hold_optional_lock): New class.
14880 * fileread.cc: Include "descriptors.h".
14881 (File_read::~File_read): Release descriptor rather than closing
14882 it.
14883 (File_read::open) [file]: Call open_descriptor rather than open.
14884 Set is_descriptor_opened_.
14885 (File_read::open) [memory]: Assert that descriptor is not open.
14886 (File_read::reopen_descriptor): New function.
14887 (File_read::release): Release descriptor.
14888 (File_read::do_read): Make non-const. Reopen descriptor.
14889 (File_read::read): Make non-const.
14890 (File_read::make_view): Reopen descriptor.
14891 (File_read::do_readv): Likewise.
14892 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14893 Update declarations.
14894 * layout.cc: Include "descriptors.h".
14895 (Layout::create_build_id): Use open_descriptor rather than open.
14896 * output.cc: Include "descriptors.h".
14897 (Output_file::open): Use open_descriptor rather than open.
14898 * archive.cc (Archive::const_iterator): Change Archive to be
14899 non-const.
14900 (Archive::begin, Archive::end): Make non-const.
14901 (Archive::count_members): Likewise.
14902 * archive.h (class Archive): Update declarations.
14903 * object.h (Object::read): Make non-const.
14904 * Makefile.am (CCFILES): Add descriptors.cc.
14905 (HFILES): Add descriptors.h.
14906 * Makefile.in: Rebuild.
14907
801647d1
ILT
14908 PR 6716
14909 * gold.h: Always include <clocale>. Add Solaris workarounds
14910 following code in binutils/sysdep.h.
14911
5edd166e
ILT
14912 PR 6048
14913 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14914 this->eh_frame_hdr_ is NULL before using it.
14915
c89ad728
ILT
14916 * dynobj.cc (Versions::Versions): Update comment.
14917
aa86f06b
ILT
14918 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14919 the base version name.
14920
5778530e
ILT
14921 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14922 array size plus one.
14923 (Stringpool_template::set_string_offsets): Subtract one from key
14924 before using it as an array index.
14925 (Stringpool_template::get_offset_with_length): Likewise.
14926 (Stringpool_template::write_to_buffer): Likewise.
14927 * stringpool.h (Stringpool_template::get_offset_from_key):
14928 Likewise.
14929
057ead22
ILT
149302008-07-23 Ian Lance Taylor <iant@google.com>
14931
7f649c59
ILT
14932 PR 6658
14933 * object.h (Merged_symbol_value::value): Do our best to handle a
14934 negative addend.
14935
057ead22
ILT
14936 PR 6647
14937 * script.cc (Version_script_info::get_versions): Don't add empty
14938 version tag to return value.
14939 (Version_script_info::get_symbol_version_helper): Change return
14940 type to bool. Add pversion parameter. Change all callers.
14941 (script_register_vers_node): Don't require a non-NULL tag.
14942 * script.h (class Version_script_info): Update declarations.
14943 (Version_script_info::get_symbol_version): Change return type to
14944 bool. Add version parameter. Change all callers.
14945 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14946 handling. Handle an empty version from a version script.
14947 (Symbol_table::define_special_symbol): Likewise.
14948 * testsuite/ver_test_10.script: New file.
14949 * testsuite/ver_test_10.sh: New file.
14950 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14951 (check_DATA): Add ver_test_10.syms.
14952 (ver_test_10.syms, ver_test_10.so): New target.
14953 * testsuite/Makefile.in: Rebuild.
14954
58e54ac2
CD
149552008-07-23 Simon Baldwin <simonb@google.com>
14956
14957 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14958 to zero for undefined symbols from dynamic libraries.
14959
95d14cd3
ILT
149602008-07-23 Ian Lance Taylor <iant@google.com>
14961
14962 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14963 Change all callers.
14964 * symtab.h (class Symbol_table): Update declaration.
14965 * testsuite/ver_test_9.cc: New file.
14966 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14967 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14968 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14969 (ver_test_9.so, ver_test_9.o): New targets.
14970 * testsuite/Makefile.in: Rebuild.
14971
92de84a6
ILT
149722008-07-22 Ian Lance Taylor <iant@google.com>
14973
34810851
ILT
14974 * options.h (class General_options): Define --check-sections.
14975 * layout.cc (Layout::set_segment_offsets): Handle
14976 --check-sections.
14977
af6156ef
ILT
14978 * options.h (class General_options): Define -n/--nmagic and
14979 -N/--omagic.
14980 * options.cc (General_options::finalize): For -n/--nmagic or
14981 -N/--omagic, set -static.
14982 * layout.cc (Layout::attach_allocated_section_to_segment): If
14983 -N/--omagic, don't put read-only and read-write sections in
14984 different segments.
14985 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14986 finding a read-only segment.
14987 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14988 don't set the minimum segment alignment to the common page size,
14989 and don't set the file offset to the address modulo the page size.
14990 * script-sections.cc (Script_sections::create_segments): If
14991 -n/--omagic, don't put read-only and read-write sections in
14992 different segments.
14993
92de84a6
ILT
14994 * cref.cc: New file.
14995 * cref.h: New file.
14996 * options.h (class General_options): Add --print-symbol-counts.
14997 * main.cc (main): Issue defined symbol report if requested.
14998 * archive.cc (Archive::interpret_header): Make into a const member
14999 function.
15000 (Archive::add_symbols): Call Input_objects::archive_start and
15001 archive_stop.
15002 (Archive::const_iterator): Define new class.
15003 (Archive::begin, Archive::end): New functions.
15004 (Archive::include_all_members): Rewrite to use iterator.
15005 (Archive::count_members): New function.
15006 * archive.h (class Archive): Update declarations.
15007 (Archive::filename): New function.
15008 * object.cc: Include "cref.h".
15009 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15010 (Sized_relobj::do_get_global_symbol_counts): New function.
15011 (Input_objects::add_object): Add object to cross-referencer.
15012 (Input_objects::archive_start): New function.
15013 (Input_objects::archive_stop): New function.
15014 (Input_objects::print_symbol_counts): New function.
15015 * object.h: Declare Cref and Archive.
15016 (Object::get_global_symbol_counts): New function.
15017 (Object::do_get_global_symbol_counts): New pure virtual function.
15018 (class Sized_relobj): Add defined_count_ field. Update
15019 declarations.
15020 (class Input_objects): Add cref_ field. Update constructor.
15021 Update declarations.
15022 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15023 defined_count_.
15024 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15025 symbol counts.
15026 (Sized_dynobj::do_get_global_symbol_counts): New function.
15027 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15028 defined_count_. Update declarations. Define Symbols typedef.
15029 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15030 parameter. Change all callers.
15031 (Symbol_table::add_from_dynobj): Add sympointers and defined
15032 parameters. Change all callers.
15033 * symtab.h (class Symbol_table): Update declarations.
15034 * Makefile.am (CCFILES): Add cref.cc.
15035 (HFILES): Add cref.h.
15036 * Makefile.in: Rebuild.
15037
3f7c5e1d
CD
150382008-07-22 Simon Baldwin <simonb@google.com>
15039
15040 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15041 to zero when writing undefined symbols.
15042
e0b64032
ILT
150432008-07-22 Ian Lance Taylor <iant@google.com>
15044
15045 * output.cc (Output_section::add_input_section): Don't try to
15046 merge empty merge sections.
15047
096b02cf
CS
150482008-07-21 Craig Silverstein <csilvers@google.com>
15049
15050 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15051 Include symbol version in error message.
cd536b21 15052
1d1f116d
CD
150532008-07-20 Chris Demetriou <cgd@google.com>
15054
cd536b21 15055 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15056 (RANDOM_SEED_CFLAGS): New substituted variable.
15057 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15058 * configure: Rebuild.
15059 * Makefile.in: Likewise.
15060 * testsuite/Makefile.in: Likewise.
15061
a18f591e
ILT
150622008-07-18 Ian Lance Taylor <iant@google.com>
15063
15064 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15065 where we see NAME/NULL and NAME/VERSION as separate symbols.
15066 * testsuite/ver_test_main.cc (main): Call t4.
15067 (t4, t4_2a): Define.
15068 * testsuite/ver_test_2.cc (t4_2): Define.
15069 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15070 * testsuite/ver_test_4.cc (t4_2a): Define.
15071 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15072 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15073
c6e3f6ed
ILT
150742008-07-17 Ian Lance Taylor <iant@google.com>
15075
15076 * dynobj.cc (Versions::add_def): If we give an error about a
15077 missing version, go ahead and create the version anyhow.
15078
ef9beddf
ILT
150792008-07-10 Ian Lance Taylor <iant@google.com>
15080
15081 Handle output sections with more than 0x7fffffff bytes.
15082 * object.h (class Relobj): Change map_to_output_ to
15083 output_sections_, and just keep a section pointer. Change all
15084 uses. Move comdat group support to Sized_relobj.
15085 (Relobj::is_section_specially_mapped): Remove.
15086 (Relobj::output_section): Remove poff parameter. Change all
15087 callers.
15088 (Relobj::output_section_offset): New function.
15089 (Relobj::set_section_offset): Rewrite.
15090 (Relobj::map_to_output): Remove.
15091 (Relobj::output_sections): New function.
15092 (Relobj::do_output_section_offset): New pure virtual function.
15093 (Relobj::do_set_section_offset): Likewise.
15094 (class Sized_relobj): Add section_offsets_ field. Add comdat
15095 group support from Relobj. Update declarations.
15096 (Sized_relobj::get_output_section_offset): New function.
15097 (Sized_relobj::do_output_section_offset): New function.
15098 (Sized_relobj::do_set_section_offset): New function.
15099 * object.cc (Relobj::output_section_address): Remove.
15100 (Sized_relobj::Sized_relobj): Initialize new fields.
15101 (Sized_relobj::include_section_group): Cast find_kept_object to
15102 Sized_relobj.
15103 (Sized_relobj::include_linkonce_section): Likewise.
15104 (Sized_relobj::do_layout): Use separate arrays for output section
15105 and output offset.
15106 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15107 output_sections.
15108 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15109 output_sections and section_offsets.
15110 (Sized_relobj::write_local_symbols): Likewise.
15111 (map_to_kept_section): Compute output address directly.
15112 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15113 output_sections and section_offsets.
15114 (Sized_relobj::write_sections): Likewise.
15115 (Sized_relobj::relocate_sections): Likewise.
15116 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15117 * output.h (class Output_reloc): Update declarations. Change
15118 u2_.relobj to Sized_relobj*.
15119 (class Output_data_reloc): Change add functions to use
15120 Sized_relobj*.
15121 * output.cc (Output_reloc::Output_reloc): Change relobj to
15122 Sized_relobj*.
15123 (Output_reloc::local_section_offset): Change return type to
15124 Elf_Addr. Use get_output_section_offset.
15125 (Output_reloc::get_address): Likewise.
15126 (Output_section::is_input_address_mapped): Don't call
15127 is_section_specially_mapped.
15128 (Output_section::output_offset): Likewise.
15129 (Output_section::output_address): Likewise.
15130 (Output_section::starting_output_address): Likewise.
15131 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15132 parameter to Sized_relobj*.
15133 (Copy_relocs::need_copy_reloc): Likewise.
15134 (Copy_relocs::save): Likewise.
15135 * copy-relocs.h (class Copy_relocs): Update declarations.
15136 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15137 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15138 * target-reloc.h (relocate_for_relocatable): Change
15139 offset_in_output_section type to Elf_Addr. Change code that uses
15140 it as well.
15141 * layout.cc (Layout::layout): Always set *off.
15142 * mapfile.cc (Mapfile::print_input_section): Use
15143 output_section_offset.
15144 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15145 Sized_relobj*.
15146 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15147 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15148 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15149
5cb66f97
ILT
151502008-07-03 Ian Lance Taylor <iant@google.com>
15151
15152 * layout.cc (Layout::include_section): Do not discard unrecognized
15153 SHT_STRTAB sections.
15154
afe47622
CS
151552008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15156
15157 * script.cc (Lex::can_continue_name): Make '?' allowable in
15158 version-script names.
15159 * testsuite/version_script.map: Change glob pattern to use '?'
15160
5adf9721
ILT
151612008-06-30 Manish Singh <yosh@gimp.org>
15162
15163 PR 6585
15164 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15165 Correct typo.
15166
e6fde208
ILT
151672008-06-30 Ian Lance Taylor <iant@google.com>
15168
15169 PR 6660
15170 PR 6682
15171 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15172 versions]: Don't try to read the value in the contents, since we
15173 don't use it. Use the template endianness when writing.
15174
3f2e6a2d
CC
151752008-06-25 Cary Coutant <ccoutant@google.com>
15176
15177 * fileread.cc (File_read::make_view): Assert on zero-length view.
15178 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15179 symbol table when there are no symbols to read.
15180
c43d3a48
CS
151812008-06-23 Craig Silverstein <csilvers@google.com>
15182
15183 * version.cc (version_string): Bump to 1.7
15184
5f494ea0
CS
151852008-06-18 Craig Silverstein <csilvers@google.com>
15186
15187 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15188 constant 0xFFFF to type Valtype.
15189 (Powerpc_relocate_functions::rel16_ha): Likewise.
15190
c42e122e
ILT
151912008-06-17 Ian Lance Taylor <iant@google.com>
15192
f34787f8
ILT
15193 * output.h (Output_section::Input_section): Initialize p2align_ to
15194 zero for Output_section_data constructors.
15195 (Output_section::Input_section::addralign): If not an input
15196 section, return the alignment of the Output_section_data.
15197 * testsuite/copy_test.cc: New file.
15198 * testsuite/copy_test_1.cc: New file.
15199 * testsuite/copy_test_2.cc: New file.
15200 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15201 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15202 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15203 (copy_test_1_pic.o, copy_test_1.so): New targets.
15204 (copy_test_2_pic.o, copy_test_2.so): New targets.
15205 * testsuite/Makefile.in: Rebuild.
15206
c42e122e
ILT
15207 * script-sections.cc (Script_sections::place_orphan): Initialize
15208 local variable exact.
15209
ce3ac18a
DE
152102008-06-13 David Edelsohn <edelsohn@gnu.org>
15211
15212 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15213
42cacb20
DE
152142008-06-12 David Edelsohn <edelsohn@gnu.org>
15215 David S. Miller <davem@davemloft.net>
15216
15217 * powerpc.cc: New file.
15218 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15219 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15220 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15221 * Makefile.in: Rebuild.
15222
7b308235
ILT
152232008-06-09 Ian Lance Taylor <iant@google.com>
15224
15225 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15226 <exception>.
15227 (throwing, orig_terminate): New static variables.
15228 (terminate_handler): New static function.
15229 (t2): Set terminate handler.
15230
f0b886e3
ILT
152312008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15232
15233 PR 6584
cd536b21 15234 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15235 alignment.
15236
3e90f135
CC
152372008-05-30 Cary Coutant <ccoutant@google.com>
15238
15239 * archive.cc (Archive::include_all_members) Correct to step
15240 over symbol table and extended name table in thin archives.
15241
e09ad04a
ILT
152422008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15243
15244 PR 6407
15245 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15246 calculation.
15247
62b01cb5
ILT
152482008-05-28 Caleb Howe <cshowe@google.com>
15249
15250 * reduced_debug_output.cc: New file.
15251 * reduced_debug_output.h: New file.
92de84a6 15252 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15253 * options.cc (General_options::finalize): Add strip_debug_non_line
15254 to the strip heirarchy.
15255 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15256 fields.
15257 * layout.cc: Include "reduced_debug_output.h".
15258 (Layout::Layout): Initialize new fields.
15259 (line_only_debug_sections): New static array.
15260 (is_lines_only_debug_sections): New static inline function.
15261 (Layout::include_section): Handle --strip-debug-non-line.
15262 (Layout::make_output_section): If --strip-debug-non-line, build
15263 new output sections for .debug_abbrev and .debug_info.
15264 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15265 gold. Warn about possible overflow.
15266 (read_signed_LEB_128): Likewise.
15267 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15268 (read_signed_LEB_128): Declare.
15269 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15270 (HFILES): Add reduced_debug_output.h.
15271 * Makefile.in: Rebuild.
15272
7d9e3d98
ILT
152732008-05-21 Ian Lance Taylor <iant@google.com>
15274
15275 * mapfile.cc: New file.
15276 * mapfile.h: New file.
15277 * options.h (class General_options): Add -M/--print-map and -Map.
15278 * options.cc (General_options::finalize): Make -M equivalent to
15279 -Map -.
15280 * main.cc: Include <cstdio> and "mapfile.h".
15281 (main): Open mapfile if requested.
15282 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15283 constructor. Change caller.
15284 (queue_initial_tasks): Add mapfile parameter. Change caller.
15285 (queue_middle_tasks): Likewise.
15286 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15287 declarations.
15288 * archive.cc: Include "mapfile.h".
15289 (Archive::add_symbols): Add mapfile parameter. Change all
15290 callers. Pass mapfile, symbol, and reason to include_member.
15291 (Archive::include_all_members): Add mapfile parameter. Change all
15292 callers.
15293 (Archive::include_member): Add mapfile, sym, and why parameters.
15294 Change all callers. Report inclusion to map file.
15295 * archive.h: Include "fileread.h".
15296 (class Archive): Update declarations.
15297 (Archive::file): New const method.
15298 (class Add_archive_symbols): Add mapfile_ field. Update
15299 constructor. Change all callers.
15300 * readsyms.h (class Read_symbols): Likewise.
15301 (class Finish_group): Likewise.
15302 (class Read_script): Likewise.
15303 * common.cc: Include "mapfile.h".
15304 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15305 all callers.
15306 (Symbol_table::do_allocate_commons): Likewise.
15307 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15308 symbol allocation to mapfile.
15309 * common.h (class Allocate_commons_task): Add mapfile_ field.
15310 Update constructor. Change all callers.
15311 * symtab.h (class Symbol_table): Update declarations.
15312 * layout.cc: Include "mapfile.h".
15313 (Layout_task_runner::run): Print information to mapfile.
15314 (Layout::create_gold_note): Change Output_data_fixed_space to
15315 Output_data_zero_fill.
15316 (Layout::create_build_id): Likewise.
15317 (Layout::print_to_mapfile): New function.
15318 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15319 constructor. Change caller.
15320 (class Layout): Declare print_to_mapfile.
15321 * output.cc (Output_section::Input_section::print_to_mapfile): New
15322 function.
15323 (Output_section::add_input_section): If producing a map, always
15324 add to input_sections_ list.
15325 (Output_section::do_print_to_mapfile): New function.
15326 (Output_segment::print_sections_to_mapfile): New function.
15327 (Output_segment::print_section_list_to_mapfile): New function.
15328 * output.h: Include "mapfile.h".
15329 (Output_data::print_to_mapfile): New function.
15330 (Output_data::do_print_to_mapfile): New virtual function.
15331 (Output_segment_headers::do_print_to_mapfile): New function.
15332 (Output_file_header::do_print_to_mapfile): New function.
15333 (Output_data_const::do_print_to_mapfile): New function.
15334 (class Output_data_const_buffer): Add map_name_ field. Update
15335 constructor. Change all callers. Add do_print_to_mapfile
15336 function.
15337 (class Output_data_fixed_space): Likewise.
15338 (class Output_data_space): Likewise.
15339 (class Output_data_zero_fill): New class.
15340 (Output_data_strtab::do_print_to_mapfile): New function.
15341 (Output_data_reloc_base::do_print_to_mapfile): New function.
15342 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15343 (Output_data_group::do_print_to_mapfile): New function.
15344 (Output_data_got::do_print_to_mapfile): New function.
15345 (Output_data_dynamic::do_print_to_mapfile): New function.
15346 (Output_symtab_xindex::do_print_to_mapfile): New function.
15347 (class Output_section): Declare do_print_to_mapflie. Declare
15348 print_to_mapfile in Input_section.
15349 (class Output_segment): Declare new functions.
15350 * object.h (Sized_relobj::symbol_count): New function.
15351 * script-sections.cc
15352 (Output_section_element_dot_assignment::set_section_addresses):
15353 Change Output_data_fixed_space to Output_data_zero_fill.
15354 (Output_data_expression::do_print_to_mapfile): New function.
15355 * script.cc (read_input_script): Add mapfile parameter. Change
15356 all callers.
15357 * script.h (read_input_script): Update declaration.
15358 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15359 (Eh_frame::do_print_to_mapfile): New function.
15360 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15361 (Output_merge_string::do_print_to_mapfile): New function.
15362 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15363 function.
15364 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15365 function.
15366 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15367 function.
15368 * Makefile.am (CCFILES): Add mapfile.cc.
15369 (HFILES): Add mapfile.h.
15370 * Makefile.in: Rebuild.
15371
9f1d377b
ILT
153722008-05-19 Ian Lance Taylor <iant@google.com>
15373
15374 * options.h (class General_options): Add -z relro.
15375 * layout.cc (Layout::Layout): Initialize relro_segment_.
15376 (Layout::add_output_section_data): Return the output section.
15377 (Layout::make_output_section): Rcognize relro sections and mark
15378 them appropriately.
15379 (Layout::attach_allocated_section_to_segment): Put relro sections
15380 in a PT_GNU_RELRO segment.
15381 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15382 section as relro.
15383 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15384 PT_TLS segments.
15385 (Layout::linkonce_mapping): Map d.rel.ro.local to
15386 .data.rel.ro.local.
15387 (Layout::output_section_name): Us .data.rel.ro.local for any
15388 section which begins with that.
15389 * layout.h (class Layout): Update add_output_section_data
15390 declaration. Add relro_segment_ field.
15391 * output.cc (Output_section::Output_section): Initialize is_relro_
15392 and is_relro_local_ fields.
15393 (Output_segment::add_output_section): Group relro sections.
15394 (Output_segment::is_first_section_relro): New function.
15395 (Output_segment::maximum_alignment): If there is a relro section,
15396 align the segment to the common page size.
15397 (Output_segment::set_section_addresses): Track whether we are
15398 looking at relro sections. If the last section is a relro
15399 section, align to the common page size.
15400 (Output_segment::set_section_list_addresses): Add in_relro
15401 parameter. Change all callers. Align to the page size when
15402 moving from relro to non-relro section.
15403 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15404 segment.
15405 * output.h (class Output_section): Add is_relro_ and
15406 is_relro_local_ fields.
15407 (Output_section::is_relro): New function.
15408 (Output_section::set_is_relro): New function.
15409 (Output_section::is_relro_local): New function.
15410 (Output_section::set_is_relro_local): New function.
15411 (class Output_segment): Update declarations.
15412 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15413 * sparc.cc (Target_sparc::got_section): Likewise.
15414 * x86_64.cc (Target_x86_64::got_section): Likewise.
15415 * testsuite/relro_test_main.cc: New file.
15416 * testsuite/relro_test.cc: New file.
15417 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15418 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15419 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15420 (relro_test.so, relro_test_pic.o): New targets.
15421 * testsuite/Makefile.in: Rebuild.
15422
a984ee1d
ILT
154232008-05-16 Ian Lance Taylor <iant@google.com>
15424
01676dcd
ILT
15425 * output.cc (Output_segment::add_output_section): Remove front
15426 parameter.
15427 * output.h (class Output_segment): Remove
15428 add_initial_output_section and overloaded add_output_section.
15429 Update declaration of remaining add_output_section.
15430 * layout.cc (Layout::create_interp): Call add_output_section
15431 rather than add_initial_output_section.
15432 (Layout::finish_dynamic_section): Likewise.
15433
497897f9
ILT
15434 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15435 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15436 know the dynamic type.
15437 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15438 field. Initialize it in constructor.
15439 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15440 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15441 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15442 reloc.
15443
a984ee1d
ILT
15444 * output.cc (Output_reloc::get_address): Change return type to
15445 Elf_Addr.
15446 * output.h (class Output_reloc): Update get_address declaration.
15447 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15448 for section addresses.
15449
55ba0940
ILT
154502008-05-09 Ian Lance Taylor <iant@google.com>
15451
15452 PR 6493
15453 * gold.cc (gold_nomem): Use return value of write.
15454
75517b77
ILT
154552008-05-08 Ian Lance Taylor <iant@google.com>
15456
15457 * symtab.c (Symbol::init_base_output_data): Add version
15458 parameter. Change all callers.
15459 (Symbol::init_base_output_segment): Likewise.
15460 (Symbol::init_base_constant): Likewise.
15461 (Symbol::init_base_undefined): Likewise.
15462 (Sized_symbol::init_output_data): Likewise.
15463 (Sized_symbol::init_output_segment): Likewise.
15464 (Sized_symbol::init_constant): Likewise.
15465 (Sized_symbol::init_undefined): Likewise.
15466 (Symbol_table::do_define_in_output_data): If the new symbol has a
15467 version, mark it as the default.
15468 (Symbol_table::do_define_in_output_segment): Likewise.
15469 (Symbol_table::do_define_as_constant): Likewise.
15470 * symtab.h (class Symbol): Update declarations.
15471 (class Sized_symbol): Likewise.
15472 * resolve.cc (Symbol::override_version): New function.
c42e122e 15473 (Symbol::override_base): Call override_version.
75517b77
ILT
15474 (Symbol::override_base_with_special): Likewise.
15475 * testsuite/ver_script_8.script: New file.
15476 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15477 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15478 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15479 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15480
f1f70eae
ILT
154812008-05-06 Ian Lance Taylor <iant@google.com>
15482
f3e9c5c5
ILT
15483 PR 6049
15484 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15485 functions.
15486 (class General_options): Remove existing --undefined, and add
15487 --no-undefined instead. Add new --undefined as synonym for -u.
15488 * archive.cc (Archive::add_symbols): Check whether symbol was
15489 named with -u.
15490 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15491 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15492 all uses. Add IS_UNDEFINED. Update declarations to split
15493 different versions of init_base. Declare init_base_undefined.
15494 (Symbol::is_defined): Handle IS_UNDEFINED.
15495 (Symbol::is_undefined): Likewise.
15496 (Symbol::is_weak_undefined): Call is_undefined.
15497 (Symbol::is_absolute): Handle IS_CONSTANT.
15498 (class Sized_symbol): Update declarations to split different
15499 versions of init. Declare init_undefined.
15500 (class Symbol_table): Declare new functions.
15501 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15502 Change all callers.
15503 (Symbol::init_base_output_data): Likewise.
15504 (Symbol::init_base_output_segment): Likewise.
15505 (Symbol::init_base_constant): Likewise.
15506 (Symbol::init_base_undefined): New function.
15507 (Sized_symbol::init_object): Rename from init. Change all
15508 callers.
15509 (Sized_symbol::init_output_data): Likewise.
15510 (Sized_symbol::init_output_segment): Likewise.
15511 (Sized_symbol::init_constant): Likewise.
15512 (Sized_symbol::init_undefined): New function.
15513 (Symbol_table::add_undefined_symbols_from_command_line): New
15514 function.
15515 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15516 function.
15517 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15518 (Symbol::output_section): Likewise.
15519 (Symbol::set_output_section): Likewise.
15520 (Symbol_table::sized_finalize_symbol): Likewise.
15521 (Symbol_table::sized_write_globals): Likewise.
15522 * resolve.cc (Symbol_table::should_override): Likewise.
15523 (Symbol::override_base_with_special): Likewise.
15524
8bdcdf2c
ILT
15525 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15526 symbol, change it to have default visibility.
15527 * testsuite/protected_1.cc: New file.
15528 * testsuite/protected_2.cc: New file.
15529 * testsuite/protected_3.cc: New file.
15530 * testsuite/protected_main_1.cc: New file.
15531 * testsuite/protected_main_2.cc: New file.
15532 * testsuite/protected_main_3.cc: New file.
15533 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15534 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15535 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15536 (protected_1.so): New target.
15537 (protected_1_pic.o, protected_2_pic.o): New targets.
15538 (protected_3_pic.o): New target.
15539 (check_PROGRAMS): Add protected_2.
15540 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15541 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15542 * testsuite/Makefile.in: Rebuild.
15543
2b706932
ILT
15544 * options.h (DEFINE_var): Add set_user_set_##varname__.
15545 (DEFINE_bool_alias): New macro.
15546 (class General_options): Define -Bstatic using DEFINE_bool_alias
15547 rather than DEFINE_special. Add --undefined as an alias for -z
15548 defs.
15549 * options.cc (General_options::parse_Bstatic): Remove.
15550
d82a5bcc
ILT
15551 * options.h (class General_options): Add --fatal-warnings.
15552 * main.cc (main): Implement --fatal-warnings.
15553 * errors.h (Errors::warning_count): New function.
15554
f1f70eae
ILT
15555 * options.h (class General_options): Add -Bsymbolic-functions.
15556 * symtab.h (Symbol::is_preemptible): Check for
15557 -Bsymbolic-functions.
15558
8825ac63
ILT
155592008-05-05 Ian Lance Taylor <iant@google.com>
15560
d98bc257
ILT
15561 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15562 as noVARNAME rather than no-VARNAME.
15563 (class General_options): Add option -z combreloc.
15564 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15565 get_address.
15566 (Output_reloc::sort_before) [SHT_REL]: New function.
15567 (Output_reloc::sort_before) [SHT_RELA]: New function.
15568 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15569 Sort_relocs_comparison.
15570 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15571 parameter. Change all callers.
15572 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15573 sort_relocs parameter. Change all callers.
15574 * output.cc (Output_reloc::get_address): New function, broken out
15575 of write_rel.
15576 (Output_reloc::write_rel): Call it.
15577 (Output_reloc::compare): New function.
15578 (Output_data_reloc_base::do_write): Optionally sort relocs.
15579
60b2b4e7
ILT
15580 * configure.ac: If targ_extra_obj is set, link it in.
15581 * configure.tgt: Initialize all variables.
15582 (x86_64*): Set targ_extra_obj and targ_extra_size.
15583 * configure: Rebuild.
15584
8825ac63
ILT
15585 * object.cc (Sized_relobj::include_section_group): Adjust section
15586 indexes read from group data. Build vector to pass to
15587 layout_group.
15588 * layout.cc (Layout::layout_group): Add flags and shndxes
15589 parameters. Remove contents parameter. Change caller. Update
15590 explicit instantiations.
15591 * layout.h (class Layout): Update layout_group declaration.
15592 * output.cc (Output_data_group::Output_data_group): Add flags and
15593 input_shndxes parameters. Remove contents parameter. Change
15594 caller.
15595 (Output_data_group::do_write): Change input_sections_ to
15596 input_shndxes_.
15597 * output.h (class Output_data_group): Update constructor
15598 declaration. Rename input_sections_ to input_shndxes_.
15599 * testsuite/many_sections_test.cc: Add template.
15600
e94cf127
CC
156012008-04-30 Cary Coutant <ccoutant@google.com>
15602
4418b2d5
CC
15603 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15604
e94cf127
CC
15605 * layout.cc (Layout::include_section): Refactored check for debug
15606 info section.
15607 (Layout::add_comdat): Add new parameters. Change type
15608 of signature parameter. Add object and shndx to signatures table.
15609 (Layout::find_kept_object): New function.
15610 * layout.h: Include <cstring>.
15611 (Layout::is_debug_info_section): New function.
15612 (Layout::add_comdat): Add new parameters.
15613 (Layout::find_kept_object): New function.
15614 (Layout::Kept_section): New struct.
15615 (Layout::Signatures): Change type of map range.
15616 * object.cc (Relobj::output_section_address): New function.
15617 (Sized_relobj::include_section_group): Add new parameters. Change
15618 calls to Layout::add_comdat. Change to build table of kept comdat
15619 groups and table mapping discarded sections to kept sections.
15620 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15621 (Sized_relobj::do_layout): Change calls to include_section_group and
15622 include_linkonce_section.
15623 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15624 value to zero when section is discarded.
15625 (Sized_relobj::map_to_kept_section): New function.
15626 * object.h (Relobj::output_section_address): New function.
15627 (Relobj::Comdat_group): New type.
15628 (Relobj::find_comdat_group): New function.
15629 (Relobj::Comdat_group_table): New type.
15630 (Relobj::Kept_comdat_section): New type.
15631 (Relobj::Kept_comdat_section_table): New type.
15632 (Relobj::add_comdat_group): New function.
15633 (Relobj::set_kept_comdat_section): New function.
15634 (Relobj::get_kept_comdat_section): New function.
15635 (Relobj::comdat_groups_): New field.
15636 (Relobj::kept_comdat_sections_): New field.
15637 (Symbol_value::input_value): Update comment.
15638 (Sized_relobj::map_to_kept_section) New function.
15639 (Sized_relobj::include_linkonce_section): Add new parameter.
15640 * target-reloc.h (Comdat_behavior): New type.
15641 (get_comdat_behavior): New function.
15642 (relocate_section): Add code to map a discarded section to the
15643 corresponding kept section when applying a relocation.
15644
e4e5049b
CS
156452008-04-30 Craig Silverstein <csilvers@google.com>
15646
15647 * dwarf_reader.cc (next_generation_count): New static var.
15648 (Addr2line_cache_entry): New struct.
15649 (addr2line_cache): New static var.
15650 (Dwarf_line_info::one_addr2line): Added caching.
15651 (Dwarf_line_info::clear_addr2line_cache): New function.
15652 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15653 cache-size parameter.
15654 (Dwarf_line_info::one_addr2line_cache): New function.
15655 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15656 new cache-size argument to one_addr2line(), and clear cache.
15657
d09e9154
CC
156582008-04-28 Cary Coutant <ccoutant@google.com>
15659
15660 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15661 R_386_PC8 relocations.
15662
7ef73768
ILT
156632008-04-23 Ian Lance Taylor <iant@google.com>
15664
55438702
ILT
15665 * object.cc (Sized_relobj::include_section_group): Check for
15666 invalid section group.
15667
c165fb93
ILT
15668 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15669 header size.
15670
7ef73768
ILT
15671 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15672 than read for file header.
15673 * archive.cc (Archive::include_member): Likewise.
15674
6194aaab
L
156752008-04-23 Paolo Bonzini <bonzini@gnu.org>
15676
15677 * aclocal.m4: Regenerate.
15678 * configure: Regenerate.
15679
d491d34e
ILT
156802008-04-19 Ian Lance Taylor <iant@google.com>
15681
5ea2bac6
ILT
15682 * version.cc (version_string): Bump to 1.6.
15683
7bc3e21a
ILT
15684 * testsuite/Makefile.am (many_sections_r_test): New target.
15685 (many_sections_r_test_SOURCES): Remove.
15686 (many_sections_r_test_DEPENDENCIES): Remove.
15687 (many_sections_r_test_LDFLAGS): Remove.
15688 (many_sections_r_test_LDADD): Remove.
15689
7fcd3aa9
ILT
15690 * object.cc (Sized_relobj::do_add_symbols): Always pass
15691 local_symbol_count_ to add_from_relobj.
15692
4c94d6ae
ILT
15693 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15694 every thousand variables.
15695 * testsuite/Makefile.in: Rebuild.
15696
d491d34e
ILT
15697 * object.cc (Xindex::initialize_symtab_xindex): New function.
15698 (Xindex::read_symtab_xindex): New function.
15699 (Xindex::sym_xindex_to_shndx): New function.
15700 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15701 available.
15702 (Sized_relobj::do_initialize_xindex): New function.
15703 (Sized_relobj::do_read_symbols): Adjust section links.
15704 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15705 parameter. Change all callers.
15706 (Sized_relobj::include_section_group): Adjust section links and
15707 symbol section indexes.
15708 (Sized_relobj::do_layout): Adjust section links.
15709 (Sized_relobj::do_count_local_symbols): Adjust section links and
15710 symbol section indexes.
15711 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15712 ordinary and special symbols.
15713 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15714 dynsym_xindex parameters. Change all callers. Adjust section
15715 links. Use SHN_XINDEX when needed.
15716 (Sized_relobj::get_symbol_location_info): Adjust section links.
15717 Don't get fooled by special symbols.
15718 * object.h (class Xindex): Define.
15719 (class Object): Add xindex_ parameter. Declare virtual functoin
15720 do_initialize_xindex.
15721 (Object::adjust_sym_shndx): New function.
15722 (Object::set_xindex): New protected function.
15723 (class Symbol_value): Add is_ordinary_shndx_ field.
15724 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15725 (Symbol_value::value): Assert ordinary section.
15726 (Symbol_value::initialize_input_to_output_map): Likewise.
15727 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15728 Change all callers.
15729 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15730 all callers.
15731 (class Sized_relobj): Update declarations.
15732 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15733 parameter. Change all callers.
15734 (Sized_relobj::adjust_shndx): New function.
15735 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15736 field.
15737 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15738 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15739 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15740 (Sized_dynobj::read_dynsym_section): Adjust section links.
15741 (Sized_dynobj::read_dynamic): Likewise.
15742 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15743 section links.
15744 (Sized_dynobj::do_initialize_xindex): New function.
15745 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15746 do_initialize_xindex.
15747 (Sized_dynobj::adjust_shndx): New function.
15748 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15749 dynsym_xindex_ fields.
15750 (Layout::finalize): Add a call to set_section_indexes before
15751 creating the symtab sections.
15752 (Layout::set_section_indexes): Don't do anything if the section
15753 already has a section index.
15754 (Layout::create_symtab_sections): Add shnum parameter. Change
15755 caller. Create .symtab_shndx section if needed.
15756 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15757 caller.
15758 (Layout::allocated_output_section_count): New function.
15759 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15760 needed.
15761 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15762 fields. Update declarations.
15763 (Layout::symtab_xindex): New function.
15764 (Layout::dynsym_xindex): New function.
15765 (class Write_symbols_task): Add layout_ field.
15766 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15767 Change caller.
15768 * output.cc (Output_section_headers::Output_section_headers): Add
15769 shstrtab_section parameter. Change all callers.
15770 (Output_section_headers::do_sized_write): Store overflow values
15771 for section count and section string table section index in
15772 section header zero.
15773 (Output_file_header::do_sized_write): Check for overflow of
15774 section count and section string table section index.
15775 (Output_symtab_xindex::do_write): New function.
15776 (Output_symtab_xindex::endian_do_write): New function.
15777 * output.h (class Output_section_headers): Add shstrtab_section_.
15778 Update declarations.
15779 (class Output_symtab_xindex): Define.
15780 (Output_section::has_out_shndx): New function.
15781 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15782 field.
15783 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15784 Change all callers.
15785 (Sized_symbol::init): Likewise.
15786 (Symbol::output_section): Check for ordinary symbol.
15787 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15788 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15789 callers.
15790 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15791 Change all callers. Simplify handling of symbols from sections
15792 not included in the link.
15793 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15794 distinction.
15795 (Weak_alias_sorter::operator()): Assert that symbols are
15796 ordinary.
15797 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15798 distinction.
15799 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15800 parameters. Change all callers.
15801 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15802 symbol distinction. Use SHN_XINDEX when needed.
15803 (Symbol_table::write_section_symbol): Add symtab_xindex
15804 parameter. Change all callers.
15805 (Symbol_table::sized_write_section_symbol): Likewise. Use
15806 SHN_XINDEX when needed.
15807 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15808 declarations.
15809 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15810 (Symbol::is_defined): Check is_ordinary.
15811 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15812 (Symbol::is_absolute, Symbol::is_common): Likewise.
15813 (class Sized_symbol): Update declarations.
15814 (class Symbol_table): Update declarations.
15815 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15816 parameters. Change all callers.
15817 (Sized_symbol::override): Likewise.
15818 (Symbol_table::override): Likewise.
15819 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15820 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15821 is_ordinary, and orig_st_shndx parameters. Change all callers.
15822 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15823 to be in an ordinary section.
15824 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15825 object and is_ordinary parameters. Change all callers.
15826 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15827 Change all callers. Don't add undefined or non-ordinary symbols
15828 to reloc_map_.
15829 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15830 Change all callers.
15831 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15832 declarations.
15833 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15834 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15835 (Sized_relobj::relocate_sections): Likewise.
15836 * target-reloc.h (scan_relocs): Adjust section symbol index.
15837 (scan_relocatable_relocs): Likewise.
15838 * i386.cc (Scan::local): Check for ordinary symbols.
15839 * sparc.cc (Scan::local): Likewise.
15840 * x86_64.cc (Scan::local): Likewise.
15841 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15842 to symbol_section_and_value.
15843 * testsuite/many_sections_test.cc: New file.
15844 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15845 (check_PROGRAMS): Add many_sections_test.
15846 (many_sections_test_SOURCES): Define.
15847 (many_sections_test_DEPENDENCIES): Define.
15848 (many_sections_test_LDFLAGS): Define.
15849 (BUILT_SOURCES): Add many_sections_define.h.
15850 (many_sections_define.h): New target.
15851 (BUILT_SOURCES): Add many_sections_check.h.
15852 (many_sections_check.h): New target.
15853 (check_PROGRAMS): Add many_sections_r_test.
15854 (many_sections_r_test_SOURCES): Define.
15855 (many_sections_r_test_DEPENDENCIES): Define.
15856 (many_sections_r_test_LDFLAGS): Define.
15857 (many_sections_r_test_LDADD): Define.
15858 (many_sections_r_test.o): New target.
15859 * testsuite/Makefile.in: Rebuild.
15860
c5818ff1
CC
158612008-04-17 Cary Coutant <ccoutant@google.com>
15862
15863 * errors.cc (Errors::info): New function.
15864 (gold_info): New function.
15865 * errors.h (Errors::info): New function.
15866 * gold.h (gold_info): New function.
15867 * object.cc (Input_objects::add_object): Print trace output.
15868 * options.cc (options::parse_set): New function.
15869 (General_options::parse_wrap): Deleted.
15870 (General_options::General_options): Deleted initializer.
15871 * options.h (options::String_set): New typedef.
15872 (options::parse_set): New function.
15873 (DEFINE_set): New macro.
15874 (General_options::wrap): Changed to use DEFINE_set. Changed
15875 callers of any_wrap_symbols and is_wrap_symbol.
15876 (General_options::trace, General_options::trace_symbol):
15877 New options.
15878 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15879 (General_options::wrap_symbols_): Deleted.
15880 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15881
b5be4a7c
DM
158822008-04-17 David S. Miller <davem@davemloft.net>
15883
15884 * options.cc (General_options::parse_V): New function.
15885 * options.h: Add entries for -V and -Qy.
15886
155a0dd7
ILT
158872008-04-17 Ian Lance Taylor <iant@google.com>
15888
15889 * common.cc (Symbol_table::allocate_commons): Remove options
15890 parameter. Change caller.
15891 (Symbol_table::do_allocate_commons): Remove options parameter.
15892 Change caller. Just call do_allocate_commons_list twice.
15893 (Symbol_table::do_allocate_commons_list): New function, broken out
15894 of do_allocate_commons.
15895 * common.h (class Allocate_commons_task): Remove options_ field.
15896 Update constructor.
15897 * symtab.cc (Symbol_table::Symbol_table): Initialize
15898 tls_commons_.
15899 (Symbol_table::add_from_object): Put TLS common symbols on
15900 tls_commons_ list.
15901 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15902 which are IN_OUTPUT_DATA.
15903 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15904 allocate_commons and do_allocate_commons declarations. Declare
15905 do_allocate_commons_list.
15906 * gold.cc (queue_middle_tasks): Update creation of
15907 Allocate_commons_task to not pass options.
15908 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15909 (TLS_TEST_C_FLAGS): New variable.
15910 (tls_test_c_pic.o): New target.
15911 (tls_test_shared.so): Link in tls_test_c_pic.o.
15912 (tls_test_c_pic_ie.o): New target.
15913 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15914 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15915 (tls_test_c.o): New target.
15916 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15917 (tls_pic_test_LDADD): Likewise.
15918 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15919 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15920 (tls_test_c_gnu2.o): New target.
15921 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15922 tls_test_c_gnu2.o.
15923 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15924 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15925 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15926 * testsuite/tls_test.cc: Include "config.h".
15927 (t_last): Call t11_last.
15928 * testsuite/tls_test.h (t11, t11_last): Declare.
15929 * testsuite/tls_test_c.c: New file.
15930 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15931 * configure.ac: Check for OpenMP support.
15932 * configure, config.in, Makefile.in: Rebuild.
15933 * testsuite/Makefile.in: Rebuild.
15934
edfbb029
CC
159352008-04-16 Cary Coutant <ccoutant@google.com>
15936
15937 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15938 (Target_i386::tls_base_symbol_defined_): New field.
15939 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15940 (Target_i386::Scan::global): Likewise.
15941 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15942 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15943 (Target_x86_64::tls_base_symbol_defined_): New field.
15944 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15945 (Target_x86_64::Scan::global): Likewise.
15946
f3c69fca
CC
159472008-04-16 Cary Coutant <ccoutant@google.com>
15948
15949 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15950 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15951 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15952 building shared libraries.
15953 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15954 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15955 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15956 * testsuite/Makefile.in: Rebuild.
15957 * testsuite/weak_undef.h: New file.
15958 * testsuite/weak_undef_file1.cc: Add extra test cases.
15959 * testsuite/weak_undef_file2.cc: Likewise.
15960 * testsuite/weak_undef_test.cc: Likewise.
15961
7c414435
DM
159622008-04-16 David S. Miller <davem@davemloft.net>
15963
32b769e1
DM
15964 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15965 Add issued_non_pic_error_ field. Declare check_non_pic.
15966 (Target_sparc::Scan::check_non_pic): New function.
15967 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15968 (Target_sparc::Scan::global): Likewise.
15969
11936fb1
DM
15970 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15971 * configure: Rebuild.
15972
7c414435
DM
15973 * options.h (DEFINE_enable): New macro.
15974 (new_dtags): New enable option.
15975 (initfirst, interpose, loadfltr, nodefaultlib,
15976 nodelete, nodlopen, nodump): New -z options.
15977 * layout.cc (Layout:finish_dynamic_section): If new
15978 dtags enabled, emit DT_RUNPATH. Also, emit a
15979 DT_FLAGS_1 containing any specified -z flags.
15980
85c7bf8b
ILT
159812008-04-16 Ian Lance Taylor <iant@google.com>
15982
12c0daef
ILT
15983 * copy-relocs.cc: New file.
15984 * copy-relocs.h: New file.
15985 * reloc.cc: Remove Copy_relocs code.
15986 * reloc.h: Likewise.
15987 * reloc-types.h (struct Reloc_types) [both versions]: Add
15988 get_reloc_addend_noerror.
15989 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15990 variants of add_global which take an addend which must be zero.
15991 * i386.cc: Include "copy-relocs.h".
15992 (class Target_i386): Change type of copy_relocs_ to variable,
15993 update initializer.
15994 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15995 Change all callers.
15996 (Target_i386::do_finalize_sections): Change handling of
15997 copy_relocs_.
15998 * sparc.cc: Include "copy-relocs.h".
15999 (class Target_sparc): Change type of copy_relocs_ to variable,
16000 update initializer.
16001 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16002 Change all callers.
16003 (Target_sparc::do_finalize_sections): Change handling of
16004 copy_relocs_.
16005 * x86_64.cc: Include "copy-relocs.h".
16006 (class Target_x86_64): Change type of copy_relocs_ to variable,
16007 update initializer.
16008 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16009 class. Change all callers.
16010 (Target_x86_64::do_finalize_sections): Change handling of
16011 copy_relocs_.
16012 * Makefile.am (CCFILES): Add copy-relocs.cc.
16013 (HFILES): Add copy-relocs.h.
16014
4f4995b6
ILT
16015 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16016
85c7bf8b
ILT
16017 * testsuite/script_test_4.sh: Permit leading zeroes.
16018
4f2a9edd
ILT
160192008-04-15 Ian Lance Taylor <iant@google.com>
16020
e6188289
ILT
16021 * script-sections.cc (Script_sections::create_segments): Use
16022 header_size_adjustment even when there is enough room for the
16023 headers.
16024 * testsuite/script_test_4.sh: New file.
16025 * testsuite/script_test_4.t: New file.
16026 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16027 (check_DATA): Add script_test_4.stdout.
16028 (MOSTLYCLEANFILES): Likewise.
16029 (script_test_4): New target.
16030 (script_test_4.stdout): New target.
16031 * testsuite/Makefile.in: Rebuild.
16032
4f2a9edd
ILT
16033 * sparc.cc: Add definitions for Output_data_plt_sparc class
16034 constants.
16035
f5314dd5
DM
160362008-04-14 David S. Miller <davem@davemloft.net>
16037
16038 * sparc.cc: New file.
16039 * Makefile.am (TARGETSOURCES): Add sparc.cc
16040 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16041 * configure.tgt: Document targ_extra_size and
16042 targ_extra_big_endian. Add entries for sparc-* and
16043 sparc64-*.
16044 * configure.ac: Handle targ_extra_size and
16045 targ_extra_big_endian.
16046 * Makefile.in: Rebuild.
16047 * configure: Likewise.
16048 * po/POTFILES.in: Likewise.
16049 * po/gold.pot: Likewise.
16050
154e0e9a
ILT
160512008-04-14 Ian Lance Taylor <iant@google.com>
16052
16053 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16054 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16055 in the name/type/flags to section mapping. Don't call
16056 allocate_output_section.
16057 (Layout::choose_output_section): Change parameter from adjust_name
16058 to is_input_section. Don't permit input sections after sections
16059 are attached to segments. Don't call allocate_output_section.
16060 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16061 not write_enable_output_section.
16062 (Layout::make_output_section): Don't push to
16063 unattached_section_list_ nor call attach_to_segment. Call
16064 attach_section_to_segment if sections are attached.
16065 (Layout::attach_sections_to_segments): New function.
16066 (Layout::attach_section_to_segment): New function.
16067 (Layout::attach_allocated_section_to_segment): Rename from
16068 attach_to_segment. Remove flags parameter.
16069 (Layout::allocate_output_section): Remove function.
16070 (Layout::write_enable_output_section): Remove function.
16071 * layout.h (class Layout): Update for above changes. Add new
16072 field sections_are_attached_.
16073 * output.h (Output_section::update_flags_for_input_section): New
16074 function.
16075 * output.cc (Output_section::add_input_section): Call
16076 update_flags_for_input_section.
16077 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16078
009a67a2
CC
160792008-04-11 Cary Coutant <ccoutant@google.com>
16080
16081 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16082 thought unnecessary.
16083 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16084
759b1a24
ILT
160852008-04-11 Ian Lance Taylor <iant@google.com>
16086
16087 * output.h (class Output_section_data): Remove inline definition
16088 of set_addralign.
16089 * output.cc (Output_section_data::set_addralign): New function.
16090
c2b45e22
CC
160912008-04-11 Cary Coutant <ccoutant@google.com>
16092
16093 Add support for TLS descriptors for i386 and x86_64.
16094 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16095 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16096 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16097 GOT_TYPE_TLS_DESC.
16098 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16099 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16100 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16101 relocations.
16102 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16103 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16104 Fix problem with initial-exec relocations.
16105 (Target_i386::Relocate::relocate_tls): Likewise.
16106 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16107 relaxation.
16108 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16109 support for section-plus-offset dynamic table entries.
16110 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16111 (Output_data_dynamic::Dynamic_entry): Add support for
16112 section-plus-offset dynamic table entries.
16113 (Output_data_dynamic::Classification): Likewise.
16114 (Output_data_dynamic::classification_): Renamed offset_.
16115 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16116 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16117 (Target_x86_64::make_plt_section): New function.
16118 (Target_x86_64::reserve_tlsdesc_entries): New function.
16119 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16120 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16121 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16122 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16123 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16124 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16125 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16126 add extra PLT entry for TLS descriptors.
16127 (Output_data_plt_x86_64::got_): New field.
16128 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16129 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16130 fields.
16131 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16132 descriptors.
16133 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16134 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16135 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16136 R_386_TLS_DESC_CALL relocations.
16137 (Target_x86_64::Scan::global): Likewise.
16138 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16139 for TLS descriptors.
16140 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16141 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16142 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16143 GD-to-IE relaxation.
16144 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16145 and TLS_DESCRIPTORS.
16146 * Makefile.in: Rebuild.
16147 * configure: Rebuild.
16148 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16149 (tls_test_shared2.so): New target.
16150 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16151 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16152 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16153 (tls_shared_gd_to_ie_test_LDADD): New variable.
16154 (tls_shared_gnu2_gd_to_ie_test): New target.
16155 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16156 New targets.
16157 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16158 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16159 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16160 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16161 (tls_shared_gnu2_test): New target.
16162 (tls_test_gnu2_shared.so): New target.
16163 (tls_shared_gnu2_test_SOURCES): New variable.
16164 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16165 (tls_shared_gnu2_test_LDFLAGS): New variable.
16166 (tls_shared_gnu2_test_LDADD): New variable.
16167 * testsuite/Makefile.in: Rebuild.
16168 * testsuite/Makefile.
16169
83bfb6b7
ILT
161702008-04-11 Ian Lance Taylor <iant@google.com>
16171
16172 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16173 justsyms.t.
16174 * testsuite/Makefile.in: Rebuild.
16175
16176 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16177 long.
16178 * testsuite/script_test_2.cc (main): Adjust test.
16179
706e1f5e
ILT
161802008-04-11 David S. Miller <davem@davemloft.net>
16181 Ian Lance Taylor <iant@google.com>
16182
16183 * options.h (General_options): Add entries for '-Y' and
16184 '-relax'.
16185 * options.cc (General_options:finalize): If -Y was used, add those
16186 entries to the library path instead of the default "/lib" and
16187 "/usr/lib".
16188
7c98e6bb
DM
161892008-04-11 David S. Miller <davem@davemloft.net>
16190
16191 * testsuite/justsyms.t: Start at 0x100.
16192 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16193 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16194 long.
16195 * testsuite/script_test_2.cc: Adjust string and section length
16196 checks.
7c98e6bb 16197
99a37bfd
ILT
161982008-04-09 Ian Lance Taylor <iant@google.com>
16199
2cefc357
ILT
16200 PR gold/5996
16201 * script-sections.cc (Sections_element::allocate_to_segment): Add
16202 orphan parameter.
16203 (Output_section_definition::allocate_to_segment): Likewise.
16204 (Orphan_output_section::allocate_to_segment): Likewise.
16205 (Script_sections::attach_sections_using_phdrs_clause): Don't
16206 propagate non-PT_LOAD segments to orphan sections.
16207 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16208 readelf rather than objdump.
16209 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16210 .interp section and PT_INTERP segment are the same size.
16211 * testsuite/Makefile.in: Rebuild.
16212
99a37bfd
ILT
16213 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16214 aliases for symbols defined in the same object.
16215 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16216 (weak_alias_test_SOURCES): New variable.
16217 (weak_alias_test_DEPENDENCIES): New variable.
16218 (weak_alias_test_LDFLAGS): New variable.
16219 (weak_alias_test_LDADD): New variable.
16220 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16221 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16222 (weak_alias_test_3.o): New target.
16223 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16224 * testsuite/weak_alias_test_main.cc: New file.
16225 * testsuite/weak_alias_test_1.cc: New file.
16226 * testsuite/weak_alias_test_2.cc: New file.
16227 * testsuite/weak_alias_test_3.cc: New file.
16228
780e49c5
ILT
162292008-04-08 Ian Lance Taylor <iant@google.com>
16230
cdb0b8f5
ILT
16231 * options.h (class General_options): Add --noinhibit-exec option.
16232 * main.cc (main): Check --noinhibit-exec.
16233
0864d551
ILT
16234 * options.h (class General_options): Define --wrap as a special
16235 option. Add wrap_symbols_ field.
16236 (General_options::any_wrap_symbols): New function.
16237 (General_options::is_wrap_symbol): New function.
16238 * options.cc (General_options::parse_wrap): New function.
16239 (General_options::General_options): Initialize wrap_symbols_.
16240 * symtab.cc (Symbol_table::wrap_symbol): New function.
16241 (Symbol_table::add_from_object): Handle --wrap.
16242 * symtab.h (class Symbol_table): Declare wrap_symbol.
16243 * target.h (Target::wrap_char): New function.
16244 (Target::Target_info): Add wrap_char field.
16245 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16246 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16247 * testsuite/testfile.cc (Target_test::test_target_info):
16248 Likewise.
16249
789aa6de
ILT
16250 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16251 there is one.
16252
2c38906f
ILT
16253 * layout.h (class Layout): Add added_eh_frame_data_ field.
16254 * layout.cc (Layout::Layout): Initialize new field.
16255 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16256 output section until we find a section we merged successfully.
16257 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16258 that the size be non-zero.
16259
780e49c5
ILT
16260 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16261 qualifier.
16262
7fcd0256
ILT
162632008-04-08 Craig Silverstein <csilvers@google.com>
16264
16265 * configure.ac: Export new conditional variable HAVE_ZLIB.
16266 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16267 on HAVE_ZLIB.
16268 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16269 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16270
6835af53
ILT
162712008-04-07 Ian Lance Taylor <iant@google.com>
16272
e24f324c
ILT
16273 * version.cc (version_string): Set to "1.5".
16274
a036edd8
ILT
16275 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16276 Add issued_non_pic_error_ field. Declare check_non_pic.
16277 (Target_x86_64::Scan::check_non_pic): New function.
16278 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16279 (Target_x86_64::Scan::global): Likewise.
16280
624f8810
ILT
16281 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16282 addend parameter. Change caller. Handle merge sections.
16283 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16284 Address to Addend. Don't add in the result of
16285 local_section_offset, pass down the addend and use the returned
16286 value.
16287 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16288 Update declarations of local_section_offset and symbol_value.
16289 * testsuite/two_file_test_1.cc (t18): New function.
16290 * testsuite/two_file_test_2.cc (f18): New function.
16291 * testsuite/two_file_test_main.cc (main): Call t18.
16292 * testsuite/two_file_test.h (t18, f18): Declare.
16293
6835af53
ILT
16294 * configure.ac: Don't test for objdump, c++filt, or readelf.
16295 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16296 conditionals.
16297 (TEST_READELF): New variable.
16298 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16299 (check_PROGRAMS): Add two_file_strip_test.
16300 (two_file_strip_test): New target.
16301 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16302 (two_file_same_shared_strip_test_SOURCES): New variable.
16303 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16304 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16305 (two_file_same_shared_strip_test_LDADD): New variable.
16306 (two_file_shared_strip.so): New target.
16307 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16308 (ver_test_5.syms, ver_test_7.syms): Likewise.
16309 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16310 (strip_test_3.stdout): Use TEST_OBJDUMP.
16311 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16312
86925eef
CC
163132008-04-04 Cary Coutant <ccoutant@google.com>
16314
16315 * symtab.h (Symbol::is_weak_undefined): New function.
16316 (Symbol::is_strong_undefined): New function.
16317 (Symbol::is_absolute): New function.
16318 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16319 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16320 absolute symbols.
16321 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16322 (weak_undef_test): New target.
16323 * testsuite/Makefile.in: Rebuild.
16324 * testsuite/weak_undef_file1.cc: New file.
16325 * testsuite/weak_undef_file2.cc: New file.
16326 * testsuite/weak_undef_test.cc: New file.
16327
126f3ece
ILT
163282008-04-03 Craig Silverstein <csilvers@google.com>
16329
16330 * compressed_output.h (class Output_compressed_section): Use
16331 unsigned buffer.
16332 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16333 add zlib header.
16334 (zlib_compressed_suffix): Removed.
16335 (Output_compressed_section::set_final_data_size): Use unsigned
16336 buffers.
16337 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16338 Fix linker invocation.
16339 (flagstest_o_specialfile_and_compress_debug_sections):
16340 Likewise.
16341 * testsuite/Makefile.in: Regenerated.
16342
deae2a14
DM
163432008-04-02 David S. Miller <davem@davemloft.net>
16344
16345 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16346 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16347
70752818
ILT
163482008-04-02 Craig Silverstein <csilvers@google.com>
16349
16350 * TODO: New file.
16351
39d0cb0e
ILT
163522008-04-02 Ian Lance Taylor <iant@google.com>
16353
16354 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16355 parameters. Update for new key type to views_. Change all
16356 callers.
16357 (File_read::read): Adjust for byteshift in returned view.
16358 (File_read::add_view): New function, broken out of
16359 find_and_make_view.
16360 (File_read::make_view): New function, broken out of
16361 find_and_make_view.
16362 (File_read::find_or_make_view): Add offset and aligned
16363 parameters. Rewrite accordingly. Change all callers.
16364 (File_read::get_view): Add offset and aligned parameters. Adjust
16365 for byteshift in return value.
16366 (File_read::get_lasting_view): Likewise.
16367 * fileread.h (class File_read): Update declarations.
16368 (class File_read::View): Add byteshift_ field. Add byteshift to
16369 constructor. Add byteshift method.
16370 * archive.h (Archive::clear_uncached_views): New function.
16371 (Archive::get_view): Add aligned parameter. Change all callers.
16372 * object.h (Object::get_view): Add aligned parameter. Change all
16373 callers.
16374 (Object::get_lasting_view): Likewise.
16375
16376 * fileread.cc (File_read::release): Don't call clear_views if
16377 there are multiple objects.
16378 * fileread.h (File_read::clear_uncached_views): New function.
16379 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16380 on the archive.
16381
a1207466
CC
163822008-03-31 Cary Coutant <ccoutant@google.com>
16383
16384 Add thin archive support.
16385 * archive.cc (Archive::armagt): New const.
16386 (Archive::setup): Remove task parameter and calls to unlock.
16387 (Archive::unlock_nested_archives): New function.
16388 (Archive::read_header): Add nested_off parameter. Change
16389 all callers.
16390 (Archive::interpret_header): Likewise.
16391 (Archive::include_all_members): Change to handle thin
16392 archives.
16393 (Archive::include_member): Likewise.
16394 * archive.h (Archive::Archive): Add new parameters and
16395 initializers.
16396 (Archive::armagt): New const.
16397 (Archive::setup): Remove task parameter.
16398 (Archive::unlock_nested_archives): New function.
16399 (Archive::read_header): Add nested_off parameter.
16400 (Archive::interpret_header): Likewise.
16401 (Archive::Nested_archive_table): New typedef.
16402 (Archive::is_thin_archive_): New field.
16403 (Archive::nested_archives_): New field.
16404 (Archive::options_): New field.
16405 (Archive::dirpath_): New field.
16406 (Archive::task_): New field.
16407 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16408 for thin archives. Pass additional parameters to
16409 Archive::Archive. Unlock the archive file after calling
16410 Archive::setup.
cd536b21 16411
479f6503
ILT
164122008-03-29 Ian Lance Taylor <iant@google.com>
16413
686c8caf
ILT
16414 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16415 version symbol to be local.
16416 * testsuite/ver_test_4.sh: New file.
16417 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16418 (check_DATA): Add ver_test_4.syms.
16419 (ver_test_4.syms): New target.
16420 * testsuite/Makefile.in: Rebuild.
16421
ab794b6b
ILT
16422 * output.cc
16423 (Output_section::Input_section_sort_entry::has_priority): New
16424 function.
16425 (Output_section::Input_section_sort_entry::match_file_name): New
16426 function.
16427 (Output_section::Input_section_sort_entry::match_section_name):
16428 Remove.
16429 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16430 Remove.
16431 (Output_section::Input_section_sort_entry::match_section_file):
16432 Remove.
16433 (Output_section::Input_section_sort_compare::operator()): Rewrite
16434 using new Input_section_sort_entry functions. Sort crtbegin and
16435 crtend first. Sort sections with no priority before sections with
16436 a priority.
16437 * testsuite/initpri1.c (d3): Check j != 4.
16438 (cd5): New constructor/destructor function.
16439 (main): Check j != 2.
16440
479f6503
ILT
16441 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16442 new symbol when resolving, don't call set_is_default.
16443 * testsuite/ver_test_7.cc: New file.
16444 * testsuite/ver_test_7.sh: New file.
16445 * testsuite/Makefile.am (ver_test_7.so): New target.
16446 (ver_test_7.o): New target.
16447 (check_SCRIPTS): Add ver_test_7.sh.
16448 (check_DATA): Add ver_test_7.syms.
16449 (ver_test_7.syms): New target.
16450
2fd32231
ILT
164512008-03-28 Ian Lance Taylor <iant@google.com>
16452
16453 * layout.cc (Layout::layout): If we see an input section with a
16454 name that needs sorting, set the must_sort flag for the output
16455 section.
16456 (Layout::make_output_section): If the name of the output section
16457 indicates that it might require sorting, set the may_sort flag.
16458 * output.h (Output_section::may_sort_attached_input_sections): New
16459 function.
16460 (Output_section::set_may_sort_attached_input_sections): New
16461 function.
16462 (Output_section::must_sort_attached_input_sections): New
16463 function.
16464 (Output_section::set_must_sort_attached_input_sections): New
16465 function.
16466 (class Output_section): Declare Input_section_sort_entry. Define
16467 Input_section_sort_compare. Declare
16468 sort_attached_input_sections. Add new fields:
16469 may_sort_attached_input_sections_,
16470 must_sort_attached_input_sections_,
16471 attached_input_sections_are_sorted_.
16472 * output.cc (Output_section::Output_section): Initialize new
16473 fields.
16474 (Output_section::add_input_section): Add an entry to
16475 input_sections_ if may_sort or must_sort are true.
16476 (Output_section::set_final_data_size): Call
16477 sort_attached_input_sections if necessary.
16478 (Output_section::Input_section_sort_entry): Define new class.
16479 (Output_section::Input_section_sort_compare::operator()): New
16480 function.
16481 (Output_section::sort_attached_input_sections): New function.
16482 * configure.ac: Check whether the compiler supports constructor
16483 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16484 * testsuite/initpri1.c: New file.
16485 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16486 CONSTRUCTOR_PRIORITY.
16487 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16488 (initpri1_LDFLAGS): New variable.
16489 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16490
18e6b24e
ILT
164912008-03-27 Ian Lance Taylor <iant@google.com>
16492
49bdd526
ILT
16493 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16494 * testsuite/common_test_1.c: New file.
16495 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16496 (common_test_1_SOURCES): New variable.
16497 (common_test_1_DEPENDENCIES): New variable.
16498 (common_test_1_LDFLAGS): New variable.
16499
18e6b24e
ILT
16500 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16501 and commons_ correctly when NAME/VERSION does not override
16502 NAME/NULL.
16503 * testsuite/ver_test_6.c: New file.
16504 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16505 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16506 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16507
04bf7072
ILT
165082008-03-26 Ian Lance Taylor <iant@google.com>
16509
5871526f
ILT
16510 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16511 of an undefined symbol from a version script.
16512 * testsuite/Makefile.am (ver_test_5.so): New target.
16513 (ver_test_5.o): New target.
16514 (check_SCRIPTS): Add ver_test_5.sh.
16515 (check_DATA): Add ver_test_5.syms.
16516 (ver_test_5.syms): New target.
16517 * testsuite/ver_test_5.cc: New file.
16518 * testsuite/ver_test_5.script: New file.
16519 * testsuite/ver_test_5.sh: New file.
16520 * Makefile.in, testsuite/Makefile.in: Rebuild.
16521
04bf7072
ILT
16522 PR gold/5986
16523 Fix problems building gold with gcc 4.3.0.
16524 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16525 (gold_error_at_location, gold_warning_at_location): Use it.
16526 * configure.ac: Check whether we can compile and use a template
16527 function with a printf attribute.
16528 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16529 when jumping over bytes.
16530 * object.cc: Instantiate Object::read_section_data.
16531 * debug.h: Include <cstring>
16532 * dwarf_reader.cc: Include <algorithm>
16533 * main.cc: Include <cstring>.
16534 * options.cc: Include <cstring>.
16535 * output.cc: Include <cstring>.
16536 * script.cc: Include <cstring>.
16537 * script.h: Include <string>.
16538 * symtab.cc: Include <cstring> and <algorithm>.
16539 * target-select.cc: Include <cstring>.
16540 * version.cc: Include <string>.
16541 * testsuite/testmain.cc: Include <cstdlib>.
16542 * configure, config.in: Rebuild.
16543
874c5b28
ILT
165442008-03-25 Ian Lance Taylor <iant@google.com>
16545
819d6c3a
ILT
16546 * options.cc: Include "../bfd/bfdver.h".
16547 (options::help): Print bug reporting address.
16548
f4b2c6f5
ILT
16549 * version.cc (print_version): Adjust output for current value of
16550 BFD_VERSION_STRING.
16551
16552 * NEWS: New file.
16553
e96caa79
ILT
16554 * options.cc (options::help): Print list of supported targets.
16555 * target-select.h: Include <vector>.
16556 (class Target_selector): Make machine_, size_, and is_big_endian_
16557 fields const. Add bfd_name_ and instantiated_target_ fields.
16558 (Target_selector::Target_selector): Add bfd_name parameter.
16559 (Target_selector::recognize): Make non-virtual, call
16560 do_recognize.
16561 (Target_selector::recognize_by_name): Make non-virtual, call
16562 do_recognize_by_name.
16563 (Target_selector::supported_names): New function.
16564 (Target_selector::bfd_name): New function.
16565 (Target_selector::do_instantiate_target): New pure virtual
16566 function.
16567 (Target_selector::do_recognize): New virtual function.
16568 (Target_selector::do_recognize_by_name): New virtual function.
16569 (Target_selector::instantiate_target): New private function.
16570 (supported_target_names): Declare.
16571 * target-select.cc (Target_selector::Target_selector): Update for
16572 new parameter and fields.
16573 (select_target_by_name): Check that the name matches before
16574 calling recognize_by_name.
16575 (supported_target_names): New function.
16576 * i386.cc (class Target_selector_i386): Update Target_selector
16577 constructor call. Remove recognize and recognize_by_name. Add
16578 do_instantiate_target.
16579 * x86_64.cc (class Target_selector_x86_64): Likewise.
16580 * testsuite/testfile.cc (class Target_selector_test): Update for
16581 changes to Target_selector.
16582
874c5b28
ILT
16583 * README: Rewrite, with some notes on unsupported features.
16584
0a65a3a7
CC
165852008-03-24 Cary Coutant <ccoutant@google.com>
16586
16587 * i386.cc (Target_i386::Got_type): New enum declaration.
16588 (Target_i386::Scan::local): Updated callers of Output_data_got
16589 member functions.
16590 (Target_i386::Scan::global): Likewise.
16591 (Target_i386::Relocate::relocate): Likewise.
16592 (Target_i386::Relocate::relocate_tls): Likewise.
16593 * object.h (Got_offset_list): New class.
16594 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16595 (Sized_relobj::local_got_offset): Likewise.
16596 (Sized_relobj::set_local_got_offset): Likewise.
16597 (Sized_relobj::local_has_tls_got_offset): Removed.
16598 (Sized_relobj::local_tls_got_offset): Removed.
16599 (Sized_relobj::set_local_tls_got_offset): Removed.
16600 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16601 * output.cc (Output_data_got::add_global): Added got_type parameter.
16602 (Output_data_got::add_global_with_rel): Likewise.
16603 (Output_data_got::add_global_with_rela): Likewise.
16604 (Output_data_got::add_global_pair_with_rel): New function.
16605 (Output_data_got::add_global_pair_with_rela): New function.
16606 (Output_data_got::add_local): Added got_type parameter.
16607 (Output_data_got::add_local_with_rel): Likewise.
16608 (Output_data_got::add_local_with_rela): Likewise.
16609 (Output_data_got::add_local_pair_with_rel): New function.
16610 (Output_data_got::add_local_pair_with_rela): New function.
16611 (Output_data_got::add_global_tls): Removed.
16612 (Output_data_got::add_global_tls_with_rel): Removed.
16613 (Output_data_got::add_global_tls_with_rela): Removed.
16614 (Output_data_got::add_local_tls): Removed.
16615 (Output_data_got::add_local_tls_with_rel): Removed.
16616 (Output_data_got::add_local_tls_with_rela): Removed.
16617 * output.h (Output_data_got::add_global): Added got_type parameter.
16618 (Output_data_got::add_global_with_rel): Likewise.
16619 (Output_data_got::add_global_with_rela): Likewise.
16620 (Output_data_got::add_global_pair_with_rel): New function.
16621 (Output_data_got::add_global_pair_with_rela): New function.
16622 (Output_data_got::add_local): Added got_type parameter.
16623 (Output_data_got::add_local_with_rel): Likewise.
16624 (Output_data_got::add_local_with_rela): Likewise.
16625 (Output_data_got::add_local_pair_with_rel): New function.
16626 (Output_data_got::add_local_pair_with_rela): New function.
16627 (Output_data_got::add_global_tls): Removed.
16628 (Output_data_got::add_global_tls_with_rel): Removed.
16629 (Output_data_got::add_global_tls_with_rela): Removed.
16630 (Output_data_got::add_local_tls): Removed.
16631 (Output_data_got::add_local_tls_with_rel): Removed.
16632 (Output_data_got::add_local_tls_with_rela): Removed.
16633 * resolve.cc (Symbol::override_base_with_special): Removed
16634 reference to has_got_offset_ field.
16635 * symtab.cc (Symbol::init_fields): Replaced initialization
16636 of got_offset_ with got_offsets_. Removed initialization
16637 of has_got_offset_
53fcba31 16638 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16639 (Symbol::got_offset): Likewise.
16640 (Symbol::set_got_offset): Likewise.
16641 (Symbol::has_tls_got_offset): Removed.
16642 (Symbol::tls_got_offset): Removed.
16643 (Symbol::set_tls_got_offset): Removed.
16644 (Symbol::got_offset_): Removed.
16645 (Symbol::tls_mod_got_offset_): Removed.
16646 (Symbol::tls_pair_got_offset_): Removed.
16647 (Symbol::got_offsets_): New field.
16648 (Symbol::has_got_offset): Removed.
16649 (Symbol::has_tls_mod_got_offset): Removed.
16650 (Symbol::has_tls_pair_got_offset): Removed.
16651 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16652 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16653 member functions.
16654 (Target_x86_64::Scan::global): Likewise.
16655 (Target_x86_64::Relocate::relocate): Likewise.
16656 (Target_x86_64::Relocate::relocate_tls): Likewise.
16657
bd52eafb
BE
166582008-03-25 Ben Elliston <bje@au.ibm.com>
16659
16660 * yyscript.y: Fix spelling error in comment.
16661
8b105e34
ILT
166622008-03-24 Ian Lance Taylor <iant@google.com>
16663
8ed814a9
ILT
16664 * options.h (class General_options): Define build_id option.
16665 * layout.h (class Layout): Declare write_build_id, create_note,
16666 create_build_id. Add build_id_note_ member.
16667 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16668 "libiberty.h", "md5.h", "sha1.h".
16669 (Layout::Layout): Initialize eh_frame_data_,
16670 eh_frame_hdr_section_, and build_id_note_.
16671 (Layout::finalize): Call create_build_id.
16672 (Layout::create_note): New function, broken out of
16673 Layout::create_gold_note.
16674 (Layout::create_gold_note): Call create_note.
16675 (Layout::create_build_id): New function.
16676 (Layout::write_build_id): New function.
16677 (Close_task_runner::run): Call write_build_id.
16678
8b105e34
ILT
16679 * x86_64.cc: Correct license to GPLv3.
16680
086a1841
ILT
166812008-03-23 Ian Lance Taylor <iant@google.com>
16682
16683 * options.cc: Include "demangle.h".
16684 (parse_optional_string): New function.
16685 (parse_long_option): Handle takes_optional_argument.
16686 (parse_short_option): Update dash_z initializer. Handle
16687 takes_optional_argument.
16688 (General_options::General_options): Initialize do_demangle_.
16689 (General_options::finalize): Set do_demangle_. Handle demangling
16690 style.
16691 * options.h (parse_optional_string): Declare.
16692 (struct One_option): Add optional_arg field. Update constructor.
16693 Update call constructor calls. Add takes_optional_argument
16694 function.
16695 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16696 (DEFINE_optional_string): Define.
16697 (General_options::demangle): Change from DEFINE_bool to
16698 DEFINE_optional_string.
16699 (General_options::no_demangle): New function.
16700 (General_options::do_demangle): New function.
16701 (General_options::set_do_demangle): New function.
16702 (General_options::execstack_status_): Move definition to end of
16703 class definition.
16704 (General_options::static_): Likewise.
16705 (General_options::do_demangle_): New field.
16706 * object.cc (big_endian>::get_symbol_location_info): Call
16707 Options::do_demangle, not Options::demangle.
16708 * symtab.cc (demangle): Likewise.
16709
cbb93e63
ILT
167102008-03-22 Ian Lance Taylor <iant@google.com>
16711
16712 * gold.h: Include <cstddef> and <sys/types.h>
16713 * options.h: Include <cstring>.
16714
ec531623
ILT
167152008-03-21 Ian Lance Taylor <iant@google.com>
16716
16717 * Added source code to GNU binutils.
752937aa 16718\f
b90efa5b 16719Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16720
16721Copying and distribution of this file, with or without modification,
16722are permitted in any medium without royalty provided the copyright
16723notice and this notice are preserved.
16724
16725Local Variables:
16726mode: change-log
16727left-margin: 8
16728fill-column: 74
16729version-control: never
16730End:
This page took 1.130894 seconds and 4 git commands to generate.