testcase for PR symtab/17855
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e3ee8ed4
AM
12015-02-18 Alan Modra <amodra@gmail.com>
2
3 PR 17954
4 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
5 visibility.
6
3a935c6c
RÁE
72015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
8
9 * gc.h (Garbage_collection::add_reference): Don't use find.
10
e0a1e121
RÁE
112015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
12
13 * object.cc (write_local_symbols): avoid std::vector copy.
14
45a4fb1a
RÁE
152015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
16
17 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
18
2d9afefe
MW
192015-02-09 Mark Wielaard <mjw@redhat.com>
20
21 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
22 DW_LANG_Fortran03 and DW_LANG_Fortran08.
23
e9c1bdad
CC
242015-02-16 Cary Coutant <ccoutant@google.com>
25
26 PR gold/13577
27 PR gold/16992
28 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
29 DF_SYMBOLIC if --dynamic-list option is used.
30 * options.cc (General_options::finalize): --dynamic-list is not
31 mutually exclusive with -Bsymbolic.
32 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
33 listed in --dynamic-list.
34 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
35 -Bsymbolic-functions.
36 * testsuite/Makefile.in: Regenerate.
37
0ed4b0bf
CC
382015-02-16 Cary Coutant <ccoutant@google.com>
39
40 PR gold/17971
41 * incremental.cc: Remove redundant include of "output.h".
42
1a920511
JY
432015-02-12 Jing Yu <jingyu@google.com>
44
45 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
46 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
47 New relocation.
48 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
49 TLSLE_MOVW_* relocations.
50 (Target_aarch64::Scan::global): Likewise.
51 (Target_aarch64::Relocate::relocate): Likewise.
52 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
53 for new TLSLE_MOVW_* relocations.
54
07f107f3
WN
552015-02-11 Will Newton <will.newton@linaro.org>
56
57 PR gold/13321
58 * arm.cc (Target_arm::make_plt_section): Create an ARM
59 state mapping symbol at the start of the PLT.
60
e051a5b5
L
612015-02-09 H.J. Lu <hongjiu.lu@intel.com>
62
63 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
64 Replace two_file_shared_2.so with two_file_shared_1.so.
65 * testsuite/Makefile.in: Regenerated.
66
dddcc5b9
AM
672015-02-09 Alan Modra <amodra@gmail.com>
68
69 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
70 plugin_test_thin.a and defsym_test.
71 * testsuite/Makefile.in: Regenerate.
72
b39b8b9d
RÁE
732015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
74
75 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
76 body.
77
b66d1c52
CC
782015-02-04 Peter Collingbourne <pcc@google.com>
79
80 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
81 forwarding symbols when computing symbol resolution info for plugins.
82 * plugin.h (Plugin_manager::symtab): New method.
83 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
84
23081de0
CC
852015-02-03 Cary Coutant <ccoutant@google.com>
86 Peter Collingbourne <pcc@google.com>
87
88 PR gold/15660
89 * archive.cc (Thin_archive_object_unlocker): New class.
90 (Archive::include_member): Unlock external members of thin archives.
91 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
92 (plugin_test_2): Likewise.
93 (plugin_test_3): Likewise.
94 (plugin_test_4): Likewise.
95 (plugin_test_5): Likewise.
96 (plugin_test_6): Likewise.
97 (plugin_test_7): Likewise.
98 (plugin_test_8): Likewise.
99 (plugin_test_9): Likewise.
100 (plugin_test_10): Likewise.
101 (plugin_test_11): New test case.
102 * testsuite/Makefile.in: Regenerate.
103 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
104 file to decide whether to claim file.
105 (all_symbols_read_hook): Likewise.
106 * testsuite/plugin_test_1.sh: Adjust expected output.
107 * testsuite/plugin_test_2.sh: Likewise.
108 * testsuite/plugin_test_3.sh: Likewise.
109 * testsuite/plugin_test_6.sh: Likewise.
110 * testsuite/plugin_test_tls.sh: Likewise.
111 * testsuite/plugin_test_11.sh: New testcase.
112
1132015-02-03 Cary Coutant <ccoutant@google.com>
114
115 * descriptors.cc (Descriptors::open): Set artificially-low limit for
116 file descriptors when debugging enabled. Add debug output.
117 (Descriptors::release): Add debug output.
118 (Descriptors::close_some_descriptor): Likewise.
119 (Descriptors::close_all): Likewise.
120 * fileread.cc (File_read::lock): Likewise.
121 (File_read::unlock): Likewise.
122
24dd5808
CC
1232015-02-02 Cary Coutant <ccoutant@google.com>
124
125 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
126 executable output file.
127
fa89cc82
HS
1282015-01-22 Han Shen <shenhan@google.com>
129
130 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
131 (Target_arm::do_plt_address_for_global): New method.
132 (Target_arm::do_plt_address_for_local): New method.
133 (Target_arm::rel_irelative_section): New method.
134 (Target_arm::make_data_plt): Add more parameters for plt ctor.
135 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
136 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
137 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
138 (Target_arm::Scan::check_non_pic): Add ifunc support.
139 (Target_arm::Scan::local): Add ifunc support.
140 (Target_arm::Scan::global): Add ifunc support.
141 (Target_arm::make_plt_section): New method.
142 (Target_arm::make_plt_entry): Change to call to make_plt_section.
143 (Target_arm::make_local_ifunc_plt_entry): New method.
144 (Target_arm::got_irelative_): New member.
145 (Target_arm::rel_irelative_): New member.
146 (Target_arm::got_section): Add creation for got_irelative_.
147 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
148 (Target_arm::Relocate::relocate): Properly set local ifunc address.
149 (Target_arm::do_dynsym_value): Properly set global ifunc address.
150 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
151 (Output_data_plt_arm::IRelative_data): New type.
152 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
153 (Output_data_plt_arm::add_entry): Add more parameters.
154 (Output_data_plt_arm::add_relocation): New method.
155 (Output_data_plt_arm::add_local_ifunc_entry): New method.
156 (Output_data_plt_arm::rel_irelative): New method.
157 (Output_data_plt_arm::entry_count): Modified.
158 (Output_data_plt_arm::address_for_global): New method.
159 (Output_data_plt_arm::address_for_local): New method.
23081de0 160gold/
fa89cc82
HS
161 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
162 (Output_data_plt_arm::insert_irelative_data): New method.
163 (Output_data_plt_arm::irelative_rel_): New member.
164 (Output_data_plt_arm::got_): New member.
165 (Output_data_plt_arm::got_irelative_): New member.
166 (Output_data_plt_arm::irelative_count_): New member.
167 (Output_data_plt_arm::IRelative_data_vec): New typedef.
168 (Output_data_plt_arm::irelative_data_vec_): New member.
169 (Output_data_plt_arm::do_write): Write out irelative entries.
170 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
171 more parameters to ctor.
172 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
173 more parameters to ctor.
174 * output.h (Output_data_reloc::add_local_relative): New method.
175 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
176
0f81d3f0
AM
1772015-01-29 Alan Modra <amodra@gmail.com>
178
179 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
180 and GOT_TLSGD to LE optimization.
181
65d92137
CC
1822015-01-28 Cary Coutant <ccoutant@google.com>
183
184 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
185 for undef TLS symbols.
186 (Target_x86_64::Relocate::relocate_tls): Likewise.
187 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
188
5485698a
CC
1892015-01-25 Cary Coutant <ccoutant@google.com>
190
191 * output.cc (Output_segment::set_section_addresses): Fix calculation
192 of size of relro segment.
193
b01a4b04
AM
1942015-01-22 Alan Modra <amodra@gmail.com>
195
196 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
197 condition for need of ifunc plt entry.
198 (Target_powerpc::Scan::global <got relocs>): Likewise.
199
3d0064a9
CC
2002015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
201
202 * mips.cc (reloc_high): Add r_sym.
203 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
204 reloc_high constructor.
205 (Mips_relocate_functions::relgot16_local): Likewise.
206 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
207 r_type to decide whether LO16 matches HI16.
208 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
209 rello16 and relgot16_local.
210
a5cd8f05
CC
2112015-01-09 Cary Coutant <ccoutant@google.com>
212
213 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
214 unless alignment is larger than page size.
215
4fc1b9d4
L
2162015-01-06 H.J. Lu <hongjiu.lu@intel.com>
217 Cary Coutant <ccoutant@google.com>
218
219 PR gold/17729
220 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
221 (DEFAULT_TARGET_X32): Set for x32.
222 * x86_64.cc (cmp_insn_32): New.
223 (lea_r10_insn_32): Likewise.
224 (lea_r11_insn_32): Likewise.
225 (cmp_insn_64): Likewise.
226 (lea_r10_insn_64): Likewise.
227 (lea_r11_insn_64): Likewise.
228 (Target_x86_64<size>::do_calls_non_split): Handle x32.
229 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
230 (check_DATA): Add split_x32 files.
231 (split_x32_[1234n].o): New targets.
232 (split_x32_[124]): New targets.
233 (split_x32_[1234r].stdout): New targets.
234 * testsuite/split_x32.sh: New file.
235 * testsuite/split_x32_1.s: Likewise.
236 * testsuite/split_x32_2.s: Likewise.
237 * testsuite/split_x32_3.s: Likewise.
238 * testsuite/split_x32_4.s: Likewise.
239 * testsuite/split_x32_n.s: Likewise.
240 * configure: Regenerated.
241 * testsuite/Makefile.in: Likewise.
242
e749cab8
L
2432015-01-06 H.J. Lu <hongjiu.lu@intel.com>
244
245 PR gold/17809
246 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
247 x32.
248
af759df0
AM
2492015-01-02 Alan Modra <amodra@gmail.com>
250
251 * version.cc (print_version): Just print current year.
252 * dwp.cc (print_version): Likewise.
253
b90efa5b
AM
2542015-01-01 Alan Modra <amodra@gmail.com>
255
256 Update year range in copyright notice of all files.
257
f12d1e8a
AM
2582014-12-25 Alan Modra <amodra@gmail.com>
259
260 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
261 new enums.
262 (Target_arm::merge_object_attributes, ): Likewise.
263
5c294fee
TG
2642014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
265
266 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
267 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
268 AEABI_VFP_args_vfp to check that.
269 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
270 value and replace hardcoded values by enum values.
271
e30880c2
CC
2722014-12-22 Cary Coutant <ccoutant@google.com>
273
274 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
275
bd040da1
L
2762014-12-20 H.J. Lu <hongjiu.lu@intel.com>
277
278 PR gold/14608
279 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
280 to "return i * i * 3;".
281
e02a4046
CC
2822014-12-16 Cary Coutant <ccoutant@google.com>
283
284 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
285 (Mapfile::print_output_data): Use current_data_size() to avoid
286 assert for sections requiring postprocessing; if address is not valid,
287 print 0.
288 (Mapfile::print_output_section): Use current_data_size(); print note
289 that addresses and sizes are before compression.
290
add6016b
L
2912014-12-14 H.J. Lu <hongjiu.lu@intel.com>
292
293 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
294 Cast current_group_size to unsigned long when reporting error.
295
0bf32ea9
JY
2962014-12-10 Jing Yu <jingyu@google.com>
297
298 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
299 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
300 Update error message.
301 (Target_aarch64::do_relax): Use absolute value of option
302 stub_group_size. Replace local variable with class member
303 stub_group_size_.
304
cbcb23fa
AM
3052014-12-04 Alan Modra <amodra@gmail.com>
306
307 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
308 addend of PLTREL24 reloc when not generating a plt stub. Make
309 max_branch_offset an "Address".
fbad6518 310 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
311 (Target_powerpc::Relocate::relocate): Likewise.
312
1611bc4a
AM
3132014-12-04 Alan Modra <amodra@gmail.com>
314
315 PR 17670
316 * symtab.cc (Symbol::set_undefined): Remove assertion.
317 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
318 on symbols defined in discarded sections, instead return false.
319 Rearrange params, update all callers.
320 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
321 branches to syms in discarded sections.
322 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
323 undefined and flag as discarded.
324 (Target_powerpc::Relocate::relocate): Localize variable.
325
4759c34e
L
3262014-12-03 H.J. Lu <hongjiu.lu@intel.com>
327
328 PR gold/17675
329 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
330 * testsuite/Makefile.in: Regenerated.
331
1f98a074
AM
3322014-12-03 Alan Modra <amodra@gmail.com>
333
334 PR 17566
335 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
336 when adding dynamic relocations against section symbols.
337
fb257835
DI
3382014-12-01 Dimitry Ivanov <dimitry@google.com>
339
340 * layout.cc (Layout::finish_dynamic_section): When '-z global'
341 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
342 * options.h (General_options): New -z option (global).
343
d8e60314
CC
3442014-12-01 Cary Coutant <ccoutant@google.com>
345
346 PR gold/17578
347 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
348 is given.
349 (Layout::create_executable_stack_info): Warn when -z noexecstack is
350 given but some inputs require executable stack.
351
982bbd97
CC
3522014-11-26 Cary Coutant <ccoutant@google.com>
353
354 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
355 .debug_str_offsets; strip .debug_gnu_pubnames and
356 .debug_gnu_pubtypes.
357 (lines_only_debug_sections): Strip all four new sections.
358
bb779192
HS
3592014-11-26 Jing Yu <jingyu@google.com>
360
361 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
362 register to be x0 when to relax TLSDESC_LD64_LO12.
363
a3e60ddb
AM
3642014-11-26 Alan Modra <amodra@gmail.com>
365
366 * powerpc.cc (struct Stub_table_owner): New.
367 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
368 unsigned int vector. Update all references.
369 (powerpc_relobj::set_stub_table): Take an unsigned int param
370 rather than a Stub_table. Update callers.
371 (Powerpc_relobj::clear_stub_table): New function.
372 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
373 stub_group_size_ vars.
374 (Target_powerpc::new_stub_table): Delete.
375 (max_branch_delta): New function, extracted from..
376 (Target_powerpc::Relocate::relocate): ..here..
377 (Target_powerpc::Branch_info::make_stub): ..and here. Return
378 status on whether stub created successfully.
379 (Stub_control::Stub_control): Add "no_size_errors" param. Move
380 default sizing to..
381 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
382 reduce on relax failure.
383 (Target_powerpc::group_sections): Add "no_size_errors" param.
384 Use stub_group_size_. Set up group info in a temp vector,
385 before building Stub_table vector. Account for input sections
386 possibly already converted to relaxed sections.
387 (Stub_table::init): Delete. Merge into..
388 (Stub_table::Stub_table): ..here.
389 (Stub_table::can_reach_stub): New function.
390 (Stub_table::add_plt_call_entry): Add "from" parameter and
391 return true iff stub could be reached.
392 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
393 param too.
394 (Stub_table::clear_stubs): Add "all" param.
395
a20605cf
AM
3962014-11-26 Alan Modra <amodra@gmail.com>
397
398 * powerpc.cc (Stub_control::set_output_and_owner): New function.
399 (Target_powerpc::group_sections): Use it.
400
43b64deb
CC
4012014-11-25 Cary Coutant <ccoutant@google.com>
402
403 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
404 (Binary_to_elf::write_symbol): Add st_size parameter.
405 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
406
c924eb67
CC
4072014-11-25 Cary Coutant <ccoutant@google.com>
408
409 PR gold/17639
410 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
411 (Sized_relobj_file::do_layout): Handle deferred sections properly
412 during GC pass 1. Don't add reloc sections to deferred list twice.
413 * object.h (Sized_relobj_file::is_deferred_layout): New function.
414 (Sized_relobj_file::is_deferred_layout_): New data member.
415
9d585188
L
4162014-11-21 H.J. Lu <hongjiu.lu@intel.com>
417
418 PR gold/17619
419 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
420 Check PC-relative offset overflow in PLT entry.
421
3ffaac20
AM
4222014-11-21 Alan Modra <amodra@gmail.com>
423
424 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
425 for undefined weaks.
426
0cfb0717
AM
4272014-11-20 Alan Modra <amodra@gmail.com>
428
429 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
430 from --stub-group-size parameter divided by 1024.
431 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
432 template parameter. Update all uses.
433 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
434 has_stub_value. Set for long branches. Don't report overflow for
435 branch to undefined weak symbols. Print info message on
436 overflowing branch to stub.
437
f9dffbf0
AM
4382014-11-20 Alan Modra <amodra@gmail.com>
439
440 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
441
e88ba8d5
L
4422014-11-13 H.J. Lu <hongjiu.lu@intel.com>
443
444 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
445 entry for R_X86_64_GOTPLT64.
446 (Target_x86_64<size>::Relocate::relocate): Update comments for
447 R_X86_64_GOTPLT64.
448
d37ffe25
ED
4492014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
450
451 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
452 * plugin.h: add lock definition
453
9726c3c1
HS
4542014-10-29 Han Shen <shenhan@google.com>
455 Jing Yu <jingyu@google.com>
456
457 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
458 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
459 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
460 Symbol::TLS_REF.
461 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
462 method.
463 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
464 (Target_aarch64::tls_ld_to_le): New method.
465 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
466 for 64bit targets.
467 (Output_data_plt_aarch64::irelative_rel_): New data member.
468 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
469 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
470 (Output_data_plt_aarch64::add_relocation): New method.
471 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
472 offset. Add got_irelative size to got size.
473 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
474 type string with the new typename.
475 (AArch64_relocate_functions::update_adr): Replace parameter x with
476 immed.
477 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
478 (AArch64_relocate_functions::reloc_common): New method.
479 (AArch64_relocate_funcsions::rela_general): Extract common part out
480 into reloc_common method.
481 (AArch64_relocate_functions::rela_general): Likewise.
482 (AArch64_relocate_functions::pcrela_general): Likewise.
483 (AArch64_relocate_functions::adr): New method.
484 (AArch64_relocate_functions::adrp): Calculate immed before calling
485 update_adr.
486 (AArch64_relocate_functions::adrp): Likewise.
487 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
488 comparing x to 0. Calculate immed from ~x when x < 0.
489 (Target_aarch64::optimize_tls_reloc): Add new cases for
490 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
491 TLSLD_MOVW_DTPREL_G0_NC.
492 (Target_aarch64::possible_function_pointer_reloc): Implement this
493 method.
494 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
495 comment.
496 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
497 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
498 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
499 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
500 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
501 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
502 (Target_aarch64::make_plt_entry): Call add_entry with two more
503 parameters.
504 (Target_aarch64::make_local_ifunc_plt_entry): New method.
505 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
506 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
507 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
508 (Target_aarch64::Relocate::relocate_tls): Add cases for
509 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
510 TLSLD_MOVW_DTPREL_G0_NC.
511 * testsuite/icf_safe_so_test.cc: Correct test comment.
512 * testsuite/icf_safe_test.sh: Add AArch64 arch.
513
80272b8c
AM
5142014-10-22 Alan Modra <amodra@gmail.com>
515
516 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
517 thread_starter.
518
998a69f4
AS
5192014-10-18 Andreas Schwab <schwab@linux-m68k.org>
520
521 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
522
aed56ec5
CC
5232014-10-17 Cary Coutant <ccoutant@google.com>
524
525 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
526 Add "typename" keyword.
527
bb779192 5282014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
529 Jing Yu <jingyu@google.com>
530
531 Patch for gold aarch64 backend to support relaxation.
532 * aarch64-reloc.def: Change format.
533 * aarch64.cc (class Reloc_stub): New class.
534 (class Stub_table): New class.
535 (class AArch64_relobj): New class.
536 (class AArch64_input_section): New class.
537 (class AArch64_output_section): New class.
538 (Target_aarch64::new_stub_table): New method.
539 (Target_aarch64::new_aarch64_input_section): New method.
540 (Target_aarch64::find_aarch64_input_section): New method.
541 (Target_aarch64::scan_section_for_stubs): New method.
542 (Target_aarch64::scan_reloc_section_for_stubs): New method.
543 (Target_aarch64::relocate_stub): New method.
544 (Target_aarch64::current_target): New method.
545 (Target_aarch64::do_make_elf_object): New method.
546 (Target_aarch64::do_may_relax): New method.
547 (Target_aarch64::do_relax): New method.
548 (Target_aarch64::group_sections): New method.
549 (Target_aarch64::scan_reloc_for_stub): New method.
550 (Target_aarch64::do_make_output_section): New method.
551 (Target_aarch64::stub_tables_): New data member.
552 (Target_aarch64::aarch64_input_section_map_): New data member.
553 (AArch64_relocate_functions::maybe_apply_stub): New method.
554
db4c9594
CC
5552014-09-30 Cary Coutant <ccoutant@google.com>
556
557 PR gold/17432
558 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
559
cd6da036
KC
5602014-09-30 Kito Cheng <kito@0xlab.org>
561
562 PR gold/13597
563 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
564 hash table before sysv-style hash table.
565
5f772412
ST
5662014-09-29 Sriraman Tallam <tmsriram@google.com>
567
568 * options.h (--pic-executable): Add negative to alias to -no-pie.
569
5efeedf6
CC
5702014-09-26 Cary Coutant <ccoutant@google.com>
571
572 PR gold/16773
573 * object.cc (Sized_relobj_file): Compute value of section symbols
574 for TLS sections the same as TLS symbols.
575
1707f183
CC
5762014-09-25 Cary Coutant <ccoutant@google.com>
577
578 PR gold/17432
579 * resolve.cc (Symbol_table::resolve): Override common placeholder
580 symbols, but adjust sizes.
581 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
582 symbols to common lists.
583
00cac886
AM
5842014-09-24 Alan Modra <amodra@gmail.com>
585
586 * po/POTFILES.in: Regenerate.
587
635aa30e
CC
5882014-09-23 Taiju Tsuiki <tzik@google.com>
589 Cary Coutant <ccoutant@google.com>
590
71b9b91b 591 PR gold/14860
635aa30e
CC
592 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
593 on input_sections_blocker.
594 * layout.cc (Write_sections_task::locks): Unblock
595 input_sections_blocker_.
596 * layout.h (Write_sections_task::Write_sections_task): Add
597 input_sections_blocker.
598 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
599 to DEPENDENCIES.
600 * testsuite/Makefile.in: Regenerate.
601
c0c71592
RÁE
6022014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
603
604 * testsuite/Makefile.am (plugin_test_10): New test.
605 * testsuite/Makefile.in: Regenerate
606 * testsuite/plugin_common_test_2.c (c1): Align to 8.
607 * testsuite/plugin_test_10.sh: New file.
608
6168c2a1
RÁE
6092014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
610
611 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
612 * resolve.cc (Symbol_table::resolve): Don't override common symbols
613 during the replacement phase.
614
3a531937
JY
6152014-09-17 Han Shen <shenhan@google.com>
616 Jing Yu <jingyu@google.com>
617
618 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
619 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
620 * aarch64.cc (Target_aarch64): Add data members
621 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
622 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
623 constructor.
624 (Target_aarch64::do_reloc_symbol_index): New method.
625 (Target_aarch64::do_reloc_addend): New method.
626 (Target_aarch64::add_tlsdesc_info): New method.
627 (Target_aarch64::do_dynsym_value): New method.
628 (Target_aarch64::do_make_data_plt): Add new parameters: got,
629 got_irelative. Pass them to Output_data_plt_aarch64_standard.
630 (Target_aarch64::make_data_plt): Add new parameters: got,
631 got_irelative. Pass them to do_make_data_plt.
632 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
633 (Target_aarch64::Relocate:tls_gd_to_le): New method.
634 (Target_aarch64::Relocate:tls_ie_to_le): New method.
635 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
636 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
637 (Target_aarch64::got_tlsdesc_section): New method.
638 (Target_aarch64::make_local_ifunc_plt_entry): New method.
639 (Target_aarch64::define_tls_base_symbol): New method.
640 (Target_aarch64::reserve_tlsdesc_entries): New method.
641 (Target_aarch64::got_mod_index_entry): New method.
642 (Target_aarch64::rela_tlsdesc_section): New method.
643 (Target_aarch64::rela_irelative_section): New method.
644 (Target_aarch64::Tlsdesc_info): New struct.
645 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
646 relocations and tlsdesc relocations.
647 (Target_aarch64::optimize_tls_reloc): Implement method.
648 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
649 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
650 in constructor.
651 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
652 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
653 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
654 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
655 (Output_data_plt_aarch64::rela_tlsdesc): New method.
656 (Output_data_plt_aarch64::rela_irelative): New method.
657 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
658 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
659 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
660 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
661 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
662 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
663 (Output_data_plt_aarch64_standard): New member variables:
664 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
665 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
666 New parameter: got, got_irelative.
667 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
668 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
669 (Output_data_plt_aarch64::do_write): Replace got_address with
670 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
671 (AArch64_relocate_functions::update_movnz): New method.
672 (AArch64_relocate_functions): Correct format.
673 (AArch64_relocate_functions::movnz): New method.
674 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
675 before the switch. Add new cases to switch.
00cac886 676 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
677 tlsgd tlsdesc cases.
678 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
679 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
680 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
681 Call reloc_name_in_error_message to print unsupported reloc.
682 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
683 make_data_plt.
684 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
685 relocs. Fill in some more dynamic tags.
686 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
687 Skip call tls_get_addr when tlsgd is relaxed.
688 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
689 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
690 tlsdesc->ie relaxation.
691
62661c93
SS
6922014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
693
694 * mips.cc (Target_mips_nacl): New class.
695 (Target_selector_mips_nacl): New class.
696 (target_selector_mips32): Rename from target_selector_mips32be and use
697 Target_selector_mips_nacl instead of Target_selector_mips.
698 (target_selector_mips32el): Rename from target_selector_mips32 and use
699 Target_selector_mips_nacl instead of Target_selector_mips.
700 (target_selector_mips64): Rename from target_selector_mips64be and use
701 Target_selector_mips_nacl instead of Target_selector_mips.
702 (target_selector_mips64el): Rename from target_selector_mips64 and use
703 Target_selector_mips_nacl instead of Target_selector_mips.
704 (Target_mips::mips_info): Add const attribute.
705
54674d38
CC
7062014-09-02 Cary Coutant <ccoutant@google.com>
707
708 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
709 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
710 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
711 (Sized_incr_dynobj::do_section_name): Likewise.
712 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
713 (Sized_incr_dynobj::do_section_name): Likewise.
714 * object.h (Object::section_name): Likewise.
715 (Object::do_section_name): Likewise.
716 (Sized_relobj_file::do_section_name): Likewise.
717 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
718 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
719
9860cbcf
CC
7202014-09-02 Cary Coutant <ccoutant@google.com>
721
722 PR gold/17005
723 * ehframe.cc (Fde::write): Add output_offset parameter.
724 (Cie::write): Likewise.
725 (Eh_frame::set_final_data_size): Account for offset within output
726 section.
727 (Eh_frame::do_sized_write): Likewise.
728 * ehframe.h (Fde::write): Add output_offset parameter.
729 (Cie::write): Likewise.
730 * output.cc (Output_section::Input_section_sort_entry): Remove
731 section_has_name_; add output_section_name parameter. Use
732 output section name for non-input sections.
733 (Output_section::Input_section_sort_entry::section_has_name): Remove.
734 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
735 (Output_section::Input_section_sort_compare): Remove logic for
736 sections without names.
737 (Output_section::Input_section_sort_init_fini_compare): Likewise.
738 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
739 Likewise.
740 (Output_section::Input_section_sort_section_name_compare): Likewise.
741
8e33481e
HS
7422014-08-29 Han Shen <shenhan@google.com>
743 Jing Yu <jingyu@google.com>
744
745 * aarch64-reloc-property.cc
746 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
747 reference reloc property in the table.
748 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
749 3 other entries.
750 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
751 2 new overloaded methods.
752 (Output_data_got_aarch64::do_write): Add code to write out
753 static relocs.
754 (class Output_data_got_aarch64::Static_reloc): New class to wrap
755 static relocs.
756 (Output_data_got_aarch64::static_relocs): New vector to
757 hold static relocs.
758 (Target_aarch64::TCB_SIZE): New const static memeber.
759 (Target_aarch64::tcb_size): New method.
760 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
761 (Target_aarch64::Relocate::relocate_tls): New method.
762 (Target_aarch64::Scan::local): Add code handling new reloc types.
763 (Target_aarch64::Scan::global): Add code handling new reloc types.
764
81233653
ST
7652014-08-13 Sriraman Tallam <tmsriram@google.com>
766
767 * options.h (-no-pie): Add option.
768
9363c7c3
JY
7692014-08-08 Jing Yu <jingyu@google.com>
770 Han Shen <shenhan@google.com>
771
772 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
773 (DEFFILES): add aarch64-reloc.def.
774 (TARGETSOURCES): Add aarch64-reloc-property.cc.
775 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
776 * Makefile.in: Regenerate.
777 * aarch64-reloc-property.cc: New file.
778 * aarch64-reloc-property.h: New file.
779 * aarch64-reloc.def: New file.
780 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
781 with tab to make the format consistent.
782 (Output_data_got_aarch64::symbol_table_): New method.
783 (Target_aarch64::do_plt_address_for_global): New method.
784 (Target_aarch64::do_plt_address_for_local): New method.
785 (Target_aarch64::do_select_as_default_target): New method.
786 (Target_aarch64::do_make_data_plt): New method.
787 (Target_aarch64::make_data_plt): New method.
788 (Output_data_plt_aarch64::has_irelative_section): New method.
789 (Output_data_plt_aarch64::address_for_global): New method.
790 (Output_data_plt_aarch64::address_for_local): New method.
791 (Output_data_plt_aarch64::irelative_rel_): New parameter.
792 (Output_data_plt_aarch64::add_entry): Implement contents.
793 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
794 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
795 the got_pov entry to plt0.
796 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
797 Implement contents.
798 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
799 (AArch64_howto): New struct.
800 (aarch64_howto[]): New static const array.
801 (AArch64_relocate_functions): New class.
802 (Target_aarch64::Scan::get_reference_flags): Remove method.
803 (Target_aarch64::Scan::local): Implement to support a few relocations.
804 (Target_aarch64::Scan::global): Implement to support a few relocations.
805 (Target_aarch64::make_plt_section): Implement contents.
806 (Target_aarch64::make_plt_entry): Implement contents.
807 (Target_aarch64::do_finalize_sections): Implement contents.
808 (Target_aarch64::Relocate::relocate): Implement a few relocations.
809 (Target_aarch64::relocate_section): Implement contents.
810
ad9fe6c1
AM
8112014-08-06 Alan Modra <amodra@gmail.com>
812
813 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
814
7cd4e5b7
AM
8152014-08-06 Alan Modra <amodra@gmail.com>
816
817 PR 13227
818 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
819
5ad9b0a7
ST
8202014-07-21 Sriraman Tallam <tmsriram@google.com>
821
822 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 823 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 824
e051745c
CC
8252014-07-08 Cary Coutant <ccoutant@google.com>
826
827 * expression.cc (struct Expression::Expression_eval_info): Add
828 new fields type_pointer, vis_pointer, and nonvis_pointer.
829 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
830 nonvis_pointer parameters. Adjust all calls.
831 (Symbol_expression::value): Update type, visibility, and nonvis bits
832 in caller.
833 * script.cc (Symbol_assignment::sized_finalize): Update type,
834 visibility, and remaining st_other bits for new symbol.
835 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
836 vis_pointer, and nonvis_pointer parameters.
837 * symtab.h (Symbol::set_type): New method.
838
839 * testsuite/Makefile.am (defsym_test): New test.
840 * testsuite/Makefile.in: Regenerate.
841 * testsuite/defsym_test.c: New file.
842 * testsuite/defsym_test.sh: New file.
843
f35c4853
CC
8442014-07-08 Cary Coutant <ccoutant@google.com>
845
846 PR gold/15639
847 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
848 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
849 (Sized_dynobj::base_read_symbols): ...new method.
850 * object.h (Sized_relobj_file::base_read_symbols): New method.
851 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
852 (Sized_relobj_file::base_read_symbols): ...new method.
853 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
854 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
855 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
856
2900af2d
AM
8572014-07-04 Alan Modra <amodra@gmail.com>
858
859 * po/POTFILES.in: Regenerate.
860
053a4d68
JY
8612014-07-02 Jing Yu <jingyu@google.com>
862
863 * aarch64.cc: New file
864 * Makefile.am (TARGETSOURCES): Add aarch64.cc
865 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
866 * Makefile.in: Regenerate.
867 * configure.tgt: Add entries for aarch64*.
868 * configure.ac: Likewise.
869 * configure: Likewise.
870
7b549045
AM
8712014-06-27 Alan Modra <amodra@gmail.com>
872
873 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
874
cb818dbf
CC
8752014-06-24 Cary Coutant <ccoutant@google.com>
876
877 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
878 sections.
879 (Dwo_file::sized_read_unit_index): Likewise.
880
9810d34d
SS
8812014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
882
883 * mips.cc: New file.
884 * Makefile.am (TARGETSOURCES): Add mips.cc
885 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
886 * configure.tgt: Add entries for mips*.
887 * configure.ac: Likewise.
888 * Makefile.in: Regenerate.
889 * configure: Likewise.
890
9baa787b
CC
8912014-06-09 Cary Coutant <ccoutant@google.com>
892
893 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
894 unit_length is within section bounds.
895
8f89af0a
CC
8962014-06-09 Cary Coutant <ccoutant@google.com>
897
898 PR gold/16980
899 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
900 map.
901
a47622ac
AM
9022014-06-07 Alan Modra <amodra@gmail.com>
903
904 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
905
4320c691
CC
9062014-06-06 Cary Coutant <ccoutant@google.com>
907
908 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
909 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
910 (Dwarf_pubnames_table::read_header): Likewise.
911 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
912 .debug_gnu_pubtypes.
913
270c9937
JB
9142014-06-05 Joel Brobecker <brobecker@adacore.com>
915
916 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
917 * Makefile.in, configure: Regenerate.
918
397998fc
AM
9192014-06-03 Alan Modra <amodra@gmail.com>
920
921 * powerpc.cc (addis_12_2): Define.
922 (Stub_table::do_write): Support fusion on ELFv2 stubs.
923
61f5c66f
AM
9242014-06-03 Alan Modra <amodra@gmail.com>
925
926 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
927 st_other output.
928
f6971787
AM
9292014-06-02 Alan Modra <amodra@gmail.com>
930
931 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
932 Only ignore relocs on ELFv1.
933 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
934
f6fb8322
CC
9352014-05-30 Cary Coutant <ccoutant@google.com>
936
937 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
938 * testsuite/Makefile.in: Regenerate.
939 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
940
c23dd342
L
9412014-05-27 H.J. Lu <hongjiu.lu@intel.com>
942
943 PR gold/16945
944 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
945 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
946
5fe7ffdc
AM
9472014-05-15 Alan Modra <amodra@gmail.com>
948
949 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
950 Compare FDE contents with DW_CFA_nop rather than 0.
951
a82bef93
ST
9522014-05-13 Sriraman Tallam <tmsriram@google.com>
953
954 * symtab.h (may_need_copy_reloc): Remove check for position independent
955 code.
956 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
957 position independence before pc absolute may_need_copy_reloc call.
958 Add check for executable output befor pc relative may_need_copy_reloc
959 call.
960 * i386.cc: Ditto.
961 * arm.cc: Ditto.
962 * sparc.cc: Ditto.
963 * tilegx.cc: Ditto.
964 * powerpc.cc: Add check for no position independence before
965 may_need_copy_reloc calls.
966 * testsuite/pie_copyrelocs_test.cc: New file.
967 * testsuite/pie_copyrelocs_shared_test.cc: New file.
968 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 969 * Makefile.in: Regenerate.
a82bef93 970
53c66605
ML
9712014-05-08 Martin Liška <mliska@suse.cz>
972
973 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
974
57b2284c
CC
9752014-05-06 Cary Coutant <ccoutant@google.com>
976
977 PR gold/16900
978 * i386.cc (Output_data_got_plt_i386): New class.
979 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
980 parameter. Change all callers.
981 (Output_data_plt_i386::layout_): Remove.
982 (Output_data_plt_i386::got_plt_): Change type.
983 (Target_i386::got_plt_): Change type. Change all references.
984 (Target_i386::got_section): Create instance of new class.
985 (Output_data_got_plt_i386::do_write): New function.
986 * x86_64.cc (Output_data_got_plt_x86_64): New class.
987 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
988 parameter. Change all callers.
989 (Output_data_plt_x86_64::layout_): Remove.
990 (Output_data_plt_x86_64::got_plt_): Change type.
991 (Target_x86_64::got_plt_): Change type. Change all references.
992 (Target_x86_64::got_section): Create instance of new class.
993 (Output_data_got_plt_x86_64::do_write): New function.
994 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
995 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
996 class.
997
6b97515d 9982014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 999
6b97515d
CC
1000 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1001 if we have pubnames/pubtypes.
1002
d1bddd3c
CC
10032014-05-02 Cary Coutant <ccoutant@google.com>
1004
5fe7ffdc
AM
1005 * defstd.cc (in_segment): Define __ehdr_start here...
1006 * layout.cc (Layout::finalize): ...Instead of here. Set the
1007 output segment when known.
1008 * resolve.cc (Symbol::override_base_with_special): Remember
1009 the original binding.
1010 * symtab.cc (Symbol::set_output_segment): New function.
1011 (Symbol::set_undefined): New function.
1012 * symtab.h (Symbol::is_weak_undefined): Check original undef
1013 binding.
1014 (Symbol::is_strong_undefined): New function.
1015 (Symbol::set_output_segment): New function.
1016 (Symbol::set_undefined): New function.
1017 * target-reloc.h (is_strong_undefined): Remove.
1018 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1019 Check for hidden undefs.
1020 (relocate_section): Call Symbol::is_strong_undefined.
1021
1022 * testsuite/Makefile.am (ehdr_start_test_1)
1023 (ehdr_start_test_2, ehdr_start_test_3)
1024 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1025 * testsuite/Makefile.in: Regenerate.
1026 * testsuite/ehdr_start_def.cc: New source file.
1027 * testsuite/ehdr_start_test.cc: New source file.
1028 * testsuite/ehdr_start_test.t: New linker script.
1029 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1030
7849f6d8
CC
10312014-04-23 Cary Coutant <ccoutant@google.com>
1032
bf2cc635 1033 PR gold/16870
7849f6d8
CC
1034 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1035
99fd8cff
CC
10362014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1037
1038 * layout.cc (Layout::include_section): Allow a target to decide
1039 whether to include a section.
1040 * target.h (Target::should_include_section): New function.
1041 (Target::do_should_include_section): New function.
1042
91f43acd
CC
10432014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1044
1045 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1046 inline into ...
1047 (Copy_relocs::emit): ... here.
1048 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1049 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1050 (Copy_reloc_entry::entries_): Change from private to protected.
1051
c4eb27e1
ST
10522014-04-02 Sriraman Tallam <tmsriram@google.com>
1053
1054 * icf.cc (get_section_contents): Replace copies of reloc
1055 vectors with const references.
1056
ae447ddd
CC
10572014-04-02 Cary Coutant <ccoutant@google.com>
1058
1059 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1060 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1061 * configure: Regenerate.
1062 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1063 -fno-use-linker-plugin.
1064 (LINK1, CXXLINK1): Add it to the link command.
1065 * testsuite/Makefile.in: Regenerate.
1066
fa47fa92
AM
10672014-03-12 Alan Modra <amodra@gmail.com>
1068
1069 * Makefile.in: Regenerate.
1070
9b12c500
CC
10712014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1072
1073 * symtab.h (Symbol::set_nonvis): New function.
1074
beacaa96
CC
10752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1076
1077 * symtab.cc (Sized_symbol<32>::init_output_data):
1078 Instantiate the template.
1079 (Sized_symbol<64>::init_output_data): Likewise.
1080
800d9823
CC
10812014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1082
1083 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1084 adjust dynamic symbol value.
1085 * target.h (Target::adjust_dyn_symbol): New function.
1086 (Target::do_adjust_dyn_symbol): New function.
1087
918fc1f8 10882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1089
918fc1f8
CC
1090 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1091 Get the value of DYNAMIC_CUSTOM dynamic entry.
1092 * output.h (Output_data_dynamic::add_custom): New function.
1093 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1094 dynamic entry.
1095 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1096 * target.h (Target::dynamic_tag_custom_value): New function.
1097 (Target::do_dynamic_tag_custom_value): New function.
1098
98ff9231
CC
10992014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1100
1101 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1102 dynsym indexes.
1103 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1104 (Target::do_has_custom_set_dynsym_indexes): New function.
1105 (Target::set_dynsym_indexes): New function.
1106 (Target::do_set_dynsym_indexes): New function.
1107
b80eed39
AM
11082014-03-07 Alan Modra <amodra@gmail.com>
1109
1110 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1111 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1112 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1113 (Powerpc_relocate_functions::has_overflow_bitfield,
1114 overflowed): Use the above.
1115 (Target_powerpc::Relocate::relocate): Correct overflow checking
1116 for a number of relocations. Modify overflow test for 16-bit
1117 fields in instructions to signed/unsigned according to whether
1118 the field takes a signed or unsigned value.
1119
4b95cf5c
AM
11202014-03-05 Alan Modra <amodra@gmail.com>
1121
1122 Update copyright years.
1123
45965137
AM
11242014-03-05 Alan Modra <amodra@gmail.com>
1125
1126 * powerpc.cc (Target_powerpc::Scan::local, global): Support
1127 R_PPC64_ADDR64_LOCAL.
1128 (Target_powerpc::Relocate::relocate): Likewise.
1129
2c80b753
AM
11302014-03-03 Alan Modra <amodra@gmail.com>
1131
1132 * dwp.cc (print_version): Update copyright year to current.
1133
c1c69e83
AM
11342014-02-10 Alan Modra <amodra@gmail.com>
1135
1136 * po/gold.pot: Regenerate.
1137
dd0c4e70
CC
11382014-02-06 Cary Coutant <ccoutant@google.com>
1139
1140 Fix problem where -u is ignored when a weak undef is seen.
1141
1142 * archive.cc (Library_base::should_include_member): Reorder
1143 code to check for -u option if a weak undef has already been seen.
1144 * testsuite/Makefile.am (weak_undef_test_2): New test case.
1145 * testsuite/Makefile.in: Regenerate.
1146 * testsuite/weak_undef_file3.cc: New file.
1147 * testsuite/weak_undef_file4.cc: New file.
1148 * testsuite/weak_undef_test_2.cc: New file.
1149
1a221d3d
CC
11502014-02-05 Cary Coutant <ccoutant@google.com>
1151
1152 Fix issues with gold undefined symbol diagnostics.
1153
1154 PR binutils/15435
1155 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
1156 check to here.
1157 * target-reloc.h (is_strong_undefined): New function.
1158 (relocate_section): Move undef vtable symbol check from here.
1159 Check for is_strong_undefined.
1160
e889f0a4 11612014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1162
e889f0a4
CC
1163 Fix problems with the --dynamic-list option.
1164
1165 PR gold/13577
1166 * options.cc (General_options::parse_dynamic_list):
1167 Set have_dynamic_list_.
1168 (General_options::General_options): Initialize have_dynamic_list_.
1169 (General_options::finalize): Turn off -Bsymbolic and
1170 -Bsymbolic-functions if --dynamic-list provided.
1171 * options.h (General_options::have_dynamic_list): New function.
1172 (General_options::have_dynamic_list_): New data member.
1173 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
1174 correctly.
5fe7ffdc 1175
e889f0a4
CC
1176 PR gold/16530
1177 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
1178 in --dynamic-list, mark it.
5fe7ffdc 1179
e889f0a4
CC
1180 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
1181 (dynamic_list_2): New test case.
1182 * testsuite/Makefile.in: Regenerate.
1183 * testsuite/dynamic_list_2.cc: New file.
1184 * testsuite/dynamic_list_2.t: New file.
1185 * testsuite/dynamic_list_lib1.cc: New file.
1186 * testsuite/dynamic_list_lib2.cc: New file.
1187 * testsuite/gc_dynamic_list_test.c: New file.
1188 * testsuite/gc_dynamic_list_test.sh: New file.
1189 * testsuite/gc_dynamic_list_test.t: New file.
1190
ec673e64
CC
11912014-01-28 Cary Coutant <ccoutant@google.com>
1192
1193 Add .gdb_index version 7 support.
1194
1195 * gold/dwarf_reader.cc: include <utility> (for make_pair).
1196 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
1197 debug sections.
1198 (Dwarf_ranges_table::read_ranges_table): Likewise.
1199 (Dwarf_pubnames_table::read_section): Check for GNU-style
1200 sections, and for compressed debug sections.
1201 (Dwarf_pubnames_table::read_header): Compute end address of table.
1202 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
1203 for end of list by offset, not by offset == 0.
1204 (Dwarf_info_reader::do_read_string_table): Check for compressed
1205 debug sections.
1206 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1207 Initialize new data members.
1208 (Dwarf_pubnames_table::next_name): return flag_byte.
1209 (Dwarf_pubnames_table::end_of_table_): New data member.
1210 (Dwarf_pubnames_table::is_gnu_style_): New data member.
1211 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
1212 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
1213 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
1214 read skeleton type unit DIEs.
1215 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
1216 (Gdb_index::do_write): Write flag_byte.
1217 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
1218 (Gdb_index::Cu_vector): Store flags along with cu indexes.
1219 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
1220 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
1221
221fd5d5
L
12222014-01-08 H.J. Lu <hongjiu.lu@intel.com>
1223
1224 * version.cc (print_version): Update copyright year to 2014.
1225
6c09fb0b
ILT
12262013-12-19 Dimitry Andric <dimitry@andric.com>
1227
1228 * stringpool.cc (Stringpool_template::reserve): Add
1229 HAVE_UNORDERED_MAP case.
1230 * stringpool.cc (Stringpool_template::print_stats): Likewise.
1231
8356f2d0
CC
12322013-12-18 Cary Coutant <ccoutant@google.com>
1233
1234 * configure.ac: Check for <unordered_set> and <unordered_map>.
1235 * config.in: Regenerate.
1236 * configure: Regenerate.
1237 * system.h: Use <unordered_set> and <unordered_map> if available.
1238
f2c7d7ee
RM
12392013-12-10 Roland McGrath <mcgrathr@google.com>
1240
1241 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
1242 with $(INSTALL_PROGRAM_ENV).
1243 * Makefile.in: Regenerate.
1244
6632e8cc
CC
12452013-11-22 Cary Coutant <ccoutant@google.com>
1246
1247 * configure.ac: Add check for which library is needed for
1248 dlopen.
1249 * configure: Regenerate.
1250
0c075858
CC
12512013-11-22 Cary Coutant <ccoutant@google.com>
1252
1253 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
1254 assembler.
1255 * testsuite/Makefile.in: Regenerate.
1256
f49fe902
L
12572013-11-17 H.J. Lu <hongjiu.lu@intel.com>
1258
1259 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
1260 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
1261 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
1262 (Target_x86_64<size>::Scan::local): Likewise.
1263 (Target_x86_64<size>::Scan::global): Likewise.
1264 (Target_x86_64<size>::Relocate::relocate): Likewise.
1265 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
1266 Likewise.
1267 (Target_x86_64<size>::Scan::check_non_pic(): Handle
1268 R_X86_64_PC32_BND.
1269
1270 * testsuite/Makefile.am (check_PROGRAMS): Add
1271 exception_x86_64_bnd_test.
1272 (exception_x86_64_bnd_test_SOURCES): New macro.
1273 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
1274 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
1275 (exception_x86_64_bnd_test_LDADD): Likewise.
1276 (exception_x86_64_bnd_1.o): New rule.
1277 (exception_x86_64_bnd_2.o): Likewise.
1278 * testsuite/Makefile.in: Regenerated.
1279
9055360d
AM
12802013-11-15 Alan Modra <amodra@gmail.com>
1281
1282 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
1283 accessor.
1284 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
1285 Only call ppc64_local_entry_offset for 64-bit. Restrict
1286 symval_for_branch lookup to ELFv1.
1287 (Stub_table::add_plt_call_entry): Use unsigned int off.
1288 (Output_data_glink::Address, invalid_address): New.
1289 (Output_data_glink::add_eh_frame): Move out of line. Add
1290 support for ELFv2.
1291 (Output_data_glink::add_global_entry, find_global_entry,
1292 global_entry_address): New functions.
1293 (Output_data_glink::global_entry_stubs_, end_branch_table_,
1294 ge_size): New variables.
1295 (Output_data_glink::set_final_data_size): Add global entry
1296 stub sizing.
1297 (Output_data_glink::do_write): Write global entry stubs.
1298 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
1299 parameter. Return true for ELFv2. Adjust callers.
1300 (Target_powerpc::Scan::local, global): Restrict opd lookup to
1301 ELFv1. Similarly for ifunc and dynamic relocation processing
1302 specific to ELFv1. Recognize that symbols are defined on
1303 their plt entries for ELFv2.
1304 (Target_powerpc::symval_for_branch): Assert if called for
1305 ELFv2 or ppc32.
1306 (Target_powerpc::Relocate::relocate): Use global entry plt
1307 stub for symbol value if such exists on ELFv2.
1308 (Target_powerpc::Relocate::relocate): Don't call
1309 symval_for_branch when ELFv2. Do adjust for local entry
1310 offset when ELFv2.
1311 (Target_powerpc::do_dynsym_value): Set symbols to global entry
1312 plt stub for ELFv2.
1313 (Target_powerpc::do_plt_address_for_global): Similarly.
1314
cafdd569
CC
13152013-11-14 Cary Coutant <ccoutant@google.com>
1316
1317 Revert patch -- this did not fix the problem, and there is
1318 no race there.
1319
1320 2013-11-14 Cary Coutant <ccoutant@google.com>
1321
1322 PR gold/14860
1323 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1324 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1325 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1326 updating fde_offsets_.
1327 (Eh_frame_hdr::lock_): New data member.
1328
94e49e16
CC
13292013-11-14 Cary Coutant <ccoutant@google.com>
1330
1331 * dwp.cc (Dwo_file_entry): New type.
1332 (File_list): Use Dwo_file_entry.
1333 (Dwo_file::verify): New function.
1334 (Dwo_file::verify_dwo_list): New function.
1335 (Dwo_file::sized_verify_dwo_list): New function.
1336 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
1337 list.
1338 (Dwp_options): New enum type.
1339 (dwp_options): Add --verify-only.
1340 (usage): Likewise.
1341 (main): Likewise.
1342 * dwp.h (gold_info): Add declaration.
1343
7cdd7d57
CC
13442013-11-14 Cary Coutant <ccoutant@google.com>
1345
1346 PR gold/14860
1347 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1348 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1349 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1350 updating fde_offsets_.
1351 (Eh_frame_hdr::lock_): New data member.
1352
1d946cb3
CC
13532013-11-06 Cary Coutant <ccoutant@google.com>
1354
1355 PR gold/15758
1356 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1357 before reloc sections.
1358
4f65b40e
AM
13592013-11-04 Alan Modra <amodra@gmail.com>
1360
1361 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1362 (Symbol::needs_dynamic_reloc): Test new flag.
1363 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1364 (Target_powerpc::Scan::get_reference_flags): Add target param.
1365 Return FUNC_DESC_ABI for 64-bit ELFv1.
1366 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1367 call.
1368 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1369 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1370
908794a9
CC
13712013-10-31 Cary Coutant <ccoutant@google.com>
1372
1373 Restore support for dwp v2 DWARF package file format.
1374
1375 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1376 tu_length parameter. Adjust all callers.
1377 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1378 * dwp.cc: Include dwarf.h.
1379 (Section_bounds): New struct type.
1380 (Unit_set): New struct type.
1381 (Dwo_file::Dwo_file): Initialize new data member.
1382 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1383 Combine and rename to...
1384 (Dwo_file::read_unit_index): ...this.
1385 (Dwo_file::sized_read_compunit_index)
1386 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1387 (Dwo_file::sized_read_unit_index): ...this.
1388 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1389 parameters; add section_id parameter.
1390 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1391 (Dwo_file::add_unit_set): ...this.
1392 (Dwo_file::shndx_map_): Remove.
1393 (Dwo_file::sect_offsets_): New data member.
1394 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1395 (Dwp_output_file::add_section): Rename to...
1396 (Dwp_output_file::add_contribution): ...this.
1397 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1398 (Dwp_output_file::add_tu_set): Likewise.
1399 (Dwp_output_file::Contribution): New type.
1400 (Dwp_output_file::Section::contributions): New data member.
1401 (Dwp_output_file::Cu_or_tu_set): Remove.
1402 (Dwp_output_file::Section::Section): New ctor.
1403 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1404 (Dwp_output_file::Dwp_index::Section_table): New type.
1405 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1406 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1407 parameter.
1408 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1409 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1410 (Dwp_output_file::Dwp_index::section_table): New member function.
1411 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1412 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1413 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1414 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1415 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1416 (Dwp_output_file::Dwp_index::section_table_): New data member.
1417 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1418 (Dwp_output_file::add_output_section): New member function.
1419 (Dwp_output_file::write_new_section): New member function.
1420 (Dwp_output_file::write_contributions): New member function.
1421 (Dwp_output_file::section_id_map_): New data member.
1422 (class Dwo_id_info_reader): Remove.
1423 (class Unit_reader): New class.
1424 (get_dwarf_section_name): New function.
1425 (Dwo_file::read_executable): Adjust initializations of class data.
1426 (Dwo_file::read): Add support for v2 package file format.
1427 (Dwo_file::read_unit_index): Likewise.
1428 (Dwo_file::sized_read_unit_index): Likewise.
1429 (Dwo_file::copy_section): Likewise.
1430 (Dwo_file::add_unit_set): Likewise.
1431 (Dwp_output_file::add_output_section): Likewise.
1432 (Dwp_output_file::add_contribution): Likewise.
1433 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1434 for empty slot.
1435 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1436 file format.
1437 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1438 slot.
1439 (Dwp_output_file::initialize): Remove unused function.
1440 (Dwp_output_file::finalize): Add support for v2 package file format.
1441 (Dwp_output_file::write_index): Likewise.
1442 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1443 function prototype.
1444
2500c017
CC
14452013-10-31 Cary Coutant <ccoutant@google.com>
1446
1447 * configure.ac: Fix check for -fmerge-constants.
1448 * configure.ac: Regenerate.
1449
dd0845d7
RM
14502013-10-30 Roland McGrath <mcgrathr@google.com>
1451
1452 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1453 Correct 9-byte nop sequence to match what the assembler generates.
1454
b4f7960d
AM
14552013-10-30 Alan Modra <amodra@gmail.com>
1456
1457 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1458 ppc64_local_entry_offset, ppc64_local_entry_offset,
1459 do_read_symbols): New functions.
1460 (Powerpc_relobj::e_flags_, st_other_): New vars.
1461 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1462 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1463 (Powerpc_relobj::e_flags_): New var.
1464 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1465 and adjust for ELFv2.
1466 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1467 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1468 (Powerpc_dynobj::do_find_special_sections): Likewise.
1469 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1470 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1471 to ELFv2 local entry.
1472 (Target_powerpc::do_relax): No thread safe barriers needed for
1473 ELFv2.
1474 (Output_data_plt_powerpc::initial_plt_entry_size_,
1475 plt_entry_size): Delete. Replace all uses with
1476 first_plt_entry_offset() and plt_entry_size().
1477 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1478 reserved_size parm. Update callers.
1479 (Output_data_plt_powerpc::entry_count): Update.
1480 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1481 and use Target_powerpc::first_plt_entry_offset().
1482 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1483 rename to plt_entry_size.
1484 (Output_data_plt_powerpc::add_ifunc_entry,
1485 add_local_ifunc_entry): Adjust reloc for ELFv2.
1486 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1487 (glink_eh_frame_fde_64v2): New.
1488 (Stub_table::plt_call_size): Support ELFv2 sizing.
1489 (Output_data_glink::add_eh_frame): Use the new FDE.
1490 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1491 (Stub_table::do_write): Write ELFv2 stubs and glink.
1492 (Target_powerpc::Relocate::relocate): Replaces nop after call
1493 with ld 2,24(1) and adjust local offset destination for ELFv2.
1494
f9c6b907
AM
14952013-10-30 Alan Modra <amodra@gmail.com>
1496
1497 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1498 (Target_powerpc::Scan::global, local): Likewise.
1499 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1500 on all ppc64 @h and @ha relocs.
1501
e84fe78f
AM
15022013-10-14 Alan Modra <amodra@gmail.com>
1503
1504 * output.h (Output_data_got::add_constant): Tidy.
1505 (Output_data_got::add_constant_pair): New function.
1506 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1507 methods used so as to first call reserve_ent().
1508
679e4abf
RM
15092013-10-11 Roland McGrath <mcgrathr@google.com>
1510
44dcb735
RM
1511 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1512 add_got_entry and add_got_entry_pair.
1513
13323c49
RM
1514 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1515 (HAVE_PUBNAMES): Likewise.
1516 * configure: Regenerate.
1517
1496b446
RM
1518 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1519 * testsuite/Makefile.in: Regenerate.
1520
cc84c10b
RM
1521 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1522 Remove const from declaration.
1523 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1524 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1525 * output.h (Output_file_header): Remove const from member target_
1526 and corresponding constructor argument.
1527 * output.cc (Output_file_header::Output_file_header): Update prototype.
1528 (Output_file_header::do_sized_write): Use this->target_ in place
1529 of parameters()->target().
1530
52f66a2c
RM
1531 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1532
2b64b551
RM
1533 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1534 * configure: Regenerate.
1535 * Makefile.in: Regenerate.
1536 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1537 * testsuite/merge_string_literals_2.c: Likewise.
1538 * testsuite/Makefile.am
1539 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1540 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1541 literal -fmerge-constants.
1542 * testsuite/Makefile.in: Regenerate.
1543
43819297
RM
1544 * i386.cc (Target_i386): Remove unused member dynbss_.
1545 * arm.cc (Target_arm): Likewise.
1546 * powerpc.cc (Target_powerpc): Likewise.
1547 * sparc.cc (Target_sparc): Likewise.
1548 * tilegx.cc (Target_tilegx): Likewise.
1549 * x86_64.cc (Target_x86_64): Likewise.
1550 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1551 type_signature_, type_offset_.
1552 * plugin.h (Plugin_hook): Remove unused member layout_.
1553 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1554 mapfile_.
1555 (Read_member): Remove unused members input_objects_, symtab_,
1556 mapfile_, layout_.
1557 (Check_library): Remove unused member symtab_.
1558 * archive.h (Lib_group): Remove unused member lib_.
1559 * archive.cc (Lib_group::Lib_group): Update initializer.
1560 * incremental.h (Incremental_binary): Remove unused member target_.
1561 (Incremental_script_entry): Removed unused member script_.
1562 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1563 * icf.h (Icf): Remove unused member num_tracked_relocs.
1564
39d9ead7
RM
1565 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1566 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1567 its only use.
1568 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1569
679e4abf
RM
1570 * archive.h: Use struct rather than class for forward declaration
1571 of Read_symbols_data.
1572
54de2ea6
CC
15732013-10-07 Cary Coutant <ccoutant@google.com>
1574
1575 PR gold/16010
1576 * testsuite/Makefile.am (icf_test): Fix dependencies.
1577 (icf_safe_test): Likewise.
1578 (icf_safe_so_test): Likewise.
1579 (large_symbol_alignment): Add empty _LDADD rule.
1580 * testsuite/Makefile.in: Regenerate.
1581
b14016f0
L
15822013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1583
1584 PR gold/15927
1585 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1586 relocation for R_X86_64_32 on x32.
1587
eb426534
RM
15882013-08-27 Roland McGrath <mcgrathr@google.com>
1589
1590 * output.cc (Output_segment::set_section_addresses): Take new
1591 Target* argument. If target->isolate_execinstr() and the segment
1592 is executable and starts at a target->abi_pagesize() boundary,
1593 pad its end out to a target->abi_pagesize() boundary with code fill.
1594 * output.h (Output_segment::set_section_addresses): Update decl.
1595 * layout.h (Layout::check_output_data_for_reset_values): Take new
1596 argument RELAX_OUTPUTS.
1597 (Layout): New member relax_output_list_.
1598 (Layout::add_relax_output): New method.
1599 * layout.cc (Layout::Layout): Update constructor.
1600 (Layout::reset_relax_output): New method.
1601 (Layout::clean_up_after_relaxation): Call it.
1602 (Layout::prepare_for_relaxation): Update caller.
1603 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1604 Call reset_relax_output before re-processing segments for
1605 isolate_execinstr case.
1606 (Layout::write_data): Handle relax_output_list_.
1607 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1608 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1609
9aff4b7a
NC
16102013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1611
1612 PR binutils/15834
1613 * object.h: Fix typos.
1614
93f8221c
RM
16152013-08-16 Roland McGrath <mcgrathr@google.com>
1616
1617 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1618 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1619
e44c3715
CC
16202013-08-07 Cary Coutant <ccoutant@google.com>
1621
1622 Revert support for v2 DWP files:
1623
1624 2013-03-01 Cary Coutant <ccoutant@google.com>
1625
1626 Add dwp support for v2 DWARF package file format.
1627 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1628 tu_length parameter. Adjust all callers.
1629 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1630 * dwp.cc: Include dwarf.h.
1631 (Section_bounds): New struct type.
1632 (Unit_set): New struct type.
1633 (Dwo_file::Dwo_file): Initialize new data member.
1634 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1635 Combine and rename to...
1636 (Dwo_file::read_unit_index): ...this.
1637 (Dwo_file::sized_read_compunit_index)
1638 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1639 (Dwo_file::sized_read_unit_index): ...this.
1640 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1641 parameters; add section_id parameter.
1642 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1643 (Dwo_file::add_unit_set): ...this.
1644 (Dwo_file::shndx_map_): Remove.
1645 (Dwo_file::sect_offsets_): New data member.
1646 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1647 (Dwp_output_file::add_section): Rename to...
1648 (Dwp_output_file::add_contribution): ...this.
1649 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1650 (Dwp_output_file::add_tu_set): Likewise.
1651 (Dwp_output_file::Contribution): New type.
1652 (Dwp_output_file::Section::contributions): New data member.
1653 (Dwp_output_file::Cu_or_tu_set): Remove.
1654 (Dwp_output_file::Section::Section): New ctor.
1655 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1656 (Dwp_output_file::Dwp_index::Section_table): New type.
1657 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1658 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1659 parameter.
1660 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1661 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1662 (Dwp_output_file::Dwp_index::section_table): New member function.
1663 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1664 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1665 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1666 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1667 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1668 (Dwp_output_file::Dwp_index::section_table_): New data member.
1669 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1670 (Dwp_output_file::add_output_section): New member function.
1671 (Dwp_output_file::write_new_section): New member function.
1672 (Dwp_output_file::write_contributions): New member function.
1673 (Dwp_output_file::section_id_map_): New data member.
1674 (class Dwo_id_info_reader): Remove.
1675 (class Unit_reader): New class.
1676 (get_dwarf_section_name): New function.
1677 (Dwo_file::read_executable): Adjust initializations of class data.
1678 (Dwo_file::read): Add support for v2 package file format.
1679 (Dwo_file::read_unit_index): Likewise.
1680 (Dwo_file::sized_read_unit_index): Likewise.
1681 (Dwo_file::copy_section): Likewise.
1682 (Dwo_file::add_unit_set): Likewise.
1683 (Dwp_output_file::add_output_section): Likewise.
1684 (Dwp_output_file::add_contribution): Likewise.
1685 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1686 for empty slot.
1687 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1688 file format.
1689 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1690 slot.
1691 (Dwp_output_file::initialize): Remove unused function.
1692 (Dwp_output_file::finalize): Add support for v2 package file format.
1693 (Dwp_output_file::write_index): Likewise.
1694 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1695 function prototype.
1696
c6905c28
CC
16972013-07-31 Cary Coutant <ccoutant@google.com>
1698
1699 * object.cc (Sized_relobj::do_output_section_address): New function.
1700 (Sized_relobj): Instantiate explicitly.
1701 * object.h (Object::output_section_address): New function.
1702 (Object::do_output_section_address): New function.
1703 (Sized_relobj::do_output_section_address): New function.
1704 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1705
17062013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1707 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1708
1709 * parameters.cc (Parameters::entry): Return target-specific entry
1710 symbol name.
1711 * target.h (Target::entry_symbol_name): New function.
1712 (Target_info::entry_symbol_name): New data member.
1713
1714 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1715 * i386.cc (Target_i386::i386_info): Likewise.
1716 (Target_i386_nacl::i386_nacl_info): Likewise.
1717 * sparc.cc (Target_sparc::sparc_info): Likewise.
1718 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1719 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1720 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1721 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1722
234d4ab8
SA
17232013-07-22 Sterling Augustine <saugustine@google.com>
1724
1725 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1726 Convert parameter shndx to local variable. Add parameters symtab
1727 and symtab_size. Scan over section names. Find relocation
1728 section corresponding to current section. Create and initialize
1729 reloc_mapper_ and reloc_type_.
1730 (Dwarf_pubnames_table::read_header): Add assertion. Change
1731 unit_length to off_t. Initialize member unit_length_. Fill in field
1732 cu_offset_.
1733 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1734 Initialize new fields unit_length_ and cu_offset_.
1735 (Dwarf_pubnames_table::read_section): Update prototype.
1736 (Dwarf_pubnames_table::cu_offset): New member function.
1737 (Dwarf_pubnames_table::subsection_size): Likewise.
1738 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1739 New fields.
1740 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1741 member functions public.
1742 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1743 Update comment. Rework logic. Move repeated parts to...
1744 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1745 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1746 pubtypes_table_, and stmt_list_offset.
1747 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1748 Gdb_index::find_pubtype_offset,
1749 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1750 (Gdb_index::pubnames_read): Update prototype and rework logic.
1751 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1752 Forward declare.
1753 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1754 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1755 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1756 Gdb_index::map_pubtable_to_dies):
1757 Declare functions.
1758 (Gdb_index::pubnames_read): Update declaration.
1759 (Gdb_index::Pubname_offset_map): New type.
1760 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1761 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1762 Gdb_index::stmt_list_offset): Declare.
1763 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1764 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1765 Gdb_index::pubtypes_offset_): Remove.
1766
a3ed37d8
RM
17672013-07-19 Roland McGrath <mcgrathr@google.com>
1768
1769 * options.h (General_options): Add -Trodata-segment option.
1770 * parameters.cc (Parameters::check_rodata_segment): New function.
1771 (Parameters::set_target_once): Call it.
1772 * parameters.h (Parameters): Declare it (private member function).
1773 * layout.cc (load_seg_unusable_for_headers): New function, broken
1774 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1775 then validate rodata segment rather than text segment.
1776 (relaxation_loop_body): Call that.
1777 (is_text_segment): New function. Don't admit a non-executable
1778 segment if TARGET->isolate_execinstr().
1779 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1780
eb5b4ded
CC
17812013-07-15 Shawn Landden <shawnlandden@gmail.com>
1782
1783 PR gold/15070
1784 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1785 * nacl.h (Sniff_file::View::View): Request aligned view.
1786
4d5effb9
CC
17872013-07-11 Cary Coutant <ccoutant@google.com>
1788
1789 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1790 correct BRLT entry size.
1791
ba8ca3e7
AM
17922013-07-03 Alan Modra <amodra@gmail.com>
1793
1794 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1795 comment.
1796
267257d2
CC
17972013-07-01 Cary Coutant <ccoutant@google.com>
1798
1799 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1800 reloc_type_.
1801 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1802 (Dwarf_ranges_table::lookup_reloc): New function.
1803 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1804 reloc_type_.
1805 (Dwarf_ranges_table::lookup_reloc): New function.
1806 (Dwarf_ranges_table::reloc_type_): New data member.
1807
06f30c9d
CC
18082013-06-27 Jing Yu <jingyu@google.com>
1809
1810 PR gold/15662
1811 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1812 function.
1813 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1814 (Target_powerpc::do_relax): Call the above.
1815
a2d7bf59
AM
18162013-06-27 Cary Coutant <ccoutant@google.com>
1817
1818 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1819 on garbage collected .opd section.
1820
18212013-06-27 Alan Modra <amodra@gmail.com>
1822
1823 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1824 is non-zero.
1825 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1826 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1827
32364e50
CC
18282013-06-14 Cary Coutant <ccoutant@google.com>
1829
1830 * resolve.cc (Symbol::override_base): Don't override st_type
1831 from plugin placeholder symbols.
1832 (Symbol_table::resolve): Likewise.
1833 (Symbol_table::should_override): Don't complain about TLS mismatch
1834 if the TO symbol is a plugin placeholder.
1835 * testsuite/Makefile.am (plugin_test_tls): New test.
1836 * testsuite/Makefile.in: Regenerate.
1837 * testsuite/plugin_test_tls.sh: New test script.
1838 * testsuite/two_file_test_2_tls.cc: New test source.
1839 * testsuite/two_file_test_tls.cc: New test source.
1840
7fb47cc9
CC
18412013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1842
1843 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1844 the maximum segment alignment is larger than the page size.
1845 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1846 correctly aligns the symbols with large alignemnt.
1847 * testsuite/Makefile.in: Regenerate.
1848 * testsuite/large_symbol_alignment.cc: New file.
1849
6934001a
CC
18502013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1851 Sriraman Tallam <tmsriram@google.com>
1852
1853 * options.h (sort_section): New option.
1854 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1855 Rename from Input_section_sort_section_name_special_ordering_compare.
1856 (Input_section_sort_section_name_compare): New struct.
1857 * output.cc (Output_section::Input_section_sort_section_name_compare::
1858 operator()): New function.
1859 (Output_section::sort_attached_input_sections): Use new sort function
1860 for .text if --sort-section=name is specified.
1861 * layout.cc (Layout::make_output_section):
1862 Add sorting by name when --sort-section=name is specified.
1863 * testsuite/Makefile.am (text_section_grouping): Test option
1864 --sort-section=name.
1865 * testsuite/Makefile.in: Regenerate.
1866 * testsuite/section_sorting_name.cc: New file.
1867 * testsuite/section_sorting_name.sh: New file.
1868
93acabad
CC
18692013-05-21 Cary Coutant <ccoutant@google.com>
1870
1871 * symtab.h (Symbol::is_cxx_vtable): New function.
1872 * target-reloc.h (relocate_section): Check for vtable symbol.
1873 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1874 * testsuite/Makefile.in: Regenerate.
1875 * testsuite/missing_key_func.cc: New test source.
1876 * testsuite/missing_key_func.sh: New test script.
1877
60e8b3fc
CC
18782013-05-21 Cary Coutant <ccoutant@google.com>
1879
2b64b551
RM
1880 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1881 type of enclosing symbol.
1882 (Relocate_info::location): Check symbol type when describing symbol.
1883 * object.h (Symbol_location_info): Remove unused line_number;
1884 add enclosing_symbol_type.
1885 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1886
9df9de2c
CC
18872013-05-13 Cary Coutant <ccoutant@google.com>
1888
2b64b551
RM
1889 * configure.ac: Export DEFAULT_TARGET.
1890 * configure: Regenerate.
1891 * Makefile.in: Regenerate.
1892 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1893 * testsuite/Makefile.in: Regenerate.
1894 * testsuite/debug_msg.sh: Delete duplicate tests.
1895 Don't check undef_int error message match for powerpc where the
1896 source file and line number aren't available.
9df9de2c 1897
bbc5ae17
RM
18982013-05-10 Roland McGrath <mcgrathr@google.com>
1899
1900 * options.h (General_options): Add --rosegment-gap option.
1901 * options.cc (finalize): --rosegment-gap implies --rosegment.
1902 * layout.cc (set_segment_offsets): Let user option override
1903 target->rosegment_gap().
1904
0c6e6c39
RM
19052013-05-10 Roland McGrath <mcgrathr@google.com>
1906
1907 * options.h (General_options): Remove leading space from help
1908 messages for -nostdlib and --rosegment.
1909
cde7cb01
MR
19102013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1911
1912 PR ld/15365
1913 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1914
f31ae5b8
AM
19152013-05-03 Alan Modra <amodra@gmail.com>
1916
1917 * merge.cc (Output_merge_string::do_add_input_section): Correct
1918 scan for number of strings. Rename vars to avoid shadowing.
1919 Include missing terminator in input_size_.
1920
d3a7cd45
L
19212013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1922
1923 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1924 Restore empty string handling.
1925
6ad3daba
CC
19262013-05-01 Cary Coutant <ccoutant@google.com>
1927
1928 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1929 uninitialized warning.
1930
e31908b6
CC
19312013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1932
1933 * output.cc (Output_section::add_merge_input_section): Allow
1934 to merge sections if the alignment is more than character size.
1935 * merge.h (Output_merge_string::Output_merge_string): Remove
1936 assert.
1937 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1938 only not-null strings. Check the alignment of strings.
1939 * stringpool.h
1940 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1941 alignment as the argument.
1942 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1943 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1944 Align non-zero length strings according to the addralign_.
1945 (Stringpool_template<Stringpool_char>::set_string_offsets):
1946 Updating offsets according to the given alignment.
1947 * testsuite/Makefile.am (text_section_grouping): Test if string
1948 literals are getting merged.
1949 * testsuite/Makefile.in: Regenerate.
1950 * testsuite/merge_string_literals_1.c: New file.
1951 * testsuite/merge_string_literals_2.c: Ditto.
1952 * testsuite/merge_string_literals.sh: Ditto.
1953
0e804863
ILT
19542013-04-26 Ian Lance Taylor <iant@google.com>
1955
1956 * target-reloc.h (relocate_section): If the reloc offset is out of
1957 range, pass VIEW as NULL to relocate.relocate.
1958 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1959 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1960 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1961 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1962 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1963 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1964
e7c5ea40
CC
19652013-04-26 Geoff Pike <gpike@chromium.org>
1966
1967 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1968 * layout.cc (Hash_task): New class.
1969 (Layout::queue_build_id_tasks): New function.
1970 (Layout::write_build_id): Handle single-thread portion of build ID
1971 computation. (In some cases, all of it is single-threaded.) Replace
1972 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1973 functionality in fewer lines of code.
1974 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1975 * options.h (General_options): make "--build-id" default to tree
1976 rather than sha1. Add two new options related to --build-id=tree:
1977 --build-id-chunk-size-for-treehash and
1978 --build-id-min-file-size-for-treehash.
1979 * Makefile.am: add testing of --build-id=tree and related new options
1980 (these tests will be invoked by "make check").
1981 * Makefile.in: Regenerate.
1982
49926cd0
AM
19832013-04-25 Alan Modra <amodra@gmail.com>
1984
1985 * configure.tgt: Add powerpcle and powerpc64le.
1986
a4034750
AM
19872013-04-22 Alan Modra <amodra@gmail.com>
1988
1989 PR gold/15355
1990 * layout.cc (Layout::segment_precedes): Allow more than one
1991 segment with the same type and flags.
1992
e79c84aa
CC
19932013-04-15 Cary Coutant <ccoutant@google.com>
1994
1995 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1996 allocate space in file for BSS sections.
1997
2199fbe7
CC
19982013-04-15 Cary Coutant <ccoutant@google.com>
1999
2000 * script-sections.cc (Orphan_output_section): Reset address
2001 to zero after each orphaned section for relocatable links.
2002
502e8a84
CC
20032013-04-15 Cary Coutant <ccoutant@google.com>
2004
a4034750
AM
2005 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2006 section starting address for relocatable link.
2007 * testsuite/Makefile.am (script_test_11): New test.
2008 * testsuite/Makefile.in: Regenerate.
2009 * testsuite/script_test_11.c: New source file.
2010 * testsuite/script_test_11.t: New linker script.
502e8a84 2011
0cfdc767
AM
20122013-04-13 Alan Modra <amodra@gmail.com>
2013
2014 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2015 owner when sections are not adjacent and exceed group size.
2016 (Target_powerpc::group_sections): Handle corner case.
2017 (Target_powerpc::Branch_info::make_stub): Handle case where
2018 stub table doesn't exist due to branches in non-exec sections.
2019 (Target_powerpc::Relocate::relocate): Likewise.
2020
6830ee24
AM
20212013-04-11 Alan Modra <amodra@gmail.com>
2022
2023 PR gold/15354
2024 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2025 .branch_lt to match bfd ld. Adjust comments throughout file.
2026
54a3d865
ILT
20272013-04-04 Ian Lance Taylor <iant@google.com>
2028
2029 GCC PR c++/56840
2030 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2031 sections before checking whether they are included in the link.
2032
9993ba11
ST
20332013-03-29 Sriraman Tallam <tmsriram@google.com>
2034
2035 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2036 object before calling the plugin claim_file handler. Pass the elf
2037 object of the archive to the plugin. Delete the elf object if the
2038 plugin claims the file.
2039
ebacd51e
AM
20402013-03-21 Alan Modra <amodra@gmail.com>
2041
2042 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2043 segment when omagic.
2044
117be58f
AM
20452013-03-21 Alan Modra <amodra@gmail.com>
2046
2047 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2048 comparison warning.
2049 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2050 uninitialized" warning.
2051
32e2b61d
AM
20522013-03-20 Alan Modra <amodra@gmail.com>
2053
2054 * symtab.h (Symbol::clear_version): New function.
2055 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2056 is_needed by weak references. Clear version for symbols defined
2057 in as-needed objects that are not needed.
2058
b3ccdeb5
AM
20592013-03-15 Alan Modra <amodra@gmail.com>
2060
2061 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2062 static and public. Add report_err param. Return false for data refs.
2063 (Target_powerpc::rela_dyn_section): New overloaded function.
2064 (Target_powerpc::plt_, iplt_): Elucidate.
2065 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2066 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2067 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2068 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2069 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2070 push_branch and make_plt_entry for ifunc syms when
2071 reloc_needs_plt_for_ifunc.
2072 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2073 for ifunc unless reloc_needs_plt_for_ifunc.
2074
ad3d8a2f
AM
20752013-03-15 Alan Modra <amodra@gmail.com>
2076
2077 * gc.h (gc_process_relocs): Don't look through function descriptors.
2078 * icf.cc (get_section_contents): Do so here instead.
2079
4d9aa155
AM
20802013-03-13 Alan Modra <amodra@gmail.com>
2081
2082 * powerpc.cc (is_branch_reloc): Forward declare.
2083 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2084 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2085 false for 64-bit, true for 32-bit non-branch relocs.
2086 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2087 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2088 nm output.
2089 (icf_safe_test): Generate linker map file as well as nm output.
2090 (icf_safe_so_test): Likewise.
2091 * testsuite/Makefile.in: Regenerate.
2092 * testsuite/icf_test.sh: Parse linker map file to determine
2093 section folding.
2094 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2095 * testsuite/icf_safe_so_test.sh: Likewise.
2096 (X86_32_or_ARM_specific_safe_fold): Merge into..
2097 (arch_specific_safe_fold): ..this.
2098 (X86_64_specific_safe_fold): Delete unused function.
2099
57420c20
AM
21002013-03-12 Alan Modra <amodra@gmail.com>
2101
2102 * gc.h (gc_process_relocs): Look through function descriptors
2103 to determine shndx, symvalue and addend used by ICF. Tidy
2104 variable duplication.
2105
dc3714f3
AM
21062013-03-11 Alan Modra <amodra@gmail.com>
2107
2108 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2109 * layout.cc (Layout_task_runner::run): ..to here.
2110 * symtab.h (struct Symbol_location): Extract from..
2111 (class Symbol_table): ..here.
2112 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2113 * target.h (class Target): Add function_location and
2114 do_function_location functions.
2115 (class Sized_target): Add do_function_location.
2116 * object.h (class Sized_relobj_file): Move find_shdr..
2117 (class Object): ..to here.
2118 * object.cc: Likewise. Update to suit. Instantiate.
2119 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
2120 * powerpc.cc (class Powerpc_dynobj): New.
2121 (Target_powerpc::do_function_location): New function.
2122 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
2123 (Powerpc_dynobj::do_read_symbols): New function.
2124 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2125
956b03bb
ILT
21262013-03-08 Ian Lance Taylor <iant@google.com>
2127
2128 * options.cc (General_options::string_to_object_format): Accept
2129 "default".
2130
4bead2d5
AM
21312013-03-08 Alan Modra <amodra@gmail.com>
2132
2133 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
2134 pointer to Post_fde.
2135 (struct Post_fde): Move definition to here..
2136 * ehframe.cc (struct Post_fde): ..from here.
2137 (Cie::write): Don't alloc Post_fde.
2138 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2139
02e60bf7
AM
21402013-03-07 Alan Modra <amodra@gmail.com>
2141
2142 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
2143 relocation referencing .LC0.
2144 * testsuite/discard_locals_test.sh: Remove FIXMEs.
2145
8343f03a
AM
21462013-03-07 Alan Modra <amodra@gmail.com>
2147
2148 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
2149 always_inline. Add assembly for powerpc to avoid GOT.
2150
3366d57c
AM
21512013-03-07 Alan Modra <amodra@gmail.com>
2152
2153 * testsuite/script_test_10.sh: Don't test .bss section
2154 header number.
2155
6c77229c
AM
21562013-03-06 Alan Modra <amodra@gmail.com>
2157
2158 * powerpc.cc (class Powerpc_relobj): Move some member functions.
2159 (Target_powerpc::symval_for_branch): Add symtab param. Update
2160 all callers. Handle folded sections.
2161 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
2162 to Powerpc_relobj.
2163 (Global_symbol_visitor_opd::operator()): Likewise.
2164
a39e4af6
AM
21652013-03-04 Alan Modra <amodra@gmail.com>
2166
2167 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
2168 * testsuite/Makefile.in: Regenerate.
2169
d5834edb
CC
21702013-03-01 Cary Coutant <ccoutant@google.com>
2171
2172 Add dwp support for v2 DWARF package file format.
2173 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2174 tu_length parameter. Adjust all callers.
2175 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2176 * dwp.cc: Include dwarf.h.
2177 (Section_bounds): New struct type.
2178 (Unit_set): New struct type.
2179 (Dwo_file::Dwo_file): Initialize new data member.
2180 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2181 Combine and rename to...
2182 (Dwo_file::read_unit_index): ...this.
2183 (Dwo_file::sized_read_compunit_index)
2184 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2185 (Dwo_file::sized_read_unit_index): ...this.
2186 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2187 parameters; add section_id parameter.
2188 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2189 (Dwo_file::add_unit_set): ...this.
2190 (Dwo_file::shndx_map_): Remove.
2191 (Dwo_file::sect_offsets_): New data member.
2192 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2193 (Dwp_output_file::add_section): Rename to...
2194 (Dwp_output_file::add_contribution): ...this.
2195 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2196 (Dwp_output_file::add_tu_set): Likewise.
2197 (Dwp_output_file::Contribution): New type.
2198 (Dwp_output_file::Section::contributions): New data member.
2199 (Dwp_output_file::Cu_or_tu_set): Remove.
2200 (Dwp_output_file::Section::Section): New ctor.
2201 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2202 (Dwp_output_file::Dwp_index::Section_table): New type.
2203 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2204 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2205 parameter.
2206 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2207 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2208 (Dwp_output_file::Dwp_index::section_table): New member function.
2209 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2210 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2211 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2212 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2213 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2214 (Dwp_output_file::Dwp_index::section_table_): New data member.
2215 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2216 (Dwp_output_file::add_output_section): New member function.
2217 (Dwp_output_file::write_new_section): New member function.
2218 (Dwp_output_file::write_contributions): New member function.
2219 (Dwp_output_file::section_id_map_): New data member.
2220 (class Dwo_id_info_reader): Remove.
2221 (class Unit_reader): New class.
2222 (get_dwarf_section_name): New function.
2223 (Dwo_file::read_executable): Adjust initializations of class data.
2224 (Dwo_file::read): Add support for v2 package file format.
2225 (Dwo_file::read_unit_index): Likewise.
2226 (Dwo_file::sized_read_unit_index): Likewise.
2227 (Dwo_file::copy_section): Likewise.
2228 (Dwo_file::add_unit_set): Likewise.
2229 (Dwp_output_file::add_output_section): Likewise.
2230 (Dwp_output_file::add_contribution): Likewise.
2231 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2232 for empty slot.
2233 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2234 file format.
2235 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2236 slot.
2237 (Dwp_output_file::initialize): Remove unused function.
2238 (Dwp_output_file::finalize): Add support for v2 package file format.
2239 (Dwp_output_file::write_index): Likewise.
2240 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2241 function prototype.
2242
a68a081d
CC
22432013-03-01 Cary Coutant <ccoutant@google.com>
2244
2245 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
2246 function into class definition in header file.
2247 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
2248 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
2249 New function.
2250 (Dwarf_info_reader::check_buffer): Move here from .cc file.
2251
9d5781f8
AM
22522013-02-28 Alan Modra <amodra@gmail.com>
2253
2254 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
2255 * target.cc (Target::do_plt_fde_location): New function.
2256 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
2257 accessor function, and constructor param.
2258 (struct Post_fde, Post_fdes): Declare.
2259 (Cie::write): Add post_fdes param.
2260 * ehframe.cc (Fde::write): Use plt_fde_location.
2261 (struct Post_fde): Define.
2262 (Cie::write): Stash FDEs added post merge mapping.
2263 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
2264 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
2265 (Eh_frame::do_sized_write): Arrange to write post map FDES after
2266 other FDEs.
2267 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
2268 (Target_powerpc::has_glink): New function.
2269 (Target_powerpc::do_relax): Add eh_frame info for stubs.
2270 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
2271 glink_eh_frame_fde_32, default_fde): New data.
2272 (Stub_table::eh_frame_added_): New var.
2273 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
2274 Make const.
2275 (Stub_table::add_eh_frame): New function.
2276 (Output_data_glink::add_eh_frame): New function.
2277 (Target_powerpc::make_glink_section): Call add_eh_frame.
2278
214383dd
ILT
22792013-02-15 Ian Lance Taylor <iant@google.com>
2280
2281 * options.h (DEFINE_uint64_alias): Define.
2282 (class General_options): Add -Ttext-segment as an alias for
2283 -Ttext.
2284
91c2b899
AM
22852013-02-15 Alan Modra <amodra@gmail.com>
2286
2287 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
2288 (Stub_table::do_write): ..here, two places.
2289 (Stub_table::plt_call_size): Use it here too.
2290
20e2a8aa
ILT
22912013-02-11 Ian Lance Taylor <iant@google.com>
2292
2293 * descriptors.cc (Descriptors::close_all): New function.
2294 * descriptors.h (class Descriptors): Declare close_all.
2295 (close_all_descriptors): New inline function.
2296 * plugin.cc: Include "descriptors.h".
2297 (Plugin_manager::cleanup): Call close_all_descriptors.
2298
8952bc69
AM
22992013-02-06 Alan Modra <amodra@gmail.com>
2300
2301 * README: Update coding style link.
2302
29bd8b6b
CC
23032013-01-28 Cary Coutant <ccoutant@google.com>
2304
a4034750
AM
2305 * dwp.cc (File_list): New typedef.
2306 (Dwo_name_info_reader): New class.
2307 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
2308 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
2309 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
2310 (Dwo_file::read_executable): New function.
2311 (Dwo_file::read): Move common setup code to ...
2312 (Dwo_file::make_object): ... here.
2313 (dwp_options): Add --exec/-e.
2314 (usage): Likewise.
2315 (main): Likewise.
29bd8b6b 2316
c6ac678d
ST
23172013-01-24 Sriraman Tallam <tmsriram@google.com>
2318
2319 * layout.cc (Layout::layout): Check for option text_reorder.
2320 (Layout::make_output_section): Ditto.
2321 * options.h (text_reorder): New option.
2322 * output.cc (Input_section_sort_compare): Remove special ordering
2323 of section names.
2324 (Output_section::
2325 Input_section_sort_section_name_special_ordering_compare::
2326 operator()): New function.
2327 (Output_section::sort_attached_input_sections): Use new sort function
2328 for .text.
2329 * output.h (Input_section_sort_section_name_special_ordering_compare):
2330 New struct.
2331 * testsuite/Makefile.am (text_section_grouping): Test option
2332 --no-text-reorder
2333 * testsuite/Makefile.in: Regenerate.
2334 * testsuite/text_section_grouping.sh: Check order of functions without
2335 default text reordering.
2336
50701cc1
MF
23372013-01-18 Mike Frysinger <vapier@gentoo.org>
2338
2339 * options.h (General_options): Change default to true for new_dtags.
2340
b1b00fcc
MF
23412013-01-18 Mike Frysinger <vapier@gentoo.org>
2342
2343 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2344 when enable_new_dtags is false. Only add DT_RUNPATH when
2345 enable_new_dtags is true.
2346
ec5b8187
AM
23472013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2348
2349 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2350 used in declaration and definition consistent.
2351 (Target_powerpc::symval_for_branch): Ditto.
2352
a880d4c4
ST
23532013-01-16 Sriraman Tallam <tmsriram@google.com>
2354
2355 * testsuite/plugin_final_layout.cc: Fix comment.
2356
7c381248
ST
23572013-01-16 Sriraman Tallam <tmsriram@google.com>
2358
2359 * layout.cc (Layout::layout): Do not do default sorting for
2360 text sections when section ordering is specified.
2361 (make_output_section): Ditto.
2362 * testsuite/plugin_final_layout.cc: Name the function sections
2363 to catch reordering issues.
2364
e2458743
AM
23652013-01-15 Alan Modra <amodra@gmail.com>
2366
2367 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2368 plt-thread-safe.
2369
431ed302
AM
23702013-01-15 Alan Modra <amodra@gmail.com>
2371
2372 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2373 * testsuite/Makefile.in: Regenerate.
2374
0ec6429b
AM
23752013-01-14 Alan Modra <amodra@gmail.com>
2376
2377 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2378 * testsuite/Makefile.in: Regenerate.
2379
0bf402d5
ILT
23802013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2381
36af3926 2382 PR bfd/14430
0bf402d5
ILT
2383 Fix mingw gold build with plugins enabled
2384 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2385 * configure.ac: Export DLOPEN_LIBS and add headers check.
2386 * plugin.cc: Handle non-dlfcn case.
2387 * Makefile.in: Regenerate.
2388 * config.in: Regenerate.
2389 * configure: Regenerate.
2390 * testsuite/Makefile.in: Regenerate.
2391
9e9143bc
ST
23922013-01-09 Sriraman Tallam <tmsriram@google.com>
2393
2394 * output.h (sort_attached_input_sections): Change to be public.
2395 * script-sections.cc
2396 (Output_section_definition::set_section_addresses): Sort
2397 attached input sections according to section order before linker
2398 script assigns section addresses.
2399 (Orphan_output_section::set_section_addresses): Sort
2400 attached input sections according to section order before linker
2401 script assigns section addresses.
2402 * Makefile.am (final_layout.sh): Use a simple linker script to
2403 check if section ordering still works.
2404 * Makefile.in: Regenerate.
2405
679af368
ILT
24062013-01-09 Ben Cheng <bccheng@google.com>
2407
2408 * arm.cc (Target_arm::attributes_accept_div): New function.
2409 (Target_arm::attributes_forbid_div): New function.
2410 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2411 attribute using the same new functions as what bfd/elf32_arm.c
2412 does.
2413
3136a00e
CC
24142013-01-07 Cary Coutant <ccoutant@google.com>
2415
2416 PR gold/14993
2417 * output.cc (Output_section::add_input_section): For incremental
2418 updates, don't track input sections that are allocated from patch
2419 space.
2420
f2a6224b
L
24212013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2422 Ian Lance Taylor <iant@google.com>
2423
2424 PR gold/14897
2425 * configure.ac (--enable-ld): Removed.
2426 (install_as_default): Set to yes only for --enable-gold=default
2427 or --disable-ld.
2428 * configure: Regenerated.
2429
4f46f626
L
24302013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2431
2432 * options.h (General_options): Add -fuse-ld= for GCC linker
2433 option compatibility.
2434
26e4ef59
CC
24352013-01-04 Cary Coutant <ccoutant@google.com>
2436
2437 * configure.ac: Fix typo restoring CXXFLAGS.
2438 * configure: Regenerate.
2439
3d587466
CC
24402013-01-04 Cary Coutant <ccoutant@google.com>
2441
4f46f626
L
2442 * testsuite/Makefile.am (CXXLINK_S): New macro.
2443 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2444 * testsuite/Makefile.in: Regenerate.
3d587466 2445
44db6695
L
24462013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2447
2448 * version.cc (print_version): Update copyright year to 2013.
2449
edcac0c1
ILT
24502012-12-20 Ian Lance Taylor <iant@google.com>
2451
2452 * layout.cc (Layout::special_ordering_of_input_section): New
2453 function.
2454 (Layout::layout): If input section requires special ordering, must
2455 sort input sections.
2456 (Layout::make_output_section): May sort .text input sections.
2457 (Layout::is_section_name_prefix_grouped): Remove.
2458 * layout.h (class Layout): Declare
2459 special_ordering_of_input_section. Don't declare
2460 is_section_name_prefix_grouped.
2461 * output.cc (Output_section::add_input_section): Revert last
2462 change.
2463 (Output_section::Input_section_sort::match_file_name): Don't crash
2464 if called on output section data.
2465 (Output_section::Input_section_sort_compare): Sort based on
2466 special ordering.
2467 (Output_section::Input_section_sort_section_order_index_compare):
2468 Revert last patch.
2469 (Output_section::sort_attached_input_sections): Likewise.
2470
28f2a4ac
ST
24712012-12-18 Sriraman Tallam <tmsriram@google.com>
2472
edcac0c1 2473 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2474 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2475 * output.cc (Output_section::add_input_section): Check if section
2476 name contains special prefix. Keep input sections to sort such
2477 sections.
2478 (Output_section::Input_section_sort_section_order_index_compare
2479 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2480 (Output_section::sort_attached_input_sections): Add condition to
2481 Input_section_entry constructor call.
28f2a4ac
ST
2482 * testsuite/Makefile.am (text_section_grouping): New test.
2483 * testsuite/Makefile.in: Regenerate.
2484 * testsuite/text_section_grouping.cc: New file.
2485 * testsuite/text_section_grouping.sh: New file.
2486
5bf135a7
NC
24872012-12-17 Nick Clifton <nickc@redhat.com>
2488
2489 * Makefile.am: Add copyright notice.
2490 * NEWS: Likewise.
2491 * README: Likewise.
2492 * configure.ac: Likewise.
2493 * ftruncate.c: Likewise.
2494 * Makefile.in: Regenerate.
2495
59965708
CC
24962012-12-14 Cary Coutant <ccoutant@google.com>
2497
a4034750
AM
2498 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2499 --no-as-needed flag.
2500 (exception_separate_shared_12_test): Likewise.
2501 (incremental_copy_test): Likewise.
2502 * testsuite/Makefile.in: Regenerate.
59965708 2503
2a77e2ab
CC
25042012-12-14 Cary Coutant <ccoutant@google.com>
2505
2506 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2507 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2508
e3deeb9c
AM
25092012-12-12 Alan Modra <amodra@gmail.com>
2510
2511 * powerpc.cc (class Track_tls): New.
2512 (class Relocate, class Scan): Inherit Track_tls.
2513 (Target_powerpc::Scan::local, global): Track tls optimization
2514 and avoid creating plt entry for __tls_get_addr if all uses
2515 are optimized away.
2516 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2517
d8f5a274
AM
25182012-12-12 Alan Modra <amodra@gmail.com>
2519
2520 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2521 Replace no_toc_optimize with toc_optimize.
2522 * output.h (Output_section::input_sections): Provide non-const variant.
2523 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2524 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2525 accessors.
2526 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2527 (class Sort_toc_sections): New.
2528 (Target_powerpc::do_finalize_sections): Sort toc sections.
2529 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2530
4c8a1de1
RM
25312012-12-10 Roland McGrath <mcgrathr@google.com>
2532
2533 * testsuite/binary_unittest.cc (read_all): New function.
2534 (Sized_binary_test): Use it instead of ::read.
2535 * fileread.cc (do_read): Don't assume pread always reads the whole
2536 amount in a single call.
2537
edc27beb
AM
25382012-12-10 Alan Modra <amodra@gmail.com>
2539
2540 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2541 Set EM_PPC64 or EM_PPC here.
2542 (Target_selector_powerpc::do_recognize): Delete.
2543
906b9150
AM
25442012-12-10 Alan Modra <amodra@gmail.com>
2545
2546 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2547 stub_table_.
2548 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2549
418c15ae
RM
25502012-12-07 Roland McGrath <mcgrathr@google.com>
2551
2552 * testsuite/binary_unittest.cc (Sized_binary_test):
2553 Use open_descriptor rather than ::open.
2554
decdd3bc
AM
25552012-12-07 Alan Modra <amodra@gmail.com>
2556
2557 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2558 typedef and invalid_address constant.
2559 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2560 instantiate constants.
2561
db399005
ILT
25622012-12-06 Roland McGrath <mcgrathr@google.com>
2563
2564 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2565 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2566 * aclocal.m4: Regenerate.
2567 * configure: Regenerate.
2568 * Makefile.in: Regenerate.
2569 * testsuite/Makefile.in: Regenerate.
2570
aba6bc71
AM
25712012-12-07 Alan Modra <amodra@gmail.com>
2572
2573 * options.h (General_options): Add no_toc_optimize.
2574 * powerpc.cc (ok_lo_toc_insn): New function.
2575 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2576
9e69ed50
AM
25772012-12-06 Alan Modra <amodra@gmail.com>
2578
2579 * options.h (General_options): Add plt_align, plt_static_chain,
2580 plt_thread_safe. Update stub_group_size help text.
2581 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2582 for new plt_thread_safe_ var.
2583 (use_plt_offset): Correct comments.
2584 (Target_powerpc::do_relax): Look for thread creation symbols to
2585 determine default plt_thread_safe value. Clear plt call stubs
2586 as well as branch stubs each iteration.
2587 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2588 insn constants.
2589 (l, hi, ha, write_insn): Move earlier.
2590 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2591 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2592 plt stubs too.
2593 (Stub_table::update_size): Adjust.
2594 (Stub_table::prev_size, set_prev_size): Delete.
2595 (Stub_table::stub_align): Let --plt-align affect result.
2596 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2597 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2598 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2599 (Stub_table::do_write): Support more stub variants.
2600
f43ba157
AM
26012012-12-04 Alan Modra <amodra@gmail.com>
2602
2603 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2604 (Target_powerpc::do_define_standard_symbols): New function.
2605
34171bc5
AM
26062012-12-03 Alan Modra <amodra@gmail.com>
2607
2608 * output.h: Formatting, whitespace.
2609
dc9589e9 26102012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2611
2612 * layout.h (Layout::get_executable_sections): Declare.
2613 * layout.cc (Layout::get_executable_sections): New function.
2614 * arm.cc (Target_arm::group_sections): Use it.
2615 (Arm_output_section::group_sections): Delete now redundant test.
2616 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2617 param to handle relative relocs.
2618 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2619 (Output_data_reloc::add_absolute): Adjust.
2620 (Output_data_reloc::add_relative): New function.
2621 (Output_data::reset_data_size): New function.
2622 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2623 (Output_section::set_addralign): New function.
2624 (Output_section::checkpoint_set_addralign): New function.
2625 (Output_section::clear_section_offsets_need_adjustment): New function.
2626 (Output_section::input_sections): Make public.
2627 * powerpc.cc (class Output_data_brlt_powerpc): New.
2628 (class Stub_table, class Stub_control): New.
2629 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2630 stub_table_, set_stub_table, stub_table): New vectors and accessor
2631 functions.
2632 (Target_powerpc::do_may_relax, do_relax, push_branch,
2633 new_stub_table, stub_tables, brlt_section, group_sections,
2634 add_branch_lookup_table, find_branch_lookup_table,
2635 write_branch_lookup_table, make_brlt_section): New functions.
2636 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2637 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2638 branch_info_): New vars.
2639 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2640 make call stubs here.
2641 (Output_data_glink): Remove all call stub handling from this class.
2642 (Target_powerpc::Scan::local, global): Save interesting branch
2643 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2644 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2645 functions on final link.
2646 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2647 Handle long branch destinations too.
2648 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2649 do_plt_address_for_local): Adjust lookup of plt call stubs.
2650
627b30b7
AM
26512012-11-30 Alan Modra <amodra@gmail.com>
2652
2653 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2654 relocs against protected symbols when building 32-bit shared libs.
2655
40b469d7
AM
26562012-11-30 Alan Modra <amodra@gmail.com>
2657
2658 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2659 param. Call got_section() to make .got. Update all callers
2660 and their callers and so on.
2661
bb66a627
AM
26622012-11-30 Alan Modra <amodra@gmail.com>
2663
2664 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2665 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2666 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2667 value if it already exists.
2668
d2cf1c6c
L
26692012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2670
2671 PR gold/14858
2672 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2673
edccdf7c
RM
26742012-11-14 Roland McGrath <mcgrathr@google.com>
2675
2676 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2677 than bfc instruction for data sandboxing.
2678
6febeb74
AM
26792012-11-08 Alan Modra <amodra@gmail.com>
2680
2681 * po/POTFILES.in: Regenerate.
2682
0a6f1bf2
AM
26832012-11-05 Alan Modra <amodra@gmail.com>
2684
2685 * configure.ac: Apply 2012-09-10 change to config.in here.
2686 * configure: Regenerate.
2687
26a4e9cb
AM
26882012-11-05 Alan Modra <amodra@gmail.com>
2689
2690 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2691 (struct Opd_ent): Use "Address" rather than "Offset".
2692 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2693 (Target_powerpc::got_section): Make public.
2694 (Target_powerpc::scan_relocs): Move code setting symbols..
2695 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2696 Create _SDA_BASE_ only when referenced.
2697
cc928013
RM
26982012-11-02 Roland McGrath <mcgrathr@google.com>
2699
2700 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2701 from last change.
2702
50ed5eb1
RM
27032012-11-01 Roland McGrath <mcgrathr@google.com>
2704
62fe925a
RM
2705 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2706 for offset_in_output_section parameter.
2707 (Sized_target::relocate_special_relocatable): Likewise.
2708 * arm.cc (Target_arm::relocate_relocs): Likewise.
2709 (Target_arm::relocate_special_relocatable): Likewise.
2710 * i386.cc (Target_i386::relocate_relocs): Likewise.
2711 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2712 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2713 * target-reloc.h (relocate_relocs): Likewise.
2714 * testsuite/testfile.cc (Target_test): Likewise.
2715 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2716 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2717
2718 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2719 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2720
2721 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2722 parameter, which is unused in the [!F_SETFD] case.
2723
50ed5eb1
RM
2724 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2725 SYMNDX to off_t before comparing it to this->data_size().
2726 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2727 * incremental.cc (Output_section_incremental_inputs::do_write):
2728 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2729
2cadc0bf
RM
2730 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2731
3bfcb652
NC
27322012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2733
2734 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2735 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2736 in EABI_VER5.
2737
c1a8d56e
CC
27382012-10-29 Cary Coutant <ccoutant@google.com>
2739
2740 * dwp.cc (usage): Add file and exit status parameters;
2741 add --help and --version options.
2742 (print_version): New function.
2743 (main): Add --help and --version options.
2744
b2490a7b
L
27452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2746
2747 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2748 final_layout_sequence.txt.
2749 * testsuite/Makefile.in: Regenerated.
2750
aa543512
L
27512012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2752
2753 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2754 COMPILE generated by automake.
2755 (LINK1): Likewise.
2756 (CXXCOMPILE1): Likewise.
2757 (CXXLINK1): Likewise.
2758 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2759 (LINK): Likewise.
2760 (CXXCOMPILE): Likewise.
2761 (CXXLINK): Likewise.
2762 * testsuite/Makefile.in: Regenerated.
2763
d361fafb
L
27642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2765
2766 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2767 on bad fwrite return.
2768
598c7410
L
27692012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2770
2771 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2772 on val.
2773
35c813e2
CC
27742012-10-23 Cary Coutant <ccoutant@google.com>
2775
2776 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2777 * testsuite/Makefile.in: Regenerate.
2778 * testsuite/dwp_test.h: New source file.
2779 * testsuite/dwp_test_1.cc: New source file.
2780 * testsuite/dwp_test_1.s: New source file.
2781 * testsuite/dwp_test_1.sh: New source file.
2782 * testsuite/dwp_test_1b.cc: New source file.
2783 * testsuite/dwp_test_1b.s: New source file.
2784 * testsuite/dwp_test_2.cc: New source file.
2785 * testsuite/dwp_test_2.s: New source file.
2786 * testsuite/dwp_test_2.sh: New source file.
2787 * testsuite/dwp_test_main.cc: New source file.
2788 * testsuite/dwp_test_main.s: New source file.
2789
77429909
CC
27902012-10-23 Cary Coutant <ccoutant@google.com>
2791
2792 * dwp.h: New header file.
2793 * dwp.cc: New source file.
2794 * gold.h: Move shared declarations to system.h.
2795 * system.h: New header file.
2796 * Makefile.am: Add dwp.
2797 * Makefile.in: Regenerate.
2798
ed5d6712
CC
27992012-10-23 Cary Coutant <ccoutant@google.com>
2800
2801 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2802 Dwarf_info_reader::read_from_pointer.
2803 (Dwarf_pubnames_table::read_header): Likewise.
2804 (Dwarf_pubnames_table::next_name): Likewise.
2805 (Dwarf_die::read_attributes): Likewise.
2806 (Dwarf_die::skip_attributes): Likewise.
2807 (Dwarf_info_reader::read_from_pointer): New function template.
2808 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2809 (Dwarf_pubnames_table): Likewise.
2810 (Dwarf_info_reader::read_from_pointer): New function template.
2811 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2812 Dwarf_pubnames_table ctor.
2813
8787852d
CC
28142012-10-23 Cary Coutant <ccoutant@google.com>
2815
2816 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2817 abbrev_shndx.
2818 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2819 abbrev_shndx_.
2820 (Dwarf_info_reader::set_abbrev_shndx): New method.
2821 (Dwarf_info_reader::abbrev_shndx_): New data member.
2822
9fc236f3
CC
28232012-10-23 Cary Coutant <ccoutant@google.com>
2824
2825 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2826 from object, not parameters.
2827 (Dwarf_info_reader::parse): Likewise.
2828 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2829 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2830 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2831 methods.
2832
effe8365
CC
28332012-10-23 Cary Coutant <ccoutant@google.com>
2834
2835 * fileread.cc (Input_file::Input_file): New constructor.
2836 * fileread.h (class Input_file): Add new constructor.
2837
1698990d
AM
28382012-10-18 Alan Modra <amodra@gmail.com>
2839
2840 PR gold/14727
2841 * object.cc (Relobj::is_section_name_included): Also match
2842 .sdata personality section.
2843
168a4726
AM
28442012-10-18 Alan Modra <amodra@gmail.com>
2845
2846 * target-reloc.h (class Default_comdat_behavior): New, package up..
2847 (get_comdat_behaviour): ..this.
2848 (relocate_section): Add Relocate_comdat_behavior template arg,
2849 adjust code to suit.
2850 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2851 (Target_arm::scan_reloc_section): Likewise.
2852 * i386.cc (Target_i386::relocate_section): Likewise.
2853 * sparc.cc (Target_sparc::relocate_section): Likewise.
2854 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2855 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2856 * powerpc.cc (class Relocate_comdat_behavior): New.
2857 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2858 gold::relocate_section with new template arg.
2859
acc276d8
AM
28602012-10-18 Alan Modra <amodra@gmail.com>
2861
2862 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2863 dynamic relocs for GOT_TPREL got entries, without symbol if
2864 resolving locally.
2865 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2866 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2867 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2868
e10f9870
AM
28692012-10-17 Alan Modra <amodra@gmail.com>
2870
2871 PR gold/14726
2872 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2873
ae034989
ST
28742012-10-16 Sriraman Tallam <tmsriram@google.com>
2875
2876 * layout.cc (Layout::include_section): Keep sections marked
2877 SHF_EXCLUDE when doing relocatable links.
2878
f3a0ed29
AM
28792012-10-16 Alan Modra <amodra@gmail.com>
2880
2881 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2882 (Target_powerpc::do_finalize_sections): Call it.
2883 (Output_data_save_res): New class and supporting functions.
2884 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2885 normal symbols defined in object files.
2886
c6de8ed4
AM
28872012-10-12 Alan Modra <amodra@gmail.com>
2888
2889 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2890 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2891 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2892 section if scan_opd_relocs not yet called.
2893 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2894
03e25981
AM
28952012-10-12 Alan Modra <amodra@gmail.com>
2896
2897 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2898 add_local_ifunc_entry): Revert last change.
2899 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2900
c9824451
AM
29012012-10-05 Alan Modra <amodra@gmail.com>
2902
2903 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2904 do_plt_address_for_global): New functions.
2905 (Output_data_got_powerpc::do_write): Don't segfault when linking
2906 statically.
2907 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2908 add_local_ifunc_entry): Return true on adding entry..
2909 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2910 glink->add_entry call. Remove unused symtab param. Adjust calls.
2911 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2912 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2913 set up symbols here.
2914 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2915 syms here. Do so even when no .iplt. Don't segfault when linking
2916 statically.
2917 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2918 new variants without reloc param.
2919 (Glink_sym_ent::Glink_sym_ent): Likewise.
2920 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2921 reloc when refs will resolve to plt call stub.
2922 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2923 R_PPC_PLTREL24 to resolve locally.
2924 (Target_powerpc::Scan::global): Correct ifunc handling.
2925 (Target_powerpc::Relocate::relocate): Correct local sym glink
2926 lookup. Don't destroy "value" when we have a plt call stub,
2927 and when checking plt call validity.
2928 (Target_powerpc::do_dynsym_value): Simplify.
2929
19fec8c1
AM
29302012-10-05 Alan Modra <amodra@gmail.com>
2931
2932 * i386.cc (Output_data_plt_i386::address_for_global,
2933 address_for_local): Add plt offset to returned value. Adjust uses.
2934 * sparc.cc (Output_data_plt_sparc::address_for_global,
2935 address_for_local): Likewise.
2936 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2937 address_for_local): Likewise.
2938 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2939 address_for_local): Likewise.
2940 * target.h (Target::plt_address_for_global, plt_address_for_local):
2941 Update comment.
2942 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2943 (Output_data_got::Got_entry::write): Nor here.
2944 * output.h: Comment fix.
2945
e867b647
WL
29462012-10-02 Jiong Wang <jiwang@tilera.com>
2947
2948 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2949 global_offset_table_ value for larget got.
2950 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2951
e5d5f5ed
AM
29522012-09-29 Alan Modra <amodra@gmail.com>
2953
2954 * powerpc.cc (Target_powerpc::iplt_): New output section.
2955 (Target_powerpc::iplt_section, make_iplt_section,
2956 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2957 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2958 Target_powerpc::plt_entry_count): Count iplt entries too.
2959 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2960 reloc section in constructor. New params.
2961 (Target_powerpc::make_plt_section): Create reloc section here instead.
2962 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2963 functions.
2964 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2965 (Output_data_glink::add_entry, find_entry): New functions to
2966 deal with local syms.
2967 (Glink_sym_ent): Add support for local syms.
2968 (Output_data_glink::do_write): Handle ifunc plt entries.
2969 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2970 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2971 (Target_powerpc::Relocate::relocate): Likewise.
2972 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2973
ec4dbad3
AM
29742012-09-25 Alan Modra <amodra@gmail.com>
2975
2976 * object.h (Sized_relobj_file::adjust_local_symbol,
2977 do_adjust_local_symbol): New functions.
2978 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2979 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2980 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2981 and irregular opd entry spacing.
2982 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2983 (Global_symbol_visitor_opd): New functor.
2984 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2985 on deleted opd entries.
2986
5c0b3823
WL
29872012-09-15 Jiong Wang <jiwang@tilera.com>
2988
2989 * tilegx.cc: New file.
2990 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2991 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2992 * configure.tgt: Add entries for tilegx*.
2993 * configure.ac: Likewise.
2994 * Makefile.in: Rebuild.
2995 * configure: Likewise.
2996 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2997 tilegx.
2998
bfdfa4cd
AM
29992012-09-13 Alan Modra <amodra@gmail.com>
3000
3001 * target-reloc.h (scan_relocs): Call scan.local for relocs
3002 against symbols in discarded sections. Pass is_discarded
3003 param.
3004 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3005 Add is_discarded param.
3006 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3007 is_discarded to flag opd entry as discarded. Don't emit dyn
3008 relocs on such entries.
3009 (Target_powerpc::Scan::global): Similarly detect and handle
3010 such opd entries.
3011 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3012 opd_ent_. Update all uses.
3013 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3014 (Target_powerpc::relocate_section): Zero out discarded opd
3015 entry relocs.
3016
d77a0555
ILT
30172012-09-12 Ian Lance Taylor <iant@google.com>
3018
3019 PR gold/14570
3020 * output.cc: Rename Output_data_got template parameter from size
3021 to got_size for all functions. Compile all variants of
3022 Output_data_got.
3023 (Output_data_got::Got_entry::write): Correct use of size for
3024 symbol value. Use local_is_tls rather than casting to
3025 Sized_relobj_file.
3026 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3027 (class Sized_relobj_file): Add do_local_is_tls.
3028 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3029
815a1205
AM
30302012-09-11 Alan Modra <amodra@gmail.com>
3031
3032 PR gold/14566
3033 * layout.cc (Layout::set_segment_offsets): When using
3034 common-page-size alignment, ensure we are on a new max-page-size
3035 page.
3036 * output.cc (Output_segment::set_section_addresses): Use
3037 abi_pagesize, not common_pagesize for relro boundary.
3038 (Output_segment::set_offset): Likewise.
3039
bd73a62d
AM
30402012-09-11 Alan Modra <amodra@gmail.com>
3041
3042 * output.h (Output_data_got::add_global_tls, add_local_tls,
3043 add_local_tls_pair): New functions.
3044 (Output_data_got::add_local_pair_with_rel): Remove second
3045 reloc param. Expand comment.
3046 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3047 use_plt_or_tls_offset_, similarly for constructor param.
3048 (Output_data_got::Got_entry::write): Add got_index param.
3049 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3050 add_local_tls_pair): New functions.
3051 (Output_data_got::Got_entry::write): Handle tls symbols
3052 with use_plt_or_tls_offset_ set specially.
3053 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3054 (Output_data_got::do_write): Replace iterator with index, pass
3055 index to entry write function.
3056 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3057 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3058 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3059 call.
3060 * i386.cc (Target_i386::Scan::local): Likewise.
3061 * sparc.cc (Target_sparc::Scan::local): Likewise.
3062 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3063 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3064 do_tls_offset_for_global): New functions.
3065 (Target_powerpc::Scan::local): Correct TLS relocations and got
3066 entry values.
3067 (Target_powerpc::Scan::global): Don't emit unnecessary
3068 dynamic relocations on TLS GOT entries.
3069
00716ab1
AM
30702012-09-10 Matthias Klose <doko@ubuntu.com>
3071
3072 * config.in: Disable sanity check for kfreebsd.
3073
c891b3f9
SA
30742012-09-10 Sterling Augustine <saugustine@google.com>
3075
3076 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3077 (Gdb_index::pubtypes_read): New parameter.
3078 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3079 to calls.
3080 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3081 pubtypes_object_.
3082
e81fea4d
AM
30832012-09-09 Alan Modra <amodra@gmail.com>
3084
3085 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3086 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3087 * gc.h (gc_process_relocs): Call target gc_add_reference.
3088 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3089 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3090 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3091 unnecessary cast.
3092 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3093 to cater for when we don't need code offset. Update use.
3094 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3095 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3096 set_opd_valid): New functions.
3097 (Target_powerpc::do_gc_add_reference): New function.
3098 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3099 stashed refs.
3100 (Target_powerpc::do_gc_mark_symbol): New function.
3101
d2d60eef
CC
31022012-09-06 Cary Coutant <ccoutant@google.com>
3103
3104 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3105 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3106 (Dwarf_die::skip_attributes): Likewise.
3107 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3108 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3109 (main): Call it.
3110 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3111
32ed4573
L
31122012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3113
3114 * testsuite/script_test_3.t: Add .got.plt output section
3115 statement.
3116 * testsuite/script_test_4.t: Likewise.
3117
f4baf0d4
AM
31182012-09-05 Alan Modra <amodra@gmail.com>
3119
3120 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
3121 update all uses and lose "enum" when using type.
3122
864a1b56
AM
31232012-09-05 Alan Modra <amodra@gmail.com>
3124
3125 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
3126 * configure: Regenerate.
3127 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
3128 (plugin_final_layout.stdout): Likewise.
3129 (memory_test): Set page sizes to 0x1000.
3130 * testsuite/Makefile.in: Regenerate.
3131 * testsuite/discard_locals_test.sh: Add FIXME comment.
3132 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
3133 * testsuite/pr14265.t: Add .got output section statement.
3134 * testsuite/script_test_2.t: Likewise.
3135 * testsuite/script_test_3.t: Likewise.
3136 * testsuite/script_test_4.t: Likewise.
3137 * testsuite/script_test_5.t: Likewise.
3138 * testsuite/script_test_6.t: Likewise.
3139 * testsuite/script_test_7.t: Likewise.
3140 * testsuite/script_test_9.t: Likewise.
3141
3ea0a085
AM
31422012-09-05 Alan Modra <amodra@gmail.com>
3143
3144 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
3145 (Powerpc_relocate_functions::Status): New typedef.
3146 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3147 (Target_powerpc::Scan::local): Handle REL64.
3148 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
3149 for REL32 and REL64.
3150 (Target_powerpc::symval_for_branch): New function, extracted from..
3151 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
3152 checks. Report overflow errors.
3153
7404fe1b
AM
31542012-09-05 Alan Modra <amodra@gmail.com>
3155
3156 * object.h (Sized_relobj_file::emit_relocs): Delete.
3157 (Sized_relobj_file::emit_relocs_reltype): Delete.
3158 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
3159 relocate_relocs for --emit-relocs.
3160 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
3161 * output.h: Update comment.
3162 (Output_segment::first_section): New function.
3163 (Output_segment::first_section_load_address): Use first_section.
3164 * output.cc (Output_segment::first_section): New function extracted..
3165 (Output_segment::first_section_load_address): ..from here. Delete.
3166 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
3167 * target.h (Sized_target::relocate_for_relocatable): Likewise.
3168 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
3169 adjust call to target.h function.
3170 * i386.cc (Target_i386): Likewise.
3171 * sparc.cc (Target_sparc): Likewise.
3172 * x86_64.cc (Target_x86_64): Likewise.
3173 * powerpc.cc (Target_powerpc): Likewise.
3174 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
3175 first tls section has section symbol for optimised local dynamic
3176 output relocs.
3177 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
3178 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
3179 optimised tls code.
3180 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
3181 Rename to relocate_relocs. Update error message.
3182
957564c9
AS
31832012-09-04 Andreas Schwab <schwab@linux-m68k.org>
3184
3185 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
3186 --just-symbols.
3187
dd93cd0a
AM
31882012-08-31 Alan Modra <amodra@gmail.com>
3189
3190 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
3191 (Powerpc_relobj::toc_base_offset): New stub function.
3192 (Target_powerpc): Add tp_offset, dtp_offset. Rename
3193 got_mod_index_offset to tlsld_got_offset. Update all refs.
3194 (Target_powerpc::Relocate::enum skip_tls): New.
3195 (Target_powerpc::call_tls_get_addr_): New var.
3196 (Target_powerpc::is_branch_reloc): Move to file scope.
3197 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
3198 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
3199 New functions.
3200 (Target_powerpc::enum Got_type): Delete old values, add new ones.
3201 (powerpc_info): Correct common_pagesize for ppc64.
3202 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
3203 (Powerpc_relocate_functions): Add overflow check enums and functions.
3204 Add non-shift version of rela, rela_ua. Delete all rel public
3205 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
3206 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
3207 addr16_ha3, addr14 functions.
3208 (Output_data_got_powerpc::add_constant_pair): New function.
3209 (Output_data_got_powerpc::got_base_offset): Likewise.
3210 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
3211 (instruction constants): Sort, add some more.
3212 (Output_data_glink::do_write): Add and use Address typedef. Use
3213 object->toc_base_offset() stub for 64-bit.
3214 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
3215 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3216 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
3217 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
3218 Always treat .opd relocs as against locally defined symbol.
3219 Correct condition for RELATIVE relocs.
3220 (Target_powerpc::do_finalize_sections): Test for NULL sections.
3221 (Target_powerpc::Relocate::relocate): Use plt call stub as value
3222 for 32-bit syms with a plt entry. Correct ppc64 toc base
3223 calculations. Handle TLS relocs, and more. Add overflow
3224 checking and adjust for Powerpc_relocate_functions changes.
3225 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
3226 Reinstate --emit-relocs code with FIXME.
3227
a1373b60
AM
32282012-08-30 Alan Modra <amodra@gmail.com>
3229
3230 * layout.cc (Layout::set_segment_offsets): Set p_align to
3231 abi_pagesize, not common_pagesize.
3232 (Layout::relaxation_loop_body): Similarly use abi_pagesize
3233 to determine whether file header can go in segment.
3234
703d02da
AM
32352012-08-30 Alan Modra <amodra@gmail.com>
3236
3237 * output.h (Output_reloc::Output_reloc <output section>): Add
3238 is_relative param. Adjust calls.
3239 (Output_reloc::add_output_section_relative): New functions.
3240 * output.cc (Output_reloc::Output_reloc <output section>): Handle
3241 is_relative.
3242 (Output_reloc::symbol_value): Handle SECTION_CODE.
3243
16164a6b
ST
32442012-08-24 Sriraman Tallam <tmsriram@google.com>
3245
3246 * gold.cc (queue_middle_tasks): Call layout again when unique
3247 segments for sections is desired.
3248 * layout.cc (Layout::Layout): Initialize new members.
3249 (Layout::get_output_section_flags): New function.
3250 (Layout::choose_output_section): Call get_output_section_flags.
3251 (Layout::layout): Make output section for mapping to a unique segment.
3252 (Layout::insert_section_segment_map): New function.
3253 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 3254 output sections marked so.
16164a6b
ST
3255 (Layout::segment_precedes): Check for unique segments when sorting.
3256 * layout.h (Layout::Unique_segment_info): New struct.
3257 (Layout::Section_segment_map): New typedef.
3258 (Layout::insert_section_segment_map): New function.
3259 (Layout::get_output_section_flags): New function.
3260 (Layout::is_unique_segment_for_sections_specified): New function.
3261 (Layout::set_unique_segment_for_sections_specified): New function.
3262 (Layout::unique_segment_for_sections_specified_): New member.
3263 (Layout::section_segment_map_): New member.
3264 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
3265 Rename is_gc_pass_one to is_pass_one.
3266 Rename is_gc_pass_two to is_pass_two.
3267 Rename is_gc_or_icf to is_two_pass.
3268 Check for which pass based on whether symbols data is present.
3269 Make it two pass when unique segments for sections is desired.
3270 * output.cc (Output_section::Output_section): Initialize new
3271 members.
3272 * output.h (Output_section::is_unique_segment): New function.
3273 (Output_section::set_is_unique_segment): New function.
3274 (Output_section::is_unique_segment_): New member.
3275 (Output_section::extra_segment_flags): New function.
3276 (Output_section::set_extra_segment_flags): New function.
3277 (Output_section::extra_segment_flags_): New member.
3278 (Output_section::segment_alignment): New function.
3279 (Output_section::set_segment_alignment): New function.
3280 (Output_section::segment_alignment_): New member.
3281 (Output_segment::Output_segment): Initialize is_unique_segment_.
3282 (Output_segment::is_unique_segment): New function.
3283 (Output_segment::set_is_unique_segment): New function.
3284 (Output_segment::is_unique_segment_): New member.
3285 * plugin.cc (allow_unique_segment_for_sections): New function.
3286 (unique_segment_for_sections): New function.
3287 (Plugin::load): Add new functions to transfer vector.
3288 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
3289 * Makefile.in: Regenerate.
3290 * testsuite/plugin_final_layout.sh: Check if unique segment
3291 functionality works.
3292 * testsuite/plugin_section_order.c (onload): Check if new interfaces
3293 are available.
3294 (allow_unique_segment_for_sections): New global.
3295 (unique_segment_for_sections): New global.
3296 (claim_file_hook): Call allow_unique_segment_for_sections.
3297 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 3298
1e2bee4f
CC
32992012-08-22 Cary Coutant <ccoutant@google.com>
3300
3301 * layout.cc (Layout::include_section): Don't assert on GROUP
3302 sections with --emit-relocs.
3303
1d5dfe78
CC
33042012-08-21 Cary Coutant <ccoutant@google.com>
3305
3306 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
3307 if --export-dynamic-symbol names an undef symbol.
3308
c9269dff
AM
33092012-08-18 Alan Modra <amodra@gmail.com>
3310
3311 * powerpc.cc: Formatting and white space.
3312 (Powerpc_relobj): Rename got2_section_ to special_.
3313 Add opd_ent_shndx_ and opd_ent_off_ vectors.
3314 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
3315 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
3316 (Target_powerpc): Add Address typedef and invalid_address. Use
3317 throughout.
3318 (Target_powerpc::is_branch_reloc): New function.
3319 (Powerpc_relocate_functions): Add Address typedef, use throughout.
3320 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
3321 for dst_mask, value and addend.
3322 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
3323 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
3324 (Output_data_glink::do_write): Correct toc base. Don't try to use
3325 uint16_t for 24-bit offset. Use get_output_section_offset and
3326 check return.
3327 (Target_powerpc::Scan::local): Handle more relocs.
3328 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
3329 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
3330 Plug in toc restoring insn after plt calls. Translate branches
3331 to function descriptor symbols to corresponding entry point.
3332 (Target_powerpc::relocate_for_relocatable): Check return from
3333 get_output_section_offset.
3334 * symtab.h: Comment typo.
3335
b1759dce
ILT
33362012-08-14 Ian Lance Taylor <iant@google.com>
3337
3338 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
3339 unsupported_relocal_local to call unsupported_reloc_global.
3340
b9b2ae8b
NC
33412012-08-14 Nick Clifton <nickc@redhat.com>
3342
3343 PR ld/14265
3344 * script-sections.cc (Sections_element::output_section_name): Add
3345 keep return parameter.
3346 (Output_section_element::match_name): Add keep return parameter.
3347 Return the value of the keep_ member.
3348 * script-sections.h (class Output_section): Update
3349 output_section_name prototype.
3350 * layout.cc (Layout::keep_input_section): New public member
3351 function.
3352 (Layout::choose_output_section): Pass keep parameter to
3353 output_section_name.
3354 * layout.h (class Layout): Add keep_input_section.
3355 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3356 sections.
3357 * testsuite/Makefile.am: Add a test.
3358 * testsuite/Makefile.in: Regenerate.
3359 * testsuite/pr14265.c: Source file for the test.
3360 * testsuite/pr14265.t: Linker script for the test.
3361 * testsuite/pr14265.sh: Shell script for the test.
3362
921b5322
AM
33632012-08-14 Alan Modra <amodra@gmail.com>
3364
3365 * target.h (Target::output_section_name): New function.
3366 (Target::do_output_section_name): New function.
3367 * layout.cc (Layout::choose_output_section): Call the above.
3368 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3369
6ce78956
AM
33702012-08-14 Alan Modra <amodra@gmail.com>
3371
3372 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3373 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3374 for replace_constant call.
3375 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3376 (Output_data_glink::do_print_to_mapfile): New function.
3377 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3378 (Target_powerpc::Relocate::relocate): Likewise.
3379
d1a8cabd
AM
33802012-08-14 Alan Modra <amodra@gmail.com>
3381
3382 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3383 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3384 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3385 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3386 all references to shndx_. Handle special case for R_PPC_PLTREL24
3387 here.
3388 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3389 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3390 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3391 here.
3392 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3393 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3394
d83ce4e3
AM
33952012-08-12 Alan Modra <amodra@gmail.com>
3396
3397 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3398 (glink insn constants): Use uint32_t.
3399 (Output_data_glink::add_entry): Use insert, not [] operator.
3400
cf43a2fe
AM
34012012-08-11 Alan Modra <amodra@gmail.com>
3402
3403 * object.h (Sized_relobj_file::find_shdr): New function.
3404 (Sized_relobj_file::find_special_sections): New function.
3405 * object.cc (Sized_relobj_file::find_shdr): New function.
3406 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3407 (Sized_relobj_file::find_special_sections): New function, split out..
3408 (Sized_relobj_file::do_read_symbols): ..from here.
3409 * output.h (Output_data_got::replace_constant): New function.
3410 (Output_data_got::num_entries): New function.
3411 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3412 (Output_data_got::got_offset): Protected rather than private.
3413 (Output_data_got::replace_got_entry): New function.
3414 * output.cc (Output_data_got::replace_got_entry): New function.
3415 * powerpc.cc (class Powerpc_relobj): New.
3416 (class Powerpc_relocate_functions): Delete all psymval variants or
3417 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3418 Implement _ha functions using corresponding _hi function.
3419 (Powerpc_relobj::find_special_sections): New function.
3420 (Target_powerpc::do_make_elf_object): New function.
3421 (class Output_data_got_powerpc): New.
3422 (class Output_data_glink): New.
3423 (class Powerpc_scan_relocatable_reloc): New.
3424 Many more changes througout file.
3425
3c892704
NC
34262012-08-09 Nick Clifton <nickc@redhat.com>
3427
3428 * po/vi.po: Updated Vietnamese translation.
3429
82435b3b
ILT
34302012-08-07 Ian Lance Taylor <iant@google.com>
3431
3432 * layout.cc (Layout::add_target_dynamic_tags): If
3433 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3434 plt_rel.
3435
a6dc81d2
NC
34362012-07-30 Nick Clifton <nickc@redhat.com>
3437
3438 * po/gold.pot: Updated template.
3439 * po/es.po: Updated Spanish translation.
3440
f1415016
CC
34412012-07-18 Cary Coutant <ccoutant@google.com>
3442
3443 PR gold/14344
3444 * configure.ac: Add check for -gpubnames support.
3445 * configure: Regenerate.
3446 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3447 support; force -gno-pubnames.
3448 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3449 support.
3450 (gdb_index_test_4): New test.
3451 * testsuite/Makefile.in: Regenerate.
3452 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3453 * testsuite/gdb_index_test_2.sh: Likewise.
3454 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3455 * testsuite/gdb_index_test_4.sh: New script.
3456 * testsuite/gdb_index_test_comm.sh: New script with common code;
3457 don't look for space after colon.
3458
b7fd7c37
ST
34592012-07-16 Sriraman Tallam <tmsriram@google.com>
3460
3461 * gold.cc (queue_middle_tasks): Update function order only after
3462 deferred objects due to plugins are processed.
3463
1f3212db
ILT
34642012-07-11 Ian Lance Taylor <iant@google.com>
3465
3466 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3467 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3468 (Target_arm::scan_reloc_for_stub): Likewise.
3469 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3470 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3471 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3472 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3473 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3474
81c82a68
ILT
34752012-07-10 Dodji Seketeli <dodji@redhat.com>
3476 Ian Lance Taylor <iant@google.com>
3477
3478 PR gold/14309
3479 * configure.ac: Test whether std::tr1::hash<off_t> works.
3480 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3481 needed.
3482 * output.h (class Output_fill): Add virtual destructor.
3483 * configure, config.in: Rebuild.
3484
eabc84f4
RM
34852012-06-22 Roland McGrath <mcgrathr@google.com>
3486
3487 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3488
370e30b6
RÁE
34892012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3490
3491 * plugin.cc (Plugin::load): Handle position independent executables.
3492
fb1b895d
CC
34932012-06-06 Cary Coutant <ccoutant@google.com>
3494
3495 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3496 add .debug_macro.
3497 (lines_only_debug_sections): Likewise.
3498 (gdb_fast_lookup_sections): New static array.
3499 (is_gdb_debug_section): Rename formal parameter.
3500 (is_lines_only_debug_section): Likewise.
3501 (is_gdb_fast_lookup_section): New function.
3502 (Layout::include_section): Check for ".zdebug_" prefix; pass
3503 section name suffix to is_gdb_debug_section, et al.; check for
3504 fast-lookup sections when building .gdb_index.
3505 * options.h (--strip-debug-gdb): Update GDB version number.
3506
7c0640fa
CC
35072012-06-06 Cary Coutant <ccoutant@google.com>
3508
3509 * configure.ac: Add check for fallocate.
3510 * configure: Regenerate.
3511 * config.in: Regenerate.
3512
3513 * options.h (class General_options): Add --mmap-output-file and
3514 --posix-fallocate options.
3515 * output.cc: (posix_fallocate): Remove; replace with...
3516 (gold_fallocate): New function.
3517 (Output_file::map_no_anonymous): Call gold_fallocate.
3518 (Output_file::map): Check --mmap-output-file option.
3519
2a49eb69
DK
35202012-06-05 Jing Yu <jingyu@google.com>
3521
3522 * gold.h (textdomain): Add do {} to empty while(0).
3523 (bindtextdomain): Likewise.
3524
fad072ac
CC
35252012-06-04 Cary Coutant <ccoutant@google.com>
3526
3527 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3528 has_dynsym_index.
3529
8cc69fb6
ST
35302012-05-25 Sriraman Tallam <tmsriram@google.com>
3531
3532 * symtab.cc (Symbol_table::define_special_symbol):
3533 Initialize *poldsym to prevent uninitialized variable errors.
3534
1be75daa
CC
35352012-05-23 Cary Coutant <ccoutant@google.com>
3536
3537 * layout.cc (Layout::section_name_mapping): Add rules to handle
3538 exact match on .data.rel.ro.local or .data.rel.ro.
3539 (Layout::output_section_name): Check for exact matches.
3540
9b689de0
CC
35412012-05-23 Cary Coutant <ccoutant@google.com>
3542
3543 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3544 more carefully.
3545
b24fdbf5
CC
35462012-05-22 Cary Coutant <ccoutant@google.com>
3547
3548 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3549 object before exporting symbol.
3550
e550e1a2
L
35512012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3552
3553 * testsuite/tls_test.cc: Include "config.h" first.
3554 * testsuite/tls_test_c.c: Likewise.
3555
df7b86aa
NC
35562012-05-17 Daniel Richard G. <skunk@iskunk.org>
3557 Nick Clifton <nickc@redhat.com>
3558
3559 PR 14072
3560 * configure.in: Add check that sysdep.h has been included before
3561 any system header files.
3562 * configure: Regenerate.
3563 * config.in: Regenerate.
3564
1007b503
CC
35652012-05-14 Cary Coutant <ccoutant@google.com>
3566
3567 * layout.cc (Layout::make_output_section): Mark .tdata section
3568 as RELRO.
3569 * testsuite/relro_test.cc: Add a TLS variable.
3570
fd885f3a
L
35712012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3572
3573 PR gold/14091
3574 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3575 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3576 R_X86_64_64.
3577
80f5885c
CC
35782012-05-08 Cary Coutant <ccoutant@google.com>
3579
3580 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3581 (lines_only_debug_sections): Likewise.
3582
2e702c99
RM
35832012-05-02 Roland McGrath <mcgrathr@google.com>
3584
3585 * nacl.cc: New file.
3586 * nacl.h: New file.
3587 * Makefile.am (CCFILES, HFILES): Add them.
3588 * Makefile.in: Regenerate.
3589 * i386.cc (Output_data_plt_i386_nacl): New class.
3590 (Output_data_plt_i386_nacl_exec): New class.
3591 (Output_data_plt_i386_nacl_dyn): New class.
3592 (Target_i386_nacl): New class.
3593 (Target_selector_i386_nacl): New class.
3594 (target_selector_i386): Use it instead of Target_selector_i386.
3595 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3596 (Target_x86_64_nacl): New class.
3597 (Target_selector_x86_64_nacl): New class.
3598 (target_selector_x86_64, target_selector_x32): Use it instead of
3599 Target_selector_x86_64.
3600 * arm.cc (Output_data_plt_arm_nacl): New class.
3601 (Target_arm_nacl): New class.
3602 (Target_selector_arm_nacl): New class.
3603 (target_selector_arm, target_selector_armbe): Use it instead of
3604 Target_selector_arm.
3605
3606 * target-select.cc (select_target): Take new Input_file* and off_t
3607 arguments, pass them on to recognize method of selector.
3608 * object.cc (make_elf_sized_object): Update caller.
3609 * parameters.cc (parameters_force_valid_target): Likewise.
3610 * incremental.cc (make_sized_incremental_binary): Likewise.
3611 * target-select.h: Update decl.
3612 (Target_selector::recognize): Take new Input_file* argument,
3613 pass it on to do_recognize.
3614 (Target_selector::do_recognize): Take new Input_file* argument.
3615 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3616 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3617 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3618 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3619
3620 * target.h (Target::Target_info): New members isolate_execinstr
3621 and rosegment_gap.
3622 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3623 * arm.cc (Target_arm::arm_info): Update initializer.
3624 * i386.cc (Target_i386::i386_info): Likewise.
3625 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3626 * sparc.cc (Target_sparc::sparc_info): Likewise.
3627 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3628 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3629 * layout.cc (Layout::attach_allocated_section_to_segment):
3630 Take new const Target* argument. If target->isolate_execinstr(), act
3631 like --rosegment.
3632 (Layout::find_first_load_seg): Take new const Target* argument;
3633 if target->isolate_execinstr(), reject PF_X segments.
3634 (Layout::relaxation_loop_body): Update caller.
3635 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3636 reset file offset to zero when we hit LOAD_SEG, and then do a second
3637 loop over the segments before LOAD_SEG to reassign offsets after
3638 addresses have been determined. Handle target->rosegment_gap().
3639 (Layout::attach_section_to_segment): Take new const Target* argument;
3640 pass it to attach_allocated_section_to_segment.
3641 (Layout::make_output_section): Update caller.
3642 (Layout::attach_sections_to_segments): Take new const Target* argument;
3643 pass it to attach_section_to_segment.
3644 * gold.cc (queue_middle_tasks): Update caller.
3645 * layout.h (Layout): Update method decls with new arguments.
3646
3647 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3648 Target_info pointer to use.
3649 (Target_arm::do_make_data_plt): New virtual method.
3650 (Target_arm::make_data_plt): New method that calls it.
3651 (Target_arm::make_plt_entry): Use it.
3652 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3653 for the section alignment.
3654 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3655 method.
3656 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3657 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3658 method.
3659 (Output_data_plt_arm::get_plt_entry_size): Call it.
3660 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3661 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3662 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3663 method.
3664 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3665 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3666 method instead of sizeof(plt_entry).
3667 (Output_data_plt_arm::add_entry): Likewise.
3668 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3669 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3670 than static method.
3671 (Target_arm::plt_entry_size): Likewise.
3672 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3673 Move to ...
3674 (Output_data_plt_arm_standard): ... here, new class.
3675 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3676 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3677 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3678
3679 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3680 Take additional argument for the PLT entry size.
3681 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3682 Use get_plt_entry_size method rather than plt_entry_size variable.
3683 (Output_data_plt_x86_64::reserve_slot): Likewise.
3684 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3685 (Output_data_plt_x86_64::add_entry): Likewise.
3686 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3687 (Output_data_plt_x86_64::address_for_global): Likewise.
3688 (Output_data_plt_x86_64::address_for_local): Likewise.
3689 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3690 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3691 Make method non-static.
3692 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3693 method.
3694 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3695 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3696 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3697 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3698 virtual method.
3699 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3700 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3701 virtual method.
3702 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3703 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3704 virtual method.
3705 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3706 (Output_data_plt_x86_64::plt_entry_size)
3707 (Output_data_plt_x86_64::first_plt_entry)
3708 (Output_data_plt_x86_64::plt_entry)
3709 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3710 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3711 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3712 (Output_data_plt_x86_64_standard): ... here, new class.
3713 (Target_x86_64::Target_x86_64): Take optional argument for the
3714 Target_info pointer to use.
3715 (Target_x86_64::do_make_data_plt): New virtual method.
3716 (Target_x86_64::make_data_plt): New method to call it.
3717 (Target_x86_64::init_got_plt_for_update): Use that.
3718 Call this->plt_->add_eh_frame method here.
3719 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3720 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3721 rather than static method.
3722 (Target_x86_64::plt_entry_size): Likewise.
3723 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3724 rather than plt_entry_size variable. Move guts of PLT filling to...
3725 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3726 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3727 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3728
3729 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3730 additional argument for the section alignment.
3731 Don't do add_eh_frame_for_plt here.
3732 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3733 non-static. Use get_plt_entry_size method rather than plt_entry_size
3734 variable.
3735 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3736 method.
3737 (Output_data_plt_i386::get_plt_entry_size): Call it.
3738 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3739 (Output_data_plt_i386::add_eh_frame): New method to call it.
3740 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3741 method.
3742 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3743 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3744 method.
3745 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3746 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3747 method instead of plt_entry_size.
3748 (Output_data_plt_i386::plt_entry_size)
3749 (Output_data_plt_i386::plt_eh_frame_fde_size)
3750 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3751 (Output_data_plt_i386_standard): ... here, new class.
3752 (Output_data_plt_i386_exec): New class.
3753 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3754 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3755 (Output_data_plt_i386::exec_plt_entry): Move to ...
3756 (Output_data_plt_i386_exec::plt_entry): ... here.
3757 (Output_data_plt_i386_dyn): New class.
3758 (Output_data_plt_i386::first_plt_entry): Move to ...
3759 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3760 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3761 (Output_data_plt_i386_dyn::plt_entry): ... here.
3762 (Target_i386::Target_i386): Take optional argument for the Target_info
3763 pointer to use.
3764 (Target_i386::do_make_data_plt): New virtual method.
3765 (Target_i386::make_data_plt): New method to call it.
3766 (Target_i386::make_plt_section): Use that.
3767 Call this->plt_->add_eh_frame method here.
3768 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3769 rather than plt_entry_size variable.
3770 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3771 (Output_data_plt_i386::address_for_local): Likewise.
3772 (Output_data_plt_i386::do_write): Likewise.
3773 Move guts of PLT filling to...
3774 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3775 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3776 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3777 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3778
b9b9f2ee
CC
37792012-05-01 Cary Coutant <ccoutant@google.com>
3780
3781 * dwarf_reader.cc (Dwarf_die::read_attributes)
3782 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3783 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3784 * reduced_debug_output.cc
3785 (Output_reduced_debug_info_section::get_die_end): Remove
3786 DW_FORM_GNU_ref_index. Add default case.
3787
57923f48
MW
37882012-04-26 Mark Wielaard <mjw@redhat.com>
3789
3790 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3791 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3792 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3793 DW_AT_high_pc as offset from DW_AT_low_pc.
3794
3795 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3796 * testsuite/Makefile.in: Regenerate.
3797 * testsuite/gdb_index_test_3.c: New test source file.
3798 * testsuite/gdb_index_test_3.sh: New test source file.
3799
2c54b4f4
ILT
38002012-04-25 Ian Lance Taylor <iant@google.com>
3801
3802 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3803 pointer.
3804 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3805 as a class, not a struct.
3806 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3807 (Target_arm::apply_cortex_a8_workaround): Likewise.
3808 * gc.h: Declare Reloc_types as a struct, not a class.
3809 * object.h: Declare Symbols_data as a struct.
3810 * reloc.h: Declare Read_relocs_data as a struct.
3811 * target.h: Declare Relocate_info as a struct.
3812
a5a5f7a3
DM
38132012-04-24 David S. Miller <davem@davemloft.net>
3814
3815 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3816 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3817 and R_SPARC_WPLT30.
3818
f038d496
CC
38192012-04-24 Cary Coutant <ccoutant@google.com>
3820
3821 * incremental-dump.cc (find_input_containing_global): Replace
3822 magic number with symbolic constant.
3823 (dump_incremental_inputs): Update version number.
3824 * incremental.cc (Output_section_incremental_inputs): Update version
3825 number; import symbolic constants from Incremental_inputs_reader.
3826 (Incremental_inputs::create_data_sections): Align relocations
3827 section correctly for 64-bit targets.
3828 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3829 constants; add padding.
3830 (Output_section_incremental_inputs::write_header): Add assert for
3831 header_size.
3832 (Output_section_incremental_inputs::write_input_files): Add assert
3833 for input_entry_size.
3834 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3835 add assert for object_info_size, input_section_entry_size,
3836 global_sym_entry_size.
3837 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3838 for data structure sizes; use them.
3839 (Incremental_input_entry_reader): Import symbolic constants from
3840 Incremental_inputs_reader; use them.
3841
a4d85145
DM
38422012-04-23 David S. Miller <davem@davemloft.net>
3843
3844 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3845 and elf_flags_set_.
3846 (Target_sparc::Target_sparc): Initialize new fields.
3847 (Target_sparc::do_make_elf_object): New function.
3848 (Target_sparc::do_adjust_elf_header): New function.
3849
1d509098
CC
38502012-04-23 Cary Coutant <ccoutant@google.com>
3851
3852 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3853 CU range table of gdb index.
3854
7ebeff7f
DM
38552012-04-20 David S. Miller <davem@davemloft.net>
3856
3857 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3858 instead of false.
3859
13cf9988
DM
38602012-04-16 David S. Miller <davem@davemloft.net>
3861
2a1079e8
DM
3862 * sparc.cc (Target_sparc::got_address): New function.
3863 (Sparc_relocate_functions::gdop_hix22): New function.
3864 (Sparc_relocate_functions::gdop_lox10): New function.
3865 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3866 relocs.
3867 (Target_sparc::Scan::local): Likewise if the global symbol is not
3868 preemptible and is not IFUNC.
3869 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3870 transformations for local and non-preemptible non-IFUNC global
3871 symbols.
3872
0bc964fc
DM
3873 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3874 writing out 64-bit part of ranges.
3875
661d7a80
DM
3876 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3877 -fpic and -fpie respectively.
3878 * Makefile.in: Regenerate.
3879
8c2bf391
DM
3880 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3881 (Target_sparc::Target_sparc): Initialize new field.
3882 (Target_sparc::do_plt_section_for_global): New function.
3883 (Target_sparc::do_plt_section_for_local): New function.
3884 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3885 (Target_sparc::make_plt_section): New function, broken out of
3886 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3887 (Target_sparc::make_plt_entry): Call make_plt_section.
3888 (Target_sparc::make_local_ifunc_plt_entry): New function.
3889 (Target_sparc::rela_ifunc_section): New function.
3890 (Target_sparc::plt_section): Remove const.
3891 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3892 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3893 and ifunc_count_ fields.
3894 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3895 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3896 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3897 (Output_data_plt_sparc::rela_ifunc): New function.
3898 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3899 (Output_data_plt_sparc::has_ifunc_section): New function.
3900 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3901 (Output_data_plt_sparc::address_for_global): New function.
3902 (Output_data_plt_sparc::address_for_local): New function.
3903 (Output_data_plt_sparc::plt_index_to_offset): New function.
3904 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3905 and entry_count.
3906 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3907 entry_count.
3908 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3909 R_SPARC_JMP_IREL to switch.
3910 (Target_sparc::Scan::check_non_pic): Likewise.
3911 (Target_sparc::Scan::local): Handle IFUNC symbols.
3912 (Target_sparc::Scan::local): Likewise.
3913 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3914 and plt_address_for_local.
3915 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3916 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3917
13cf9988
DM
3918 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3919 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3920 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3921 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3922 global relocs too.
3923 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3924 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3925 calls.
3926 * sparc.cc (Target_sparc::Scan::global): Likewise.
3927 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3928
31821be0
CC
39292012-04-16 Cary Coutant <ccoutant@google.com>
3930
3931 * archive.cc (Library_base::should_include_member): Check for
3932 --export-dynamic-symbol.
3933 * options.h (class General_options): Add --export-dynamic-symbol.
3934 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3935 --export-dynamic-symbol.
3936 (Symbol_table::gc_mark_undef_symbols): Likewise.
3937 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3938
2615994e
DM
39392012-04-12 David S. Miller <davem@davemloft.net>
3940
3941 * sparc.cc (Reloc::wdisp10): New relocation method.
3942 (Reloc::h34): Likewise.
3943 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3944 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3945 R_SPARC_WDISP10.
3946 (Target_sparc::Scan::local): Likewise.
3947 (Target_sparc::Scan::global): Likewise.
3948 (Target_sparc::Relocate::relocate): Likewise.
3949
6782735d
CC
39502012-04-09 Cary Coutant <ccoutant@google.com>
3951
3952 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3953 low_pc == 0.
3954
8c7a0b00
ILT
39552012-04-06 Ian Lance Taylor <iant@google.com>
3956
3957 * timer.cc: #include <unistd.h>.
3958
58797674
RM
39592012-04-06 Roland McGrath <mcgrathr@google.com>
3960
3961 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3962 * config.in: Regenerate.
3963 * configure: Regenerate.
3964
44350750
NC
39652012-04-05 Nick Clifton <nickc@redhat.com>
3966
3967 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3968 (AM_LC_MESSAGES): Add.
3969 * aclocal.m4: Regenerate.
3970 * config.in: Regenerate.
3971 * configure: Regenerate.
3972
c1027032
CC
39732012-03-21 Cary Coutant <ccoutant@google.com>
3974
3975 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3976 * Makefile.in: Regenerate.
3977 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3978 (Sized_elf_reloc_mapper::symbol_section): New function.
3979 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3980 (make_elf_reloc_mapper): New function.
3981 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3982 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3983 (Dwarf_abbrev_table::do_get_abbrev): New function.
3984 (Dwarf_ranges_table::read_ranges_table): New function.
3985 (Dwarf_ranges_table::read_range_list): New function.
3986 (Dwarf_pubnames_table::read_section): New function.
3987 (Dwarf_pubnames_table::read_header): New function.
3988 (Dwarf_pubnames_table::next_name): New function.
3989 (Dwarf_die::Dwarf_die): New function.
3990 (Dwarf_die::read_attributes): New function.
3991 (Dwarf_die::skip_attributes): New function.
3992 (Dwarf_die::set_name): New function.
3993 (Dwarf_die::set_linkage_name): New function.
3994 (Dwarf_die::attribute): New function.
3995 (Dwarf_die::string_attribute): New function.
3996 (Dwarf_die::int_attribute): New function.
3997 (Dwarf_die::uint_attribute): New function.
3998 (Dwarf_die::ref_attribute): New function.
3999 (Dwarf_die::child_offset): New function.
4000 (Dwarf_die::sibling_offset): New function.
4001 (Dwarf_info_reader::check_buffer): New function.
4002 (Dwarf_info_reader::parse): New function.
4003 (Dwarf_info_reader::do_parse): New function.
4004 (Dwarf_info_reader::do_read_string_table): New function.
4005 (Dwarf_info_reader::lookup_reloc): New function.
4006 (Dwarf_info_reader::get_string): New function.
4007 (Dwarf_info_reader::visit_compilation_unit): New function.
4008 (Dwarf_info_reader::visit_type_unit): New function.
4009 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4010 Sized_elf_reloc_mapper.
4011 (Sized_dwarf_line_info::symbol_section): Remove function.
4012 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4013 (Sized_dwarf_line_info::read_line_mappings): Remove object
4014 parameter, adjust callers.
4015 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4016 * dwarf_reader.h: Include <sys/types.h>.
4017 (class Track_relocs): Remove forward declaration.
4018 (class Elf_reloc_mapper): New class.
4019 (class Sized_elf_reloc_mapper): New class.
4020 (class Dwarf_abbrev_table): New class.
4021 (class Dwarf_range_list): New class.
4022 (class Dwarf_ranges_table): New class.
4023 (class Dwarf_pubnames_table): New class.
4024 (class Dwarf_die): New class.
4025 (class Dwarf_info_reader): New class.
4026 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4027 (Sized_dwarf_line_info::symbol_section): Remove member function.
4028 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4029 base class.
4030 * gdb-index.cc: New source file.
4031 * gdb-index.h: New source file.
4032 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4033 and .debug_types sections, call Layout::add_to_gdb_index.
4034 (Sized_relobj_incr::do_section_name): Implement.
4035 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4036 return type; Implement.
4037 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4038 return type.
4039 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4040 parameter list and return type.
4041 (Sized_incr_dynobj::do_section_contents): Likewise.
4042 * layout.cc: Include gdb-index.h.
4043 (Layout::Layout): Initialize gdb_index_data_.
4044 (Layout::init_fixed_output_section): Check for .gdb_index section.
4045 (Layout::add_to_gdb_index): New function. Instantiate.
4046 * layout.h: Add forward declaration for class Gdb_index.
4047 (Layout::add_to_gdb_index): New member function.
4048 (Layout::gdb_index_data_): New data member.
4049 * main.cc: Include gdb-index.h.
4050 (main): Print statistics for gdb index.
4051 * object.cc (Object::section_contents): Move code into
4052 do_section_contents.
4053 (need_decompressed_section): Check for sections needed when building
4054 gdb index.
4055 (build_compressed_section_map): Likewise.
4056 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4057 gdb index.
4058 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4059 sections; call Layout::add_to_gdb_index.
4060 (Sized_relobj_file::do_decompressed_section_contents): Call
4061 do_section_contents directly.
4062 * object.h (Object::do_section_contents): Adjust parameter list and
4063 return type.
4064 (Object::do_decompressed_section_contents): Call do_section_contents
4065 directly.
4066 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4067 return type.
4068 * options.h (class General_options): Add --gdb-index option.
4069 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4070 list and return type.
4071 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4072 * reloc.h (Track_relocs::checkpoint): New function.
4073 (Track_relocs::reset): New function.
4074
4075 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4076 New test cases.
4077 * testsuite/Makefile.in: Regenerate.
4078 * testsuite/gdb_index_test.cc: New test source file.
4079 * testsuite/gdb_index_test_1.sh: New test source file.
4080 * testsuite/gdb_index_test_2.sh: New test source file.
4081
647f1574
DK
40822012-03-19 Doug Kwan <dougkwan@google.com>
4083
4084 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4085 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4086 __exidx_start and __exidx_end. Make symbol table parameter
4087 anonymous as it is not used.
4088 * gold.cc (queue_middle_tasks): Call target hook to define any
4089 target-specific symbols.
4090 * target.h (Target::define_standard_symbols): New method.
4091 (Target::do_define_standard_symbols): Same.
4092 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4093 * testsuite/Makefile.in: Regenerate.
4094 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4095 and __exidx_end.
4096 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4097 relocations are generated for __exidx_start and __exidx_end.
4098
7c6109da
DK
40992012-03-16 Doug Kwan <dougkwan@google.com>
4100
4101 * testsuite/Makefile.am: Disable test initpri3b.
4102 * testsuite/Makefile.in: Regenerate.
4103
7b8957f8
DK
41042012-03-15 Doug Kwan <dougkwan@google.com>
4105
4106 * arm.cc (Target_arm::got_section): Make .got section read-only
4107 if -z now is given.
4108
14dc9ef7
ILT
41092012-03-15 Ian Lance Taylor <iant@google.com>
4110
4111 PR gold/13850
4112 * layout.cc (Layout::make_output_section): Correctly mark
4113 SHT_INIT_ARRAY, et. al., as relro.
4114
fa40b62a
DK
41152012-03-14 Doug Kwan <dougkwan@google.com>
4116
4117 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
4118 dynamic relocations for protected symbols in shared objects.
4119
fd325007
ILT
41202012-03-13 Ian Lance Taylor <iant@google.com>
4121
4122 * resolve.cc (Symbol_table::resolve): When merging common symbols,
4123 keep the larger alignment.
4124
e8dd54e1
CC
41252012-03-12 Cary Coutant <ccoutant@google.com>
4126
4127 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
4128 handling of DW_LNE_define_file.
4129
feb5f3b0
CC
41302012-03-12 Cary Coutant <ccoutant@google.com>
4131
4132 * reduced_debug_output.cc
4133 (Output_reduced_debug_info_section::get_die_end): Add new FORM
4134 codes to switch.
4135
a1fb4256
CC
41362012-02-29 Cary Coutant <ccoutant@google.com>
4137
4138 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
4139
5dd8762a
CC
41402012-02-29 Cary Coutant <ccoutant@google.com>
4141
4142 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4143 Call Object::decompressed_section_contents.
4144 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
4145 New dtor.
4146 (Sized_dwarf_line_info::buffer_start_): New data member.
4147 * merge.cc (Output_merge_data::do_add_input_section): Call
4148 Object::decompressed_section_contents.
4149 (Output_merge_string::do_add_input_section): Likewise.
4150 * object.cc (need_decompressed_section): New function.
4151 (build_compressed_section_map): Decompress sections needed later.
4152 (Sized_relobj_file::do_decompressed_section_contents): New function.
4153 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4154 * object.h (Object::decompressed_section_contents): New function.
4155 (Object::discard_decompressed_sections): New function.
4156 (Object::do_decompressed_section_contents): New function.
4157 (Object::do_discard_decompressed_sections): New function.
4158 (Compressed_section_info): New type.
4159 (Compressed_section_map): Include decompressed section contents.
4160 (Sized_relobj_file::do_decompressed_section_contents): New function.
4161 (Sized_relobj_file::do_discard_decompressed_sections): New function.
4162
7b5de7ee
CC
41632012-02-16 Cary Coutant <ccoutant@google.com>
4164
4165 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
4166 * testsuite/Makefile.in: Regenerate.
4167
f9fa4a63
CC
41682012-02-14 Cary Coutant <ccoutant@google.com>
4169
4170 * options.cc (General_options::finalize): Disallow -pie and -static.
4171
2c175ebc
DK
41722012-02-03 Doug Kwan <dougkwan@google.com>
4173
4174 * arm.cc (Arm_relocate_functions::abs8,
4175 Arm_relocate_functions::abs16): Use
4176 Bits::has_signed_unsigned_overflow32.
4177 (Arm_relocate_functions::thm_abs8): Correct range of
4178 overflow check.
4179 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
4180 in assertions.
4181
90cff06f
DK
41822012-02-02 Doug Kwan <dougkwan@google.com>
4183
4184 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
4185 position independent outputs, not just shared objects.
4186
63887f3d
L
41872012-01-30 H.J. Lu <hongjiu.lu@intel.com>
4188
4189 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
4190 * configure: Regenerated.
4191
bef2b434
ILT
41922012-01-27 Ian Lance Taylor <iant@google.com>
4193
4194 * reloc.h (Bits): New class with static functions, copied from
4195 namespace utils in arm.cc.
4196 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
4197 instead.
4198
c335b55d
L
41992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4200
4201 * incremental.cc (write_info_blocks): Correct relocation offset.
4202
41194d9f
L
42032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4204
4205 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
4206 (Relocate::tls_gd_to_le): Likewise.
4207
1bae613c
L
42082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4209
4210 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
4211
24482ca0
L
42122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
4213
4214 * configure.ac: Check if -mcmodel=medium works.
4215 * configure: Regenerated.
4216
c2c7840a
CC
42172012-01-24 Cary Coutant <ccoutant@google.com>
4218
4219 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
4220 definition and ...
4221 (read_unsigned_LEB_128_x): ... this new function.
4222 (read_signed_LEB_128): Replaced with inline definition and ...
4223 (read_signed_LEB_128_x): ... this new function.
4224 * int_encoding.h (read_unsigned_LEB_128_x): New function.
4225 (read_unsigned_LEB_128): Add inline definition.
4226 (read_signed_LEB_128_x): New function.
4227 (read_signed_LEB_128): Add inline definition.
4228 * testsuite/Makefile.am (leb128_unittest): New unit test.
4229 * testsuite/Makefile.in: Regenerate.
4230 * testsuite/leb128_unittest.cc: New unit test.
4231
833de760 42322012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
4233
4234 PR gold/13617
4235 * i386.cc (Target_i386::do_code_fill): When using a jmp
4236 instruction, pad with nop instructions.
4237 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4238
618d6666
L
42392012-01-22 H.J. Lu <hongjiu.lu@intel.com>
4240
4241 * x86_64.cc (gc_process_relocs): Add typename on types used in
4242 template.
4243 (scan_relocs): Likewise.
4244 (relocate_section): Likewise.
4245 (apply_relocation): Likewise.
4246
3660ff06
L
42472012-01-10 H.J. Lu <hongjiu.lu@intel.com>
4248
4249 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
4250 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
4251 under x32.
4252
fc51264f
L
42532012-01-09 H.J. Lu <hongjiu.lu@intel.com>
4254
4255 * x86_64.cc: Initial support for x32.
4256
dd74ae06
CC
42572012-01-03 Cary Coutant <ccoutant@google.com>
4258
4259 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
4260 Use abstract base class for GOT.
4261 * gold/output.h (class Output_data_got_base): New abstract base class.
4262 (class Output_data_got): Derive from new base class, adjust ctors.
4263 (Output_data_got::reserve_slot): Make virtual; rename to
4264 do_reserve_slot; Adjust callers.
4265 * gold/target.h (Sized_target::init_got_plt_for_update): Return
4266 pointer to abstract base class.
4267 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
4268
83896202
ILT
42692011-12-18 Ian Lance Taylor <iant@google.com>
4270
4271 * object.h (Relobj::local_symbol_value): New function.
4272 (Relobj::local_plt_offset): New function.
4273 (Relobj::local_has_got_offset): New function.
4274 (Relobj::local_got_offset): New function.
4275 (Relobj::set_local_got_offset): New function.
4276 (Relobj::do_local_symbol_value): New pure virtual function.
4277 (Relobj::do_local_plt_offset): Likewise.
4278 (Relobj::do_local_has_got_offset): Likewise.
4279 (Relobj::do_local_got_offset): Likewise.
4280 (Relobj::do_set_local_got_offset): Likewise.
4281 (Sized_relobj::do_local_has_got_offset): Rename from
4282 local_has_got_offset.
4283 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
4284 (Sized_relobj::do_set_local_got_offset): Rename from
4285 set_local_got_offset.
4286 (Sized_relobj_file::do_local_plt_offset): Rename from
4287 local_plt_offset.
4288 (Sized_relobj_file::do_local_symbol_value): New function.
4289 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
4290 local_plt_offset.
4291 * output.cc (Output_data_got::Got_entry::write): Change object to
4292 Relobj. Use local_symbol_value.
4293 (Output_data_got::add_global_with_rel): Change rel_dyn to
4294 Output_data_reloc_generic*. Use add_global_generic.
4295 (Output_data_got::add_global_with_rela): Remove. Change all
4296 callers to use add_global_with_rel.
4297 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
4298 Output_data_reloc_generic*. Use add_global_generic.
4299 (Output_data_got::add_global_pair_with_rela): Remove. Change all
4300 callers to use add_global_pair_with_rel.
4301 (Output_data_got::add_local): Change object to Relobj*.
4302 (Output_data_got::add_local_plt): Likewise.
4303 (Output_data_got::add_local_with_rel): Change object to Relobj*,
4304 change rel_dyn to Output_data_reloc_generic*. Use
4305 add_local_generic.
4306 (Output_data_got::add_local_with_rela): Remove. Change all
4307 callers to use all_local_with_rel.
4308 (Output_data_got::add_local_pair_with_rel): Change object to
4309 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
4310 add_output_section_generic.
4311 (Output_data_got::add_local_pair_with_rela): Remove. Change all
4312 callers to use add_local_pair_with_rel.
4313 (Output_data_got::reserve_local): Change object to Relobj*.
4314 * output.h: (class Output_data_reloc_generic): Add pure virtual
4315 declarations for add_global_generic, add_local_generic,
4316 add_output_section_generic.
4317 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
4318 functions for Output_data_reloc_generic. Update declarations for
4319 changes listed in output.cc.
4320 (class Output_data_got): Change template parameter to got_size.
4321 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
4322 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
4323 function.
4324 (Sized_relobj_incr::do_local_plt_offset): New function.
4325 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
4326 add_global_generic.
4327
76677ad0
CC
43282011-12-17 Cary Coutant <ccoutant@google.com>
4329
4330 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
4331 * resolve.cc (Symbol_table::resolve): Likewise.
4332 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
4333 arrays.
4334 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
4335
8b8dd8d5
ILT
43362011-12-16 Ian Lance Taylor <iant@google.com>
4337
4338 * output.h (Output_data_reloc_generic::add): Only call
4339 add_dynamic_reloc if this is a dynamic reloc section.
4340
d55525b9
L
43412011-12-15 H.J. Lu <hongjiu.lu@intel.com>
4342
4343 PR gold/13505
4344 * target-reloc.h (apply_relocation): Replace <64, false> with
4345 <size, big_endian>.
4346
ff81c7c1
NC
43472011-11-25 Nick Clifton <nickc@redhat.com>
4348
4349 * po/it.po: New Italian translation.
4350
628f39be
SA
43512011-11-17 Sterling Augustine <saugustine@google.com>
4352
4353 * script.cc (script_include_directive): Implement.
4354 (read_script_file): New local variables name and search_path. Update
4355 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4356 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4357 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4358
98ef3ea4
SA
43592011-11-11 Sterling Augustine <saugustine@google.com>
4360
4361 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4362 (file_or_sections_cmd): Likewise.
4363
f4a8b6d7
DK
43642011-11-11 Doug Kwan <dougkwan@google.com>
4365
4366 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4367 if --just-symbols is given.
4368
29ab395d
DK
43692011-11-10 Doug Kwan <dougkwan@google.com>
4370
4371 PR gold/13362
4372 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4373 when processing data relocs.
4374 * reloc.h (Relocate_functions::rel_unaligned): New method.
4375 (Relocate_functions::pcrel_unaligned): Ditto.
4376 (Relocate_functions::rel32_unaligned): Ditto.
4377 (Relocate_functions::pcrel32_unaligned): Ditto.
4378
2c339f71
DK
43792011-11-09 Doug Kwan <dougkwan@google.com>
4380
4381 PR gold/13362
4382 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4383 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4384 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4385 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4386 (Relocate_functions::rel_unaligned): New.
4387 (Relocate_functions::rel32_unaligned): New.
4388 * target-reloc.h (relocate_for_relocatable): Add code to handle
4389 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4390 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4391 arm_unaligned_reloc_r): New targets.
4392 * testsuite/Makefile.in: Regenerate.
4393 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4394 linking.
4395
3f3cddf1
ILT
43962011-11-02 Ian Lance Taylor <iant@google.com>
4397
4398 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4399 NATIVE_LINKER.
4400 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4401 * options.cc (General_options::finalize): Use library search path
4402 from configure script if specified. If not native and no sysroot,
4403 only search TOOLLIBDIR.
4404 * options.h (Search_directory::Search_directory): Change name to
4405 const std::string&.
4406 (General_options::add_to_library_path_with_sysroot): Change arg to
4407 const std::string&.
4408 * configure, Makefile.in, config.in: Rebuild.
4409
a8e2273b
ILT
44102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4411
4412 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4413 we are working around the ARM1176 Erratum.
4414 * options.h (General_options::fix_arm1176): Add option.
4415 * testsuite/Makefile.am: Add testcases, and keep current ones
4416 working.
4417 * testsuite/Makefile.in: Regenerate.
4418 * testsuite/arm_fix_1176.s: New file.
4419 * testsuite/arm_fix_1176.sh: Likewise.
4420
cd6eab1c
ILT
44212011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4422
4423 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4424 may_use_blx_.
4425 (Target_arm::may_use_blx): Remove method.
4426 (Target_arm::set_may_use_blx): Likewise.
4427 (Target_arm::may_use_v4t_interworking): New method.
4428 (Target_arm::may_use_v5t_interworking): Likewise.
4429 (Target_arm::may_use_blx_): Remove member variable.
4430 (Arm_relocate_functions::arm_branch_common): Check for v5T
4431 interworking.
4432 (Arm_relocate_functions::thumb_branch_common): Likewise.
4433 (Reloc_stub::stub_type_for_reloc): Likewise.
4434 (Target_arm::do_finalize_sections): Correct interworking checks.
4435 * testsuite/Makefile.am: Add new tests.
4436 * testsuite/Makefile.in: Regenerate.
4437 * testsuite/arm_farcall_arm_arm.s: New test.
4438 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4439 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4440 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4441 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4442 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4443 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4444 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4445
286adcf4
CC
44462011-10-31 Cary Coutant <ccoutant@google.com>
4447
4448 PR gold/13023
4449 * expression.cc (Expression::eval_with_dot): Add
4450 is_section_dot_assignment parameter.
4451 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4452 absolute and assigning to dot within a section.
4453 * script-sections.cc
4454 (Output_section_element_assignment::set_section_addresses): Pass
4455 dot_section to set_if_absolute.
4456 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4457 as is_section_dot_assignment flag to eval_with_dot.
4458 (Output_section_element_dot_assignment::set_section_addresses):
4459 Likewise.
4460 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4461 parameter. Also set value if relative to dot_section; set the
4462 symbol's output_section.
4463 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4464 parameter. Adjust all callers.
4465 (Expression::eval_maybe_dot): Likewise.
4466 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4467 Adjust all callers.
4468 * testsuite/script_test_2.t: Test assignment of an absolute value
4469 to dot within an output section element.
4470
9634ed06
CC
44712011-10-31 Cary Coutant <ccoutant@google.com>
4472
4473 * options.h (class General_options): Add --[no-]gnu-unique options.
4474 * symtab.cc (Symbol_table::sized_write_globals): Convert
4475 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4476
de4101c7
CC
44772011-10-31 Cary Coutant <ccoutant@google.com>
4478
4479 PR gold/13359
4480 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4481 unnecessary assertion.
4482 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4483
7257cc92
ST
44842011-10-31 Sriraman Tallam <tmsriram@google.com>
4485
4486 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4487 gc_mark_symbol.
4488 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4489 gc_mark_symbol.
4490 Change to just keep the section associated with symbol.
4491 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4492 they are externally visible and --export-dynamic is turned on.
4493 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4494
bfc34b3f
ILT
44952011-10-19 Ian Lance Taylor <iant@google.com>
4496
4497 PR gold/13163
4498 * script-sections.cc
4499 (Output_section_element_dot_assignment::needs_output_section): New
4500 function.
4501
ea0d8c47
ILT
45022011-10-19 Ian Lance Taylor <iant@google.com>
4503
4504 PR gold/13204
4505 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4506 --section-start option was seen.
4507 * options.h (General_options::any_section_start): New function.
4508
abd242a9
DM
45092011-10-18 David S. Miller <davem@davemloft.net>
4510
4511 PR binutils/13301
4512 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4513 member to track relocation locations that have moved during TLS
4514 reloc optimizations.
4515 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4516 (Target_sparc::Relocate::relocate): Adjust view down by 4
4517 bytes if it matches reloc_adjust_addr_.
4518 (Target_sparc::Relocate::relocate_tls): Always move the
4519 __tls_get_addr call delay slot instruction forward 4 bytes when
4520 performing relaxation.
4521
bab9090f
CC
45222011-10-18 Cary Coutant <ccoutant@google.com>
4523
4524 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4525 (Output_file::map_no_anonymous): Check for non-zero
4526 return code from posix_fallocate.
4527
f7c5b166
CC
45282011-10-17 Cary Coutant <ccoutant@google.com>
4529
4530 PR gold/13245
4531 * plugin.cc (is_visible_from_outside): Check for symbols
4532 referenced from dynamic objects.
4533 * resolve.cc (Symbol_table::resolve): Don't count references
4534 from dynamic objects as references from real ELF files.
4535 * testsuite/plugin_test_2.sh: Adjust expected result.
4536
b490c0bb
CC
45372011-10-17 Cary Coutant <ccoutant@google.com>
4538
4539 * gold.cc: Include timer.h.
4540 (queue_middle_tasks): Stamp time.
4541 (queue_final_tasks): Likewise.
4542 * main.cc (main): Store timer in parameters. Print timers
4543 for each pass.
4544 * parameters.cc (Parameters::Parameters): Initialize timer_.
4545 (Parameters::set_timer): New function.
4546 (set_parameters_timer): New function.
4547 * parameters.h (Parameters::set_timer): New function.
4548 (Parameters::timer): New function.
4549 (Parameters::timer_): New data member.
4550 (set_parameters_timer): New function.
4551 * timer.cc (Timer::stamp): New function.
4552 (Timer::get_pass_time): New function.
4553 * timer.h (Timer::stamp): New function.
4554 (Timer::get_pass_time): New function.
4555 (Timer::pass_times_): New data member.
4556
f475cf7b
CC
45572011-10-17 Cary Coutant <ccoutant@google.com>
4558
4559 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4560 task for members of lib groups.
4561
cdd7e244
CC
45622011-10-17 Cary Coutant <ccoutant@google.com>
4563
4564 PR gold/13288
4f95c8b4 4565 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4566 (File_read::make_view): Move bounds check (replace with assert)...
4567 (File_read::find_or_make_view): ... to here.
4568
dfb45471
CC
45692011-10-12 Cary Coutant <ccoutant@google.com>
4570
4f95c8b4 4571 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4572 ::read returns less than requested size.
4573
53bbcc1b
CC
45742011-10-10 Cary Coutant <ccoutant@google.com>
4575
4f95c8b4 4576 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4577 Initialize defined_count_.
4578 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4579 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4580 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4581 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4582 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4583 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4584 member.
4585 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4586 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4587 Return zeroes instead of internal error.
4588
397b129b
CC
45892011-10-10 Cary Coutant <ccoutant@google.com>
4590
4591 PR gold/13249
4f95c8b4 4592 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4593 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4594 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4595 (Output_reloc::type_): Adjust size of bit field.
4596 (Output_reloc::use_plt_offset_): New bit field.
4597 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4598 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4599 flag. Adjust all callers.
4f95c8b4 4600 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4601 creating RELATIVE relocations.
4602
d5698657
NC
46032011-10-10 Nick Clifton <nickc@redhat.com>
4604
4605 * po/es.po: Updated Spanish translation.
4606 * po/fi.po: Updated Finnish translation.
4607
6a59a5c2
DN
46082011-10-03 Diego Novillo <dnovillo@google.com>
4609
4610 * options.cc (parse_uint): Fix dereference of RETVAL.
4611
f0558624
ST
46122011-09-29 Sriraman Tallam <tmsriram@google.com>
4613
4614 * layout.h (section_order_map_): New member.
4615 (get_section_order_map): New member function.
4616 * output.cc (Output_section::add_input_section): Check for patterns
4617 only when --section-ordering-file is specified.
4618 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4619 output_sections have been formed.
4620 * layout.cc (Layout_Layout): Initialize section_order_map_.
4621 * plugin.cc (update_section_order): Store order in order_map. Do not
4622 update the order.
4623 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4624 * testsuite/Makefile.in: Regenerate.
4625 * testsuite/plugin_section_order.c: New file.
4626 * testsuite/plugin_final_layout.cc: New file.
4627 * testsuite/plugin_final_layout.sh: New file.
4628
a7dac153
CC
46292011-09-29 Cary Coutant <ccoutant@google.com>
4630
4f95c8b4 4631 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4632 Check for NULL.
4f95c8b4 4633 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4634 symbols during incremental update.
4635 (Symbol_table::add_from_dynobj): Likewise.
4636
eebd87a5
ILT
46372011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4638 Ian Lance Taylor <iant@google.com>
4639
4640 * symtab.cc (Symbol_table::define_special_symbol): Always
4641 canonicalize version string.
4642
403a3331
CC
46432011-09-26 Cary Coutant <ccoutant@google.com>
4644
4f95c8b4
CC
4645 * gold.cc (queue_initial_tasks): Move option checks ...
4646 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4647 some options; make others fatal.
4648
235061c2
CC
46492011-09-26 Cary Coutant <ccoutant@google.com>
4650
4651 gcc PR lto/47247
4652 * plugin.cc (get_symbols_v2): New function.
4653 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4654 (is_referenced_from_outside): New function.
4655 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4656 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4657 (get_symbols): Pass version parameter.
4658 (get_symbols_v2): New function.
4659 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4660 parameter.
4661 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4662 (onload): Add LDPT_GET_SYMBOLS_V2.
4663 (all_symbols_read_hook): Use get_symbols_v2; check for
4664 LDPR_PREVAILING_DEF_IRONLY_EXP.
4665 * testsuite/plugin_test_3.sh: Update expected results.
4666
dc87f620
ILT
46672011-09-23 Simon Baldwin <simonb@google.com>
4668
4669 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4670 configuration options.
4671 * configure: Regenerate.
4672 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4673 * Makefile.in: Regenerate.
4674 * testsuite/Makefile.in: Regenerate.
4675
a8279f82
ST
46762011-09-19 Sriraman Tallam <tmsriram@google.com>
4677
4678 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4679
0c9350c8
CC
46802011-09-19 Cary Coutant <ccoutant@google.com>
4681
4682 * incremental.cc (can_incremental_update): Fix typo in comment.
4683 * incremental.h (can_incremental_update): Likewise.
4684
aa06ae28
CC
46852011-09-18 Cary Coutant <ccoutant@google.com>
4686
4687 * incremental.cc (can_incremental_update): New function.
4688 * incremental.h (can_incremental_update): New function.
4689 * layout.cc (Layout::init_fixed_output_section): Call it.
4690 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4691 * object.cc (Sized_relobj_file::do_layout): Call
4692 can_incremental_update.
4693
ebb300b2
CC
46942011-09-13 Cary Coutant <ccoutant@google.com>
4695
4696 * configure.ac: Check for glibc support for gnu_indirect_function
4697 support with static linking, setting automake conditional
4698 IFUNC_STATIC.
4699 * Makefile.in: Regenerate.
4700 * configure: Regenerate.
4701
4702 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4703 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4704 for IFUNC_STATIC.
4705 * testsuite/Makefile.in: Regenerate.
4706
1206d0d5
CC
47072011-09-13 Cary Coutant <ccoutant@google.com>
4708
4709 * incremental.cc (Sized_relobj_incr::do_layout): Call
4710 report_comdat_group for kept comdat sections.
4711 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4712 * testsuite/Makefile.in: Regenerate.
4713 * testsuite/incr_comdat_test_1.cc: New source file.
4714 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4715 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4716 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4717
40b29874
ILT
47182011-09-13 Ian Lance Taylor <iant@google.com>
4719
4720 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4721 variable external_symbols_offset.
4722
1b045aac
ILT
47232011-09-12 Ian Lance Taylor <iant@google.com>
4724
4725 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4726 triggered if object has no symbols.
4727
24c6c55a
DM
47282011-09-09 David S. Miller <davem@davemloft.net>
4729
4730 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4731 (Output_fill_debug_line::do_write): Likewise.
4732
66570254
CC
47332011-08-29 Cary Coutant <ccoutant@google.com>
4734
4735 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4736 casts to match formatting specs.
4737 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4738
8ea8cd50
CC
47392011-08-26 Cary Coutant <ccoutant@google.com>
4740
4741 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4742 remaining hole size when allocating.
4743 (Layout::make_output_section): Set fill methods for debug sections.
4744 * layout.h (Free_list::Free_list_node): Move from private to
4745 public.
4746 (Free_list::set_min_hole_size): New function.
4747 (Free_list::begin, Free_list::end): New functions.
4748 (Free_list::min_hole_): New data member.
4749 * output.cc: Include dwarf.h.
4750 (Output_fill_debug_info::do_minimum_hole_size): New function.
4751 (Output_fill_debug_info::do_write): New function.
4752 (Output_fill_debug_line::do_minimum_hole_size): New function.
4753 (Output_fill_debug_line::do_write): New function.
4754 (Output_section::Output_section): Initialize new data member.
4755 (Output_section::set_final_data_size): Ensure patch space is larger
4756 than minimum hole size.
4757 (Output_section::do_write): Fill holes in debug sections.
4758 * output.h (Output_fill): New class.
4759 (Output_fill_debug_info): New class.
4760 (Output_fill_debug_line): New class.
4761 (Output_section::set_free_space_fill): New function.
4762 (Output_section::free_space_fill_): New data member.
4763 * testsuite/Makefile.am (incremental_test_3): Add
4764 --incremental-patch option.
4765 (incremental_test_4): Likewise.
4766 (incremental_test_5): Likewise.
4767 (incremental_test_6): Likewise.
4768 (incremental_copy_test): Likewise.
4769 (incremental_common_test_1): Likewise.
4770 * testsuite/Makefile.in: Regenerate.
4771
7cf80422
NC
47722011-08-26 Nick Clifton <nickc@redhat.com>
4773
4774 * po/es.po: Updated Spanish translation.
4775
c3f7b0e5
CC
47762011-08-01 Cary Coutant <ccoutant@google.com>
4777
4778 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4779 * gold/testsuite/Makefile.in: Regenerate.
4780 * gold/testsuite/justsyms_exec.c: New source file.
4781 * gold/testsuite/justsyms_lib.c: New source file.
4782
9590bf25
CC
47832011-08-01 Cary Coutant <ccoutant@google.com>
4784
4785 * layout.cc (Layout::set_segment_offsets): Don't realign text
4786 segment if -Ttext was specified.
4787 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4788 file type.
4789 * object.h (Sized_relobj_file::e_type): New function.
4790 (Sized_relobj_file::e_type_): New data member.
4791 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4792 base address for ET_EXEC files.
4793 * target.cc (Target::do_make_elf_object_implementation): Allow
4794 ET_EXEC files with --just-symbols option.
4795
dcd8d12e
CC
47962011-07-28 Cary Coutant <ccoutant@google.com>
4797
4798 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4799 Add thread_number parameter.
4800 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4801 * workqueue-threads.cc
4802 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4803 current thread if its thread number is greater than desired thread
4804 count.
4805 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4806 Add thread_number parameter.
4807 (Workqueue::should_cancel_thread): Likewise.
4808 (Workqueue::find_runnable_or_wait): Pass thread_number to
4809 should_cancel_thread.
4810 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4811 parameter.
4812
804eb480
ST
48132011-07-22 Sriraman Tallam <tmsriram@google.com>
4814
4815 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4816 only after checking if it cannot be forced local.
4817 * symtab.h (is_externally_visible): Check if the symbol is not forced
4818 local.
4819
f1ddb600
ILT
48202011-07-15 Ian Lance Taylor <iant@google.com>
4821
4822 * options.h (class General_options): Add --print-output-format.
4823 Move -EL next to -EB, for better --help output.
4824 * target-select.cc: Include <cstdio>, "options.h", and
4825 "parameters.h".
4826 (Target_selector::do_target_bfd_name): New function.
4827 (print_output_format): New function.
4828 * target-select.h (class Target_selector): Update declarations.
4829 (Target_selector::target_bfd_name): New function.
4830 (print_output_format): Declare.
4831 * main.cc: Include "target-select.h".
4832 (main): Handle --print-output-format.
4833 * gold.cc: Include "target-select.h".
4834 (queue_initial_tasks): Handle --print-output-format when there are
4835 no input files.
4836 * parameters.cc (parameters_force_valid_target): Give a better
4837 error message if -EB/-EL does not match target.
4838 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4839 function.
4840
7d172687
ILT
48412011-07-15 Ian Lance Taylor <iant@google.com>
4842
4843 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4844 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4845 (Output_data_plt_i386::do_write): Write address of .dynamic
4846 section to first entry in .got.plt section.
4847 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4848 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4849 Initialize layout_.
4850 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4851 section to first entry in .got.plt section.
4852 * layout.h (Layout::dynamic_section): New function.
4853
e9552f7e
ST
48542011-07-13 Sriraman Tallam <tmsriram@google.com>
4855
4856 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4857 to claim_file call.
4858 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4859 input_section_position_, and input_section_glob_.
4860 (read_layout_from_file): Call function section_ordering_specified.
4861 * layout.h (is_section_ordering_specified): New function.
4862 (section_ordering_specified): New function.
4863 (section_ordering_specified_): New boolean member.
4864 * main.cc(main): Call load_plugins after layout object is defined.
4865 * output.cc (Output_section::add_input_section): Use
4866 function section_ordering_specified to check if section ordering is
4867 needed.
4868 * output.cc (Output_section::add_relaxed_input_section): Use
4869 function section_ordering_specified to check if section ordering is
4870 needed.
4871 (Output_section::update_section_layout): New function.
4872 (Output_section::sort_attached_input_sections): Check if input section
4873 must be reordered.
4874 * output.h (Output_section::update_section_layout): New function.
4875 * plugin.cc (get_section_count): New function.
4876 (get_section_type): New function.
4877 (get_section_name): New function.
4878 (get_section_contents): New function.
4879 (update_section_order): New function.
58797674 4880 (allow_section_ordering): New function.
e9552f7e
ST
4881 (Plugin::load): Add the new interfaces to the transfer vector.
4882 (Plugin_manager::load_plugins): New parameter.
4883 (Plugin_manager::all_symbols_read): New parameter.
4884 (Plugin_manager::claim_file): New parameter. Save the elf object for
4885 unclaimed objects.
4886 (Plugin_manager::get_elf_object): New function.
4887 (Plugin_manager::get_view): Change to directly use the bool to check
4888 if get_view is called from claim_file_hook.
4889 * plugin.h (input_objects): New function
4890 (Plugin__manager::load_plugins): New parameter.
4891 (Plugin_manager::claim_file): New parameter.
4892 (Plugin_manager::get_elf_object): New function.
4893 (Plugin_manager::in_claim_file_handler): New function.
4894 (Plugin_manager::in_claim_file_handler_): New member.
4895 (layout): New function.
4896 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4897 handler with an extra parameter. Make the elf object before calling
4898 claim_file handler.
4899 * testsuite/plugin_test.c (get_section_count): New function pointer.
4900 (get_section_type): New function pointer.
4901 (get_section_name): New function pointer.
4902 (get_section_contents): New function pointer.
4903 (update_section_order): New function pointer.
4904 (allow_section_ordering): New function pointer.
4905 (onload): Check if the new interfaces exist.
4906
9446efde
ILT
49072011-07-13 Ian Lance Taylor <iant@google.com>
4908
4909 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4910 relro section.
4911 * x86_64.cc (Target_x86_64::got_section): Likewise.
4912 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4913 (relro_now_test_SOURCES): New variable.
4914 (relro_now_test_DEPENDENCIES): New variable.
4915 (relro_now_test_LDFLAGS): New variable.
4916 (relro_now_test_LDADD): New variable.
4917 (relro_now_test.so): New target.
4918 * testsuite/Makefile.in: Rebuild.
4919
07aa62f2
ILT
49202011-07-12 Ian Lance Taylor <iant@google.com>
4921
4922 PR gold/12980
4923 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4924 GLOB_DAT relocation rather than a RELATIVE relocation for a
4925 protected symbol when creating a shared library.
4926 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4927 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4928 * testsuite/protected_main_1.cc (main): Test that protected
4929 function has same address.
4930
e2153196
ILT
49312011-07-11 Ian Lance Taylor <iant@google.com>
4932
4933 PR gold/12979
4934 * options.h (class General_options): Add -Bgroup.
4935 * options.cc (General_options::finalize): If -Bgroup is set,
4936 default to --unresolved-symbols=report-all.
4937 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4938 * target-reloc.h (issue_undefined_symbol_error): Handle
4939 --unresolved-symbols=report-all.
4940
6daf5215
ILT
49412011-07-08 Ian Lance Taylor <iant@google.com>
4942
4943 PR gold/11985
4944 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4945 if linker script discards key sections.
4946 (Layout::create_dynamic_symtab): Likewise.
4947 (Layout::assign_local_dynsym_offsets): Likewise.
4948 (Layout::sized_create_version_sections): Likewise.
4949 (Layout::create_interp): Likewise.
4950 (Layout::finish_dynamic_section): Likewise.
4951 (Layout::set_dynamic_symbol_size): Likewise.
4952
beabb2c6
ILT
49532011-07-08 Ian Lance Taylor <iant@google.com>
4954
4955 PR gold/12386
4956 * options.h (class General_options): Add --unresolved-symbols.
4957 * target-reloc.h (issue_undefined_symbol_error): Check
4958 --unresolved-symbols. Add comments.
4959
9c16daf1
ILT
49602011-07-08 Ian Lance Taylor <iant@google.com>
4961
4962 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4963 expression more complex.
4964
191f1a2d
ILT
49652011-07-08 Ian Lance Taylor <iant@google.com>
4966
4967 PR gold/11317
4968 * target-reloc.h (issue_undefined_symbol_error): New inline
4969 function, broken out of relocate_section.
4970 (relocate_section): Call issue_undefined_symbol_error.
4971 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4972 there is no TLS segment if we are about to issue an undefined
4973 symbol error.
4974 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4975
62855347
ILT
49762011-07-08 Ian Lance Taylor <iant@google.com>
4977
4978 PR gold/12279
4979 * resolve.cc (Symbol_table::should_override): Add fromtype
4980 parameter. Change all callers. Give error when linking together
4981 TLS and non-TLS symbol.
4982 (Symbol_table::should_override_with_special): Add fromtype
4983 parameter. Change all callers.
4984 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4985 there is no TLS segment if we have reported some errors.
4986 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4987
67181c72
ILT
49882011-07-08 Ian Lance Taylor <iant@google.com>
4989
4990 PR gold/12372
4991 * target.h (Target::plt_address_for_global): New function.
4992 (Target::plt_address_for_local): New function.
4993 (Target::plt_section_for_global): Remove.
4994 (Target::plt_section_for_local): Remove.
4995 (Target::do_plt_address_for_global): New virtual function.
4996 (Target::do_plt_address_for_local): New virtual function.
4997 (Target::do_plt_section_for_global): Remove.
4998 (Target::do_plt_section_for_local): Remove.
4999 (Target::register_global_plt_entry): Add Symbol_table and Layout
5000 parameters.
5001 * output.cc (Output_data_got::Got_entry::write): Use
5002 plt_address_for_global and plt_address_for_local.
5003 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5004 address of output section.
5005 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5006 got_irelative_, and irelative_count_ fields. Update
5007 declarations.
5008 (Output_data_plt_i386::has_irelative_section): New function.
5009 (Output_data_plt_i386::entry_count): Add irelative_count_.
5010 (Output_data_plt_i386::set_final_data_size): Likewise.
5011 (class Target_i386): Add got_irelative_ and rel_irelative_
5012 fields. Update declarations.
5013 (Target_i386::Target_i386): Initialize new fields.
5014 (Target_i386::do_plt_address_for_global): New function replacing
5015 do_plt_section_for_global.
5016 (Target_i386::do_plt_address_for_local): New function replacing
5017 do_plt_section_for_local.
5018 (Target_i386::got_section): Create got_irelative_.
5019 (Target_i386::rel_irelative_section): New function.
5020 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5021 fields. Don't define __rel_iplt_{start,end}.
5022 (Output_data_plt_i386::add_entry): Add symtab and layout
5023 parameters. Change all callers. Use different PLT and GOT for
5024 IFUNC symbols.
5025 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5026 layout parameters. Change all callers. Use different PLT and
5027 GOT.
5028 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5029 (Output_data_plt_i386::rel_irelative): New function.
5030 (Output_data_plt_i386::address_for_global): New function.
5031 (Output_data_plt_i386::address_for_local): New function.
5032 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5033 IRELATIVE GOT when changing IFUNC GOT entries.
5034 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5035 reloc.
5036 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5037 if we didn't create an IRELATIVE GOT.
5038 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5039 plt_address_for_local.
5040 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5041 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5042 got_irelative_, and irelative_count_ fields. Update
5043 declarations.
5044 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5045 Initialize new fields. Remove symtab parameter. Change all
5046 callers.
5047 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5048 irelative_count_.
5049 (Output_data_plt_x86_64::has_irelative_section): New function.
5050 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5051 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5052 fields. Update declarations.
5053 (Target_x86_64::Target_x86_64): Initialize new fields.
5054 (Target_x86_64::do_plt_address_for_global): New function replacing
5055 do_plt_section_for_global.
5056 (Target_x86_64::do_plt_address_for_local): New function replacing
5057 do_plt_section_for_local.
5058 (Target_x86_64::got_section): Create got_irelative_.
5059 (Target_x86_64::rela_irelative_section): New function.
5060 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5061 all callers. Don't create __rel_iplt_{start,end}.
5062 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5063 parameters. Change all callers. Use different PLT and GOT for
5064 IFUNC symbols.
5065 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5066 layout parameters. Change all callers. Use different PLT and
5067 GOT.
5068 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5069 parameters. Change all callers. Use different PLT and GOT for
5070 IFUNC symbols.
5071 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5072 (Output_data_plt_x86_64::rela_irelative): New function.
5073 (Output_data_plt_x86_64::address_for_global): New function.
5074 (Output_data_plt_x86_64::address_for_local): New function.
5075 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5076 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5077 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5078 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5079 parameters.
5080 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5081 reloc.
5082 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5083 symbols if we didn't create an IRELATIVE GOT.
5084 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5085 plt_address_for_local.
5086 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5087 * testsuite/ifuncvar1.c: New test file.
5088 * testsuite/ifuncvar2.c: New test file.
5089 * testsuite/ifuncvar3.c: New test file.
5090 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5091 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5092 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5093 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5094 * testsuite/Makefile.in: Rebuild.
5095
33c15b45
CC
50962011-07-07 Cary Coutant <ccoutant@google.com>
5097
5098 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5099 (two_file_test_1_ndebug.o): Likewise.
5100 (two_file_test_1b_ndebug.o): Likewise.
5101 (two_file_test_2_ndebug.o): Likewise.
5102 (two_file_test_main_ndebug.o): Likewise.
5103 (incremental_test_2): Link with no-debug versions.
5104
f48b5fb7
CC
51052011-07-06 Cary Coutant <ccoutant@google.com>
5106
5107 * gold/incremental.cc
5108 (Output_section_incremental_inputs::write_info_blocks): Check for
5109 hidden and internal symbols.
5110
221597a5
CC
51112011-07-06 Cary Coutant <ccoutant@google.com>
5112
5113 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5114 Check disposition for startup file.
5115 (Incremental_inputs::report_command_line): Ignore
5116 --incremental-startup-unchanged option.
5117 * options.cc (General_options::parse_incremental_startup_unchanged):
5118 New function.
5119 (General_options::General_options): Initialize new data member.
5120 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
5121 (General_options): Add --incremental-startup-unchanged option.
5122 (General_options::incremental_startup_disposition): New function.
5123 (General_options::incremental_startup_disposition_): New data member.
5124
e24719f6
CC
51252011-07-06 Cary Coutant <ccoutant@google.com>
5126
5127 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
5128 input file index to Script_info ctor.
5129 (Sized_incremental_binary::do_file_has_changed): Find the
5130 command-line argument for files named in scripts.
5131 * incremental.h (Script_info::Script_info): New ctor
5132 with input file index.
5133 (Script_info::input_file_index): New function.
5134 (Script_info::input_file_index_): New data member.
5135 (Incremental_binary::get_library): Add const.
5136 (Incremental_binary::get_script_info): Add const.
5137 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
5138 * testsuite/Makefile.am (incremental_test_5): New test case.
5139 (incremental_test_6): New test case.
5140 * testsuite/Makefile.in: Regenerate.
5141
8f7c81e8
CC
51422011-07-06 Cary Coutant <ccoutant@google.com>
5143
5144 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
5145 debug output when command lines differ.
5146
9fbd3822
CC
51472011-07-06 Cary Coutant <ccoutant@google.com>
5148
5149 * incremental.cc (Incremental_inputs::report_command_line): Ignore
5150 --incremental-patch option.
5151 * layout.cc (Free_list::allocate): Extend allocation beyond original
5152 end if enabled.
5153 (Layout::make_output_section): Mark sections that should get
5154 patch space.
5155 * options.cc (parse_percent): New function.
5156 * options.h (parse_percent): New function.
5157 (DEFINE_percent): New macro.
5158 (General_options): Add --incremental-patch option.
5159 * output.cc (Output_section::Output_section): Initialize new data
5160 members.
5161 (Output_section::add_input_section): Print section name when out
5162 of patch space.
5163 (Output_section::add_output_section_data): Likewise.
5164 (Output_section::set_final_data_size): Add patch space when
5165 doing --incremental-full.
5166 (Output_section::do_reset_address_and_file_offset): Remove patch
5167 space.
5168 (Output_segment::set_section_list_addresses): Print debug output
5169 only if --incremental-update.
5170 * output.h (Output_section::set_is_patch_space_allowed): New function.
5171 (Output_section::is_patch_space_allowed_): New data member.
5172 (Output_section::patch_space_): New data member.
5173 * parameters.cc (Parameters::incremental_full): New function.
5174 * parameters.h (Parameters::incremental_full): New function
5175 * testsuite/Makefile.am (incremental_test_2): Add test for
5176 --incremental-patch option.
5177 * testsuite/Makefile.in: Regenerate.
5178 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
5179 (t18): Remove function body.
5180
f6cccc2c
DK
51812011-07-05 Doug Kwan <dougkwan@google.com>
5182
5183 PR gold/12771
5184 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
5185 Arm_Address type for relocation result.
5186 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
5187 overflow check.
5188 (Arm_relocate_functions::abs32): Use unaligned access.
5189 (Arm_relocate_functions::rel32): Ditto.
5190 (Arm_relocate_functions::prel31): Ditto.
5191 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
5192 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
5193 static data relocations.
5194 * testsuite/Makefile.in: Regnerate.
5195 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
5196
28a13fec
ILT
51972011-07-05 Ian Lance Taylor <iant@google.com>
5198
5199 PR gold/12392
5200 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
5201 symbols if necessary.
5202 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5203
24d47b34
ILT
52042011-07-05 Ian Lance Taylor <iant@google.com>
5205
5206 PR gold/12952
5207 * resolve.cc (Symbol::override_base_with_special): Simply override
5208 version with special symbol version, ignoring previous version.
5209
41f9cbbe
ILT
52102011-07-05 Ian Lance Taylor <iant@google.com>
5211
5212 * object.cc (Sized_relobj_file::include_section_group): Add
5213 information to comment about signature location.
5214
886288f1
ILT
52152011-07-02 Ian Lance Taylor <iant@google.com>
5216
5217 PR gold/12957
5218 * options.h (class General_options): Add -f and -F.
5219 * options.cc (General_options::finalize): Fatal error if -f/-F
5220 are used without -shared.
5221 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
5222
ae3a6d4f
ILT
52232011-07-02 Ian Lance Taylor <iant@google.com>
5224
5225 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
5226
21131061
ILT
52272011-07-01 Ian Lance Taylor <iant@google.com>
5228
5229 PR gold/12525
5230 PR gold/12952
5231 * resolve.cc (Symbol::override_base_with_special): Don't override
5232 the version if the overriding symbol has a different name.
5233 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
5234 all callers. If we give an error about an undefined version,
5235 define the base version if necessary.
5236 * dynobj.h (class Versions): Update declaration.
5237 * testsuite/weak_alias_test_5.cc: New file.
5238 * testsuite/weak_alias_test.script: New file.
5239 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
5240 and versioned_alias have the right value, and call t2.
5241 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
5242 weak_alias_test_5.so.
5243 (weak_alias_test_LDADD): Likewise.
5244 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
5245 * testsuite/Makefile.in: Rebuild.
5246
611062c0
ILT
52472011-07-01 Ian Lance Taylor <iant@google.com>
5248
5249 PR gold/12525
5250 * options.h (class General_options): Support -z notext.
5251 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
5252 -Wl,-z,notext.
5253 (two_file_shared_nonpic.so): Likewise.
5254 (two_file_shared_mixed.so): Likewise.
5255 (two_file_shared_mixed_1.so): Likewise.
5256 (weak_undef_lib_nonpic.so): Likewise.
5257 (alt/weak_undef_lib_nonpic.so): Likewise.
5258 (tls_test_shared_nonpic.so): Likewise.
5259 * testsuite/Makefile.in: Rebuild.
5260
328c7c2f
ILT
52612011-07-01 Ian Lance Taylor <iant@google.com>
5262
5263 PR gold/12525
5264 * configure.ac: Test whether static linking works, setting
5265 the automake conditional HAVE_STATIC.
5266 * testsuite/Makefile.am: Disable tests using -static if
5267 HAVE_STATIC is not true.
5268 * configure, testsuite/Makefile.in: Rebuild.
5269
02d7cd44
ILT
52702011-07-01 Ian Lance Taylor <iant@google.com>
5271
5272 PR gold/12525
5273 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
5274 Assert if we see DW_EH_PE_indirect.
5275 * target.h (Target::ehframe_datarel_base): New function.
5276 (Target::do_ehframe_datarel_base): New target function.
5277 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
5278 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
5279 function.
5280
07a60597
ILT
52812011-07-01 Ian Lance Taylor <iant@google.com>
5282
5283 PR gold/12571
5284 * options.h (class General_options): Add
5285 --ld-generated-unwind-info.
5286 * ehframe.cc (Fde::write): Add address parameter. Change all
5287 callers. If associated with PLT, fill in address and size.
5288 (Cie::set_output_offset): Only add merge mapping if there is an
5289 object.
5290 (Cie::write): Add address parameter. Change all callers.
5291 (Eh_frame::add_ehframe_for_plt): New function.
5292 * ehframe.h (class Fde): Update declarations. Move shndx_ and
5293 input_offset_ fields into union u_, with new plt field.
5294 (Fde::Fde): Adjust for new union field.
5295 (Fde::Fde) [Output_data version]: New constructor.
5296 (Fde::add_mapping): Only add merge mapping if there is an object.
5297 (class Cie): Update declarations.
5298 (class Eh_frame): Declare add_ehframe_for_plt.
5299 * layout.cc (Layout::layout_eh_frame): Break out code into
5300 make_eh_frame_section, and call it.
5301 (Layout::make_eh_frame_section): New function.
5302 (Layout::add_eh_frame_for_plt): New function.
5303 * layout.h (class Layout): Update declarations.
5304 * merge.cc (Merge_map::add_mapping): Add assertion.
5305 * i386.cc: Include "dwarf.h".
5306 (class Output_data_plt_i386): Make first_plt_entry,
5307 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
5308 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5309 and plt_eh_frame_fde.
5310 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
5311 boundary. Call add_eh_frame_for_plt if appropriate.
5312 * x86_64.cc: Include "dwarf.h".
5313 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
5314 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
5315 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
5316 and plt_eh_frame_fde.
5317 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
5318 appropriate.
5319
14788a3f
ILT
53202011-06-29 Ian Lance Taylor <iant@google.com>
5321
5322 PR gold/12629
5323 * object.cc (Sized_relobj_file::layout_section): Change shdr
5324 parameter to be const.
5325 (Sized_relobj_file::layout_eh_frame_section): New function, broken
5326 out of do_layout.
5327 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
5328 appropriate. Call layout_eh_frame_section.
5329 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
5330 sections.
5331 * object.h (class Sized_relobj_file): Update declarations.
5332
6c21fce1
ILT
53332011-06-29 Ian Lance Taylor <iant@google.com>
5334
37e41b03 5335 PR gold/12652
6c21fce1
ILT
5336 * script.cc (Token::integer_value): Accept trailing M/m/K/k
5337 modifier.
5338 (Lex::gather_token): Accept trailing M/m/K/k for integers.
5339
4d5e4e62
ILT
53402011-06-29 Ian Lance Taylor <iant@google.com>
5341
5342 PR gold/12675
5343 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5344 SHT_X86_64_UNWIND.
5345 * layout.cc (Layout::layout_eh_frame): Likewise.
5346
886f533a
ILT
53472011-06-29 Ian Lance Taylor <iant@google.com>
5348
5349 PR gold/12695
5350 * layout.cc (Layout::symtab_section_shndx): New function.
5351 * layout.h (class Layout): Declare symtab_section_shndx.
5352 * output.cc (Output_section::write_header): Call it.
5353
f3ae1b28
ILT
53542011-06-29 Ian Lance Taylor <iant@google.com>
5355
5356 PR gold/12818
5357 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5358 symbols which are not used in a relocation.
5359
aecf301f
ILT
53602011-06-28 Ian Lance Taylor <iant@google.com>
5361
5362 PR gold/12898
5363 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5364 script create indistinguishable segments.
5365 (Layout::set_segment_offsets): Use stable_sort when sorting
5366 segments. Pass this to Compare_segments constructor.
5367 * layout.h (class Layout): Make segment_precedes non-static.
5368 (class Compare_segments): Change from struct to class. Add
5369 layout_ field. Add constructor.
5370 * script-sections.cc
5371 (Script_sections::attach_sections_using_phdrs_clause): Rename
5372 local orphan to is_orphan. Don't report failure to put empty
5373 section in segment. On attachment failure, report name of
5374 section, and attach to first PT_LOAD segment.
5375
03ef7571
ILT
53762011-06-28 Ian Lance Taylor <iant@google.com>
5377
5378 PR gold/12934
5379 * target-select.cc (Target_selector::Target_selector): Add
5380 emulation parameter. Change all callers.
5381 (select_target_by_bfd_name): Rename from select_target_by_name.
5382 Change all callers.
5383 (select_target_by_emulation): New function.
5384 (supported_emulation_names): New function.
5385 * target-select.h (class Target_selector): Add emulation_ field.
5386 Update declarations.
5387 (Target_selector::recognize_by_bfd_name): Rename from
5388 recognize_by_name. Change all callers.
5389 (Target_selector::supported_bfd_names): Rename from
5390 supported_names. Change all callers.
5391 (Target_selector::recognize_by_emulation): New function.
5392 (Target_selector::supported_emulations): New function.
5393 (Target_selector::emulation): New function.
5394 (Target_selector::do_recognize_by_bfd_name): Rename from
5395 do_recognize_by_name. Change all callers.
5396 (Target_selector::do_supported_bfd_names): Rename from
5397 do_supported_names. Change all callers.
5398 (Target_selector::do_recognize_by_emulation): New function.
5399 (Target_selector::do_supported_emulations): New function.
5400 (select_target_by_bfd_name): Change name in declaration.
5401 (select_target_by_emulation): Declare.
5402 (supported_emulation_names): Declare.
5403 * parameters.cc (parameters_force_valid_target): Try to find
5404 target based on emulation from -m option.
5405 * options.h (class General_options): Change doc string for -m.
5406 * options.cc (help): Print emulations.
5407 (General_options::parse_V): Likewise.
5408 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5409 Add emulation parameter. Change all callers.
5410
200b2bb9
ILT
54112011-06-28 Ian Lance Taylor <iant@google.com>
5412
5413 * target.h (class Target): Add osabi_ field.
5414 (Target::osabi): New function.
5415 (Target::set_osabi): New function.
5416 (Target::Target): Initialize osabi_.
5417 (Target::do_adjust_elf_header): Make pure virtual.
5418 (Sized_target::do_adjust_elf_header): Declare.
5419 * target.cc (Sized_target::do_adjust_elf_header): New function.
5420 (class Sized_target): Instantiate all versions.
5421 * freebsd.h (class Target_freebsd): Remove.
5422 (Target_selector_freebsd::do_recognize): Call set_osabi on
5423 Target.
5424 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5425 (Target_selector_freebsd::set_osabi): Remove.
5426 * i386.cc (class Target_i386): Inherit from Sized_target rather
5427 than Target_freebsd.
5428 * x86_64.cc (class Target_x86_64): Likewise.
5429
b3ce541e
ILT
54302011-06-28 Ian Lance Taylor <iant@google.com>
5431
5432 * target.h (Target::can_check_for_function_pointers): Rewrite.
5433 Make non-virtual.
5434 (Target::can_icf_inline_merge_sections): Likewise.
5435 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5436 (Target::Target_info): Add can_icf_inline_merge_sections field.
5437 (Target::do_can_check_for_function_pointers): New virtual
5438 function.
5439 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5440 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5441 from can_check_for_function_pointers, move in file.
5442 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5443 section_may_have_icf_unsafe_poineters, move in file.
5444 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5445 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5446 Rename from can_check_for_function_pointers, move in file.
5447 (Target_i386::can_icf_inline_merge_sections): Remove.
5448 (Target_i386::i386_info): Initialize
5449 can_icf_inline_merge_sections.
5450 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5451 Initialize can_icf_inline_merge_sections.
5452 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5453 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5454 Rename from can_check_for_function_pointers, move in file.
5455 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5456 (Target_x86_64::x86_64_info): Initialize
5457 can_icf_inline_merge_sections.
5458 * testsuite/testfile.cc (Target_test::test_target_info):
5459 Likewise.
5460 * icf.cc (get_section_contents): Correct formatting.
5461
6d1c4efb
ILT
54622011-06-27 Ian Lance Taylor <iant@google.com>
5463
5464 * symtab.cc (Symbol::versioned_name): New function.
5465 (Symbol_table::add_to_final_symtab): Use versioned_name when
5466 appropriate.
5467 (Symbol_table::sized_write_symbol): Likewise.
5468 * symtab.h (class Symbol): Declare versioned_name.
5469 * stringpool.h (class Stringpool_template): Add variant of add
5470 which takes a std::basic_string.
5471 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5472 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5473 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5474 (ver_test_12.o): New target.
5475 * testsuite/Makefile.in: Rebuild.
5476
57eb9b50
DK
54772011-06-27 Doug Kwan <dougkwan@google.com>
5478
5479 * arm.cc (Arm_relocate_functions::thm_jump8,
5480 Arm_relocate_functions::thm_jump11): Use a wider signed
5481 type to compute offset.
5482 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5483 arm_thm_jump8.
5484 * testsuite/Makefile.in: Regenerate.
5485 * testsuite/arm_branch_in_range.sh: Check test results of
5486 arm_thm_jump11 and arm_thm_jump8.
5487 * testsuite/arm_thm_jump11.s: New test source file.
5488 * testsuite/arm_thm_jump11.t: New linker script.
5489 * testsuite/arm_thm_jump8.s: New test source file.
5490 * testsuite/arm_thm_jump8.t: New linker script.
5491
487b39df
ILT
54922011-06-24 Ian Lance Taylor <iant@google.com>
5493
5494 * layout.cc: Include "object.h".
5495 (ctors_sections_in_init_array): New static variable.
5496 (Layout::is_ctors_in_init_array): New function.
5497 (Layout::layout): Add entry to ctors_sections_in_init_array if
5498 appropriate.
5499 * layout.h (class Layout): Declare is_ctors_in_init_array.
5500 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5501 is_ctors_reverse_view is set.
5502 (Sized_relobj_file::write_sections): Add layout parameter. Change
5503 all callers. Set is_ctors_reverse_view field of View_size.
5504 (Sized_relobj_file::reverse_words): New function.
5505 * object.h (Sized_relobj_file::View_size): Add
5506 is_ctors_reverse_view field.
5507 (class Sized_relobj_file): Update declarations.
5508 * testsuite/initpri3.c: New test.
5509 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5510 initpri3b.
5511 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5512 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5513 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5514 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5515 * testsuite/Makefile.in: Rebuild.
5516
472076e4
CC
55172011-06-24 Cary Coutant <ccoutant@google.com>
5518
5519 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5520 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5521 (debug_msg_cdebug.err): New targets.
5522 * testsuite/Makefile.in: Regenerate.
5523 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5524 Fix checks for link with shared library.
5525
a60af0db
DK
55262011-06-24 Doug Kwan <dougkwan@google.com>
5527
5528 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5529 skip empty text sections.
5530 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5531
5393d741
ILT
55322011-06-22 Ian Lance Taylor <iant@google.com>
5533
5534 PR gold/12910
5535 * options.h (class General_options): Add --ctors-in-init-array.
5536 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5537 friends as SHT_PROGBITS for merging sections.
5538 (Layout::layout): Remove special handling of .init_array and
5539 friends. Don't sort if doing relocatable link. Sort for .ctors
5540 and .dtors if ctors_in_init_array.
5541 (Layout::make_output_section): Force correct section types for
5542 .init_array and friends. Don't sort if doing relocatable link,
5543 Don't sort .ctors and .dtors if ctors_in_init_array.
5544 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5545 (Layout::output_section_name): Add relobj parameter. Change all
5546 callers. Handle .ctors. and .dtors. in code rather than table.
5547 Handle .ctors and .dtors if ctors_in_init_array.
5548 (Layout::match_file_name): New function, moved from output.cc.
5549 * layout.h (class Layout): Update declarations.
5550 * output.cc: Include "layout.h".
5551 (Input_section_sort_entry::get_priority): New function.
5552 (Input_section_sort_entry::match_file_name): Just call
5553 Layout::match_file_name.
5554 (Output_section::Input_section_sort_init_fini_compare::operator()):
5555 Handle .ctors and .dtors. Sort by explicit priority rather than
5556 by name.
5557 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5558 * testsuite/initpri2.c: New test.
5559 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5560 (check_PROGRAMS): Add initpri2.
5561 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5562 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5563 * configure, testsuite/Makefile.in: Rebuild.
5564
e1f74f98
ILT
55652011-06-19 Ian Lance Taylor <iant@google.com>
5566
5567 PR gold/12880
5568 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5569 .interp section to a PT_INTERP segment even if we have seen a
5570 --dynamic-linker option. Don't do it if we have seen a PHDRS
5571 clause in a linker script.
5572 (Layout::finalize): Don't create a .interp section if we've
5573 already create a PT_INTERP segment.
5574 (Layout::create_interp): Always call choose_output_section (revert
5575 patch of 2011-06-17). Don't create PT_INTERP segment.
5576 * script-sections.cc
5577 (Script_sections::create_note_and_tls_segments): Add a .interp
5578 section to a PT_INTERP segment even if we have seen a
5579 --dynamic-linker option.
5580
766f91bb
ILT
55812011-06-18 Ian Lance Taylor <iant@google.com>
5582
5583 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5584 merely because a non-PT_LOAD segment has a dynamic reloc.
5585
0d212c3a
ILT
55862011-06-18 Ian Lance Taylor <iant@google.com>
5587
5588 * layout.cc (Layout::finish_dynamic_section): Don't create
5589 DT_FLAGS entry if not needed.
5590
911a5072
ILT
55912011-06-18 Ian Lance Taylor <iant@google.com>
5592
5593 PR gold/12745
5594 * layout.cc (Layout::layout_eh_frame): Correct handling of
5595 writable .eh_frame section.
5596
534b4e5f
ILT
55972011-06-17 Ian Lance Taylor <iant@google.com>
5598
5599 PR gold/12893
5600 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5601 symbol is redefined with the exact same object and value.
5602
10b4f102
ILT
56032011-06-17 Ian Lance Taylor <iant@google.com>
5604
5605 PR gold/12880
5606 * layout.h (class Layout): Add interp_segment_ field.
5607 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5608 (Layout::attach_allocated_section_to_segment): If making shared
5609 library, put .interp section in PT_INTERP segment.
5610 (Layout::finalize): Also call create_interp if -dynamic-linker
5611 option was used.
5612 (Layout::create_interp): Assert that there is no PT_INTERP
5613 segment. If not using a SECTIONS clause, use make_output_section.
5614 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5615 * script-sections.cc
5616 (Script_sections::create_note_and_tls_segments): If making shared
5617 library, put .interp section in PT_INTERP segment.
5618
a29b0dad
ILT
56192011-06-17 Ian Lance Taylor <iant@google.com>
5620
e588ea8d
ILT
5621 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5622 when making a shared library.
5623
56242011-06-17 Ian Lance Taylor <iant@google.com>
5625
5626 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5627 parameter. Change all callers. Don't issue warning about PC32
5628 against locally defined symbol.
a29b0dad 5629
9d3b0698
ILT
56302011-06-16 Ian Lance Taylor <iant@google.com>
5631
5632 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5633 occurs in same object.
5634
85b0f90c
AM
56352011-06-14 Alan Modra <amodra@gmail.com>
5636
5637 * po/POTFILES.in: Regenerate.
5638
a94907d9
ILT
56392011-06-09 Ian Lance Taylor <iant@google.com>
5640
5641 * script-sections.cc
5642 (Orphan_output_section::set_section_addresses): For a relocatable
5643 link set address to 0.
5644
4fb3a1c3
CC
56452011-06-09 Cary Coutant <ccoutant@google.com>
5646
5647 PR gold/12804
5648 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5649 used with --compress-debug-sections.
5650 * gold/object.cc (Sized_relobj_file::do_layout): Report
5651 uncompressed size of compressed input sections.
5652
61220854
CC
56532011-06-08 Cary Coutant <ccoutant@google.com>
5654
5655 PR gold/12804
5656 * testsuite/two_file_test_2_v1.cc: Change initialization of
5657 v2 to keep it in .data.
5658
e6455dfb
CC
56592011-06-07 Cary Coutant <ccoutant@google.com>
5660
5661 * common.cc (Symbol_table::do_allocate_commons_list): Call
5662 gold_fallback.
5663 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5664 (Errors::fallback): New function.
5665 (gold_fallback): New function.
5666 * errors.h (Errors::fallback): New function.
5667 * gold.cc (gold_exit): Change status parameter to enum; adjust
5668 all callers.
5669 (queue_initial_tasks): Call gold_fallback.
5670 * gold.h: Include cstdlib.
5671 (Exit_status): New enum type.
5672 (gold_exit): Change status parameter to enum.
5673 (gold_fallback): New function.
5674 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5675 (Layout::create_symtab_sections): Likewise.
5676 (Layout::create_shdrs): Likewise.
5677 * main.cc (main): Adjust call to gold_exit.
5678 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5679 (Output_data_got::add_got_entry_pair): Likewise.
5680 (Output_section::add_input_section): Likewise.
5681 (Output_section::add_output_section_data): Likewise.
5682 (Output_segment::set_section_list_addresses): Likewise.
5683 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5684
fb0e076f
CC
56852011-06-07 Cary Coutant <ccoutant@google.com>
5686
5687 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5688 for incremental links.
5689 * output.cc (Output_segment::set_section_list_addresses): Remove
5690 FIXME and test for TLS or BSS.
5691
a5ee4d5d
CC
56922011-06-07 Cary Coutant <ccoutant@google.com>
5693
5694 * testsuite/Makefile.am: Add incremental_copy_test,
5695 incremental_common_test_1.
5696 * testsuite/Makefile.in: Regenerate.
5697 * testsuite/common_test_1_v1.c: New source file.
5698 * testsuite/common_test_1_v2.c: New source file.
5699 * testsuite/copy_test_v1.cc: New source file.
5700
5146f448
CC
57012011-06-07 Cary Coutant <ccoutant@google.com>
5702
5703 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5704 update, allocate common from bss section's free list.
5705 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5706 linker-defined symbols.
5707 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5708 Skip GOT and PLT entries that are no longer referenced.
5709 (Output_section_incremental_inputs::write_info_blocks): Mark
5710 linker-defined symbols.
5711 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5712 * output.cc (Output_section::allocate): New function.
5713 * output.h (Output_section::allocate): New function.
5714 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5715 linker-defined symbols.
5716 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5717 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5718 (Symbol::init_base_output_data): Likewise.
5719 (Symbol::init_base_output_segment): Likewise.
5720 (Symbol::init_base_constant): Likewise.
5721 (Sized_symbol::init_output_data): Likewise.
5722 (Sized_symbol::init_output_segment): Likewise.
5723 (Sized_symbol::init_constant): Likewise.
5724 (Symbol_table::do_define_in_output_data): Likewise.
5725 (Symbol_table::do_define_in_output_segment): Likewise.
5726 (Symbol_table::do_define_as_constant): Likewise.
5727 * symtab.h (Symbol::is_predefined): New function.
5728 (Symbol::init_base_output_data): Add is_predefined parameter.
5729 (Symbol::init_base_output_segment): Likewise.
5730 (Symbol::init_base_constant): Likewise.
5731 (Symbol::is_predefined_): New data member.
5732 (Sized_symbol::init_output_data): Add is_predefined parameter.
5733 (Sized_symbol::init_output_segment): Likewise.
5734 (Sized_symbol::init_constant): Likewise.
5735 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5736
26d3c67d
CC
57372011-06-07 Cary Coutant <ccoutant@google.com>
5738
5739 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5740 instead of emit_copy_reloc.
5741 (Copy_relocs::emit_copy_reloc): Refactor.
5742 (Copy_relocs::make_copy_reloc): New function.
5743 (Copy_relocs::add_copy_reloc): Remove.
5744 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5745 section.
5746 (Copy_relocs::make_copy_reloc): New function.
5747 (Copy_relocs::add_copy_reloc): Remove.
5748 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5749 unchanged input files.
5750 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5751 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5752 Reserve BSS space for COPY relocations.
5753 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5754 (Output_section_incremental_inputs::write_info_blocks): Record
5755 whether a symbol is copied from a shared object.
5756 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5757 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5758 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5759 (Incremental_input_entry_reader::get_output_symbol_index): Add
5760 is_copy parameter.
5761 (Incremental_binary::emit_copy_relocs): New function.
5762 (Incremental_binary::do_emit_copy_relocs): New function.
5763 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5764 new data member.
5765 (Sized_incremental_binary::add_copy_reloc): New function.
5766 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5767 (Sized_incremental_binary::Copy_reloc): New struct.
5768 (Sized_incremental_binary::Copy_relocs): New typedef.
5769 (Sized_incremental_binary::copy_relocs_): New data member.
5770 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5771 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5772 * target.h (Sized_target::emit_copy_reloc): New function.
5773 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5774
7cdb37d9
CC
57752011-06-02 Cary Coutant <ccoutant@google.com>
5776
5777 PR gold/12163
5778 * gold/archive.cc (Archive::Archive): Initialize new data member.
5779 (Archive::include_all_members): Return if archive has already been
5780 included.
5781 * gold/archive.h (Archive::include_all_members_): New data member.
5782
cc643b88
NC
57832011-06-02 Nick Clifton <nickc@redhat.com>
5784
5785 * dynobj.h: Fix spelling mistake in comment.
5786 * output.cc: Likewise.
5787
f62a3ca7 57882011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5789 Asier Llano
f62a3ca7
DK
5790
5791 PR gold/12826
cc643b88 5792 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5793 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5794 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5795 redundant arm_exidx_test.so.
5796 * testsuite/Makefile.in: Regenerate.
5797 (check_SCRIPTS): Add pr12826.sh
5798 (check_DATA): Add pr12826.stdout
5799 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5800 * testsuite/pr12826.sh: New file.
5801 * testsuite/pr12826_1.s: Ditto.
5802 * testsuite/pr12826_1.s: Ditto.
5803
8dbe1edc
ILT
58042011-05-30 Ian Lance Taylor <iant@google.com>
5805
5806 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5807 sections.
5808
c49875be
ILT
58092011-05-29 Ian Lance Taylor <iant@google.com>
5810
5811 PR gold/12804
5812 * testsuite/Makefile.am: Use different file name for two_file_test
5813 temporary file for each incremental test.
5814 * testsuite/Makefile.in: Rebuild.
5815
69d53f7a
ILT
58162011-05-29 Ian Lance Taylor <iant@google.com>
5817
5818 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5819 binary input file is empty.
5820
41d0ab5f
ILT
58212011-05-27 Ian Lance Taylor <iant@google.com>
5822
5823 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5824 (ver_test_9.so): Likewise.
5825 * testsuite/Makefile.in: Rebuild.
5826
89d8a36b
CC
58272011-05-26 Cary Coutant <ccoutant@google.com>
5828
5829 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5830 * incremental.cc (Incremental_inputs::report_input_section): Fix
5831 comment, indentation.
5832 (Incremental_inputs::report_comdat_group): New function.
5833 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5834 of data for incremental input file entry.
5835 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5836 group count, COMDAT group signatures.
5837 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5838 an unchanged input file.
5839 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5840 Initialize new data member.
5841 (Incremental_object_entry::add_comdat_group): New function.
5842 (Incremental_object_entry::get_comdat_group_count): New function.
5843 (Incremental_object_entry::get_comdat_signature_key): New function.
5844 (Incremental_object_entry::groups_): New data member.
5845 (Incremental_inputs::report_comdat_group): New function.
5846 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5847 data for incremental input file entry.
5848 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5849 (Incremental_input_entry_reader::get_input_section): Adjust size of
5850 data for incremental input file entry.
5851 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5852 (Incremental_input_entry_reader::get_comdat_group_signature): New
5853 function.
5854 * object.cc (Sized_relobj::include_section_group): Report kept
5855 COMDAT groups for incremental links.
5856
1706a06f
ILT
58572011-05-24 David Meyer <pdox@google.com>
5858
5859 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5860 with name parameter. Add found_name parameter.
5861 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5862 * dirsearch.h (class Dirsearch): Update declaration.
5863
a10ae760
ILT
58642011-05-24 Ian Lance Taylor <iant@google.com>
5865
5866 * archive.cc (Library_base::should_include_member): Pull in object
5867 from archive if it defines the entry symbol.
5868 * parameters.cc (Parameters::entry): New function.
5869 * parameters.h (class Parameters): Declare entry.
5870 * output.h (class Output_file_header): Remove entry_ field.
5871 * output.cc (Output_file_header::Output_file_header): Remove entry
5872 parameter. Change all callers.
5873 (Output_file_header::entry): Use parameters->entry.
5874 * gold.cc (queue_middle_tasks): Likewise.
5875 * plugin.cc (Plugin_hook::run): Likewise.
5876
aa92d6ed
CC
58772011-05-24 Cary Coutant <ccoutant@google.com>
5878
5879 * gold.cc (queue_initial_tasks): Pass incremental base filename
5880 to Output_file::open_base_file; don't print error message.
5881 * incremental-dump.cc (main): Adjust call to
5882 Output_file::open_for_modification.
5883 * incremental-dump.cc (main): Likewise.
5884 * incremental.cc (Incremental_inputs::report_command_line):
5885 Ignore --incremental-base option when comparing command lines.
5886 Ignore parameter when given as separate argument.
5887 * options.h (class General_options): Add --incremental-base.
5888 * output.cc (Output_file::Output_file):
5889 (Output_file::open_base_file): Add base_name and writable parameters;
5890 read base file into new file; print error message here.
5891 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5892 callers.
5893 * output.h (Output_file::open_for_modification): Rename to...
5894 (Output_file::open_base_file): ...this; add base_name and
5895 writable parameters; adjust all callers.
5896 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5897 callers.
5898 * testsuite/Makefile.am (incremental_test_4): Test
5899 --incremental-base.
5900 * testsuite/Makefile.in: Regenerate.
5901
2eedd706
CC
59022011-05-24 Cary Coutant <ccoutant@google.com>
5903
5904 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5905 incremental_test_4.
5906 * testsuite/Makefile.in: Regenerate.
5907 * testsuite/two_file_test_1_v1.cc: New test source file.
5908 * testsuite/two_file_test_1b_v1.cc: New test source file.
5909 * testsuite/two_file_test_2_v1.cc: New test source file.
5910
0f1c85a6
CC
59112011-05-24 Cary Coutant <ccoutant@google.com>
5912
5913 * dynobj.h (Dynobj::do_dynobj): New function.
5914 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5915 flag and soname for shared objects.
5916 * incremental.cc (Incremental_inputs::report_object): Make
5917 either Incremental_object_entry or Incremental_dynobj_entry; add
5918 soname to string table.
5919 (Incremental_inputs::report_input_section): Add assertion.
5920 (Output_section_incremental_inputs::set_final_data_size): Adjust
5921 type of input file entry for shared libraries; adjust size of
5922 shared library info entry.
5923 (Output_section_incremental_inputs::write_input_files): Write
5924 as_needed flag for shared libraries.
5925 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5926 of input file entry for shared libraries; write soname.
5927 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5928 soname from incremental info.
5929 * incremental.h (enum Incremental_input_flags): Add
5930 INCREMENTAL_INPUT_AS_NEEDED.
5931 (Incremental_input_entry::Incremental_input_entry): Initialize new
5932 data member.
5933 (Incremental_input_entry::set_as_needed): New function.
5934 (Incremental_input_entry::as_needed): New function.
5935 (Incremental_input_entry::do_dynobj_entry): New function.
5936 (Incremental_input_entry::as_needed_): New data member.
5937 (Incremental_object_entry::Incremental_object_entry): Don't check
5938 for shared library.
5939 (Incremental_object_entry::do_type): Likewise.
5940 (class Incremental_dynobj_entry): New class.
5941 (Incremental_input_entry_reader::as_needed): New function.
5942 (Incremental_input_entry_reader::get_soname): New function.
5943 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5944 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5945 size of shared library info entry.
58797674 5946 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5947 incremental link when adding DT_NEEDED entries.
5948 * object.h (Object::Object): Initialize new data member.
5949 (Object::dynobj): New function.
5950 (Object::set_as_needed): New function.
5951 (Object::as_needed): New function.
5952 (Object::do_dynobj): New function.
5953 (Object::as_needed_): New data member.
5954
6fa2a40b
CC
59552011-05-24 Cary Coutant <ccoutant@google.com>
5956
5957 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5958 info; adjust display of GOT entries.
5959 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5960 vector of input objects; remove file_status_.
5961 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5962 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5963 got_plt reader; call target hooks to reserve GOT entries.
5964 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5965 of input file info header and GOT info entry.
5966 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5967 relocation info.
5968 (Got_plt_view_info::got_descriptor): Remove.
5969 (Got_plt_view_info::sym_index): New data member.
5970 (Got_plt_view_info::input_index): New data member.
5971 (Local_got_offset_visitor::visit): Write input file index.
5972 (Global_got_offset_visitor::visit): Write 0 for input file index.
5973 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5974 with sym_index and input_index.
5975 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5976 incremental info GOT entry; replace got_descriptor with input_index.
5977 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5978 map from input file index to object.
5979 (Sized_relobj_incr::do_layout): Replace direct data member reference
5980 with accessor function.
5981 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5982 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5983 Adjust size of input file info header.
5984 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5985 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5986 (Incremental_input_entry_reader::get_input_section): Adjust size of
5987 input file info header.
5988 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5989 of incremental info GOT entry.
5990 (Incremental_got_plt_reader::get_got_desc): Remove.
5991 (Incremental_got_plt_reader::get_got_symndx): New function.
5992 (Incremental_got_plt_reader::get_got_input_index): New function.
5993 (Sized_incremental_binary::Sized_incremental_binary): Remove
5994 file_status_; add input_objects_.
5995 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5996 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5997 (Sized_incremental_binary::file_is_unchanged): Remove.
5998 (Sized_incremental_binary::set_input_object): New function.
5999 (Sized_incremental_binary::input_object): New function.
6000 (Sized_incremental_binary::file_status_): Remove.
6001 (Sized_incremental_binary::input_objects_): New data member.
6002 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6003 references.
6004 (Sized_relobj_incr::invalid_address): Move to base class.
6005 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6006 class.
6007 (Sized_relobj_incr::do_output_section_offset): Likewise.
6008 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6009 (Sized_relobj_incr::section_offsets_): Likewise.
6010 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6011 function.
6012 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6013 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6014 with accessor function.
6015 (Sized_relobj_file::do_layout): Likewise.
6016 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6017 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6018 (Sized_relobj_file::compute_final_local_value): Replace refs to
6019 section_offsets_ with accessor function.
6020 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6021 * object.h (Relobj::Relobj): Initialize new data members.
6022 (Relobj::add_dyn_reloc): New function.
6023 (Relobj::first_dyn_reloc): New function.
6024 (Relobj::dyn_reloc_count): New function.
6025 (Relobj::first_dyn_reloc_): New data member.
6026 (Relobj::dyn_reloc_count_): New data member.
6027 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6028 references.
6029 (Sized_relobj::Address): New typedef.
6030 (Sized_relobj::invalid_address): Move here from child class.
6031 (Sized_relobj::Sized_relobj): Initialize new data members.
6032 (Sized_relobj::sized_relobj): New function.
6033 (Sized_relobj::is_output_section_offset_invalid): Move here from
6034 child class.
6035 (Sized_relobj::get_output_section_offset): Likewise.
6036 (Sized_relobj::local_has_got_offset): Likewise.
6037 (Sized_relobj::local_got_offset): Likewise.
6038 (Sized_relobj::set_local_got_offset): Likewise.
6039 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6040 (Sized_relobj::clear_got_offsets): New function.
6041 (Sized_relobj::section_offsets): Move here from child class.
6042 (Sized_relobj::do_output_section_offset): Likewise.
6043 (Sized_relobj::do_set_section_offset): Likewise.
6044 (Sized_relobj::Local_got_offsets): Likewise.
6045 (Sized_relobj::local_got_offsets_): Likewise.
6046 (Sized_relobj::section_offsets_): Likewise.
6047 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6048 references.
6049 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6050 class.
6051 (Sized_relobj_file::sized_relobj): New function
6052 (Sized_relobj_file::local_has_got_offset): Move to base class.
6053 (Sized_relobj_file::local_got_offset): Likewise.
6054 (Sized_relobj_file::set_local_got_offset): Likewise.
6055 (Sized_relobj_file::get_output_section_offset): Likewise.
6056 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6057 (Sized_relobj_file::do_output_section_offset): Likewise.
6058 (Sized_relobj_file::do_set_section_offset): Likewise.
6059 (Sized_relobj_file::Local_got_offsets): Likewise.
6060 (Sized_relobj_file::local_got_offsets_): Likewise.
6061 (Sized_relobj_file::section_offsets_): Likewise.
6062 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6063 (all constructors).
6064 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6065 (Output_reloc::get_symbol_index): Likewise.
6066 (Output_reloc::local_section_offset): Likewise.
6067 (Output_reloc::get_address): Likewise.
6068 (Output_reloc::symbol_value): Likewise.
6069 (Output_data_got::reserve_slot): Move to class definition.
6070 (Output_data_got::reserve_local): New function.
6071 (Output_data_got::reserve_slot_for_global): Remove.
6072 (Output_data_got::reserve_global): New function.
6073 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6074 (all constructors, two instantiations).
6075 (Output_reloc::get_relobj): New function (two instantiations).
6076 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6077 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6078 (Output_data_reloc::add_global): Adjust type of relobj.
6079 (Output_data_reloc::add_global_relative): Likewise.
6080 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6081 (Output_data_reloc::add_local): Likewise.
6082 (Output_data_reloc::add_local_relative): Likewise.
6083 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6084 (Output_data_reloc::add_local_section): Likewise.
6085 (Output_data_reloc::add_output_section): Likewise.
6086 (Output_data_reloc::add_absolute): Likewise.
6087 (Output_data_reloc::add_target_specific): Likewise.
6088 (Output_data_got::reserve_slot): Move definition here.
6089 (Output_data_got::reserve_local): New function.
6090 (Output_data_got::reserve_global): New function.
6091 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6092 section_offsets_ with accessor function.
6093 (Sized_relobj_file::write_sections): Likewise.
6094 (Sized_relobj_file::do_relocate_sections): Likewise.
6095 * target.h (Sized_target::reserve_local_got_entry): New function.
6096 (Sized_target::reserve_global_got_entry): New function.
6097 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6098 (Target_x86_64::reserve_global_got_entry): New function.
6099 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6100
4829d394
CC
61012011-05-23 Cary Coutant <ccoutant@google.com>
6102
6103 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6104 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6105 bit when checking got_type.
6106 * incremental.cc (Sized_incremental_binary::setup_readers):
6107 Store symbol table and string table locations; initialize bit vector
6108 of file status flags.
6109 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6110 unchanged files.
6111 (Sized_incremental_binary::do_process_got_plt): New function.
6112 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6113 (Output_section_incremental_inputs::set_final_data_size): Record
6114 file index for each input file.
6115 (Output_section_incremental_inputs::write_got_plt): Store file index
6116 instead of input entry offset for each GOT entry.
6117 * incremental.h
6118 (Incremental_input_entry::Incremental_input_entry): Initialize new
6119 data member.
6120 (Incremental_input_entry::set_offset): Store file index.
6121 (Incremental_input_entry::get_file_index): New function.
6122 (Incremental_input_entry::file_index_): New data member.
6123 (Incremental_binary::process_got_plt): New function.
6124 (Incremental_binary::do_process_got_plt): New function.
6125 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6126 data members.
6127 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
6128 (Sized_incremental_binary::set_file_is_unchanged): New function.
6129 (Sized_incremental_binary::file_is_unchanged): New function.
6130 (Sized_incremental_binary::do_process_got_plt): New function.
6131 (Sized_incremental_binary::file_status_): New data member.
6132 (Sized_incremental_binary::main_symtab_loc_): New data member.
6133 (Sized_incremental_binary::main_strtab_loc_): New data member.
6134 * output.cc (Output_data_got::Got_entry::write): Add case
6135 RESERVED_CODE.
6136 (Output_data_got::add_global): Call add_got_entry.
6137 (Output_data_got::add_global_plt): Likewise.
6138 (Output_data_got::add_global_with_rel): Likewise.
6139 (Output_data_got::add_global_with_rela): Likewise.
6140 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
6141 (Output_data_got::add_global_pair_with_rela): Likewise.
6142 (Output_data_got::add_local): Call add_got_entry.
6143 (Output_data_got::add_local_plt): Likewise.
6144 (Output_data_got::add_local_with_rel): Likewise.
6145 (Output_data_got::add_local_with_rela): Likewise.
6146 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
6147 (Output_data_got::add_local_pair_with_rela): Likewise.
6148 (Output_data_got::reserve_slot): New function.
6149 (Output_data_got::reserve_slot_for_global): New function.
6150 (Output_data_got::add_got_entry): New function.
6151 (Output_data_got::add_got_entry_pair): New function.
6152 (Output_section::add_output_section_data): Edit FIXME.
6153 * output.h
6154 (Output_section_data_build::Output_section_data_build): New
6155 constructor with size parameter.
6156 (Output_data_space::Output_data_space): Likewise.
6157 (Output_data_got::Output_data_got): Initialize new data member; new
6158 constructor with size parameter.
6159 (Output_data_got::add_constant): Call add_got_entry.
6160 (Output_data_got::reserve_slot): New function.
6161 (Output_data_got::reserve_slot_for_global): New function.
6162 (class Output_data_got::Got_entry): Add RESERVED_CODE.
6163 (Output_data_got::add_got_entry): New function.
6164 (Output_data_got::add_got_entry_pair): New function.
6165 (Output_data_got::free_list_): New data member.
6166 * target.h (Sized_target::init_got_plt_for_update): New function.
6167 (Sized_target::register_global_plt_entry): New function.
6168 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
6169 Initialize new data member; call init; add constructor with PLT count.
6170 (Output_data_plt_x86_64::init): New function.
6171 (Output_data_plt_x86_64::add_relocation): New function.
6172 (Output_data_plt_x86_64::reserve_slot): New function.
6173 (Output_data_plt_x86_64::free_list_): New data member.
6174 (Target_x86_64::init_got_plt_for_update): New function.
6175 (Target_x86_64::register_global_plt_entry): New function.
6176 (Output_data_plt_x86_64::add_entry): Allocate from free list for
6177 incremental updates.
6178 (Output_data_plt_x86_64::add_relocation): New function.
6179 * testsuite/object_unittest.cc (Object_test): Set default options.
6180
ec69d6da
ILT
61812011-05-16 Ian Lance Taylor <iant@google.com>
6182
6183 * options.h (class General_options): Make -i a synonym for -r.
6184
732e31de
ILT
61852011-05-16 Ian Lance Taylor <iant@google.com>
6186
6187 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
6188
403676b5
CC
61892011-05-10 Cary Coutant <ccoutant@google.com>
6190
6191 * object.cc (Sized_relobj::do_count_local_symbols): Check for
6192 strip_all (-s).
6193
5b7b7d6e
ILT
61942011-05-06 Ian Lance Taylor <iant@google.com>
6195
6196 * layout.cc (Layout::layout): If the output section flags change,
6197 update the ordering.
6198
f0f9babf
CC
61992011-04-25 Cary Coutant <ccoutant@google.com>
6200
6201 * incremental-dump.cc (dump_incremental_inputs): Print local
6202 symbol info for each input file.
6203 * incremental.cc
6204 (Output_section_incremental_inputs::set_final_data_size): Add local
6205 symbol info to input file entries in incremental info.
6206 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6207 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
6208 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
6209 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
6210 implementation.
6211 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
6212 (Sized_incr_relobj::do_relocate): Write the local symbols.
6213 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
6214 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
6215 Adjust size of input file header.
6216 (Incremental_inputs_reader::get_local_symbol_offset): New function.
6217 (Incremental_inputs_reader::get_local_symbol_count): New function.
6218 (Incremental_inputs_reader::get_input_section): Adjust size of input
6219 file header.
6220 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
6221 (Sized_incr_relobj::This): New typedef.
6222 (Sized_incr_relobj::sym_size): New const data member.
6223 (Sized_incr_relobj::Local_symbol): New struct.
6224 (Sized_incr_relobj::do_output_local_symbol_count): New function.
6225 (Sized_incr_relobj::do_local_symbol_offset): New function.
6226 (Sized_incr_relobj::local_symbol_count_): New data member.
6227 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
6228 (Sized_incr_relobj::local_symbol_index_): New data member.
6229 (Sized_incr_relobj::local_symbol_offset_): New data member.
6230 (Sized_incr_relobj::local_dynsym_offset_): New data member.
6231 (Sized_incr_relobj::local_symbols_): New data member.
6232 * object.h (Relobj::output_local_symbol_count): New function.
6233 (Relobj::local_symbol_offset): New function.
6234 (Relobj::do_output_local_symbol_count): New function.
6235 (Relobj::do_local_symbol_offset): New function.
6236 (Sized_relobj::do_output_local_symbol_count): New function.
6237 (Sized_relobj::do_local_symbol_offset): New function.
6238
d0a9ace3
ILT
62392011-04-22 Vladimir Simonov <sv@sw.ru>
6240
6241 * descriptors.cc (set_close_on_exec): New function.
6242 (Descriptors::open): Use set_close_on_exec.
6243 * output.cc (S_ISLNK): Define if not defined.
6244
94a3fc8b
CC
62452011-04-22 Cary Coutant <ccoutant@google.com>
6246
6247 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6248 global symbol map.
6249 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6250 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
6251 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
6252 relocations.
6253 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
6254 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
6255 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
6256 * incremental.h
6257 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
6258 function.
6259 (Incremental_binary::apply_incremental_relocs): New function.
6260 (Incremental_binary::do_apply_incremental_relocs): New function.
6261 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
6262 data member.
6263 (Sized_incremental_binary::add_global_symbol): New function.
6264 (Sized_incremental_binary::global_symbol): New function.
6265 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6266 (Sized_incremental_binary::symbol_map_): New data member.
6267 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
6268 * target.h (Sized_target::apply_relocation): New function.
6269 * target-reloc.h (apply_relocation): New function.
6270 * x86_64.cc (Target_x86_64::apply_relocation): New function.
6271
c87e4302
DK
62722011-04-22 Doug Kwan <dougkwan@google.com>
6273
6274 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
6275 flag of a SHT_ARM_EXIDX section.
2e702c99 6276 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
6277 * testsuite/Makefile.in: Regenerate.
6278 * testsuite/arm_exidx_test.s: New file.
6279 * testsuite/arm_exidx_test.sh: Same.
6280
e7782cf6
CC
62812011-04-20 Cary Coutant <ccoutant@google.com>
6282
6283 PR gold/12689
6284 * archive.h (Incremental_archive_entry::Archive_member):
6285 Initialize arg_serial_ (second constructor).
6286
308ecdc7
ILT
62872011-04-17 Ian Lance Taylor <iant@google.com>
6288
6289 * object.cc (Relocate_info::location): Simplify location string.
6290 * errors.cc (Errors::error_at_location): Don't print program
6291 name.
6292 (Errors::warning_at_location): Likewise.
6293 (Errors::undefined_symbol): Likewise.
6294 * testsuite/debug_msg.sh: Update accordingly.
6295
bec5b579
CC
62962011-04-14 Cary Coutant <ccoutant@google.com>
6297
6298 * gold/layout.cc (Layout::symtab_section_offset): New function.
6299 * gold/layout.h (Layout::symtab_section_offset): New function.
6300 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
6301
88597d34
ILT
63022011-04-12 Ian Lance Taylor <iant@google.com>
6303
6304 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
6305 with MREMAP_MAYMOVE.
6306 * output.h (class Output_file): Add map_is_allocated_ field.
6307 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
6308 not available, provide stubs. If mremap is not available, #define
6309 it to gold_mremap.
6310 (MREMAP_MAYMOVE): Define if not defined.
6311 (Output_file::Output_file): Initialize map_is_allocated_.
6312 (Output_file::resize): Check map_is_allocated_.
6313 (Output_file::map_anonymous): If mmap fails, use malloc.
6314 (Output_file::unmap): Don't do anything for an anonymous map.
6315 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
6316 is not available, provide stubs.
6317 (File_read::View::~View): Use free rather than delete[].
6318 (File_read::make_view): Use malloc rather than new[]. If mmap
6319 fails, use malloc.
6320 (File_read::find_or_make_view): Use malloc rather than new[].
6321 * gold.h: Remove HAVE_REMAP code.
6322 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
6323 exists. Rename mremap to gold_mremap. If mmap is not available
6324 don't do anything.
6325 * configure, config.in: Rebuild.
6326
11e361bc
ILT
63272011-04-11 Ian Lance Taylor <iant@google.com>
6328
6329 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
6330 initialize local variable v.
6331
cdc29364
CC
63322011-04-11 Cary Coutant <ccoutant@google.com>
6333
6334 * archive.cc (Archive::include_member): Adjust call to
6335 report_object.
6336 (Add_archive_symbols::run): Track argument serial numbers.
6337 (Lib_group::include_member): Likewise.
6338 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
6339 * archive.h (Incremental_archive_entry::Archive_member):
6340 Initialize arg_serial_.
6341 (Archive_member::arg_serial_): New data member.
6342 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6343 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6344 incremental link.
6345 (Sized_dynobj::do_for_all_local_got_entries): New function.
6346 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6347 function.
6348 * fileread.cc (get_mtime): New function.
6349 * fileread.h (get_mtime): New function.
6350 * gold.cc (queue_initial_tasks): Check for incremental update.
6351 (process_incremental_input): New function.
6352 (queue_middle_tasks): Don't force valid target for incremental
6353 update.
6354 * incremental-dump.cc (find_input_containing_global): Adjust
6355 size of symbol info entry.
6356 (dump_incremental_inputs): Dump argument serial number and
6357 in_system_directory flag; bias shndx by 1; print symbol names
6358 when dumping per-file symbol lists; use new symbol info readers.
6359 * incremental.cc
6360 (Output_section_incremental_inputs:update_data_size): New function.
6361 (Sized_incremental_binary::setup_readers): Setup input readers
6362 for each input file; build maps for files added from libraries
6363 and scripts.
6364 (Sized_incremental_binary::check_input_args): New function.
6365 (Sized_incremental_binary::do_check_inputs): Build map of argument
6366 serial numbers to input arguments.
6367 (Sized_incremental_binary::do_file_has_changed): Rename
6368 do_file_is_unchanged to this; compare file modification times.
6369 (Sized_incremental_binary::do_init_layout): New function.
6370 (Sized_incremental_binary::do_reserve_layout): New function.
6371 (Sized_incremental_binary::do_get_input_reader): Remove.
6372 (Sized_incremental_binary::get_symtab_view): New function.
6373 (Incremental_checker::can_incrementally_link_output_file): Remove.
6374 (Incremental_inputs::report_command_line): Exclude --debug options.
6375 (Incremental_inputs::report_archive_begin): Add parameter; track
6376 argument serial numbers; don't put input file entry for archive
6377 before archive members.
6378 (Incremental_inputs::report_archive_end): Put input file entry
6379 for archive after archive members.
6380 (Incremental_inputs::report_object): Add parameter; track argument
6381 serial numbers and in_system_directory flag.
6382 (Incremental_inputs::report_script): Add parameter; track argument
6383 serial numbers.
6384 (Output_section_incremental_inputs::set_final_data_size): Adjust
6385 size of symbol info entry; check for forwarding symbols.
6386 (Output_section_incremental_inputs::write_input_files): Write
6387 in_system_directory flag and argument serial number.
6388 (Output_section_incremental_inputs::write_info_blocks): Map section
6389 indices between incremental info and original input file; store
6390 input section index for each symbol.
6391 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6392 change operator() to visit().
6393 (class Global_got_offset_visitor): Likewise.
6394 (class Global_symbol_visitor_got_plt):
6395 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6396 classes.
6397 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6398 (Sized_incr_relobj::do_read_symbols): New function.
6399 (Sized_incr_relobj::do_layout): New function.
6400 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6401 (Sized_incr_relobj::do_add_symbols): New function.
6402 (Sized_incr_relobj::do_should_include_member): New function.
6403 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6404 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6405 (Sized_incr_relobj::do_section_size): New function.
6406 (Sized_incr_relobj::do_section_name): New function.
6407 (Sized_incr_relobj::do_section_contents): New function.
6408 (Sized_incr_relobj::do_section_flags): New function.
6409 (Sized_incr_relobj::do_section_entsize): New function.
6410 (Sized_incr_relobj::do_section_address): New function.
6411 (Sized_incr_relobj::do_section_type): New function.
6412 (Sized_incr_relobj::do_section_link): New function.
6413 (Sized_incr_relobj::do_section_info): New function.
6414 (Sized_incr_relobj::do_section_addralign): New function.
6415 (Sized_incr_relobj::do_initialize_xindex): New function.
6416 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6417 (Sized_incr_relobj::do_read_relocs): New function.
6418 (Sized_incr_relobj::do_gc_process_relocs): New function.
6419 (Sized_incr_relobj::do_scan_relocs): New function.
6420 (Sized_incr_relobj::do_count_local_symbols): New function.
6421 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6422 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6423 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6424 (Sized_incr_relobj::do_relocate): New function.
6425 (Sized_incr_relobj::do_set_section_offset): New function.
6426 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6427 (Sized_incr_dynobj::do_read_symbols): New function.
6428 (Sized_incr_dynobj::do_layout): New function.
6429 (Sized_incr_dynobj::do_add_symbols): New function.
6430 (Sized_incr_dynobj::do_should_include_member): New function.
6431 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6432 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6433 (Sized_incr_dynobj::do_section_size): New function.
6434 (Sized_incr_dynobj::do_section_name): New function.
6435 (Sized_incr_dynobj::do_section_contents): New function.
6436 (Sized_incr_dynobj::do_section_flags): New function.
6437 (Sized_incr_dynobj::do_section_entsize): New function.
6438 (Sized_incr_dynobj::do_section_address): New function.
6439 (Sized_incr_dynobj::do_section_type): New function.
6440 (Sized_incr_dynobj::do_section_link): New function.
6441 (Sized_incr_dynobj::do_section_info): New function.
6442 (Sized_incr_dynobj::do_section_addralign): New function.
6443 (Sized_incr_dynobj::do_initialize_xindex): New function.
6444 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6445 (make_sized_incremental_object): New function.
6446 (Incremental_library::copy_unused_symbols): New function.
6447 (Incremental_library::do_for_all_unused_symbols): New function.
6448 * incremental.h (enum Incremental_input_flags): New type.
6449 (class Incremental_checker): Remove.
6450 (Incremental_input_entry::Incremental_input_entry): Add argument
6451 serial number.
6452 (Incremental_input_entry::arg_serial): New function.
6453 (Incremental_input_entry::set_is_in_system_directory): New function.
6454 (Incremental_input_entry::is_in_system_directory): New function.
6455 (Incremental_input_entry::arg_serial_): New data member.
6456 (Incremental_input_entry::is_in_system_directory_): New data member.
6457 (class Script_info): Move here from script.h.
6458 (Script_info::Script_info): Add filename parameter.
6459 (Script_info::filename): New function.
6460 (Script_info::filename_): New data member.
6461 (Incremental_script_entry::Incremental_script_entry): Add argument
6462 serial number.
6463 (Incremental_object_entry::Incremental_object_entry): Likewise.
6464 (Incremental_object_entry::add_input_section): Build list of input
6465 sections with map to original shndx.
6466 (Incremental_object_entry::get_input_section_index): New function.
6467 (Incremental_object_entry::shndx_): New data member.
6468 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6469 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6470 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6471 serial number.
6472 (Incremental_inputs::report_archive_begin): Likewise.
6473 (Incremental_inputs::report_object): Likewise.
6474 (Incremental_inputs::report_script): Likewise.
6475 (class Incremental_global_symbol_reader): New class.
6476 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6477 and store flags and input file type.
6478 (Incremental_input_entry_reader::arg_serial): New function.
6479 (Incremental_input_entry_reader::type): Extract type from flags.
6480 (Incremental_input_entry_reader::is_in_system_directory): New function.
6481 (Incremental_input_entry_reader::get_input_section_count): Call
6482 accessor function for type.
6483 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6484 function for type; adjust size of global symbol entry.
6485 (Incremental_input_entry_reader::get_global_symbol_count): Call
6486 accessor function for type.
6487 (Incremental_input_entry_reader::get_object_count): Likewise.
6488 (Incremental_input_entry_reader::get_object_offset): Likewise.
6489 (Incremental_input_entry_reader::get_member_count): Likewise.
6490 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6491 (Incremental_input_entry_reader::get_member_offset): Likewise.
6492 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6493 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6494 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6495 (Incremental_input_entry_reader::get_global_symbol_reader): New
6496 function.
6497 (Incremental_input_entry_reader::get_output_symbol_index): New
6498 function.
6499 (Incremental_input_entry_reader::type_): Remove.
6500 (Incremental_input_entry_reader::flags_): New data member.
6501 (Incremental_inputs_reader::input_file_offset): New function.
6502 (Incremental_inputs_reader::input_file_index): New function.
6503 (Incremental_inputs_reader::input_file): Call input_file_offset.
6504 (Incremental_inputs_reader::input_file_at_offset): New function.
6505 (Incremental_relocs_reader::get_r_type): Reformat.
6506 (Incremental_relocs_reader::get_r_shndx): Reformat.
6507 (Incremental_relocs_reader::get_r_offset): Reformat.
6508 (Incremental_relocs_reader::data): New function.
6509 (Incremental_binary::Incremental_binary): Initialize new data members.
6510 (Incremental_binary::check_inputs): Add cmdline parameter.
6511 (Incremental_binary::file_is_unchanged): Remove.
6512 (Input_reader::arg_serial): New function.
6513 (Input_reader::get_unused_symbol_count): New function.
6514 (Input_reader::get_unused_symbol): New function.
6515 (Input_reader::do_arg_serial): New function.
6516 (Input_reader::do_get_unused_symbol_count): New function.
6517 (Input_reader::do_get_unused_symbol): New function.
6518 (Incremental_binary::input_file_count): New function.
6519 (Incremental_binary::get_input_reader): Change signature to use
6520 index instead of filename.
6521 (Incremental_binary::file_has_changed): New function.
6522 (Incremental_binary::get_input_argument): New function.
6523 (Incremental_binary::get_library): New function.
6524 (Incremental_binary::get_script_info): New function.
6525 (Incremental_binary::init_layout): New function.
6526 (Incremental_binary::reserve_layout): New function.
6527 (Incremental_binary::output_file): New function.
6528 (Incremental_binary::do_check_inputs): New function.
6529 (Incremental_binary::do_file_is_unchanged): Remove.
6530 (Incremental_binary::do_file_has_changed): New function.
6531 (Incremental_binary::do_init_layout): New function.
6532 (Incremental_binary::do_reserve_layout): New function.
6533 (Incremental_binary::do_input_file_count): New function.
6534 (Incremental_binary::do_get_input_reader): Change signature.
6535 (Incremental_binary::input_args_map_): New data member.
6536 (Incremental_binary::library_map_): New data member.
6537 (Incremental_binary::script_map_): New data member.
6538 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6539 new data members.
6540 (Sized_incremental_binary::output_section): New function.
6541 (Sized_incremental_binary::inputs_reader): Add const.
6542 (Sized_incremental_binary::symtab_reader): Add const.
6543 (Sized_incremental_binary::relocs_reader): Add const.
6544 (Sized_incremental_binary::got_plt_reader): Add const.
6545 (Sized_incremental_binary::get_symtab_view): New function.
6546 (Sized_incremental_binary::Inputs_reader): New typedef.
6547 (Sized_incremental_binary::Input_entry_reader): New typedef.
6548 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6549 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6550 (Sized_incremental_binary::do_file_has_changed): New function.
6551 (Sized_incremental_binary::do_init_layout): New function.
6552 (Sized_incremental_binary::do_reserve_layout): New function.
6553 (Sized_input_reader::Inputs_reader): Remove.
6554 (Sized_input_reader::Input_entry_reader): Remove.
6555 (Sized_input_reader::do_arg_serial): New function.
6556 (Sized_input_reader::do_get_unused_symbol_count): New function.
6557 (Sized_input_reader::do_get_unused_symbol): New function.
6558 (Sized_incremental_binary::do_input_file_count): New function.
6559 (Sized_incremental_binary::do_get_input_reader): Change signature;
6560 use index instead of filename.
6561 (Sized_incremental_binary::section_map_): New data member.
6562 (Sized_incremental_binary::input_entry_readers_): New data member.
6563 (class Sized_incr_relobj): New class.
6564 (class Sized_incr_dynobj): New class.
6565 (make_sized_incremental_object): New function.
6566 (class Incremental_library): New class.
6567 * layout.cc (Free_list::num_lists): New static data member.
6568 (Free_list::num_nodes): New static data member.
6569 (Free_list::num_removes): New static data member.
6570 (Free_list::num_remove_visits): New static data member.
6571 (Free_list::num_allocates): New static data member.
6572 (Free_list::num_allocate_visits): New static data member.
6573 (Free_list::init): New function.
6574 (Free_list::remove): New function.
6575 (Free_list::allocate): New function.
6576 (Free_list::dump): New function.
6577 (Free_list::print_stats): New function.
6578 (Layout_task_runner::run): Resize output file for incremental updates.
6579 (Layout::Layout): Initialize new data members.
6580 (Layout::set_incremental_base): New function.
6581 (Layout::init_fixed_output_section): New function.
6582 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6583 incremental updates.
6584 (Layout::create_gold_note): Do not create gold note section for
6585 incremental updates.
6586 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6587 for incremental updates.
6588 (Layout::set_section_offsets): For incremental updates, allocate space
6589 from free list.
6590 (Layout::create_symtab_sections): Layout with offsets relative to
6591 start of section; for incremental updates, allocate space from free
6592 list.
6593 (Layout::create_shdrs): For incremental updates, allocate space from
6594 free list.
6595 (Layout::finish_dynamic_section): For incremental updates, do not
6596 check --as-needed (fixed in subsequent patch).
6597 * layout.h (class Free_list): New class.
6598 (Layout::set_incremental_base): New function.
6599 (Layout::incremental_base): New function.
6600 (Layout::init_fixed_output_section): New function.
6601 (Layout::allocate): New function.
6602 (Layout::incremental_base_): New data member.
6603 (Layout::free_list_): New data member.
6604 * main.cc (main): Print Free_list statistics.
6605 * object.cc (Relobj::finalize_incremental_relocs): Add
6606 clear_counts parameter; clear counts only when clear_counts is set.
6607 (Sized_relobj::Sized_relobj): Initialize new base class.
6608 (Sized_relobj::do_layout): Don't report special sections.
6609 (Sized_relobj::do_for_all_local_got_entries): New function.
6610 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6611 symtab_off to all symbol table offsets.
6612 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6613 * object.h (class Got_offset_list): Move to top of file.
6614 (Object::Object): Allow case where input_file == NULL.
6615 (Object::~Object): Likewise.
6616 (Object::input_file): Assert that input_file != NULL.
6617 (Object::lock): Allow case where input_file == NULL.
6618 (Object::unlock): Likewise.
6619 (Object::is_locked): Likewise.
6620 (Object::token): Likewise.
6621 (Object::release): Likewise.
6622 (Object::is_incremental): New function.
6623 (Object::get_mtime): New function.
6624 (Object::for_all_local_got_entries): New function.
6625 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6626 (Object::set_is_in_system_directory): New function.
6627 (Object::is_in_system_directory): New function.
6628 (Object::do_is_incremental): New function.
6629 (Object::do_get_mtime): New function.
6630 (Object::do_for_all_local_got_entries): New function.
6631 (Object::is_in_system_directory_): New data member.
6632 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6633 (class Sized_relobj_base): New class.
6634 (class Sized_relobj): Derive from Sized_relobj_base.
6635 (class Sized_relobj::Symbols): Redeclare from base class.
6636 (class Sized_relobj::local_got_offset_list): Remove.
6637 (class Sized_relobj::Output_sections): Redeclare from base class.
6638 (class Sized_relobj::do_for_all_local_got_entries): New function.
6639 (class Sized_relobj::write_local_symbols): Add offset parameter.
6640 (class Sized_relobj::local_symbol_offset_): Update comment.
6641 (class Sized_relobj::local_dynsym_offset_): Update comment.
6642 * options.cc (Input_arguments::add_file): Remove const.
6643 * options.h (Input_file_argument::Input_file_argument):
6644 Initialize arg_serial_ (all constructors).
6645 (Input_file_argument::set_arg_serial): New function.
6646 (Input_file_argument::arg_serial): New function.
6647 (Input_file_argument::arg_serial_): New data member.
6648 (Input_arguments::Input_arguments): Initialize file_count_.
6649 (Input_arguments::add_file): Remove const.
6650 (Input_arguments::number_of_input_files): New function.
6651 (Input_arguments::file_count_): New data member.
6652 (Command_line::number_of_input_files): Call
6653 Input_arguments::number_of_input_files.
6654 * output.cc (Output_segment_headers::Output_segment_headers):
6655 Set current size.
6656 (Output_section::Input_section::current_data_size): New function.
6657 (Output_section::Output_section): Initialize new data members.
6658 (Output_section::add_input_section): Don't do merge sections for
6659 an incremental link; allocate space from free list for an
6660 incremental update.
6661 (Output_section::add_output_section_data): Allocate space from
6662 free list for an incremental update.
6663 (Output_section::update_data_size): New function.
6664 (Output_section::set_fixed_layout): New function.
6665 (Output_section::reserve): New function.
6666 (Output_segment::set_section_addresses): Remove const.
6667 (Output_segment::set_section_list_addresses): Remove const; allocate
6668 space from free list for an incremental update.
6669 (Output_segment::set_offset): Adjust size of RELRO segment for an
6670 incremental update.
6671 * output.h (Output_data::current_data_size): Move here from
6672 child classes.
6673 (Output_data::pre_finalize_data_size): New function.
6674 (Output_data::update_data_size): New function.
6675 (Output_section_headers::update_data_size): new function.
6676 (Output_section_data_build::current_data_size): Move to Output_data.
6677 (Output_data_strtab::update_data_size): New function.
6678 (Output_section::current_data_size): Move to Output_data.
6679 (Output_section::set_fixed_layout): New function.
6680 (Output_section::has_fixed_layout): New function.
6681 (Output_section::reserve): New function.
6682 (Output_section::update_data_size): New function.
6683 (Output_section::has_fixed_layout_): New data member.
6684 (Output_section::free_list_): New data member.
6685 (Output_segment::set_section_addresses): Remove const.
6686 (Output_segment::set_section_list_addresses): Remove const.
6687 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6688 New function.
6689 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6690 New function.
6691 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6692 parameter when calling Add_symbols constructor; store argument
6693 serial number for members of a lib group.
6694 (Add_symbols::locks): Allow case where token == NULL.
6695 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6696 (Read_member::~Read_member): New function.
6697 (Read_member::is_runnable): New function.
6698 (Read_member::locks): New function.
6699 (Read_member::run): New function.
6700 (Check_script::~Check_script): New function.
6701 (Check_script::is_runnable): New function.
6702 (Check_script::locks): New function.
6703 (Check_script::run): New function.
6704 (Check_library::~Check_library): New function.
6705 (Check_library::is_runnable): New function.
6706 (Check_library::locks): New function.
6707 (Check_library::run): New function.
6708 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6709 (Add_symbols::library_): New data member.
6710 (class Read_member): New class.
6711 (class Check_script): New class.
6712 (class Check_library): New class.
6713 * reloc.cc (Read_relocs::is_runnable): Allow case where
6714 token == NULL.
6715 (Read_relocs::locks): Likewise.
6716 (Scan_relocs::locks): Likewise.
6717 (Relocate_task::locks): Likewise.
6718 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6719 to clear counters.
6720 (Sized_relobj::incremental_relocs_scan): Fix comment.
6721 (Sized_relobj::do_relocate): Pass output file offset to
6722 write_local_symbols.
6723 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6724 from class declaration.
6725 * script.cc (read_input_script): Allocate Script_info; pass
6726 argument serial number to report_script.
6727 * script.h (class Script_info): Move to incremental.h.
6728 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6729 * symtab.h (Symbol_table::add_from_incrobj): New function.
6730 (Symbol_table::set_file_offset): New function.
6731
b961d0d7
CC
67322011-04-05 Cary Coutant <ccoutant@google.com>
6733
6734 * incremental-dump.cc (dump_incremental_inputs): Change signature
6735 to take a Sized_incremental_binary; change caller. Use readers
6736 in Sized_incremental_binary.
6737 * incremental.cc
6738 (Sized_incremental_binary::find_incremental_inputs_sections):
6739 Rename do_find_incremental_inputs_sections to this.
6740 (Sized_incremental_binary::setup_readers): New function.
6741 (Sized_incremental_binary::do_check_inputs): Check
6742 has_incremental_info_ flag; move setup code to setup_readers;
6743 use input readers.
6744 (Sized_incremental_binary::do_file_is_unchanged): New function.
6745 (Sized_incremental_binary::do_get_input_reader): New function.
6746 * incremental.h (class Incremental_binary): Move to end of file.
6747 (Incremental_binary::file_is_unchanged): New function.
6748 (Incremental_binary::do_file_is_unchanged): New function.
6749 (Incremental_binary::Input_reader): New class.
6750 (Incremental_binary::get_input_reader): New function.
6751 (class Sized_incremental_binary): Move to end of file.
6752 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6753 input section reader classes.
6754 (Sized_incremental_binary::has_incremental_info): New function.
6755 (Sized_incremental_binary::inputs_reader): New function.
6756 (Sized_incremental_binary::symtab_reader): New function.
6757 (Sized_incremental_binary::relocs_reader): New function.
6758 (Sized_incremental_binary::got_plt_reader): New function.
6759 (Sized_incremental_binary::do_file_is_unchanged): New function.
6760 (Sized_incremental_binary::Sized_input_reader): New class.
6761 (Sized_incremental_binary::get_input_reader): New function.
6762 (Sized_incremental_binary::find_incremental_inputs_sections):
6763 Rename do_find_incremental_inputs_sections to this.
6764 (Sized_incremental_binary::setup_readers): New function.
6765 (Sized_incremental_binary::has_incremental_info_): New data member.
6766 (Sized_incremental_binary::inputs_reader_): New data member.
6767 (Sized_incremental_binary::symtab_reader_): New data member.
6768 (Sized_incremental_binary::relocs_reader_): New data member.
6769 (Sized_incremental_binary::got_plt_reader_): New data member.
6770 (Sized_incremental_binary::current_input_file_): New data member.
6771
a869183f
PP
67722011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6773
6774 PR gold/12640
6775 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6776 violation.
6777
67782011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6779
6780 * archive.cc (Archive::include_member): Adjust call to report_object.
6781 (Add_archive_symbols::run): Add script_info to call to
6782 report_archive_begin.
6783 (Lib_group::include_member): Adjust call to report_object.
6784 (Add_lib_group_symbols::run): Adjust call to report_object.
6785 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6786 blocks. Add object count for script input files.
6787 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6788 script_info parameter; change all callers.
6789 (Incremental_inputs::report_object): Add script_info parameter;
6790 change all callers.
6791 (Incremental_inputs::report_script): Store backpointer to
6792 incremental info entry.
6793 (Output_section_incremental_inputs::set_final_data_size): Record
6794 additional information for scripts.
6795 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6796 * incremental.h (Incremental_script_entry::add_object): New function.
6797 (Incremental_script_entry::get_object_count): New function.
6798 (Incremental_script_entry::get_object): New function.
6799 (Incremental_script_entry::objects_): New data member; adjust
6800 constructor.
6801 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6802 (Incremental_inputs::report_object): Add script_info parameter.
6803 (Incremental_inputs_reader::get_object_count): New function.
6804 (Incremental_inputs_reader::get_object_offset): New function.
6805 * options.cc (Input_arguments::add_file): Return reference to
6806 new input argument.
6807 * options.h (Input_argument::set_script_info): New function.
6808 (Input_argument::script_info): New function.
6809 (Input_argument::script_info_): New data member; adjust all
6810 constructors.
6811 (Input_file_group::add_file): Return reference to new input argument.
6812 (Input_file_lib::add_file): Likewise.
6813 (Input_arguments::add_file): Likewise.
6814 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6815 * script.cc (Parser_closure::Parser_closure): Add script_info
6816 parameter; adjust all callers.
6817 (Parser_closure::script_info): New function.
6818 (Parser_closure::script_info_): New data member.
6819 (read_input_script): Report scripts earlier to incremental info.
6820 (script_add_file): Set script_info in Input_argument.
6821 (script_add_library): Likewise.
6822 * script.h (Script_options::Script_info): Rewrite class.
6823
a869183f 68242011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6825
6826 * archive.cc (Library_base::should_include_member): Move
6827 method here from class Archive.
6828 (Archive::Archive): Initialize base class.
6829 (Archive::should_include_member): Move to base class.
6830 (Archive::do_for_all_unused_symbols): New function.
6831 (Add_archive_symbols::run): Remove redundant access to
6832 incremental_inputs.
6833 (Lib_group::Lib_group): Initialize base class.
6834 (Lib_group::do_filename): New function.
6835 (Lib_group::include_member): Pass pointer to Lib_group to
6836 report_object.
6837 (Lib_group::do_for_all_unused_symbols): New function.
6838 (Add_lib_group_symbols::run): Report archive information for
6839 incremental links.
6840 * archive.h (class Library_base): New base class.
6841 (class Archive): Derive from Library_base.
6842 (Archive::filename): Move to base class.
6843 (Archive::set_incremental_info): Likewise.
6844 (Archive::incremental_info): Likewise.
6845 (Archive::Should_include): Likewise.
6846 (Archive::should_include_member): Likewise.
6847 (Archive::Armap_entry): Remove.
6848 (Archive::Unused_symbol_iterator): Remove.
6849 (Archive::unused_symbols_begin): Remove.
6850 (Archive::unused_symbols_end): Remove.
6851 (Archive::do_filename): New function.
6852 (Archive::do_get_mtime): New function.
6853 (Archive::do_for_all_unused_symbols): New function.
6854 (Archive::task_): Move to base class.
6855 (Archive::incremental_info_): Likewise.
6856 (class Lib_group): Derive from Library_base.
6857 (Lib_group::do_filename): New function.
6858 (Lib_group::do_get_mtime): New function.
6859 (Lib_group::do_for_all_unused_symbols): New function.
6860 (Lib_group::task_): Move to base class.
6861 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6862 function.
6863 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6864 function.
6865 * incremental.cc (Incremental_inputs::report_archive_begin):
6866 Use Library_base; call library's get_mtime; add incremental inputs
6867 entry before members.
6868 (class Unused_symbol_visitor): New class.
6869 (Incremental_inputs::report_archive_end): Use Library_base; use
6870 visitor class to record unused symbols; don't add incremental inputs
6871 entry after members.
6872 (Incremental_inputs::report_object): Use Library_base.
6873 * incremental.h
6874 (Incremental_archive_entry::Incremental_archive_entry): Remove
6875 unused Archive parameter.
6876 (Incremental_inputs::report_archive_begin): Use Library_base.
6877 (Incremental_inputs::report_archive_end): Likewise.
6878 (Incremental_inputs::report_object): Likewise.
6879 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6880 function.
6881 * object.h (Object::for_all_global_symbols): New function.
6882 (Object::do_for_all_global_symbols): New function.
6883 (Sized_relobj::do_for_all_global_symbols): New function.
6884 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6885 function.
6886 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6887 function.
6888
61ab3e40
ILT
68892011-03-27 Ian Lance Taylor <iant@google.com>
6890
6891 * archive.cc (Archive::interpret_header): Return -1 if something
6892 goes wrong. Change callers accordingly.
6893
30e1f9e6
CC
68942011-03-25 Cary Coutant <ccoutant@google.com>
6895
6896 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6897 * testsuite/Makefile.in: Regenerate.
6898
9370ce59 68992011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6900
6901 * plugin.cc (get_view): New.
6902 (Plugin::load): Pass get_view to the plugin.
6903 (Plugin_manager::get_view): New.
6904
9312bb0a
ILT
69052011-03-21 Ian Lance Taylor <iant@google.com>
6906
6907 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6908 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6909
7e12ba9e
ST
69102011-03-21 Sriraman Tallam <tmsriram@google.com>
6911
6912 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6913 Change == to -eq.
6914 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6915 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6916 Change == to -eq.
6917 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6918 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6919
fd7a005d
ILT
69202011-03-14 Ian Lance Taylor <iant@google.com>
6921
6922 * script-sections.cc (Sort_output_sections::script_compare):
6923 Rename from is_before, change return type.
6924 (Sort_output_sections::operator()): Adjust accordingly.
6925
ed16fd1b
ILT
69262011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6927
6928 PR gold/12572
6929 * testsuite/odr_violation2.cc: Add comment to make all error line
6930 numbers double digits.
6931 * testsuite/debug_msg.sh: Adjust expected errors.
6932
71ff8986
ILT
69332011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6934
6935 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6936 but mark earlier ones as non-canonical
6937 (offset_to_iterator): Update search target and example
6938 (do_addr2line): Return extra lines in a vector*
6939 (format_file_lineno): Extract from do_addr2line
6940 (one_addr2line): Add vector* out-param
6941 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6942 when a lineno entry appeared last for its instruction
6943 (Dwarf_line_info): Add vector* out-param
6944 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6945 * symtab.cc (Odr_violation_compare): Include the lineno in the
6946 comparison again.
6947 (linenos_from_loc): New. Combine the canonical line for an
6948 address with its other lines.
6949 (True_if_intersect): New. Helper functor to make
6950 std::set_intersection a query.
6951 (detect_odr_violations): Compare sets of lines instead of just
6952 one line for each function. This became less deterministic, but
6953 has fewer false positives.
6954 * symtab.h: Declarations.
6955 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6956 mix an optimized and non-optimized object in the same binary
6957 (odr_violation2.so): Same.
6958 * testsuite/Makefile.in: Regenerate from Makefile.am.
6959 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6960 * testsuite/debug_msg.sh: Update line numbers and add
6961 assertions.
6962 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6963 non-optimized context.
6964 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6965 isn't inlined, and use OdrDerived in an optimized context.
6966 * testsuite/odr_header1.h: Defines OdrDerived, where
6967 optimization will change the
6968 first-instruction-in-the-destructor's file and line number.
6969 * testsuite/odr_header2.h: Defines OdrBase.
6970
a19fefdc
ILT
69712011-03-09 Ian Lance Taylor <iant@google.com>
6972
6973 * fileread.cc (File_read::clear_views): Don't delete the whole
6974 file view.
6975
ecb351e9
ILT
69762011-03-08 Ian Lance Taylor <iant@google.com>
6977
6978 PR gold/12525
6979 * fileread.cc: #include <climits>.
6980 (GOLD_IOV_MAX): Define.
6981 (File_read::read_multiple): Limit number of entries by iov_max.
6982 * fileread.h (class File_read): Always set max_readv_entries to
6983 128.
6984
b821d13c
ILT
69852011-03-07 Ian Lance Taylor <iant@google.com>
6986
6987 PR gold/12525
6988 * options.h (class General_options): Add -dy and -dn.
6989
89243142
CC
69902011-03-02 Cary Coutant <ccoutant@google.com>
6991
6992 * testsuite/script_test_9.t: Add TLS segment.
6993
d0773f31
ILT
69942011-03-02 Simon Baldwin <simonb@google.com>
6995
6996 * configure.ac: Add check for gnu_indirect_function support in
6997 the toolchain building binutils.
6998 * configure: Rebuild.
6999
9370ce59 70002011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7001
7002 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7003 plugin only symbols.
7004 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7005 in plugin files as not needed in the symbol table.
7006
4cf7a849
ST
70072011-02-11 Sriraman Tallam <tmsriram@google.com>
7008
7009 * output.cc (Output_section::add_input_section): Delay fill
7010 generation for section ordering.
7011
b578bd7d
ILT
70122011-02-09 Ian Lance Taylor <iant@google.com>
7013
7014 PR gold/12316
7015 * object.h (class Sized_relobj): Remove clear_local_symbols.
7016 * reloc.cc (Sized_relobj::do_relocate): Don't call
7017 clear_local_symbols.
7018
9370ce59 70192011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7020
7021 * plugin.cc (is_visible_from_outside): Return true for symbols
7022 in the -u option.
7023
55382fb7
ILT
70242011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7025
7026 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7027 filename.
7028
4e271fff
ST
70292011-02-02 Sriraman Tallam <tmsriram@google.com>
7030
7031 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7032 to std::string.
4e271fff 7033 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7034 section_name to be std::string.
4e271fff
ST
7035 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7036
d433c3ac
ILT
70372011-01-25 Ian Lance Taylor <iant@google.com>
7038
7039 * script.cc (script_add_extern): Rewrite to use
7040 add_symbol_reference.
7041
880473a6
DK
70422011-01-25 Doug Kwan <dougkwan@google.com>
7043
d433c3ac 7044 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7045
f30f86fa
ILT
70462011-01-24 Ian Lance Taylor <iant@google.com>
7047
7048 * options.h (class General_options): Accept
7049 --no-detect-odr-violations.
7050
8e51a0b9
ILT
70512011-01-24 Ian Lance Taylor <iant@google.com>
7052
7053 * version.cc (version_string): Bump to 1.11.
7054
0f3b89d8
ILT
70552011-01-24 Ian Lance Taylor <iant@google.com>
7056
7057 * plugin.cc (class Plugin_rescan): Define new class.
7058 (Plugin_manager::claim_file): Set any_claimed_.
7059 (Plugin_manager::save_archive): New function.
7060 (Plugin_manager::save_input_group): New function.
7061 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7062 necessary.
7063 (Plugin_manager::new_undefined_symbol): New function.
7064 (Plugin_manager::rescan): New function.
7065 (Plugin_manager::rescannable_defines): New function.
7066 (Plugin_manager::add_input_file): Set any_added_.
7067 * plugin.h (class Plugin_manager): define new fields rescannable_,
7068 undefined_symbols_, any_claimed_, and any_added_. Declare
7069 Plugin_rescan as friend. Declare new functions.
7070 (Plugin_manager::Rescannable): Define type.
7071 (Plugin_manager::Rescannable_list): Define type.
7072 (Plugin_manager::Undefined_symbol_list): Define type.
7073 (Plugin_manager::Plugin_manager): Initialize new fields.
7074 * archive.cc (Archive::defines_symbol): New function.
7075 (Add_archive_symbols::run): Pass archive to plugins if any.
7076 * archive.h (class Archive): Declare defines_symbol.
7077 * readsyms.cc (Input_group::~Input_group): New function.
7078 (Finish_group::run): Pass input_group to plugins if any.
7079 * readsyms.h (class Input_group): Declare destructor.
7080 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7081 any.
7082
3bb951e5
ILT
70832011-01-10 Ian Lance Taylor <iant@google.com>
7084
7085 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7086 section as relro.
7087 (Layout::set_segment_offsets): Reset increase_relro before calling
7088 set_section_addresses a second time.
7089
0aa45fac
CC
70902011-01-04 Cary Coutant <ccoutant@google.com>
7091
7092 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7093 sections before NOBITS sections.
7094
0db46eb4
L
70952011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7096
7097 * version.cc (print_version): Update copyright to 2011.
7098
829c9745
CC
70992010-12-23 Cary Coutant <ccoutant@google.com>
7100
7101 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7102 of OS to this->add. Add OD parameter to second form of the function.
7103
7500420b
ILT
71042010-12-20 Ian Lance Taylor <iant@google.com>
7105
7106 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7107 second of two consecutive entries with same offset.
7108
f8e9a930
RW
71092010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7110
7111 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7112 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7113 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7114 to avoid unneeded links against $(LDADD).
7115 * testsuite/Makefile.in: Regenerate.
7116
2fbb4320
ILT
71172010-12-15 Ian Lance Taylor <iant@google.com>
7118
7119 PR gold/12324
7120 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
7121 for R_X86_64_32 and R_X86_64_PC32.
7122 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
7123 ver_matching_def_pic.o.
7124 (ver_matching_def_pic.o): New target.
7125
fedb228d
RW
71262010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7127
7128 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
7129 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
7130 Move definition before File_read::View member definitions.
7131 (File_read::View::~View): Initialize and hold lock before
7132 updating current_mapped_bytes.
7133
9b547ce6
RW
71342010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7135
7136 * dwarf_reader.cc: Remove outdated comment.
7137 * gold-threads.cc: Fix typo in error message.
7138 * archive.cc: Fix typos in comments.
7139 * archive.h: Likewise.
7140 * arm-reloc-property.cc: Likewise.
7141 * arm-reloc-property.h: Likewise.
7142 * arm-reloc.def: Likewise.
7143 * arm.cc: Likewise.
7144 * attributes.h: Likewise.
7145 * cref.cc: Likewise.
7146 * ehframe.cc: Likewise.
7147 * fileread.h: Likewise.
7148 * gold.h: Likewise.
7149 * i386.cc: Likewise.
7150 * icf.cc: Likewise.
7151 * incremental.h: Likewise.
7152 * int_encoding.cc: Likewise.
7153 * layout.h: Likewise.
7154 * main.cc: Likewise.
7155 * merge.h: Likewise.
7156 * object.cc: Likewise.
7157 * object.h: Likewise.
7158 * options.cc: Likewise.
7159 * readsyms.cc: Likewise.
7160 * reduced_debug_output.cc: Likewise.
7161 * reloc.cc: Likewise.
7162 * script-sections.cc: Likewise.
7163 * sparc.cc: Likewise.
7164 * symtab.h: Likewise.
7165 * target-reloc.h: Likewise.
7166 * target.cc: Likewise.
7167 * target.h: Likewise.
7168 * timer.cc: Likewise.
7169 * timer.h: Likewise.
7170 * x86_64.cc: Likewise.
7171
83e17bd5
CC
71722010-12-09 Cary Coutant <ccoutant@google.com>
7173
7174 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
7175 stack.
7176 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
7177 parameter; change all callers.
7178 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
7179 * options.h (warn_execstack): New option.
7180
017257f8
DK
71812010-12-07 Doug Kwan <dougkwan@google.com>
7182
7183 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
7184 like function call relocations.
7185
c20cbc06
ILT
71862010-12-07 Ian Lance Taylor <iant@google.com>
7187
7188 * archive.cc (Archive::get_elf_object_for_member): Permit
7189 punconfigured to be NULL.
7190 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
7191 (Archive::include_member): Pass NULL to get_elf_object_for_member
7192 if we searched for the archive and this is the first included
7193 object.
7194
4dbfafcc
ILT
71952010-12-01 Ian Lance Taylor <iant@google.com>
7196
7197 * dwarf_reader.h (class Sized_dwarf_line_info): Add
7198 track_relocs_type_ field.
7199 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7200 Set track_relocs_type_.
7201 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
7202 contents when using RELA relocs.
7203 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
7204 reloc_map_.
7205 * reloc.cc (Track_relocs::next_addend): New function.
7206 * reloc.h (class Track_relocs): Declare next_addend.
7207
e5e19edd
ILT
72082010-12-01 Ian Lance Taylor <iant@google.com>
7209
7210 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
7211 virtual destructor.
7212
9a5ce24c
ILT
72132010-12-01 Ian Lance Taylor <iant@google.com>
7214
7215 * README: Update compilers known to work and fail.
7216
c7791212
NC
72172010-11-23 Matthias Klose <doko@ubuntu.com>
7218
7219 * configure.in: For --enable-gold, handle value `default' instead of
7220 `both*'. Always install ld as ld.bfd, install as ld if gold is
7221 not the default.
7222 * configure: Regenerate.
7223
0ad220c9
DK
72242010-11-18 Doug Kwan <dougkwan@google.com>
7225
7226 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
7227 and right_alignment to be zero. Store result alignment only if it is
7228 greater than existing alignment.
7229
ab8056e0
CC
72302010-11-16 Cary Coutant <ccoutant@google.com>
7231
7232 PR gold/12220
7233 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
7234 Check for ".zdebug_line".
7235
fd064a5b
CC
72362010-11-16 Doug Kwan <dougkwan@google.com>
7237 Cary Coutant <ccoutant@google.com>
7238
7239 * output.h (Output_segment::set_section_addresses): Pass increase_relro
7240 by reference; adjust all callers.
7241 * output.cc (Output_segment::set_section_addresses): Adjust references
7242 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
7243 list is empty.
7244 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
7245 end at page boundary.
7246
6fc6ea19
CC
72472010-11-16 Cary Coutant <ccoutant@google.com>
7248
7249 PR gold/12220
7250 * layout.cc (Layout::choose_output_section): Transform names of
7251 compressed sections even when using a script with a SECTIONS clause.
7252 (Layout::output_section_name): Remove code to transform
7253 compressed debug section names.
7254 * output.cc (Output_section::add_input_section): Use uncompressed
7255 section size when tracking input sections.
7256
95a2c8d6
RS
72572010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
7258
7259 * symtab.h (Symbol::NON_PIC_REF): Remove.
7260 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
7261 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
7262 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
7263 (Symbol::use_plt_offset): Take a flags argument and pass it
7264 directly to needs_dynamic_reloc. Restrict check for undefined
7265 weak symbols to function calls.
7266 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
7267 (Target_arm::Scan::global): Use it.
7268 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
7269 (Target_arm::Relocate::relocate): Likewise.
7270 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
7271 parameter with an r_type parameter. Use get_reference_flags
7272 to get the flags.
7273 (Target_arm::Relocate::relocate): Update accordingly.
7274 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
7275 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
7276 (Target_i386::Scan::global): Likewise.
7277 (Target_i386::Relocate::relocate): Likewise.
7278 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
7279 parameter with an r_type parameter. Use get_reference_flags
7280 to get the flags.
7281 (Target_i386::Relocate::relocate): Update accordingly.
7282 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
7283 (Target_powerpc::Scan::global): Use it.
7284 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
7285 (Target_powerpc::Relocate::relocate): Likewise.
7286 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
7287 (Target_sparc::Scan::global): Use it.
7288 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
7289 (Target_sparc::Relocate::relocate): Likewise.
7290 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
7291 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
7292 (Target_x86_64::Scan::global): Likewise.
7293 (Target_x86_64::Relocate::relocate): Likewise.
7294
f625ae50
DK
72952010-11-08 Doug Kwan <dougkwan@google.com>
7296 Cary Coutant <ccoutant@google.com>
7297
7298 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
7299 (Arm_exidx_merge_section::section_contents_): New data member.
7300 (Arm_input_section::Arm_input_section): Initialize original_contents_.
7301 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 7302 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
7303 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
7304 in parameters instead of calling Object::section_contents without
7305 locking.
7306 (Arm_output_section::group_section): New parameter TASK. Pass it
7307 to callees that need locking objects.
7308 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
7309 to lock EXIDX input sections. Fix a formatting issue. Call
7310 Arm_exidx_merged_section::build_contents to create merged section
7311 contents.
7312 (Arm_output_section::create_stub_group): New parameter TASK. Use it
7313 to lock object of stub table owner.
7314 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
7315 TEXT_SIZE to initialize data member TEXT_SIZE_.
7316 (Arm_exidx_input_section::addralign): Fix typo in comment.
7317 (Arm_exidx_input_section::text_size): New method.
7318 (Target_arm::do_relax): New parameter TASK. Pass it to callees
7319 that require locking objects. Lock objects before scanning for stubs
7320 and updating local symbols.
7321 (Arm_input_section<big_endian>::init): Copy contents of original
7322 input section.
2e702c99 7323 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
7324 original input section instead of calling Object::section_contents
7325 without locking.
7326 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
7327 size without calling Object::section_size().
7328 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
7329 for size. Allocate a buffer for merged EXIDX entries.
7330 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 7331 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
7332 building code to Arm_exidx_merged_section::build_contetns. Write
7333 out contetns in buffer instead of building it on the fly.
7334 (Arm_relobj::make_exidx_input_section): Also pass text section size
7335 to Arm_exidx_input_section constructor.
7336 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
7337 (Arm_dynobj::do_read_symbols): Fix memory leak.
7338 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
7339 * target.h: (class Task): Add forward declaration.
7340 (Target::relax): Add new parameter TASK and pass it to
7341 Target::do_relax().
7342 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7343
5f9bcf58
CC
73442010-11-05 Cary Coutant <ccoutant@google.com>
7345
7346 PR gold/10708
7347 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7348 object when reading from the file.
7349 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7350 second layout pass.
7351 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7352 when reading section contents.
7353 (get_section_contents): Likewise.
7354 (icf::find_identical_sections): Likewise.
7355 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7356 object when reading from the file.
7357 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7358 the object when doing deferred section layout.
7359
e597fa08
NC
73602010-11-03 Nick Clifton <nickc@redhat.com>
7361
7362 PR gold/12001
7363 * script.h (class Symbol_assignment: name): New member. Returns
7364 the name of the symbol.
7365 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7366 Returns true if the given symbol name is on the list of
7367 assignments wating to be processed.
7368 * archive.cc (should_incldue_member): If the symbol is undefined,
7369 check to see if it is on the list of symbols pending assignment.
7370
3f9a3278
ILT
73712010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7372
7373 * script-sections.cc (Script_sections::find_memory_region): Check
7374 for a NULL output section pointer.
7375
d06fb4d1
DK
73762010-10-29 Doug Kwan <dougkwan@google.com>
7377
7378 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7379 Output_section::add_relaxed_input_section.
7380 * output.cc (Output_section::add_relaxed_input_section): Add new
7381 arguments LAYOUT and NAME. Set section order index.
7382 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7383 Copy section order index.
7384 * output.h (Output_section::add_relaxed_input_section): Add new
7385 arguments LAYOUT and NAME.
7386
90e24de5
ILT
73872010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7388
7389 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7390 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7391 * testsuite/Makefile.in: Regenerate.
7392
c9484ea5
DK
73932010-10-20 Doug Kwan <dougkwan@google.com>
7394
7395 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7396 without SHF_LINK_ORDER flags.
7397 * layout.cc (Layout::choose_output_section): Do not filter
7398 SHF_LINK_ORDER flag in a relocatable link.
7399
5bc2f5be
CC
74002010-10-17 Cary Coutant <ccoutant@google.com>
7401
7402 * output.h (Output_segment::set_section_addresses): Change function
7403 signature. Update all callers.
7404 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7405 sections.
7406 (Output_segment::set_section_addresses): Align after last TLS
7407 section. Add padding before last relro section instead of after.
7408
0c91cf04
DK
74092010-10-17 Doug Kwan <dougkwan@google.com>
7410
7411 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7412 GOT output section to be writable.
7413
8c21d9d3
CC
74142010-10-14 Cary Coutant <ccoutant@google.com>
7415
7416 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7417 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7418 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7419 mode.
7420 * incremental.cc (report_command_line): Ignore all forms of
7421 --incremental.
7422 * layout.cc (Layout::Layout): Check parameters for incremental link
7423 mode.
7424 * options.cc (General_options::parse_incremental): New function.
7425 (General_options::parse_no_incremental): New function.
7426 (General_options::parse_incremental_full): New function.
7427 (General_options::parse_incremental_update): New function.
7428 (General_options::incremental_mode_): New data member.
7429 (General_options::finalize): Check incremental_mode_.
7430 * options.h (General_options): Update help text for --incremental.
7431 Add --no-incremental, --incremental-full, --incremental-update.
7432 (General_options::Incremental_mode): New enum type.
7433 (General_options::incremental_mode): New function.
7434 (General_options::incremental_mode_): New data member.
7435 * parameters.cc (Parameters::incremental_mode_): New data member.
7436 (Parameters::set_options): Set incremental_mode_.
7437 (Parameters::set_incremental_full): New function.
7438 (Parameters::incremental): New function.
7439 (Parameters::incremental_update): New function.
7440 (set_parameters_incremental_full): New function.
7441 * parameters.h (Parameters::set_incremental_full): New function.
7442 (Parameters::incremental): New function.
7443 (Parameters::incremental_update): New function.
7444 (Parameters::incremental_mode_): New data member.
7445 (set_parameters_incremental_full): New function.
7446 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7447 incremental link mode.
7448 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7449 (Sized_relobj::do_relocate_sections): Likewise.
7450 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7451 option.
7452 * testsuite/Makefile.in: Regenerate.
7453 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7454
bb32aa18 74552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7456
7457 * script-sections.h (class Script_sections): Make
7458 Sections_elements typedef public.
7459 * script-sections.cc (class Sort_output_sections): Add elements_
7460 field. Add constructor which sets it; change all callers.
7461 (Sort_output_sections::is_before): New function.
7462 (Sort_output_sections::operator()): Call is_before.
7463 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7464 conditional.
7465 * testsuite/script_test_10.sh: New test. Test script section
7466 order.
7467 * testsuite/script_test_10.t: Likewise.
7468 * testsuite/script_test_10.s: Likewise.
7469 * testsuite/Makefile.am: Wrap the cross linker tests and the
7470 common tests into NATIVE_OR_CROSS_LINKER.
7471 (check_SCRIPTS): Add script_test_10.sh.
7472 (check_DATA): Add script_test_10.stdout.
7473 (script_test_10.o, script_test_10): New targets.
7474 (script_test_10.stdout): New target.
7475 * configure, testsuite/Makefile.in: Regenerate.
7476
3cef7179
ILT
74772010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7478
7479 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7480 error for the deprecated relocations.
7481 (Target_arm::Scan::global): Likewise.
7482 (Target_arm::Relocate::relocate): Likewise.
7483
7411e9a8
RS
74842010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7485
7486 * fileread.cc (Input_file::find_file): Initialize *found_name
7487 and *namep when using the fallback search for case 4.
7488
6a9da32a
CC
74892010-10-11 Cary Coutant <ccoutant@google.com>
7490
7491 * options.h (class General_options): Redefine -z lazy as an alias for
7492 the negation of -z now.
7493
ac897c20
ILT
74942010-10-11 Ian Lance Taylor <iant@google.com>
7495
7496 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7497 binding.
7498
ea5cae92
NC
74992010-10-06 Nick Clifton <nickc@redhat.com>
7500
7501 * script-sections.cc(class Memory_region): Remove
7502 current_lma_offset_ field. Rename current_vma_offset_ to
7503 current_offset_. Add last_section_ field.
7504 (Memory_region::get_current_vma_address): Rename to
7505 get_current_address.
7506 (Memory_region::get_current_lma_address): Delete.
7507 (Memory_region::increment_vma_offset): Rename to
7508 increment_offset.
7509 (Memory_region::increment_lma_offset): Delete.
7510 (Memory_region::attributes_compatible): New method. Returns
7511 true if the provided section is compatible with the region.
7512 (Memory_region::get_last_section): New method. Returns the last
7513 section to use the region.
7514 (Memory_region::set_last_section): New method. Stores the last
7515 section to use the region.
7516 (Script_sections::block_in_region): New method. Returns true if
7517 a block of memory is contained within a region.
7518 (Script_sections::find_memory_region): New method. Locates a
7519 memory region to be used to set a VMA or LMA address.
7520 (Output_section_definition::set_section_addresses): Add code to
7521 check for addresses set by memory regions.
7522 (Output_segment::set_section_addresses): Remove memory region
7523 walking code.
7524 (Script_sections::create_segment): Add a warning if a header
7525 segment is created outside of any region.
7526 * script-sections.h (class Script_sections): Add prototypes for
7527 find_memory_region and block_in_region methods.
7528 * testsuite/memory_test.s: Use .long instead of .word.
7529 * testsuite/memory_test.t: Add some more output sections.
7530 * testsuite/memory_test.sh: Update expected output.
7531
a9bfd952
DK
75322010-10-02 Doug Kwan <dougkwan@google.com>
7533
7534 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7535 defintion to symtab.h
7536 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7537 declaration to defintion.
7538
bacff3ab
NC
75392010-10-01 Nick Clifton <nickc@redhat.com>
7540
7541 * expression.cc (eval): Replace dummy argument with NULL.
7542 (eval_maybe_dot): Check for a NULL result section pointer.
7543 (Symbol_expression::value): Likewise.
7544 (Dot_expression::value): Likewise.
7545 (BINARY_EXPRESSION): Likewise.
7546 (Max_expression::value): Likewise.
7547 (Min_expression::value): Likewise.
7548 (Absolute_expression::value): Likewise.
7549 (Addr_expression::value_from_output_section): Likewise.
7550 (Loaddddr_expression::value_from_output_section): Likewise.
7551 (Segment_start_expression::value): Likewise.
7552 * script-sections.cc
7553 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7554 argument with NULL.
7555 (Sections_elememt_dot_assignment::set_section_addresses):
7556 Likewise.
7557 (Output_data_expression::do_write_to_buffer): Likewise.
7558 (Output_section_definition::finalize_symbols): Likewise.
7559 (Output_section_definition::set_section_addresses): Likewise.
7560
f81bc8b5
DK
75612010-09-30 Doug Kwan <dougkwan@google.com>
7562
7563 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7564
c95e9f27
ST
75652010-09-28 Sriraman Tallam <tmsriram@google.com>
7566
7567 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7568 function.
c95e9f27
ST
7569 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7570 virtual function.
7571 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7572 virtual function.
7573 * icf.cc (get_section_contents): Inline merge sections only when
7574 target allows it.
7575
3cac54d2
RW
75762010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7577
7578 * configure: Regenerate.
7579
2904037a
ILT
75802010-09-17 Ian Lance Taylor <iant@google.com>
7581
7582 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7583 * testsuite/Makefile.am (memory_test.o): New target.
7584 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7585 memory_test.t.
7586 * testsuite/Makefile.in: Rebuild.
2904037a 7587
bca7fb63
DK
75882010-09-17 Doug Kwan <dougkwan@google.com>
7589
7590 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7591 defintion if relocation uses GOT entries of the symbol.
7592 * testsuite/icf_safe_test.sh: Fix test.
7593 * testsuite/icf_safe_so_test.sh: Fix test.
7594
4ef28648
CC
75952010-09-16 Cary Coutant <ccoutant@google.com>
7596
7597 * script_sections.cc (class Memory_region): Remove "NULL" from
7598 vector initializations.
7599
793990de
CC
76002010-09-15 Cary Coutant <ccoutant@google.com>
7601
7602 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7603 Resolve forwarding symbols.
7604
81e015e2
DK
76052010-09-15 Doug Kwan <dougkwan@google.com>
7606
7607 * gold/testsuite/script_test_3.t: Add ARM special sections.
7608 * gold/testsuite/script_test_4.t: Same.
7609 * gold/testsuite/script_test_5.t: Same.
7610 * gold/testsuite/script_test_6.t: Same.
7611 * gold/testsuite/script_test_7.t: Same.
7612 * gold/testsuite/script_test_7.t: Same.
7613 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7614
36171d64
CC
76152010-09-14 Cary Coutant <ccoutant@google.com>
7616
7617 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7618 (Target_x86_64::Relocate::relocate_tls): Replace check for
7619 saw_tls_block_reloc_ with test for executable section.
7620
d89051bd
CC
76212010-09-12 Cary Coutant <ccoutant@google.com>
7622
7623 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7624 position-independent executables to shared libraries need dynamic
7625 relocations.
7626 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7627 position-independent executables.
7628 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7629 * testsuite/Makefile.in: Regenerate.
7630
fca41f0f
NC
76312010-09-10 Nick Clifton <nickc@redhat.com>
7632
7633 PR gold/11997
7634 * testsuite/memory_test.t: Discard any sections that are not
7635 needed.
7636
6695e4b3
L
76372010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7638
7639 PR gold/11996
7640 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7641 "This::" to work around a bug in gcc 4.2.
7642
7643 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7644
0f72bf6f
RÁE
76452010-09-09 Rafael Espindola <espindola@google.com>
7646
7647 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7648 sections with different PF_X flags in the same segment.
7649 (Layout::find_first_load_seg): Search all segments to find the first
7650 one.
7651 * options.h (rosegment): New.
7652
76532010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7654
05a79166 7655 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7656
aa98ff75
DK
76572010-09-08 Doug Kwan <dougkwan@google.com>
7658
7659 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7660 (Arm_relobj::do_relocate_sections): Add new parameter for output
7661 file to match the parent.
7662 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7663 of local symbols instead of input values. Update code to track
7664 changes in gold::relocate_section.
7665 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7666 (Sized_relobj::compute_final_local_value_internal): New methods.
7667 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7668 body into private version of Sized_relobj::compute_final_local_value.
7669 Call the inline method.
7670 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7671 merged symbol value if there is one.
7672 (Symbol_value::has_output_value): New method defintiion.
7673 (Sized_relobj::Compute_final_local_value_status): New enum type.
7674 (Sized_relobj::compute_final_local_value): New methods.
7675 (Sized_relobj::compute_final_local_value_internal): New methods.
7676 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7677 and arm_cortex_a8.sh.
7678 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7679 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7680 New tests.
7681 * Makefile.in: Regenerate.
7682 * testsuite/arm_bl_out_of_range.s: Update test.
7683 * testsuite/thumb_bl_out_of_range.s: Ditto.
7684 * testsuite/thumb_blx_out_of_range.s: Ditto.
7685 * testsuite/arm_branch_out_of_range.sh: New file.
7686 * testsuite/arm_cortex_a8.sh: Ditto.
7687 * testsuite/arm_cortex_a8_b.s: Ditto.
7688 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7689 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7690 * testsuite/arm_cortex_a8_bl.s: Ditto.
7691 * testsuite/arm_cortex_a8_blx.s: Ditto.
7692 * testsuite/arm_cortex_a8_local.s: Ditto.
7693 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7694 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7695
05a79166
L
76962010-09-08 Rafael Espindola <espindola@google.com>
7697
7698 * Makefile.am (memory_test.stdout): Run readelf with -W.
7699 * Makefile.in: Regenerate.
7700 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7701 64 bit output.
7702
33dbc701
RÁE
77032010-09-08 Rafael Espindola <espindola@google.com>
7704
7705 * script-sections.cc (Script_sections::add_memory_region): Convert
7706 field precision to int.
7707 * script.cc (script_set_section_region, script_set_section_region):
7708 Convert field precision to int.
7709
731ca54a
RÁE
77102010-09-08 Rafael Espindola <espindola@google.com>
7711
7712 * arm.cc (do_finalize_sections): Create the __exidx_start and
7713 __exdix_end symbols even when the section is missing.
7714
7f8cd844
NC
77152010-09-08 Nick Clifton <nickc@redhat.com>
7716
7717 * README: Remove claim that MEMORY is not supported.
7718 * expression.cc (script_exp_function_origin)
7719 (script_exp_function_length): Move from here to ...
7720 * script.cc: ... here.
7721 (script_set_section_region, script_add_memory)
7722 (script_parse_memory_attr, script_include_directive): New
7723 functions.
7724 * script-sections.cc
7725 (class Memory_region): New class.
7726 (class Output_section_definition): Add set_memory_region,
7727 set_section_vma, set_section_lma and get_section_name methods.
7728 (class Script_Sections): Add add_memory_region,
7729 find_memory_region, find_memory_region_origin,
7730 find_memory_region_length and set_memory_region methods.
7731 Have set_section_addresses method walk the list of set memory
7732 regions.
7733 Extend the print methos to display memory regions.
7734 * script-sections.h: Add prototypes for new methods.
7735 Add enum for MEMORY region attributes.
7736 * yyscript.y: Add support for parsing MEMORY regions.
7737 * script-c.h: Add prototypes for new functions.
7738 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7739 * testsuite/Makefile.in: Regenerate.
7740 * testsuite/memory_test.sh: New script.
7741 * testsuite/memory_test.s: New assembler source file.
7742 * testsuite/memory_test.t: New linker script.
7743
a4649286
DK
77442010-08-27 Doug Kwan <dougkwan@google.com>
7745
7746 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7747 reference override an existing dynamic weak reference.
7748 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7749 * testsuite/Makefile.in: Regenerate.
7750 * testsuite/dyn_weak_ref.sh: New file.
7751 * testsuite/dyn_weak_ref_1.c: Ditto.
7752 * testsuite/dyn_weak_ref_2.c: Ditto.
7753
b56648ad
ILT
77542010-08-27 Ian Lance Taylor <iant@google.com>
7755
7756 * incremental.h (class Incremental_input_entry): Add virtual
7757 destructor.
7758
809313cb
ILT
77592010-08-27 Ian Lance Taylor <iant@google.com>
7760
7761 * testsuite/start_lib_test_3.c: Mark t3 as used.
7762
11e32464
NC
77632010-08-27 Nick Clifton <nickc@redhat.com>
7764
7765 * options.cc (version_script): Fix small typo in previous
7766 whitespace tidyup.
7767
ca09d69a
NC
77682010-08-25 Nick Clifton <nickc@redhat.com>
7769
7770 * archive.cc: Formatting fixes: Remove whitespace between
7771 typename and following asterisk. Remove whitespace between
7772 function name and opening parenthesis.
7773 * archive.h: Likewise.
7774 * arm.cc: Likewise.
7775 * attributes.cc: Likewise.
7776 * attributes.h: Likewise.
7777 * common.cc: Likewise.
7778 * copy-relocs.cc: Likewise.
7779 * dirsearch.h: Likewise.
7780 * dynobj.cc: Likewise.
7781 * ehframe.cc: Likewise.
7782 * ehframe.h: Likewise.
7783 * expression.cc: Likewise.
7784 * fileread.cc: Likewise.
7785 * fileread.h: Likewise.
7786 * gc.h: Likewise.
7787 * gold-threads.cc: Likewise.
7788 * gold.cc: Likewise.
7789 * i386.cc: Likewise.
7790 * icf.h: Likewise.
7791 * incremental-dump.cc: Likewise.
7792 * incremental.cc: Likewise.
7793 * layout.cc: Likewise.
7794 * layout.h: Likewise.
7795 * main.cc: Likewise.
7796 * merge.cc: Likewise.
7797 * merge.h: Likewise.
7798 * object.cc: Likewise.
7799 * object.h: Likewise.
7800 * options.cc: Likewise.
7801 * options.h: Likewise.
7802 * output.cc: Likewise.
7803 * output.h: Likewise.
7804 * plugin.cc: Likewise.
7805 * plugin.h: Likewise.
7806 * powerpc.cc: Likewise.
7807 * reloc.cc: Likewise.
7808 * script-c.h: Likewise.
7809 * script-sections.cc: Likewise.
7810 * script.cc: Likewise.
7811 * stringpool.cc: Likewise.
7812 * symtab.cc: Likewise.
7813 * symtab.h: Likewise.
7814 * target.cc: Likewise.
7815 * timer.cc: Likewise.
7816 * timer.h: Likewise.
7817 * version.cc: Likewise.
7818 * x86_64.cc: Likewise.
7819
b8fa8750
NC
78202010-08-24 Nick Clifton <nickc@redhat.com>
7821
7822 PR 11899
7823 * layout.cc (segment_precedes): Sort segments by their physical
7824 addresses, if they have been set.
7825
9919d93b
CC
78262010-08-23 Cary Coutant <ccoutant@google.com>
7827
7828 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7829 symbols data.
7830 (Lib_group::include_member): Unlock object after deleting its
7831 symbols data.
7832 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7833 the bug fixed here.
7834
97b4be1c
CC
78352010-08-19 Neil Vachharajani <nvachhar@google.com>
7836 Cary Coutant <ccoutant@google.com>
7837
7838 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7839 constructor, and set_blocker.
7840 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7841 readsyms_blocker_.
7842 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7843 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7844 * testsuite/Makefile.am (start_lib_test): New test case.
7845 * testsuite/Makefile.in: Regenerate.
7846 * testsuite/start_lib_test_main.c: New file.
7847 * testsuite/start_lib_test_1.c: New file.
7848 * testsuite/start_lib_test_2.c: New file.
7849 * testsuite/start_lib_test_3.c: New file.
7850
dd0b1884
ILT
78512010-08-19 Ian Lance Taylor <iant@google.com>
7852
7853 * Makefile.in: Rebuild with automake 1.11.1.
7854 * aclocal.m4: Likewise.
7855 * testsuite/Makefile.in: Likewise.
7856
7223e9ca
ILT
78572010-08-19 Ian Lance Taylor <iant@google.com>
7858
7859 PR 10893
7860 * i386.cc (class Output_data_plt_i386): Update declarations.
7861 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7862 local_ifuncs_ fields.
7863 (Target_i386::do_plt_section_for_global): New function.
7864 (Target_i386::do_plt_section_for_local): New function.
7865 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7866 parameter; change all callers. Initialize global_ifuncs_ and
7867 local_ifuncs_. If doing a static link define __rel_iplt_start and
7868 __rel_iplt_end.
7869 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7870 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7871 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7872 symbols.
7873 (Target_i386::make_plt_section): New function, broken out of
7874 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7875 (Target_i386::make_plt_entry): Call make_plt_section.
7876 (Target_i386::make_local_ifunc_plt_entry): New function.
7877 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7878 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7879 R_386_IRELATIVE to switch.
7880 (Target_i386::Scan::global): Likewise.
7881 (Target_i386::Relocate::relocate): Likewise.
7882 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7883 switch.
7884 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7885 (Target_x86_64::do_plt_section_for_global): New function.
7886 (Target_x86_64::do_plt_section_for_local): New function.
7887 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7888 parameter; change all callers. If doing a static link define
7889 __rela_iplt_start and __rela_iplt_end.
7890 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7891 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7892 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7893 to point to .plt.
7894 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7895 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7896 switch.
7897 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7898 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7899 R_X86_64_IRELATIVE to switch.
7900 (Target_x86_64::Scan::global): Likewise.
7901 (Target_x86_64::Relocate::relocate): Likewise.
7902 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7903 switch.
7904 * target.h (class Target): Add plt_section_for_global and
7905 plt_section_for_local functions. Add do_plt_section_for_global
7906 and do_plt_section_for_local virtual functions.
7907 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7908 clarifying comments.
7909 (Symbol::use_plt_offset): Handle IFUNC symbol.
7910 * object.cc (Sized_relobj::Sized_relobj): Initialize
7911 local_plt_offsets_.
7912 (Sized_relobj::local_has_plt_offset): New function.
7913 (Sized_relobj::local_plt_offset): New function.
7914 (Sized_relobj::set_local_plt_offset): New function.
7915 (Sized_relobj::do_count): Handle IFUNC symbol.
7916 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7917 a bit away from input_shndx_ field. Add set_is_func_symbol and
7918 is_ifunc_symbol functions.
7919 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7920 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7921 local_plt_offsets_ field.
7922 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7923 * output.h (class Output_section_data): Add non-const
7924 output_section function.
7925 (class Output_data_got): Update declarations.
7926 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7927 Add use_plt_offset parameter to global and local constructors.
7928 Change all callers. Change local_sym_index_ field to 31 bits.
7929 Change GSYM_CODE and CONSTANT_CODE accordingly.
7930 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7931 doing a static link don't set sh_link field.
7932 (Output_data_got::Got_entry::write): Use PLT offset if
7933 appropriate.
7934 (Output_data_got::add_global_plt): New function.
7935 (Output_data_got::add_local_plt): New function.
7936 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7937 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7938 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7939 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7940 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7941 IFUNC conditional.
7942 * testsuite/ifunc-sel.h: New file.
7943 * testsuite/ifuncmain1.c: New file.
7944 * testsuite/ifuncmain1vis.c: New file.
7945 * testsuite/ifuncmod1.c: New file.
7946 * testsuite/ifuncdep2.c: New file.
7947 * testsuite/ifuncmain2.c: New file.
7948 * testsuite/ifuncmain3.c: New file.
7949 * testsuite/ifuncmod3.c: New file.
7950 * testsuite/ifuncmain4.c: New file.
7951 * testsuite/ifuncmain5.c: New file.
7952 * testsuite/ifuncmod5.c: New file.
7953 * testsuite/ifuncmain6pie.c: New file.
7954 * testsuite/ifuncmod6.c: New file.
7955 * testsuite/ifuncmain7.c: New file.
7956 * configure, testsuite/Makefile.in: Rebuild.
7957
56f75c03
ILT
79582010-08-18 Ian Lance Taylor <iant@google.com>
7959
7960 * incremental.cc
7961 (Output_section_incremental_inputs::write_input_files): Add cast
7962 to avoid signed/unsigned comparison warning.
7963 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7964
55455f89
CC
79652010-08-12 Cary Coutant <ccoutant@google.com>
7966
7967 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7968
e2054bcb
ILT
79692010-08-13 Ian Lance Taylor <iant@google.com>
7970
7971 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7972
74f67560
DK
79732010-08-12 Cary Coutant <ccoutant@google.com>
7974 Doug Kwan <dougkwan@google.com>
7975
7976 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7977 defintion overrides non-weak undef, remember that the original undef
7978 is not weak.
7979 * symtab.cc (Symbol_table::sized_write_global): For undef without
7980 an original weak binding, set binding to global in output.
7981 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7982 * testsuite/Makefile.in: Regenerate.
7983 * testsuite/strong_ref_weak_def.sh: New file.
7984 * testsuite/strong_ref_weak_def_1.c: Ditto.
7985 * testsuite/strong_ref_weak_def_2.c: Ditto.
7986
d1238d12
CC
79872010-08-12 Cary Coutant <ccoutant@google.com>
7988
7989 * testsuite/incremental_test.sh: Rewrite.
7990 * testsuite/incremental_test_1.c: Rewrite.
7991 * testsuite/incremental_test_2.c: Rewrite.
7992
0e70b911
CC
79932010-08-12 Cary Coutant <ccoutant@google.com>
7994
7995 * arm.cc (Target_arm::got_size): Add const.
7996 (Target_arm::got_entry_count): New function.
7997 (Target_arm::plt_entry_count): New function.
7998 (Target_arm::first_plt_entry_offset): New function.
7999 (Target_arm::plt_entry_size): New function.
8000 (Output_data_plt_arm::entry_count): New function.
8001 (Output_data_plt_arm::first_plt_entry_offset): New function.
8002 (Output_data_plt_arm::get_plt_entry_size): New function.
8003 * i386.cc (Target_i386::got_size): Add const.
8004 (Target_i386::got_entry_count): New function.
8005 (Target_i386::plt_entry_count): New function.
8006 (Target_i386::first_plt_entry_offset): New function.
8007 (Target_i386::plt_entry_size): New function.
8008 (Output_data_plt_i386::entry_count): New function.
8009 (Output_data_plt_i386::first_plt_entry_offset): New function.
8010 (Output_data_plt_i386::get_plt_entry_size): New function.
8011 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8012 find_incremental_inputs_sections. Dump incremental_got_plt section.
8013 * incremental.cc: Include target.h.
8014 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8015 parameter. Adjust all callers. Find incremental_got_plt section.
8016 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8017 section.
8018 (Output_section_incremental_inputs::set_final_data_size): Calculate
8019 size of incremental_got_plt section.
8020 (Output_section_incremental_inputs::do_write): Write the
8021 incremental_got_plt section.
8022 (Got_plt_view_info): New struct.
8023 (Local_got_offset_visitor): New class.
8024 (Global_got_offset_visitor): New class.
8025 (Global_symbol_visitor_got_plt): New class.
8026 (Output_section_incremental_inputs::write_got_plt): New function.
8027 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8028 Add parameter. Adjust all callers.
8029 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8030 (Incremental_inputs::got_plt_section): New function.
8031 (Incremental_inputs::got_plt_section_): New data member.
8032 (Incremental_got_plt_reader): New class.
8033 * layout.cc (Layout::create_incremental_info_sections): Add the
8034 incremental_got_plt section.
8035 * object.h (Got_offset_list::get_list): New function.
8036 (Got offset_list::for_all_got_offsets): New function.
8037 (Sized_relobj::local_got_offset_list): New function.
8038 * powerpc.cc (Target_powerpc::got_size): Add const.
8039 (Target_powerpc::got_entry_count): New function.
8040 (Target_powerpc::plt_entry_count): New function.
8041 (Target_powerpc::first_plt_entry_offset): New function.
8042 (Target_powerpc::plt_entry_size): New function.
8043 (Output_data_plt_powerpc::entry_count): New function.
8044 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8045 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8046 * sparc.cc (Target_sparc::got_size): Add const.
8047 (Target_sparc::got_entry_count): New function.
8048 (Target_sparc::plt_entry_count): New function.
8049 (Target_sparc::first_plt_entry_offset): New function.
8050 (Target_sparc::plt_entry_size): New function.
8051 (Output_data_plt_sparc::entry_count): New function.
8052 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8053 (Output_data_plt_sparc::get_plt_entry_size): New function.
8054 * symtab.h (Symbol::got_offset_list): New function.
8055 (Symbol_table::for_all_symbols): New function.
8056 * target.h (Sized_target::got_entry_count): New function.
8057 (Sized_target::plt_entry_count): New function.
8058 (Sized_target::plt_entry_size): New function.
8059 * x86_64.cc (Target_x86_64::got_size): Add const.
8060 (Target_x86_64::got_entry_count): New function.
8061 (Target_x86_64::plt_entry_count): New function.
8062 (Target_x86_64::first_plt_entry_offset): New function.
8063 (Target_x86_64::plt_entry_size): New function.
8064 (Output_data_plt_x86_64::entry_count): New function.
8065 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8066 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8067
09ec0418
CC
80682010-08-12 Cary Coutant <ccoutant@google.com>
8069
8070 * archive.cc: Include incremental.h.
8071 (Archive::Archive): Initialize incremental_info_.
8072 (Archive::include_member): Record archive members in incremental info.
8073 (Add_archive_symbols::run): Record begin and end of an archive in
8074 incremental info.
8075 (Lib_group::include_member): Record objects in incremental info.
8076 * archive.h (Incremental_archive_entry): Forward declaration.
8077 (Archive::set_incremental_info): New member function.
8078 (Archive::incremental_info): New member function.
8079 (Archive::Unused_symbol_iterator): New class.
8080 (Archive::unused_symbols_begin): New member function.
8081 (Archive::unused_symbols_end): New member function.
8082 (Archive::incremental_info_): New data member.
8083 * incremental-dump.cc (find_input_containing_global): New function.
8084 (dump_incremental_inputs): Dump new incremental info sections.
8085 * incremental.cc: Include symtab.h.
8086 (Output_section_incremental_inputs): New class.
8087 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8088 new incremental info sections.
8089 (Sized_incremental_binary::do_check_inputs): Likewise.
8090 (Incremental_inputs::report_archive): Remove.
8091 (Incremental_inputs::report_archive_begin): New function.
8092 (Incremental_inputs::report_archive_end): New function.
8093 (Incremental_inputs::report_object): New function.
8094 (Incremental_inputs::finalize_inputs): Remove.
8095 (Incremental_inputs::report_input_section): New function.
8096 (Incremental_inputs::report_script): Rewrite.
8097 (Incremental_inputs::finalize): Do nothing but finalize string table.
8098 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8099 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8100 (Incremental_inputs::create_data_sections): New function.
8101 (Incremental_inputs::relocs_entsize): New function.
8102 (Output_section_incremental_inputs::set_final_data_size): New function.
8103 (Output_section_incremental_inputs::do_write): New function.
8104 (Output_section_incremental_inputs::write_header): New function.
8105 (Output_section_incremental_inputs::write_input_files): New function.
8106 (Output_section_incremental_inputs::write_info_blocks): New function.
8107 (Output_section_incremental_inputs::write_symtab): New function.
8108 * incremental.h (Incremental_script_entry): Forward declaration.
8109 (Incremental_object_entry): Forward declaration.
8110 (Incremental_archive_entry): Forward declaration.
8111 (Incremental_inputs): Forward declaration.
8112 (Incremental_inputs_header_data): Remove.
8113 (Incremental_inputs_header): Remove.
8114 (Incremental_inputs_header_write): Remove.
8115 (Incremental_inputs_entry_data): Remove.
8116 (Incremental_inputs_entry): Remove.
8117 (Incremental_inputs_entry_write): Remove.
8118 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
8119 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
8120 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8121 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
8122 Likewise.
8123 (Incremental_input_entry): New class.
8124 (Incremental_script_entry): New class.
8125 (Incremental_object_entry): New class.
8126 (Incremental_archive_entry): New class.
8127 (Incremental_inputs::Incremental_inputs): Initialize new data members.
8128 (Incremental_inputs::report_inputs): Remove.
8129 (Incremental_inputs::report_archive): Remove.
8130 (Incremental_inputs::report_archive_begin): New function.
8131 (Incremental_inputs::report_archive_end): New function.
8132 (Incremental_inputs::report_object): Change prototype.
8133 (Incremental_inputs::report_input_section): New function.
8134 (Incremental_inputs::report_script): Change prototype.
8135 (Incremental_inputs::get_reloc_count): New function.
8136 (Incremental_inputs::set_reloc_count): New function.
8137 (Incremental_inputs::create_data_sections): New function.
8138 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8139 (Incremental_inputs::inputs_section): New function.
8140 (Incremental_inputs::symtab_section): New function.
8141 (Incremental_inputs::relocs_section): New function.
8142 (Incremental_inputs::get_stringpool): Add const.
8143 (Incremental_inputs::command_line): Add const.
8144 (Incremental_inputs::inputs): Remove.
8145 (Incremental_inputs::command_line_key): New function.
8146 (Incremental_inputs::input_file_count): New function.
8147 (Incremental_inputs::input_files): New function.
8148 (Incremental_inputs::relocs_entsize): New function.
8149 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8150 (Incremental_inputs::finalize_inputs): Remove.
8151 (Incremental_inputs::Input_info): Remove.
8152 (Incremental_inputs::lock_): Remove.
8153 (Incremental_inputs::inputs_): Change type.
8154 (Incremental_inputs::inputs_map_): Remove.
8155 (Incremental_inputs::current_object_entry_): New data member.
8156 (Incremental_inputs::inputs_section_): New data member.
8157 (Incremental_inputs::symtab_section_): New data member.
8158 (Incremental_inputs::relocs_section_): New data member.
8159 (Incremental_inputs::reloc_count_): New data member.
8160 (Incremental_inputs_reader): New class.
8161 (Incremental_symtab_reader): New class.
8162 (Incremental_relocs_reader): New class.
8163 * layout.cc (Layout::finalize): Move finalization of incremental info
8164 and creation of incremental info sections to follow finalization of
8165 symbol table. Set offsets for postprocessing sections.
8166 (Layout::create_incremental_info_sections): Call
8167 Incremental_inputs::create_data_sections. Add incremental symtab
8168 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
8169 sections to layout after input sections.
8170 * layout.h (struct Timespec): Forward declaration.
8171 (Layout::incremental_inputs): Add const.
8172 (Layout::create_incremental_info_sections): Add parameter.
8173 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
8174 * object.cc: Include incremental.h.
8175 (Relobj::finalize_incremental_relocs): New function.
8176 (Sized_relobj::do_layout): Record input sections in incremental info.
8177 * object.h (Object::output_section): New function.
8178 (Object::output_section_offset): Moved from Relobj.
8179 (Object::get_incremental_reloc_base): New function.
8180 (Object::get_incremental_reloc_count): New function.
8181 (Object::do_output_section): New function.
8182 (Object::do_output_section_offset): Moved from Relobj.
8183 (Object::do_get_incremental_reloc_base): New function.
8184 (Object::do_get_incremental_reloc_count): New function.
8185 (Object::Object): Initialize new data members.
8186 (Relobj::output_section): Renamed do_output_section and moved to
8187 protected.
8188 (Relobj::output_section_offset): Moved to Object.
8189 (Relobj::do_get_incremental_reloc_base): New function.
8190 (Relobj::do_get_incremental_reloc_count): New function.
8191 (Relobj::allocate_incremental_reloc_counts): New function.
8192 (Relobj::count_incremental_reloc): New function.
8193 (Relobj::finalize_incremental_relocs): New function.
8194 (Relobj::next_incremental_reloc_index): New function.
8195 (Relobj::reloc_counts_): New data member.
8196 (Relobj::reloc_bases_): New data member.
8197 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
8198 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
8199 (Sized_relobj::incremental_relocs_scan): New function.
8200 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8201 (Sized_relobj::incremental_relocs_write): New function.
8202 (Sized_relobj::incremental_relocs_write_reltype): New function.
8203 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
8204 incremental link.
8205 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
8206 archives and object files elsewhere.
8207 (Add_symbols::run): Report object files here.
8208 (Finish_group::run): Report end of archive at end of group.
8209 * reloc.cc: Include layout.h, incremental.h.
8210 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
8211 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
8212 (Sized_relobj::incremental_relocs_scan): New function.
8213 (Sized_relobj::incremental_relocs_scan_reltype): New function.
8214 (Sized_relobj::do_relocate_sections): Write incremental relocations.
8215 (Sized_relobj::incremental_relocs_write): New function.
8216 (Sized_relobj::incremental_relocs_write_reltype): New function.
8217 * script.cc (read_input_script): Rewrite test for incremental link.
8218 Change call to Incremental_inputs::report_script.
8219 * symtab.h (Symbol_table::first_global_index): New function.
8220 (Symbol_table::output_count): New function.
8221
ce0d1972
DK
82222010-08-12 Doug Kwan <dougkwan@google.com>
8223
8224 * arm.cc (Target_arm::merge_object_attributes): Check command line
8225 options --no-wchar-size-warning and --no-enum-size-warning.
8226 * options.h (General_options): Add ld-compatible options
8227 --no-enum-size-warning and --no-wchar-size-warning.
8228
6e5710ce
ILT
82292010-08-04 Ian Lance Taylor <iant@google.com>
8230
8231 * x86_64.cc (Target_x86_64::Scan::local): Use
8232 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
8233 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
8234 (Target_x86_64::Scan::global): Likewise.
8235 (Target_x86_64::Relocate::relocate): Likewise.
8236 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
8237 Likewise.
8238
fef830db
CC
82392010-08-03 Cary Coutant <ccoutant@google.com>
8240
8241 * merge.cc (Output_merge_string::do_add_input_section): Count strings
8242 to reserve space in merged_strings vector. Keep total input size
8243 for stats.
8244 (Output_merge_string::do_print_merge_stats): Print total input size.
8245 * merge.h (Output_merge_string): Add input_size_ field.
8246 * stringpool.cc (Stringpool_template::string_length): Move
8247 implementations out of Stringpool_template class and place in
8248 stringpool.h.
8249 * stringpool.h (string_length): Move out of Stringpool_template.
8250
1e3811b0
ILT
82512010-08-03 Ian Lance Taylor <iant@google.com>
8252
8253 PR 11712
8254 * layout.cc (relaxation_loop_body): If address of load segment is
8255 set, adjust address to include headers if possible.
8256
7af0c620
ILT
82572010-08-03 Ian Lance Taylor <iant@google.com>
8258
8259 * version.cc (version_string): Bump to 1.10.
8260
22f0da72
ILT
82612010-08-03 Ian Lance Taylor <iant@google.com>
8262
8263 PR 11805
8264 * layout.h (enum Output_section_order): Define.
8265 (class Layout): Update declarations.
8266 * layout.cc (Layout::get_output_section): Add order parameter.
8267 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
8268 is_first_non_relro parameters. Change all callers.
8269 (Layout::choose_output_section): Likewise.
8270 (Layout::add_output_section_data): Likewise.
8271 (Layout::make_output_section): Likewise. Set order.
8272 (Layout::default_section_order): New function.
8273 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
8274 * output.cc (Output_section::Output_section): Initialize order_.
8275 Don't initialize deleted fields.
8276 (Output_segment::Output_segment): Don't initialize deleted
8277 fields.
8278 (Output_segment::add_output_section_to_load): New function
8279 replacing add_output_section. Change all callers to call this or
8280 add_output_section_to_nonload.
8281 (Output_segment::add_output_section_to_nonload): New function.
8282 (Output_segment::remove_output_section): Rewrite.
8283 (Output_segment::add_initial_output_data): Likewise.
8284 (Output_segment::has_any_data_sections): Likewise.
8285 (Output_segment::is_first_section_relro): Likewise.
8286 (Output_segment::maximum_alignment): Likewise.
8287 (Output_segment::has_dynamic_reloc): New function replacing
8288 dynamic_reloc_count. Change all callers.
8289 (Output_segment::has_dynamic_reloc_list): New function replacing
8290 dynamic_reloc_count_list. Change all callers.
8291 (Output_segment::set_section_addresses): Rewrite.
8292 (Output_segment::set_offset): Rewrite.
8293 (Output_segment::find_first_and_last_list): Remove.
8294 (Output_segment::set_tls_offsets): Rewrite.
8295 (Output_segment::first_section_load_address): Likewise.
8296 (Output_segment::output_section_count): Likewise.
8297 (Output_segment::section_with_lowest_load_address): Likewise.
8298 (Output_segment::write_section_headers): Likewise.
8299 (Output_segment::print_sections_to_map): Likewise.
8300 * output.h (class Output_data): Remove dynamic_reloc_count_
8301 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
8302 (Output_data::add_dynamic_reloc): Rewrite.
8303 (Output_data::has_dynamic_reloc): New function.
8304 (Output_data::dynamic_reloc_count): Remove.
8305 (class Output_section): Add order_ field. Remvoe is_relro_local_,
8306 is_last_relro_, is_first_non_relro_, is_interp_,
8307 is_dynamic_linker_section_ fields. Add order and set_order
8308 functions. Remove is_relro_local, set_is_relro_local,
8309 is_last_relro, set_is_last_relro, is_first_non_relro,
8310 set_is_first_non_relro functions, is_interp, set_is_interp,
8311 is_dynamic_linker_section, and set_is_dynamic_linker_section
8312 functions.
8313 (class Output_segment): Change Output_data_list from std::list to
8314 std:;vector. Add output_lists_ field. Remove output_data_ and
8315 output_bss_ fields. Update declarations.
8316
3ff2ccb0
ILT
83172010-08-02 Ian Lance Taylor <iant@google.com>
8318
8319 * arm.cc (Target_arm::gc_process_relocs): Use typename.
8320 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
8321 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
8322
88a4108b
ILT
83232010-08-02 Ian Lance Taylor <iant@google.com>
8324
8325 PR 11855
8326 * script.cc (Script_options::Script_options): Initialize
8327 symbol_definitions_ and symbol_references_.
8328 (Script_options::add_symbol_assignment): Update
8329 symbol_definitions_ and symbol_references_.
8330 (Script_options::add_symbol_reference): New function.
8331 (script_symbol): New function.
8332 * script.h (class Script_options): Add symbol_definitions_ and
8333 symbol_references_ fields.
8334 (Script_options::referenced_const_iterator): New type.
8335 (Script_options::referenced_begin): New function.
8336 (Script_options::referenced_end): New function.
8337 (Script_options::is_referenced): New function.
8338 (Script_options::any_unreferenced): New function.
8339 * script-c.h (script_symbol): Declare.
8340 * yyscript.y (exp): Call script_symbol.
8341 * symtab.cc: Include "script.h".
8342 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8343 Change all callers. Check symbols referenced by scripts.
8344 (Symbol_table::add_undefined_symbols_from_command_line): Add
8345 layout parameter. Change all callers.
8346 (Symbol_table::do_add_undefined_symbols_from_command_line):
8347 Likewise. Break out loop body. Check symbols referenced by
8348 scripts.
8349 (Symbol_table::add_undefined_symbol_from_command_line): New
8350 function broken out of
8351 do_add_undefined_symbols_from_command_line.
8352 * symtab.h (class Symbol_table): Update declarations.
8353 * archive.cc: Include "layout.h".
8354 (Archive::should_include_member): Add layout parameter. Change
8355 all callers. Check for symbol mentioned in expression.
8356 * archive.h (class Archive): Update declaration.
8357 * object.cc (Sized_relobj::do_should_include_member): Add layout
8358 parameter.
8359 * object.h (Object::should_include_member): Add layout parameter.
8360 Change all callers.
8361 (Object::do_should_include_member): Add layout parameter.
8362 (class Sized_relobj): Update declaration.
8363 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8364 parameter.
8365 * dynobj.h (class Sized_dynobj): Update declaration.
8366 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8367 layout parameter.
8368 * plugin.h (class Sized_pluginobj): Update declaration.
8369
5f1ab67a
ILT
83702010-08-02 Ian Lance Taylor <iant@google.com>
8371
8372 PR 11866
8373 * output.cc (Output_segment::set_offset): Search for the first and
8374 last sections rather than assuming that the list is in order.
8375 (Output_segment::find_first_and_last_list): New function.
8376 * output.h (class Output_segment): Update declarations.
8377 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8378 (relro_strip_test_SOURCES): New variable.
8379 (relro_strip_test_DEPENDENCIES): New variable.
8380 (relro_strip_test_LDFLAGS): New variable.
8381 (relro_strip_test_LDADD): New variable.
8382 (relro_strip_test.so): New target.
8383
a8df5856
ILT
83842010-08-02 Ian Lance Taylor <iant@google.com>
8385
8386 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8387 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8388 (Target_i386::got_tlsdesc_section): New function.
8389 (Target_i386::got_section): Create space for GOT entries for
8390 TLSDESC relocations.
8391 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8392 R_386_TLS_GOTDESC.
8393 (Target_i386::Scan::global): Likewise.
8394 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8395 using TLSDESC GOT.
8396 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8397 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8398 (Target_x86_64::got_tlsdesc_section): New function.
8399 (Target_x86_64::got_section): Create space for GOT entries for
8400 TLSDESC relocations.
8401 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8402 R_386_TLS_GOTDESC.
8403 (Target_x86_64::Scan::global): Likewise.
8404 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8405 using TLSDESC GOT.
8406
0c10a0a6
ILT
84072010-08-02 Ian Lance Taylor <iant@google.com>
8408
8409 * testsuite/final_layout.sh: Use dc to convert from hex to
8410 decimal.
8411
41cbeecc
ST
84122010-07-29 Sriraman Tallam <tmsriram@google.com>
8413
8414 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8415 paramter to the call to gold::gc_process_relocs.
8416 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8417 paramter to the call to gold::gc_process_relocs.
8418 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8419 parameter to the call to gold::gc_process_relocs.
8420 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8421 template parameter to the call to gold::gc_process_relocs.
8422 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8423 paramter to the call to gold::gc_process_relocs.
8424 * gc.h (get_embedded_addend_size): New function.
8425 (gc_process_relocs): Save the size of the reloc for use by ICF.
8426 * icf.cc (get_section_contents): Get the addend from the text section
8427 for SHT_REL relocation sections.
8428 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8429 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8430 * int_encoding.h (read_from_pointer): New overloaded function.
8431 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8432 * testsuite/icf_sht_rel_addend_test.sh: New file.
8433 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8434 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8435
6ea55b82
RW
84362010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8437
8438 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8439 * Makefile.in: Regenerate.
8440 * testsuite/Makefile.in: Regenerate.
8441
9691462b
ILT
84422010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8443
8444 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8445 * gold/testsuite/debug_msg.cc: Likewise.
8446 * gold/testsuite/odr_violation1.cc
8447 * gold/testsuite/odr_violation2.cc
8448
76897331
CC
84492010-07-21 Cary Coutant <ccoutant@google.com>
8450
8451 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8452 string, and length fields.
8453 (Output_merge_string::Merged_strings_list): New type.
8454 (Output_merge_string::Merged_strings_lists): New typedef.
8455 (Output_merge_string): Replace merged_strings_ with
8456 merged_strings_lists_.
8457 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8458 Merged_strings_list per input object and section. Don't store pointer
8459 to the string. Don't store length with each merged string entry.
8460 (Output_merge_string::finalize_merged_data): Loop over list of merged
8461 strings lists. Recompute length of each merged string.
8462
78384e8f
CC
84632010-07-15 Cary Coutant <ccoutant@google.com>
8464
8465 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8466 here.
8467
783659f9
ILT
84682010-07-14 Ian Lance Taylor <iant@google.com>
8469
8470 * descriptors.cc (Descriptors::open): Report correct name in error
8471 message.
8472
131687b4
DK
84732010-07-13 Doug Kwan <dougkwan@google.com>
8474
8475 * arm.cc (Arm_input_section::Arm_input_section): For a
8476 SHT_ARM_EXIDX section, always keeps the input sections.
8477 (Arm_input_section::set_exidx_section_link): New method.
8478 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8479 has_errors_ to false.
8480 (Arm_exidx_input_section::has_errors,
8481 Arm_exidx_input_section::set_has_errors): New methods.
8482 (Arm_exidx_input_section::has_errors_): New data member.
8483 (Arm_relobj::get_exidx_shndx_list): New method.
8484 (Arm_output_section::append_text_sections_to_list): Do not skip
8485 section without SHF_EXECINSTR.
8486 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8487 errors.
2e702c99 8488 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8489 section header. Make error messages more verbose. Check for
8490 a non-executable section linked to an EXIDX section.
8491 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8492 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8493 check that there is no deferred EXIDX section if we exit early.
8494 Instead of not making an EXIDX section in case of an error, make one
8495 and set the has_errors flag of it.
8496 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8497 in a relocatable link.
8498 (Target_arm::do_relax): Look for the EXIDX output section instead of
8499 assuming that it is called .ARM.exidx.
2e702c99 8500 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8501 section list. Do not check for SHF_EXECINSTR section flags but
8502 skip any input section with errors.
8503 * output.cc (Output_section::Output_section): Initialize
8504 always_keeps_input_sections_ to false.
8505 (Output_section::add_input_section): Check for
8506 always_keeps_input_sections_.
8507 * output.h (Output_section::always_keeps_input_sections,
8508 Output_section::set_always_keeps_input_sections): New methods.
8509 (Output_section::always_keeps_input_sections): New data member.
8510
69517287
RÁE
85112010-07-13 Rafael Espindola <espindola@google.com>
8512
8513 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8514 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8515
82742395
ILT
85162010-07-13 Philip Herron <herron.philip@googlemail.com>
8517 Ian Lance Taylor <iant@google.com>
8518
8519 * output.h (Output_section_lookup_maps::add_merge_section):
8520 Correct check of whether value was inserted.
8521 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8522 (Output_section_lookup_maps::add_relaxed_input_section):
8523 Likewise.
8524 * arm.cc (Target_arm::got_section): Remove used local os.
8525 * i386.cc (Target_i386::got_section): Likewise.
8526 * x86_64.cc (Target_x86_64::got_section): Likewise.
8527 * sparc.cc (Target_sparc::got_section): Likewise.
8528 (Target_sparc::relocate): Remove unused local have_got_offset.
8529 * powerpc.cc (Target_powerpc::relocate): Likewise.
8530
f2d707b5
ILT
85312010-07-13 Ian Lance Taylor <iant@google.com>
8532
241531d6
ILT
8533 * compressed_output.cc (zlib_decompress): Fix signature in
8534 !HAVE_ZLIB_H case.
8535
f2d707b5
ILT
8536 * archive.cc (Archive::include_member): Unlock an external member
8537 of a thin archive. Don't bother to delete an object we know is
8538 NULL.
8539
a2e47362
CC
85402010-07-12 Cary Coutant <ccoutant@google.com>
8541
8542 * compressed_output.cc (zlib_decompress): New function.
8543 (get_uncompressed_size): New function.
8544 (decompress_input_section): New function.
8545 * compressed_output.h (get_uncompressed_size): New function.
8546 (decompress_input_section): New function.
8547 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8548 Handle compressed debug sections.
8549 * layout.cc (is_compressed_debug_section): New function.
8550 (Layout::output_section_name): Map compressed section names to
8551 canonical names.
8552 * layout.h (is_compressed_debug_section): New function.
8553 (is_debug_info_section): Recognize compressed debug sections.
8554 * merge.cc: Include compressed_output.h.
8555 (Output_merge_data::do_add_input_section): Handle compressed
8556 debug sections.
8557 (Output_merge_string::do_add_input_section): Handle compressed
8558 debug sections.
8559 * object.cc: Include compressed_output.h.
8560 (Sized_relobj::Sized_relobj): Initialize new data members.
8561 (build_compressed_section_map): New function.
8562 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8563 * object.h (Object::section_is_compressed): New method.
8564 (Object::do_section_is_compressed): New method.
8565 (Sized_relobj::Compressed_section_map): New type.
8566 (Sized_relobj::do_section_is_compressed): New method.
8567 (Sized_relobj::compressed_sections_): New data member.
8568 * output.cc (Output_section::add_input_section): Handle compressed
8569 debug sections.
8570 * reloc.cc: Include compressed_output.h.
8571 (Sized_relobj::write_sections): Handle compressed debug sections.
8572
ce279a62
CC
85732010-07-08 Cary Coutant <ccoutant@google.com>
8574
8575 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8576 weak when resolving to a dynamic def.
8577 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8578 for weak undef/dynamic def cases. Adjust callers.
8579 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8580 undef_binding_weak_.
8581 (Symbol_table::sized_write_globals): Adjust symbol binding.
8582 (Symbol_table::sized_write_symbol): Add binding parameter.
8583 * symtab.h (Symbol::set_undef_binding): New method.
8584 (Symbol::is_undef_binding_weak): New method.
8585 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8586 (Symbol_table::should_override): Add new parameter.
8587 (Symbol_table::sized_write_symbol): Add new parameter.
8588
8589 * testsuite/weak_undef_file1.cc: Add new test case.
8590 * testsuite/weak_undef_file2.cc: Fix header comment.
8591 * testsuite/weak_undef_test.cc: Add new test case.
8592
b2286c10
DK
85932010-06-29 Doug Kwan <dougkwan@google.com>
8594
8595 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8596 Initialize USE_SYMBOL_.
8597 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8598 definition.
8599 (Arm_reloc_property::uses_symbol_): New data member declaration.
8600 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8601 uses symbol value and symbol is undefined but not weakly undefined.
8602
4802450a
RÁE
86032010-06-28 Rafael Espindola <espindola@google.com>
8604
8605 * plugin.cc (Plugin::load): Use dlerror.
8606
e5ca47ba
ILT
86072010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8608
8609 * symtab.cc (detect_odr_violations): When reporting an ODR
8610 violation, report an object where the symbol is defined.
8611
8a75a161
DK
86122010-06-25 Doug Kwan <dougkwan@google.com>
8613
8614 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8615 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8616 definition.
8617 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8618 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8619 target hook to detect function points.
8620 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8621 * icf.h (Icf::check_section_for_function_pointers): Change type of
8622 parameter SECTION_NAME to const reference to std::string. Use
8623 target hook to determine if section may have unsafe pointers.
8624 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8625 method definition.
8626
42218b9f
RÁE
86272010-06-21 Rafael Espindola <espindola@google.com>
8628
8629 * fileread.cc (Input_file::find_fie): New
8630 (Input_file::open): Use Input_file::find_fie.
8631 * fileread.h (Input_file::find_fie): New
8632 * plugin.cc (set_extra_library_path): New.
8633 (Plugin::load): Add set_extra_library_path to the transfer vector.
8634 (Plugin_manager::set_extra_library_path): New.
8635 (Plugin_manager::add_input_file): Use the extra search path if set.
8636 (set_extra_library_path(): New.
8637 * plugin.h (Plugin_manager): Add set_extra_library_path and
8638 extra_search_path_.
8639
a0506cca
CC
86402010-06-19 Cary Coutant <ccoutant@google.com>
8641
8642 * layout.cc (gdb_sections): Add .debug_types.
8643 (lines_only_debug_sections): Likewise.
8644
6508b958
RÁE
86452010-06-18 Rafael Espindola <espindola@google.com>
8646
8647 * plugin.cc (add_input_file,add_input_library)
8648 (Plugin_manager::add_input_file): Make filename arguments const.
8649 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8650 const.
8651
3e235302
DK
86522010-06-16 Doug Kwan <dougkwan@google.com>
8653
8654 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8655 .ARM.attributes section if we have not merged any input
8656 attributes sections.
8657
106e8a6c
DK
86582010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8659
8660 * arm.cc: Allow combining objects with no EABI version
8661 information.
8662
91ff43fe
RÁE
86632010-06-15 Rafael Espindola <espindola@google.com>
8664
8665 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8666
68ed838c
ILT
86672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8668
8669 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8670 (struct iovec): Correct !HAVE_READV definition.
8671
f3a2388f
CC
86722010-06-10 Cary Coutant <ccoutant@google.com>
8673
8674 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8675 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8676 reloc sections.
8677 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8678
8679 PR 11683
8680 * symtab.h (Symbol::is_placeholder): New member function.
8681 * target-reloc.h (relocate_section): Check for placeholder symbols.
8682
8683 * testsuite/Makefile.am (plugin_test_8): New test.
8684 (plugin_test_9): New test.
8685 * testsuite/Makefile.in: Regenerate.
8686
e1df38aa
NC
86872010-06-09 Nick Clifton <nickc@redhat.com>
8688
8689 * yyscript.y (input_list_element): Allow strings prefixed with
8690 the '-' character. Treat these as libraries.
8691 * script.cc (script_add_library): New function. Adds a library
8692 specified by "-l<name>" found in an input script.
8693 * script-c.h: Add prototype for script_add_library.
8694
25bbe950
DK
86952010-06-07 Doug Kwan <dougkwan@google.com>
8696
8697 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8698 Restrict stub-group size to be within long conditional branch
8699 range when working around cortex-A8 erratum.
8700
0f32ea4c
ILT
87012010-06-07 Damien Diederen <dd@crosstwine.com>
8702
8703 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8704 #ifdef typo.
8705
8fe2a369
ST
87062010-06-03 Sriraman Tallam <tmsriram@google.com>
8707
8708 PR gold/11658
8709 * output.cc
8710 (Output_section::Input_section_sort_entry::compare_section_ordering):
8711 Change to return non-zero correctly.
8712 (Output_section::Input_section_sort_section_order_index_compare
8713 ::operator()): Change to fix ambiguity in comparisons.
8714
6e9ba2ca
ST
87152010-06-01 Sriraman Tallam <tmsriram@google.com>
8716
8717 * gold.h (is_wildcard_string): New function.
8718 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8719 (Layout::layout_eh_frame): Ditto.
8720 (Layout::find_section_order_index): New method.
8721 (Layout::read_layout_from_file): New method.
8722 * layout.h (Layout::find_section_order_index): New method.
8723 (Layout::read_layout_from_file): New method.
8724 (Layout::input_section_position_): New private member.
8725 (Layout::input_section_glob_): New private member.
8726 * main.cc (main): Call read_layout_from_file here.
8727 * options.h (--section-ordering-file): New option.
8728 * output.cc (Output_section::input_section_order_specified_): New
8729 member.
8730 (Output_section::Output_section): Initialize new member.
8731 (Output_section::add_input_section): Add new parameter.
8732 Keep input sections when --section-ordering-file is used.
8733 (Output_section::set_final_data_size): Sort input sections when
8734 section ordering file is specified.
8735 (Output_section::Input_section_sort_entry): Add new parameter.
8736 Check sorting type.
8737 (Output_section::Input_section_sort_entry::compare_section_ordering):
8738 New method.
8739 (Output_section::Input_section_sort_compare::operator()): Change to
8740 consider section_order_index.
8741 (Output_section::Input_section_sort_init_fini_compare::operator()):
8742 Change to consider section_order_index.
8743 (Output_section::Input_section_sort_section_order_index_compare
8744 ::operator()): New method.
8745 (Output_section::sort_attached_input_sections): Change to sort
8746 according to section order when specified.
e1df38aa
NC
8747 (Output_section::add_input_section<32, true>): Add new parameter.
8748 (Output_section::add_input_section<64, true>): Add new parameter.
8749 (Output_section::add_input_section<32, false>): Add new parameter.
8750 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8751 * output.h (Output_section::add_input_section): Add new parameter.
8752 (Output_section::input_section_order_specified): New
8753 method.
8754 (Output_section::set_input_section_order_specified): New method.
8755 (Input_section::Input_section): Initialize section_order_index_.
8756 (Input_section::section_order_index): New method.
8757 (Input_section::set_section_order_index): New method.
8758 (Input_section::section_order_index_): New member.
8759 (Input_section::Input_section_sort_section_order_index_compare): New
8760 struct.
8761 (Output_section::input_section_order_specified_): New member.
8762 * script-sections.cc (is_wildcard_string): Delete and move modified
8763 method to gold.h.
8764 (Output_section_element_input::Output_section_element_input): Modify
8765 call to is_wildcard_string.
8766 (Output_section_element_input::Input_section_pattern
8767 ::Input_section_pattern): Ditto.
8768 (Output_section_element_input::Output_section_element_input): Ditto.
8769 * testsuite/Makefile.am (final_layout): New test case.
8770 * testsuite/Makefile.in: Regenerate.
8771 * testsuite/final_layout.cc: New file.
8772 * testsuite/final_layout.sh: New file.
8773
3537c84b
RÁE
87742010-06-01 Rafael Espindola <espindola@google.com>
8775
8776 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8777
105b6afd
RÁE
87782010-06-01 Rafael Espindola <espindola@google.com>
8779
8780 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8781 visibility of symbols.
8782
29e11421
DK
87832010-05-27 Doug Kwan <dougkwan@google.com>
8784
8785 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8786 from start of output section instead of address for a local symbol
8787 in a merged or relaxed section when doing a relocatable link.
8788
5e0f337e
RÁE
87892010-05-26 Rafael Espindola <espindola@google.com>
8790
703d02da 8791 PR 11604
5e0f337e
RÁE
8792 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8793 adding sections the garbage collector removed.
8794 * gold/testsuite/Makefile.am: Add test.
8795 * gold/testsuite/Makefile.in: Regenerate.
8796 * gold/testsuite/plugin_test_7.sh: New.
8797 * gold/testsuite/plugin_test_7_1.c: New.
8798 * gold/testsuite/plugin_test_7_2.c: New.
8799
f4187277
RÁE
88002010-05-26 Rafael Espindola <espindola@google.com>
8801
8802 * script-sections.cc (Output_section_definition::set_section_addresses):
8803 Check for --section-start.
8804
5c388529
DK
88052010-05-26 Doug Kwan <dougkwan@google.com>
8806
8807 * arm.cc (Arm_scan_relocatable_relocs): New class.
8808 (Target_arm::relocate_special_relocatable): New method.
8809 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8810 (Arm_relocate_functions::thumb_branch_common): Same.
8811 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8812 instead of Default_scan_relocatable_relocs.
8813 * target-reloc.h (relocate_for_relocatable): Let target handle
8814 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8815 * target.h (Sized_target::relocate_special_relocatable): New method.
8816
bca1c3ae
ILT
88172010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8818
8819 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8820
0439c796
DK
88212010-05-23 Doug Kwan <dougkwan@google.com>
8822
8823 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8824 instead of a cast.
8825 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8826 with a direct branch, not a conditional branch, to a stub.
8827 * merge.cc (Output_merge_base::record_input_section): New method
8828 defintion.
8829 (Output_merge_data::do_add_input_section): Record input section if
8830 keeps-input-sections flag is set.
8831 (Output_merge_string::do_add_input_section): Ditto.
8832 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8833 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8834 INPUT_SECTIONS_.
8835 (Output_merge_base::keeps_input_sections,
8836 Output_merge_base::set_keeps_input_sections,
8837 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8838 method definitions.
8839 (Output_merge_base::Input_sections): New type declaration.
8840 (Output_merge_base::input_sections_begin,
8841 Output_merge_base::input_sections_end,
8842 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8843 (Output_merge_base::bool keeps_input_sections_,
8844 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8845 Output_merge_base::input_sections_): New data members.
8846 (Output_merge_data::do_set_keeps_input_sections): New method
8847 defintion.
8848 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8849 * output.cc (Output_section::Input_section::relobj): Move method
8850 defintion from class declaration to here and handle merge sections.
8851 (Output_section::Input_section::shndx): Ditto.
8852 (Output_section::Output_section): Remove initializations of removed
8853 data members and initialize new data member LOOKUP_MAPS_.
8854 (Output_section::add_input_section): Set keeps-input-sections flag
8855 for a newly created merge output section as appropriate. Adjust code
8856 to use Output_section_lookup_maps class.
8857 (Output_section::add_relaxed_input_section): Adjst code for lookup
8858 maps code refactoring.
2e702c99 8859 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8860 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8861 class. If adding input section to a newly created merge output
8862 section fails, remove the new merge section.
8863 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8864 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8865 (Output_section::find_merge_section): Ditto.
0439c796 8866 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8867 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8868 Output_section_lookup_maps class.
8869 (Output_section::get_input_sections): Export merge sections. Adjust
8870 code to use Output_section_lookup_maps class.
8871 (Output_section:::add_script_input_section): Adjust code to use
8872 Output_section_lookup_maps class. Update lookup maps for merge
8873 sections also.
8874 (Output_section::discard_states): Use Output_section_lookup_maps.
8875 (Output_section::restore_states): Same.
8876 * output.h (Merge_section_properties): Move class defintion out of
8877 Output_section.
8878 (Output_section_lookup_maps): New class.
8879 (Output_section::Input_section::is_merge_section): New method
8880 defintion.
8881 (Output_section::Input_section::relobj): Move defintion out of class
8882 defintion. Declare method only.
8883 (Output_section::Input_section::shndx): Ditto.
8884 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8885 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8886 (Output_section::Merge_section_by_properties_map,
8887 Output_section::Output_section_data_by_input_section_map,
8888 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8889 Remove types.
2e702c99 8890 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8891 KEEPS_INPUT_SECTIONS.
8892 (Output_section::build_lookup_maps): New method declaration.
8893 (Output_section::merge_section_map_,
8894 Output_section::merge_section_by_properties_map_,
8895 Output_section::relaxed_input_section_map_,
8896 Output_section::is_relaxed_input_section_map_valid_): Remove data
8897 members.
8898 (Output_section::lookup_maps_): New data member.
8899
76295588
L
89002010-05-21 Doug Kwan <dougkwan@google.com>
8901
8902 PR gold/11619
8903 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8904 avoid a compilation error.
8905
d103a984
RÁE
89062010-05-19 Rafael Espindola <espindola@google.com>
8907
8908 * script-sections.cc (Output_section_definition::allocate_to_segment):
8909 Update the phdrs_list even when the output section is NULL.
8910 * testsuite/Makefile.am: Add test.
8911 * testsuite/Makefile.in: Regenerate.
8912 * testsuite/script_test_9.cc: New.
8913 * testsuite/script_test_9.sh: New.
8914 * testsuite/script_test_9.t: New.
8915
6625d24e
DK
89162010-05-19 Doug Kwan <dougkwan@google.com>
8917
8918 * arm.cc (Arm_input_section::original_size): New method.
8919 (Arm_input_section::do_addralign): Add a cast.
8920 (Arm_input_section::do_output_offset): Remove static cast.
8921 (Arm_input_section::original_addralign,
8922 Arm_input_section::original_size_): Change type to uint32_t.
8923 (Arm_input_section::init): Add safe casts for section alignment
8924 and size.
8925 (Arm_input_section::set_final_data_size): Do not set address and
8926 offset of stub table.
8927 (Arm_output_section::fix_exidx_coverage): Change use of of
8928 Output_section::Simple_input_section to that of
8929 Output_section::Input_section.
8930 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8931 except for the first pass.
8932 * output.cc (Output_section::get_input_sections): Change type of
8933 input_sections to std::list<Input_section>.
8934 (Output_section::add_script_input_section): Rename from
8935 Output_section::add_simple_input_section. Change type of SIS
8936 parameter from Simple_input_section to Input_section.
8937 * output.h (Output_section::Simple_input_section): Remove class.
8938 (Output_section::Input_section): Change class visibility to public.
8939 (Output_section::Input_section::addralign): Use stored alignments
8940 for special input sections if set.
8941 (Output_section::Input_section::set_addralign): New method.
8942 (Output_section::get_input_sections): Change parameter type from
8943 list of Simple_input_section to list of Input_section.
8944 (Output_section::add_script_input_section): Rename from
8945 Output_section::add_simple_input_section. Change first parameter's
8946 type from Simple_input_section to Input_section and remove the
8947 second and third parameters.
8948 * script-sections.cc (Input_section::Input_section_list): Change
8949 type to list of Output_section::Input_section/
8950 (Input_section_info::Input_section_info): Change parameter type of
8951 INPUT_SECTION to Output_section::Input_section.
8952 (Input_section_info::input_section): Change return type.
8953 (Input_section_info::input_section_): Change type to
8954 Output_section::Input_section.
8955 (Output_section_element_input::set_section_addresses): Adjust code
8956 to use Output_section::Input_section instead of
8957 Output_section::Simple_input_section. Adjust code for renaming
8958 of Output_section::add_simple_input_section.
8959 (Orphan_output_section::set_section_addresses): Ditto.
8960
e1e82ea4
RW
89612010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8962
8963 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8964 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8965
91e75c8a
RÁE
89662010-05-18 Rafael Espindola <espindola@google.com>
8967
8968 * options.cc (General_options::finalize): Handle -nostdlib.
8969 * options.h (nostdlib): New option.
8970 * script.cc (script_add_search_dir): Handle -nostdlib.
8971
da59ad79
DK
89722010-05-12 Doug Kwan <dougkwan@google.com>
8973
8974 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8975 attributes section only if there no attributes section after merging.
8976 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8977 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8978 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8979 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8980 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8981 and arm_attr_merge_7.stdout.
8982 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8983 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8984 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8985 arm_attr_merge_7b.o): New rules.
8986 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8987 arm_attr_merge_7
8988 * testsuite/Makefile.in: Regenerate.
8989 * testsuite/arm_attr_merge.sh: New file.
8990 * testsuite/arm_attr_merge_[67][ab].s: Same.
8991
3e01a7fd
NC
89922010-05-05 Nick Clifton <nickc@redhat.com>
8993
8994 * po/es.po: Updated Spanish translation.
8995
7ad2014a
L
89962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8997
8998 * Makefile.am (install-exec-local): Properly install gold as
8999 default cross linker.
9000 * Makefile.in: Regenerated.
9001
4fda8867
NC
90022010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9003 Nick Clifton <nickc@redhat.com>
9004
9005 * configure.ac (install_as_default): Define and set to false
9006 unless --enable-gold or --enable-gold=both/gold has been
9007 specified.
9008 * configure: Regenerate.
9009
9010 * Makefile.am (install-exec-local): Install the executable as
9011 'ld.gold'. If install_as_default is true then also install it as
9012 'ld'.
9013 * Makefile.in: Regenerated.
9014
bd288ea2
ILT
90152010-04-24 Ian Lance Taylor <iant@google.com>
9016
9017 * layout.cc (Layout::layout_reloc): In relocatable link don't
9018 combine reloc sections for grouped sections.
9019
ef38fd8a
ST
90202010-04-23 Sriraman Tallam <tmsriram@google.com>
9021
9022 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9023 sections that are not ordinary to icf.
9024 * icf.cc (get_section_contents): Handle relocation pointing to section
9025 with no object or shndx information.
9026 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9027 * testsuite/Makefile.in: Regenerate.
9028 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9029 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9030
f6973bdc
ILT
90312010-04-22 Ian Lance Taylor <iant@google.com>
9032
9033 * expression.cc (Expression::Expression_eval_info): Add
9034 result_alignment_pointer field.
9035 (Expression::eval_with_dot): Add result_alignment_pointer
9036 parameter. Change all callers.
9037 (Expression::eval_maybe_dot): Likewise.
9038 (class Binary_expression): Add alignment_pointer parameter to
9039 left_value and right_value. Change all callers.
9040 (BINARY_EXPRESSION): Set result alignment.
9041 (class Trinary_expression): Add alignment_pointer parameter to
9042 arg2_value and arg3_value. Change all callers.
9043 (Trinary_cond::value): Set result alignment.
9044 (Max_expression::value, Min_expression::value): Likewise.
9045 (Align_expression::value): Likewise.
9046 * script-sections.cc (class Sections_element): Add dot_alignment
9047 parameter to set_section_addresses virtual function. Update
9048 instantiations.
9049 (class Output_section_element): Likewise.
9050 (Script_sections::create_segments): Add dot_alignment parameter.
9051 Change all callers.
9052 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9053 (Script_sections::set_phdrs_clause_addresses): Likewise.
9054 * script-sections.h: Update declarations.
9055 * script.h: Update declarations.
9056 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9057 min_p_align.
9058 * testsuite/script_test_3.t: Set large alignment.
9059 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9060 segment has expected alignment.
9061
9c9c98a5
NC
90622010-04-22 Nick Clifton <nickc@redhat.com>
9063
9064 * po/gold.pot: Updated by the Translation project.
9065 * po/vi.po: Updated Vietnamese translation.
9066
2253bfba
L
90672010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9068
9069 * testsuite/Makefile.am (check_PROGRAMS): Add
9070 icf_virtual_function_folding_test.
9071 * testsuite/Makefile.in: Regenerated.
9072
85fdf906
AH
90732010-04-15 Andrew Haley <aph@redhat.com>
9074
9075 * options.h (merge_exidx_entries): New option.
9076 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9077 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9078 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9079 (Target_arm::merge_exidx_entries): New function.
9080 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9081 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9082 to Arm_exidx_fixup constructor.
9083 Add new arg, merge_exidx_entries.
9084 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9085 Arm_output_section::fix_exidx_coverage.
9086
ce97fa81
ST
90872010-04-18 Sriraman Tallam <tmsriram@google.com>
9088
9089 * icf.cc (get_section_contents): Check for preemptible functions.
9090 Ignore addend when appropriate.
9091 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9092 section folded.
9093 (add_from_relobj): Check for section folded.
9094 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9095 * symtab.h (should_add_dynsym_entry): Add new parameter.
9096 * target-reloc.h (scan_relocs): Check for section folded.
9097 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9098 Check reloc types for function pointers in shared objects.
9099 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9100 case.
9101 (icf_preemptible_functions_test): New test case.
9102 (icf_string_merge_test): New test case.
9103 * testsuite.Makefile.in: Regenerate.
9104 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9105 bar_glob. Refactor code.
9106 * testsuite/icf_preemptible_functions_test.cc: New file.
9107 * testsuite/icf_preemptible_functions_test.sh: New file.
9108 * testsuite/icf_string_merge_test.cc: New file.
9109 * testsuite/icf_string_merge_test.sh: New file.
9110 * testsuite/icf_virtual_function_folding_test.cc: New file.
9111 * testsuite/icf_virtual_function_folding_test.sh: New file.
9112
04ceb17c
DK
91132010-04-14 Doug Kwan <dougkwan@google.com>
9114
9115 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
9116 for local symbol recounting if we remove a section due to ICF.
9117 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
9118 there are no regular objects in input.
9119
153e7da4
DK
91202010-04-13 Doug Kwan <dougkwan@google.com>
9121
9122 * arm.cc (Arm_input_section::set_final_data_size): Compute
9123 accurate final data size instead of using current data size.
9124
4dbd9faf
DK
91252010-04-09 Doug Kwan <dougkwan@google.com>
9126
9127 * layout.cc (Layout::choose_output_section): Handle script section
9128 types.
9129 (Layout::make_output_section_for_script): Add section type parameter.
9130 Handle script section types.
9131 * layout.h (Layout::make_output_section_for_script): Add section
9132 type parameter.
9133 * output.cc (Output_section::Output_section): Initialize data member
9134 is_noload_.
9135 (Output_section::do_reset_address_and_file_offset): Do not set address
9136 to 0 if section is a NOLOAD section.
9137 * output.h (Output_section::is_noload): New method.
9138 (Output_section::set_is_noload): Ditto.
9139 (Output_section::is_noload_): New data member.
9140 * script-c.h (Script_section_type): New enum type.
9141 (struct Parser_output_section_header): Add new file section_type.
9142 * script-sections.cc (Sections_element::output_section_name): Add
9143 parameter for returning script section type.
9144 (Output_section_definition::output_section_name): Ditto.
9145 (Output_section_definition::section_type)P; New method.
9146 (Output_section_definiton::script_section_type_name): Ditto.
9147 (Output_section_definition::script_section_type_): New data member.
9148 (Output_section_definition::Output_section_definition): Initialize
9149 data member Output_section_definition::script_section_type_.
9150 (Output_section_definition::create_sections): Pass script section type
9151 to Layout::make_output_section_for_script.
9152 (Output_section_definition::output_section_name): Return script
9153 section type to caller.
9154 (Output_section_definition::set_section_address): Do not advance
9155 dot value and load address if section type is NOLOAD. Set address
9156 of NOLOAD sections regardless of section flags.
9157 (Output_section_definition::print): Print section type if it is
9158 not SCRIPT_SECTION_TYPE_NONE.
9159 (Output_section_definition::section_type): New method.
9160 (Output_section_definition::script_section_type_name): Ditto.
9161 (Script_sections::output_section_name): Add new parameter
9162 PSECTION_TYPE for returning script section type. Pass it to
9163 section elements. Handle discard sections.
9164 (Sort_output_sections::operator()): Handle NOLOAD sections.
9165 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 9166 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
9167 returning script section type.
9168 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
9169 INFO and NOLOAD.
9170 * yyscript.y (union): Add new field SECTION_TYPE.
9171 (COPY, DSECT, INFO, NOLOAD): New tokens.
9172 (opt_address_and_section_type): Change type to output_section_header.
9173 (section_type): New non-terminal
9174 (section_header): Handle section type.
2253bfba 9175 (opt_address_and_section_type): Return section type value.
4dbd9faf 9176
721ea635
L
91772010-04-09 H.J. Lu <hongjiu.lu@intel.com>
9178
9179 * testsuite/plugin_common_test_1.c (foo): Add prototype.
9180 * testsuite/plugin_common_test_2.c (foo): Likewise.
9181
6bf924b0
DK
91822010-04-08 Doug Kwan <dougkwan@google.com>
9183
9184 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
9185 Output_merge_data.
9186 * output.cc (Output_section::add_merge_input_section): Simplify
9187 code and return status of Output_merge_base::add_input_section.
e1df38aa 9188 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
9189 returns true.
9190
24af6f92
DK
91912010-04-07 Doug Kwan <dougkwan@google.com>
9192
9193 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
9194 if section is marked as containing instructions but has no mapping
9195 symbols.
9196 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
9197 correct section index.
9198 (Arm_relobj::find_linked_text_section): Ditto.
9199
00698fc5
CC
92002010-04-07 Cary Coutant <ccoutant@google.com>
9201
9202 * archive.cc (include_member): Destroy Read_symbols_data object before
9203 releasing file.
9204 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
9205 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
9206 (Read_symbols_data::~Read_symbols_data) New destructor.
9207 (Section_relocs::Section_relocs) New constructor.
9208 (Section_relocs::~Section_relocs) New destructor.
9209 (Read_relocs_data::Read_relocs_data) New constructor.
9210 (Read_relocs_data::~Read_relocs_data) New destructor.
9211 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
9212 pointers to NULL after deleting.
9213
7296d933
DK
92142010-04-07 Doug Kwan <dougkwan@google.com>
9215
9216 * arm.cc: Replace "endianity" with "endianness" in comments.
9217 (Arm_exidx_cantunwind): Ditto.
9218 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
9219 (Arm_relobj::merge_flags_and_attributes): New method.
9220 (Arm_relobj::merge_flags_and_attributes_): New data member.
9221 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
9222 (Arm_relobj::scan_sections_for_stubs): Ditto.
9223 (Arm_relobj::do_read_symbols): Check to see if we really want to
9224 merge processor-specific flags and attributes. Exit early if
9225 an object is empty except for section names and the undefined symbol.
9226 (Target_arm::do_finalize_sections): Move check for ELF format to
9227 Arm_relobj::do_read_symbols. Merge processor specific flags and
9228 attributes from a regular object only when we have determined that
9229 it is aapropriate. Do not create an .ARM.attributes section in
9230 output if there is no regular input object.
9231 (Target_arm::merge_processor_specific_flags): Check
9232 --warn-mismatch before printing any error.
9233 (Target_arm::merge_object_attributes): Ditto.
9234 * gold.cc (queue_middle_tasks): Handle the case in which there is
9235 no regular object in input.
9236 * options.cc (General_options::parse_EB): New method.
9237 (General_options::parse_EL): Same.
9238 (General_options::General_options): Initialize endianness_.
9239 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
9240 New options.
9241 (General_options::Endianness): New enum.
9242 (General_options::endianness): New method.
9243 (General_options::endianness_): New data member.
9244 * parameters.cc (Parameters::set_options): Check target endianness.
9245 (Parameters::set_target_once): Ditto.
9246 (Parameters::check_target_endianness): New method.
9247 (parameters_force_valid_target): If either -EL or -EB is specified,
9248 use it to define endianness of default target.
9249 * parameters.h (Parameters::check_target_endianness): New method
9250 declaration.
9251 * target.h (class Target): Change "endianity" to "endianness"
9252 in comments.
9253
efc8d4f2
RW
92542010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9255
9256 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
9257 * configure: Regenerate.
9258 * Makefile.in: Regenerate.
9259 * testsuite/Makefile.in: Regenerate.
9260
be234d88
CC
92612010-04-06 Cary Coutant <ccoutant@google.com>
9262
9263 gcc PR lto/42757
9264 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
9265 prevailing definitions of common symbols.
9266 * testsuite/plugin_test_6.sh: New test case.
9267 * testsuite/plugin_common_test_1.c: New test case.
9268 * testsuite/plugin_common_test_2.c: New test case.
9269 * testsuite/Makefile.am (plugin_test_6): New test case.
9270 * testsuite/Makefile.in: Regenerate.
9271
bd32c6bd
NC
92722010-04-06 Nick Clifton <nickc@redhat.com>
9273
9274 * po/vi.po: New Vietnamese translation.
9275
323c532f
DK
92762010-03-30 Doug Kwan <dougkwan@google.com>
9277
9278 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
9279
4fcd97eb
DK
92802010-03-25 Doug Kwan <dougkwan@google.com>
9281
9282 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
9283 to avoid a conversion warning on a 32-bit host.
9284
4ebf39db
ILT
92852010-03-24 Ian Lance Taylor <iant@google.com>
9286
9287 * testsuite/script_test_3.t: Add a TLS segment.
9288 * testsuite/Makefile.am (check_PROGRAMS): Add
9289 tls_phdrs_script_test.
9290 (tls_phdrs_script_test_SOURCES): Define.
9291 (tls_phdrs_script_test_DEPENDENCIES): Define.
9292 (tls_phdrs_script_test_LDFLAGS): Define.
9293 (tls_phdrs_script_test_LDADD): Define.
9294 * testsuite/Makefile.in: Rebuild.
9295
4a599bdd
CC
92962010-03-23 Cary Coutant <ccoutant@google.com>
9297
9298 * fileread.cc (find_or_make_view): Fix comment.
9299
6c93b22c
ILT
93002010-03-23 Ian Lance Taylor <iant@google.com>
9301
9302 * script-sections.cc (class Orphan_section_placement): Define
9303 PLACE_TLS and PLACE_TLS_BSS.
9304 (Orphan_section_placement::Orphan_section_placement): Initialize
9305 new places.
9306 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
9307 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
9308 (tls_script_test_SOURCES): Define.
9309 (tls_script_test_DEPENDENCIES): Define.
9310 (tls_script_test_LDFLAGS): Define.
9311 (tls_script_test_LDADD): Define.
9312 * testsuite/Makefile.in: Rebuild.
9313
a2c7281b
DK
93142010-03-22 Doug Kwan <dougkwan@google.com>
9315
9316 * arm.cc (Arm_relocate_functions::abs8,
9317 Arm_relocate_functions::abs16): Use correct check for overflow
9318 specified in the ARM ELF specs.
9319 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
9320 target of a BLX instruction specially.
9321 (Reloc_stub::stub_type_for_reloc): Ditto.
9322 (Relocate::relocate): Use symbolic names instead of numeric relocation
9323 codes to report error.
9324 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
9325 workaround.
9326 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
9327 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
9328 thumb2_blx_out_of_range.stdout
9329 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
9330 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
9331 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
9332 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
9333 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
9334 thumb2_blx_in_range, thumb2_blx_in_range.o,
9335 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
9336 thumb2_blx_out_of_range.o): New rules.
2e702c99 9337 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
9338 thumb2_blx_in_range and thumb2_blx_out_of_range.
9339 * testsuite/Makefile.in: Regenerate.
9340 * arm_branch_in_range.sh: Add tests for THUMB BLX.
9341 * testsuite/thumb_blx_in_range.s: New file.
9342 * testsuite/thumb_blx_out_of_range.s: New file.
9343
b0193076
RÁE
93442010-03-22 Rafael Espindola <espindola@google.com>
9345
9346 * archive.cc (Should_include): Move to archive.h.
9347 (should_include_member): Make it a member of Archive.
9348 (Lib_group): New.
9349 (Add_lib_group_symbols): New.
9350 * archive.h: Include options.h.
9351 (Archive_member): Moved from Archive.
9352 (Should_include): Moved from archive.cc.
9353 (Lib_group): New.
9354 (Add_lib_group_symbols): New.
9355 * dynobj.cc (do_should_include_member): New.
9356 * dynobj.h (do_should_include_member): New.
9357 * gold.cc (queue_initial_tasks): Update call to queue.
9358 * main.cc (main): Print lib group stats.
9359 * object.cc (do_should_include_member): New.
9360 * object.h: Include archive.h.
9361 (Object::should_include_member): New.
9362 (Object::do_should_include_member): New.
9363 (Sized_relobj::do_should_include_member): New.
9364 * options.cc (General_options::parse_start_lib): New.
9365 (General_options::parse_end_lib): New.
9366 (Input_arguments::add_file): Handle lib groups.
9367 (Input_arguments::start_group): Check we are not in a lib.
9368 (Input_arguments::start_lib): New.
9369 (Input_arguments::end_lib): New.
9370 * options.h (General_options): Add start_lib and end_lib.
9371 (Input_argument::lib_): New.
9372 (Input_argument::lib): New.
9373 (Input_argument::is_lib): New.
9374 (Input_file_lib): New.
9375 (Input_arguments::in_lib_): New.
9376 (Input_arguments::in_lib): New.
9377 (Input_arguments::start_lib): New.
9378 (Input_arguments::end_lib_): New.
9379 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9380 in unused members as preempted.
9381 (Sized_pluginobj::do_should_include_member): New.
9382 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9383 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9384 return the blocker.
9385 (Read_symbols::do_whole_lib_group): New.
9386 (Read_symbols::do_lib_group): New.
9387 (Read_symbols::do_read_symbols): Handle lib groups.
9388 (Read_symbols::get_name): Handle lib groups.
9389 * readsyms.h (Read_symbols): Add an archive member pointer.
9390 (Read_symbols::do_whole_lib_group): New.
9391 (Read_symbols::do_lib_group): New.
9392 (Read_symbols::member_): New.
9393 * script.cc (read_input_script): Update call to queue_soon.
9394
d099120c
DK
93952010-03-19 Doug Kwan <dougkwan@google.com>
9396
9397 * arm.cc (Stub_table::Stub_table): Initialize new data members
9398 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9399 (Stub_table::add_reloc_stub): Assign stub offset and update
9400 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9401 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9402 New data members.
2e702c99 9403 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9404 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9405 instead of going over all reloc stubs.
2e702c99 9406 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9407 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9408 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9409 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9410 Stringpool_template::offset_.
9411 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9412 Stringpool_template::offset_ to zero.
9413
1aa37384
DK
94142010-03-15 Doug Kwan <dougkwan@google.com>
9415
9416 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9417 offset_.
9418 (Stringpool_template::new_key_offset): New method.
9419 (Stringpool_template::add_string): Assign offsets when adding new
9420 strings.
9421 (Stringpool_template::set_string_offsets): Do not set string offsets
9422 when not optimizing.
9423 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9424 member size_.
2e702c99
RM
9425 (Chunked_vector::clear): Clear size_.
9426 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9427 (Chunked_vector::size): Return size_.
9428 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9429 (Chunked_vector::size_): New data member.
1aa37384
DK
9430 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9431 (Stringpool_template::new_key_offset): New method declaration.
9432 (Stringpool_template::offset_): New data member.
9433
b672b057
RÁE
94342010-03-15 Rafael Espindola <espindola@google.com>
9435
9436 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9437 Add_symbols' constructor.
9438 * readsyms.h (Add_symbols): Remove the input_group member.
9439
b6848d3c
ILT
94402010-03-10 Ian Lance Taylor <iant@google.com>
9441
9442 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9443 target to ask whether a reference to a symbol requires a stack
9444 split.
9445 * target.h (Target::is_call_to_non_split): New function.
9446 (Target::do_is_call_to_non_split): Declare virtual function.
9447 * target.cc: Include "symtab.h".
9448 (Target::do_is_call_to_non_split): New function.
9449 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9450
a2a5469e
CC
94512010-03-10 Cary Coutant <ccoutant@google.com>
9452
9453 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9454 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9455 (File_read::open[2]): Add whole_file_view_ to list of views.
9456 (File_read::make_view): Remove test of whole_file_view_.
9457 (File_read::find_or_make_view): Create whole_file_view_ if
9458 necessary.
9459 (File_read::clear_views): Replace bool parameter with enum;
9460 adjust all callers. Don't delete views with permanent data;
9461 do delete cached views and views from archives if
9462 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9463 if clearing the corresponding view.
9464 * fileread.h (File_read::Clear_views_mode): New enum.
9465 (File_read::View::is_permanent_view): New method.
9466 (File_read::clear_views): Replace bool parameter
9467 with enum; adjust all callers.
9468 * options.h (General_options): Change keep_files_mapped option;
9469 add map_whole_files.
9470 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9471 releasing the file.
9472 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9473 the file.
9474
8861f32b
DM
94752010-03-10 David S. Miller <davem@davemloft.net>
9476
9477 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9478
d62d0f5f
ST
94792010-03-09 Sriraman Tallam <tmsriram@google.com>
9480
9481 * icf.cc (get_section_contents): Add '@' marker after processing the
9482 merge reloc.
9483
9177756d
DK
94842010-03-08 Doug Kwan <dougkwan@google.com>
9485
9486 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9487 due to a conversion warning.
9488 (Arm_relobj::update_output_local_symbol_count): Check for local
9489 symbol with unset output index.
9490
9e9e071b
ILT
94912010-03-05 Ian Lance Taylor <iant@google.com>
9492
9493 * options.h (class General_options): Add --spare-dynamic-tags.
9494 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9495 --spare-dynamic-tags.
9496
a81ee015
ILT
94972010-03-05 Ian Lance Taylor <iant@google.com>
9498
9499 * incremental.cc: Include "libiberty.h".
9500
44ec90b9
RO
95012010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9502
9503 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9504 function, is_info_ member.
9505 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9506 (Versions::Versions): Update caller.
9507 (Versions::define_base_version): Likewise.
9508 (Versions::add_def): Likewise.
9509
0897ed3b
ST
95102010-03-03 Sriraman Tallam <tmsriram@google.com>
9511
9512 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9513 (Scan::possible_function_pointer_reloc): New function.
9514 (Scan::local_reloc_may_be_function_pointer): Change to call
9515 possible_function_pointer_reloc.
9516 (Scan::global_reloc_may_be_function_pointer): Ditto.
9517 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9518 relocations in ".data.rel.ro._ZTV" section.
9519 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9520 * testsuite/icf_safe_so_test.cc: Ditto.
9521 * testsuite/icf_safe_test.cc: Ditto.
9522 * testsuite/icf_safe_test.sh: Ditto.
9523
d3bbad62
ILT
95242010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9525 Ian Lance Taylor <iant@google.com>
9526
9527 * target-reloc.h (relocate_section): Check the symbol table index
9528 for -1U before setting the local symbol index.
9529 (scan_relocatable_relocs): If copying the relocation, record that
9530 the local symbol is required.
9531 * object.h (Symbol_value::is_output_symtab_index_set): New
9532 function.
9533 (Symbol_value::may_be_discarded_from_output_symtab): New
9534 function.
9535 (Symbol_value::has_output_symtab_entry): New function.
9536 (Symbol_value::needs_output_symtab_entry): Remove.
9537 (Symbol_value::output_symtab_index): Make sure the symbol index is
9538 set.
9539 (Symbol_value::set_output_symtab_index): Make sure the symbol
9540 index is not set. Make sure the new index is valid.
9541 (Symbol_value::set_must_have_output_symtab_entry): New function.
9542 (Symbol_value::has_output_dynsym_entry): New function.
9543 (Symbol_value::set_output_dynsym_index): Make sure the new index
9544 is valid.
9545 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9546 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9547 local symbol if permitted.
9548 (Sized_relobj::do_finalize_local_symbols): Call
9549 is_output_symtab_index_set rather than needs_output_symtab_entry.
9550 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9551 rather than needs_output_symtab_entry. Call
9552 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9553 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9554 is_output_symtab_index_set rather than needs_output_symtab_entry.
9555 * testsuite/discard_locals_relocatable_test.c: New file.
9556 * testsuite/discard_locals_test.sh: Test -r.
9557 * testsuite/Makefile.am (check_DATA): Add
9558 discard_locals_relocatable_test1.syms,
9559 discard_local_relocatable_test2.syms.
9560 (MOSTLYCLEANFILES): Likewise. Also add
9561 discard_locals_relocatable_test1.lout and
9562 discard_locals_relocatable_test2.out.
9563 (discard_locals_relocatable_test1.syms): New target.
9564 (discard_locals_relocatable_test.o): New target.
9565 (discard_locals_relocatable_test1.out): New target.
9566 (discard_locals_relocatable_test2.syms): New target.
9567 (discard_locals_relocatable_test2.out): New target.
9568 (various): Add missing ../ld-new dependencies.
9569 * testsuite/Makefile.in: Rebuild.
9570
7e8ccf26
NC
95712010-03-03 Nick Clifton <nickc@redhat.com>
9572
9573 * po/fi.po: New Finnish translation.
9574
2a0ff005
DK
95752010-03-01 Doug Kwan <dougkwan@google.com>
9576
9577 * layout.cc (Layout::Layout): Force section types of .init_array*,
9578 .preinit_array* and .fini_array* sections.
9579 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9580 Fix check of return value of std::string::find.().
9581 (Output_section::Input_section_sort_compare::operator()): Remove
9582 comment about .init_array.
9583 (Output_section::Input_section_sort_init_fini_compare::operator()):
9584 New method.
9585 (Output_section::sort_attached_input_sections): Handle .init_array
9586 and .fini_array specially.
9587 * output.h (Output_section::Inut_section_sort_compare): Update
9588 comment.
9589 (Output_section::Input_section_sort_init_fini_compare): New struct.
9590
c3e4ae29
DK
95912010-02-26 Doug Kwan <dougkwan@google.com>
9592
9593 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9594 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9595 * testsuite/debug_msg.sh: Avoid matching source line number for
9596 use of global variable undef_int.
9597
2fd9ae7a
DK
95982010-02-26 Doug Kwan <dougkwan@google.com>
9599
9600 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9601 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9602 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9603 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9604 * options.cc (General_options::General_options): Initialize member
9605 fix_v4bx_.
9606 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9607 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9608 and rm_no_fix_v4bx.stdout
9609 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9610 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9611 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9612 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9613 and arm_no_fix_v4bx.
9614 * Makefile.in: Regenerate.
9615 * testsuite/arm_fix_v4bx.s: New file.
9616 * testsuite/arm_fix_v4bx.sh: Ditto.
9617
67ec7d0b
DK
96182010-02-24 Doug Kwan <dougkwan@google.com>
9619
9620 * arm.cc (Target_arm::got_section): Make the .got section the first
9621 non RELRO section in the data segment.
9622 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9623 suffixes of section names.
9624
10165461
DK
96252010-02-24 Doug Kwan <dougkwan@google.com>
9626
9627 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9628 flags and attributes merging if an input file is a binary file.
9629 * fileread.cc (Input_file::open): Record format of original file.
9630 * fileread.h (Input_file::Format): New enum type.
2e702c99 9631 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9632 (Input_file::format): New method definition.
9633 (Input_file::format_):: New data member.
9634
4a54abbb
DK
96352010-02-24 Doug Kwan <dougkwan@google.com>
9636
9637 * arm.cc (Arm_output_data_got): New class.
9638 (ARM_TCB_SIZE): New constant
9639 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9640 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9641 If user uses a script with a SECTIONS clause, issue only a warning
9642 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9643 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9644 garbage collection.
9645 (Target_arm::got_mode_index_entry): Handle static linking.
9646 (Target_arm::Scan::local): Ditto.
9647 (Target_arm::Scan::global): Ditto.
9648 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9649 all incorrectly implemented relocations.
e1df38aa 9650 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9651 Arm_output_section::fix_exidx_coverage.
9652 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9653 from ".ARM.exidx." and ".ARM.extab.".
9654
ca419a6f
ILT
96552010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9656
9657 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9658 section if it does not already exist.
9659 * attributes.cc (Attributes_section_data::Attributes_section_data):
9660 Don't crash if size is zero.
9661
135b9c78
ILT
96622010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9663 Ian Lance Taylor <iant@google.com>
9664
9665 * gold.cc (queue_middle_tasks): If no input files were opened,
9666 exit.
9667 * workqueue.h (Task_function::Task_function): Assert that there is
9668 a blocker.
9669
bb0bfe4f
DK
96702010-02-22 Doug Kwan <dougkwan@google.com>
9671
9672 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9673 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9674 types to avoid warnings due to different uint64_t implementations
9675 on different hosts.
9676
2a2b6d42
DK
96772010-02-21 Doug Kwan <dougkwan@google.com>
9678
9679 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9680 handling of the maximum backward branch offset.
2e702c99 9681 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9682 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9683 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9684 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9685 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9686 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9687 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9688 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9689 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9690 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9691 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9692 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9693 thumb2_bl_out_of_range.o): New rules.
9694 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9695 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9696 thumb2_bl_out_of_range
9697 * testsuite/Makefile.in: Regenerate.
9698 * testsuite/arm_bl_in_range.s: New file.
9699 * testsuite/arm_bl_out_of_range.s: Ditto.
9700 * testsuite/arm_branch_in_range.sh: Ditto.
9701 * testsuite/arm_branch_range.t: Ditto.
9702 * testsuite/thumb2_branch_range.t: Ditto.
9703 * testsuite/thumb_bl_in_range.s: Ditto.
9704 * testsuite/thumb_bl_out_of_range.s: Ditto.
9705 * testsuite/thumb_branch_range.t: Ditto.
9706
b487ad64
ST
97072010-02-20 Sriraman Tallam <tmsriram@google.com>
9708
9709 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9710 Add reloc offset information.
9711 * icf.cc (get_section_contents): Change iterators to point to the new
9712 vectors. Add reloc offset information to the contents.
9713 * icf.h (Icf::Sections_reachable_info): New typedef.
9714 (Icf::Sections_reachable_list): New typedef.
9715 (Icf::Offset_info): New typedef.
9716 (Icf::Reloc_info): New struct typedef.
9717 (Icf::Reloc_info_list): New typedef.
9718 (Icf::symbol_reloc_list): Delete method.
9719 (Icf::addend_reloc_list): Delete method.
9720 (Icf::section_reloc_list): Delete method.
9721 (Icf::reloc_info_list): New method.
9722 (Icf::reloc_info_list_): New member.
9723
f96accdf
DK
97242010-02-19 Doug Kwan <dougkwan@google.com>
9725
9726 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9727 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9728 * arm.cc (Arm_relocation_functions): New forward declaration.
9729 (Target_arm::Target_arm): Initialize new data members
9730 got_mod_index_offset_ and tls_base_symbol_defined_.
9731 (Target_arm::Relocate::relocate_tls): New method.
9732 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9733 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9734 New methods.
2e702c99 9735 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9736 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9737 (Target_arm::got_mod_index_offset_,
9738 Target_arm::tls_base_symbol_defined_): New data members.
9739 (Target_arm::Scan::local, Target::Scan::global,
9740 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9741 relocations.
9742
c8761b9a
DK
97432010-02-18 Doug Kwan <dougkwan@google.com>
9744
9745 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9746 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9747 text section as a parameter becuase some broken tools may not set
9748 the link in section header.
9749 (Target_arm::has_got_section): New method.
9750 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9751 without any mapping symbol as data only. Remove warning.
9752 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9753 link in its section header, try to discover the link by inspecting the
9754 REL31 relocation at the beginning of the section.
9755 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9756 in error message.
9757 (Target_arm::Scan::global): Treat any reference to the symbol
9758 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9759
21bb3914
ST
97602010-02-12 Sriraman Tallam <tmsriram@google.com>
9761
9762 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9763 (Scan::global_reloc_may_be_function_pointer): New function.
9764 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9765 (Scan::global_reloc_may_be_function_pointer): New function.
9766 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9767 (Scan::global_reloc_may_be_function_pointer): New function.
9768 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9769 (Scan::global_reloc_may_be_function_pointer): New function.
9770 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9771 (Scan::global_reloc_may_be_function_pointer): New function.
9772 (Scan::possible_function_pointer_reloc): New function.
9773 (Target_x86_64::can_check_for_function_pointers): New function.
9774 * gc.h (gc_process_relocs): Scan relocation types to determine if
9775 function pointers were taken for targets that support it.
9776 * icf.cc (Icf::find_identical_sections): Include functions for
9777 folding in safe ICF whose pointer is not taken.
9778 * icf.h (Secn_fptr_taken_set): New typedef.
9779 (fptr_section_id_): New member.
9780 (section_has_function_pointers): New function.
9781 (set_section_has_function_pointers): New function.
9782 (check_section_for_function_pointers): New function.
9783 * options.h: Fix comment for safe ICF option.
9784 * target.h (can_check_for_function_pointers): New function.
9785 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9786 Modify icf_safe_test for X86-64.
9787 * testsuite/Makefile.in: Regenerate.
9788 * testsuite/icf_safe_so_test.cc: New file.
9789 * testsuite/icf_safe_so_test.sh: New file.
9790 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9791 (main): Change to take pointer to function kept_func_3.
9792 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9793 folding is done correctly for X86-64.
9794
0da6fa6c
DM
97952010-02-12 David S. Miller <davem@davemloft.net>
9796
9797 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9798 is_symbolless parameter.
9799 (Output_reloc<SHT_REL>::is_symbolless): New.
9800 (Output_reloc<SHT_REL>::is_symbolless_): New.
9801 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9802 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9803 (Output_reloc<SHT_RELA>::is_symbolless): New.
9804 (Output_data_reloc::add_global): Handle is_symbolless.
9805 (Output_data_reloc::add_global_relative): Likewise.
9806 (Output_data_reloc::add_local): Likewise.
9807 (Output_data_reloc::add_local_relative): Likewise.
9808 (Output_data_reloc::add_symbolless_global_addend): New.
9809 (Output_data_reloc::add_symbolless_local_addend): New.
9810 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9811 is_symbolless.
9812 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9813 instead of ->is_relative_
9814 (Output_reloc::write): Likewise.
9815 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9816 (Output_reloc::write_rel): Simplify.
9817
9818 * sparc.cc (Target_sparc::Scan::local): Use
9819 ->add_symbolless_local_addend as needed.
9820 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9821 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9822 based upon relocation offset.
9823
e4782e83
DK
98242010-02-11 Doug Kwan <dougkwan@google.com>
9825
9826 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9827 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9828 beginning of function.
9829 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9830 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9831 parameter is_32bit in calls to should_apply_static_reloc.
9832 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9833 (check_DATA): Add arm_abs_global.stdout.
9834 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9835 arm_abs_global.stdout): New rules.
9836 (MOSTLLYCLEANFILES): Add arm_abs_global
9837 * Makefile.in: Regenerate.
9838 * testsuite/arm_abs_global.s: New file.
9839 * testsuite/arm_abs_global.sh: Ditto.
9840 * testsuite/arm_abs_lib.s: Ditto.
9841
93ceb764
ILT
98422010-02-11 Ian Lance Taylor <iant@google.com>
9843
9844 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9845 Read_relocs task.
9846 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9847 Allocate_commons_task first.
9848 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9849 task, rather than symtab_lock_.
9850 (Gc_process_relocs::~Gc_process_relocs): New function.
9851 (Gc_process_relocs::is_runnable): Check this_blocker_.
9852 (Gc_process_relocs::locks): Use next_blocker_ rather than
9853 blocker_.
9854 (Scan_relocs::~Scan_relocs): New function.
9855 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9856 symtab_lock_.
9857 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9858 next_blocker_.
9859 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9860 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9861 constructor accordingly.
9862 (class Gc_process_relocs): Likewise.
9863 (class Scan_relocs): Likewise.
9864 * common.h (class Allocate_commons_task): Remove symtab_lock_
9865 field, and corresponding constructor parameter.
9866 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9867 symtab_lock_.
9868 (Allocate_commons_task::locks): Likewise.
9869
114dfbe1
ILT
98702010-02-11 Ian Lance Taylor <iant@google.com>
9871
9872 * gold-threads.h (class Once): Define.
9873 (class Initialize_lock): Rewrite as child of Once.
9874 * gold-threads.cc (class Once_initialize): Define.
9875 (once_pointer_control): New static variable.
9876 (once_pointer, once_arg): New static variables.
9877 (c_run_once): New static function.
9878 (Once::Once, Once::run_once, Once::internal_run): New functions.
9879 (class Initialize_lock_once): Remove.
9880 (initialize_lock_control): Remove.
9881 (initialize_lock_pointer): Remove.
9882 (initialize_lock_once): Remove.
9883 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9884 (Initialize_lock::initialize): Rewrite.
9885 (Initialize_lock::do_run_once): New function.
9886 * archive.cc (Archive::interpret_header): Only clear name if it is
9887 not already empty.
9888 * fileread.cc: Include "gold-threads.h"
9889 (file_counts_lock): New static variable.
9890 (file_counts_initialize_lock): Likewise.
9891 (File_read::release): Only increment counts when using --stats.
9892 Use a lock around the increment.
9893 * parameters.cc (class Set_parameters_target_once): Define.
9894 (set_parameters_target_once): New static variable.
9895 (Parameters::Parameters): Move here from parameters.h.
9896 (Parameters::set_target): Rewrite.
9897 (Parameters::set_target_once): New function.
9898 (Parameters::clear_target): Move here and rewrite.
9899 * parameters.h (class Parameters): Update declarations. Add
9900 set_parameters_target_once_ field.
9901 (Parameters::Parameters): Move to parameters.cc.
9902 (Parameters::clear_target): Likewise.
9903 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9904 task.
9905 (Start_group::~Start_group): New function.
9906 (Start_group::is_runnable): New function.
9907 (Start_group::locks, Start_group::run): New functions.
9908 (Finish_group::run): Change saw_undefined to size_t.
9909 * readsyms.h (class Start_group): Define.
9910 (class Finish_group): Change saw_undefined_ field to size_t.
9911 (Finish_group::Finish_group): Remove saw_undefined and
9912 this_blocker parameters. Change all callers.
9913 (Finish_group::set_saw_undefined): New function.
9914 (Finish_group::set_blocker): New function.
9915 * symtab.h (class Symbol_table): Change saw_undefined to return
9916 size_t. Change saw_undefined_ field to size_t.
9917 * target-select.cc (Set_target_once::do_run_once): New function.
9918 (Target_selector::Target_selector): Initialize set_target_once_
9919 field. Don't initialize lock_ and initialize_lock_ fields.
9920 (Target_selector::instantiate_target): Rewrite.
9921 (Target_selector::set_target): New function.
9922 * target-select.h (class Set_target_once): Define.
9923 (class Target_selector): Update declarations. Make
9924 Set_target_once a friend. Remove lock_ and initialize_lock_
9925 fields. Add set_target_once_ field.
9926
fa17a3f4
ILT
99272010-02-10 Ian Lance Taylor <iant@google.com>
9928
9929 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9930 queueing any tasks.
9931 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9932 (queue_middle_tasks): Add all blockers before queueing any tasks.
9933 (queue_final_tasks): Likewise.
9934 * token.h (Task_token::add_blockers): New function.
9935 * object.h (Input_objects::number_of_relobjs): New function.
9936
c7177d31
ILT
99372010-02-10 Ian Lance Taylor <iant@google.com>
9938
5de0e392
ILT
9939 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9940 shared, not if not position independent.
9941 * x86_64.cc (Relocate::relocate_tls): Likewise.
9942 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9943 (tls_pie_pic_test): New target.
9944 * testsuite/Makefile.in: Rebuild.
9945
c7177d31
ILT
9946 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9947 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9948 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9949 * testsuite/Makefile.in: Rebuild.
9950
684b268a
DM
99512010-02-09 David S. Miller <davem@davemloft.net>
9952
9953 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9954 R_SPARC_RELATIVE using ->add_local_relative().
9955 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9956
612a8d3d
DM
9957 * output.h (Output_data_dynamic::add_section_size): New method
9958 that takes two Output_data objects.
9959 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9960 entry param. Handle it in initializers.
9961 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9962 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9963 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9964 arg.
9965 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9966 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9967 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9968 for dynrel_includes_plt.
9969 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9970 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9971 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9972 before .rela.plt
9973 (Target_sparc::do_finalize_sections): Update to pass true for
9974 dynrel_includes_plt.
9975 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9976 output before .rela.plt
9977 (Target_powerpc::do_finalize_sections): Update to pass true for
9978 dynrel_includes_plt when 32-bit.
9979
cb1be87e
DK
99802010-02-08 Doug Kwan <dougkwan@google.com>
9981
9982 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9983 method.
9984 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9985 Arm_relobj::scan_section_for_cortex_a8_stubs,
9986 Arm_relobj::do_relocation_section): Instead of calling
9987 Output_section::output_address, use faster
9988 Arm_relobj::simple_input_section_output_address.
9989
705b5121
DM
99902010-02-08 David S. Miller <davem@davemloft.net>
9991
9992 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9993 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9994 relocation helper function.
9995
024c4466
DM
9996 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9997 just like R_SPARC_GOT{10,13,22}.
9998 (Target_sparc::Scan::local): Likewise.
9999 (Target_sparc::Relocate:relocate): Likewise.
10000
9109c078
ILT
100012010-02-06 Ian Lance Taylor <iant@google.com>
10002
10003 * configure.ac: Rewrite targetobjs duplicate removal code to use
10004 only shell constructs.
10005 * configure: Rebuild.
10006
cf846138
DK
100072010-02-05 Doug Kwan <dougkwan@google.com>
10008
10009 PR 11247
10010 * arm.cc (Arm_relobj::section_is_scannable): New method.
10011 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10012 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10013
6cfaf60b
DK
100142010-02-04 Doug Kwan <dougkwan@google.com>
10015
10016 PR 11247
10017 * arm-reloc-property.cc (cstdio): Include.
10018 * configure.ac (targetobjs): Remove duplicates.
10019 * configure: Regenerate.
10020 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10021 big and little endian version for a given address size.
10022
5c57f1be
DK
100232010-02-03 Doug Kwan <dougkwan@google.com>
10024
10025 * arm-reloc-property.cc
10026 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10027 definition.
10028 * arm-reloc-property.h
10029 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10030 New method definition.
10031 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10032 declaration.
10033 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10034 overflow to N.
10035 (GOT_PREL): Change implemented to Y.
10036 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10037 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10038 (Arm_relocate_functions::movw_abs_nc): Remove method.
10039 (Arm_relocate_functions::movt_abs): Ditto.
10040 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10041 (Arm_relocate_functions::thm_movt_abs): Ditto.
10042 (Arm_relocate_functions::movw_rel_nc): Ditto.
10043 (Arm_relocate_functions::movw_rel): Ditto.
10044 (Arm_relocate_functions::movt_rel): Ditto.
10045 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10046 (Arm_relocate_functions:thm_movw_rel): Ditto.
10047 (Arm_relocate_functions:thm_movt_rel): Ditto.
10048 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10049 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10050 New method definitions.
10051 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10052 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10053 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10054 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10055 (Target_arm::Relocate::relocate): Check for non-static or
10056 unimplemented relocation code and exit early. Change calls to
10057 Target_arm::reloc_uses_thumb_bit and
10058 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10059 instead. Refactor code to handle similar relocations to increase
10060 code sharing. Remove check for unsupported relocation code in switch
10061 statement.
10062 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10063 relocation property table to find out size. Change error message to
10064 print out the name of a relocation code instead of the numeric value.
10065 (Target_arm::scan_reloc_for_stub): Use relocation property table
10066 instead of calling Target_arm::reloc_uses_thumb_bit().
10067
218c5831
DK
100682010-02-02 Doug Kwan <dougkwan@google.com>
10069
10070 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10071 types of relaxed input section.
10072
0d31c79d
DK
100732010-02-02 Doug Kwan <dougkwan@google.com>
10074
10075 * Makefile.am (HFILES): Add arm-reloc-property.h.
10076 (DEFFILES): New.
2e702c99
RM
10077 (TARGETSOURCES): Add arm-reloc-property.cc
10078 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10079 (libgold_a_SOURCES): $(DEFFILES)
10080 * Makefile.in: Regenerate.
10081 * arm-reloc-property.cc: New file.
10082 * arm-reloc-property.h: New file.
10083 * arm-reloc.def: New file.
10084 * arm.cc: Update comments.
10085 (arm-reloc-property.h): New included header.
10086 (arm_reloc_property_table): New global variable.
10087 (Target_arm::do_select_as_default_target): New method definition.
10088 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10089 arm-reloc-property to targ_extra_obj.
10090 * parameters.cc (set_parameters_target): Call
10091 Target::select_as_default_target().
10092 * target.h (Target::select_as_default_target): New method definition.
10093 (Target::do_select_as_default_target): Same.
10094
546c7457
DK
100952010-02-01 Doug Kwan <dougkwan@google.com>
10096
10097 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10098 first_output_text_section_.
10099 (Arm_exidx_fixup::first_output_text_section): New method definition.
10100 (Arm_exidx_fixup::first_output_text_section_): New data member.
10101 (Arm_exidx_fixup::process_exidx_section): Record the first text
10102 output section seen.
10103 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10104 and entsize in output section header.
10105
11b861d5
DK
101062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10107
10108 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10109 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10110 (Arm_relocate_functions::thm_alu11): New Method.
10111 (Arm_relocate_functions::thm_pc8): New Method.
10112 (Arm_relocate_functions::thm_pc12): New Method.
10113 (Target_arm::Scan::local): Handle the relocations.
10114 (Target_arm::Scan::global): Likewise.
10115 (Target_arm::Relocate::relocate): Likewise.
10116 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10117
c9a2c125
DK
101182010-01-29 Doug Kwan <dougkwan@google.com>
10119
10120 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
10121 of relocation types as ld.
10122
1521477a
DK
101232010-01-29 Doug Kwan <dougkwan@google.com>
10124
10125 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
10126 to public.
10127 (Arm_relocate_functions::thumb_branch_common): Ditto.
10128 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
10129 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
10130 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
10131 Arm_relocate_functions::jump24): Remove.
10132 (Target_arm::Relocate::relocate): Adjust code to call
10133 Arm_relocation_functions::arm_branch_common and
10134 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 10135 wrappers. Merge switch-cases together to reduce source code size.
1521477a 10136
e7eca48c
DK
101372010-01-29 Doug Kwan <dougkwan@google.com>
10138
10139 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
10140 output_local_symbol_count_needs_update_.
10141 (Arm_relobj::output_local_symbol_count_needs_update,
10142 Arm_relobj::set_output_local_symbol_count_needs_update,
10143 Arm_relobj::update_output_local_symbol_count): New methods.
10144 (Arm_relobj::output_local_symbol_count_needs_update_): New data
10145 member.
10146 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
10147 of pointed function as in a R_ARM_PREL31 relocation.
10148 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
10149 for output local symbol count updating.
10150 (Target_arm::do_relax): Update output local symbol counts in objects
10151 if necessary.
10152 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
10153
02961d7e
ILT
101542010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10155
10156 * arm.cc: Added support for the ARM relocations:
10157 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
10158 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
10159 (Arm_relocate_functions::movw_rel_nc): Renamed (was
10160 movw_prel_nc).
10161 (Arm_relocate_functions::movw_rel): New method.
10162 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
10163 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
10164 thm_movw_prel_nc).
10165 (Arm_relocate_functions::thm_movw_rel): New method.
10166 (Arm_relocate_functions::thm_movt_rel): Renamed (was
10167 thm_movt_prel).
10168 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
10169 relocations.
10170 (Target_arm::Scan::global): Likewise.
10171 (Target_arm::Relocate::relocate): Likewise.
10172 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10173 Likewise.
10174
b10d2873
ILT
101752010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10176
10177 * arm.cc: Added support for ARM group relocations.
10178 (Target_arm::reloc_needs_sym_origin): New method.
10179 (Arm_relocate_functions::calc_grp_kn): New method.
10180 (Arm_relocate_functions::calc_grp_residual): New method.
10181 (Arm_relocate_functions::calc_grp_gn): New method.
10182 (Arm_relocate_functions::arm_grp_alu): New Method.
10183 (Arm_relocate_functions::arm_grp_ldr): New Method.
10184 (Arm_relocate_functions::arm_grp_ldrs): New Method.
10185 (Arm_relocate_functions::arm_grp_ldc): New Method.
10186 (Target_arm::Scan::local): Handle the ARM group relocations.
10187 (Target_arm::Scan::global): Likewise.
10188 (Target_arm::Relocate::relocate): Likewise.
10189 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10190 Likewise.
10191
2b328d4e
DK
101922010-01-26 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (set): Include.
10195 (class Arm_exidx_fixup): Change type of last_input_section_ to const
10196 pointer type.
2e702c99 10197 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
10198 (Arm_output_section::append_text_sections_to_list): New method.
10199 (Arm_output_section::fix_exidx_coverage): Ditto.
10200 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 10201 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
10202 Relobj::set_section_offset() instead of
10203 Sized_relobj::invalidate_section_offset().
2e702c99 10204 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
10205 parameter for section headers. Ignore relocation sections for
10206 unallocated sections and EXIDX sections.
10207 (Target_arm::fix_exidx_coverage): New method.
10208 (Target_arm::output_section_address_less_than): New type.
10209 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
10210 linked text section instead of the EXIDX section.
10211 (Arm_output_section::create_stub_group): Add an assertion to check
10212 that this is not an EXIDX output section.
10213 (Arm_output_section::append_text_sections_to_list): New method.
10214 (Arm_output_section::fix_exidx_coverage): Ditto.
10215 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 10216 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
10217 (Target_arm::do_relax): Fix EXIDX output section coverage in the
10218 first pass.
10219 (Target_arm::fix_exidx_coverage): New method.
10220 * object.h (Relobj::set_output_section): New method.
10221 (Sized_relobj::invalidate_section_offset): Remove method.
10222 (Sized_relobj::do_invalidate_section_offset): Remove method.
10223 (Sized_relobj::do_set_section_offset): Handle offset value -1.
10224
c7f3c371
DK
102252010-01-25 Doug Kwan <dougkwan@google.com>
10226
10227 * arm.cc (Arm_exidx_merged_section::do_output_offset):
10228 Fix warning due to signed and unsigned comparison on a 32-bit host.
10229
8923b24c
DK
102302010-01-22 Doug Kwan <dougkwan@google.com>
10231
10232 * arm.cc (Target_arm::do_relax): Record an output section for section
10233 offset adjustment it contains any stub table that has changed.
10234 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
10235 offsets in an output section if necessary.
10236 * output.cc (Output_section::Output_section): Initialize
10237 section_offsets_need_adjustments_.
10238 (Output_section::add_input_section_for_script): Renamed to
10239 Output_section::add_simple_input_section.
10240 (Output_section::save_states): Add a comment.
10241 (Output_section::discard_states): New method defintion.
10242 (Output_section::adjust_section_offsets): Same.
10243 * output.h (Output_section::add_input_section_for_script): Renamed to
10244 Output_section::add_simple_input_section.
10245 (Output_section::discard_states): New method declaration.
10246 (Output_section::adjust_section_offsets): Same.
10247 (Output_section::section_offsets_need_adjustment,
10248 Output_section::set_section_offsets_need_adjustment): New method
10249 definitions.
10250 (Output_section::section_offsets_need_adjustment_): New data member.
10251 * script-sections.cc
10252 (Output_section_element_input::set_section_address): Adjust code for
10253 renaming of Output_section::add_input_section_for_script.
10254 (Orphan_output_section::set_section_address): Same.
10255
9b2fd367
DK
102562010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10257
10258 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
10259 Fix_v4bx enum values .
10260 * gold/options.h (General_options): New option definitions.
10261 (General_options::fix_v4bx): New method.
10262 (General_options::Fix_v4bx): New enum.
10263 * gold/options.cc (General_options::parse_fix_v4bx): New method.
10264 (General_options::parse_fix_v4bx_interworking): New method.
10265
80d0d023
DK
102662010-01-22 Doug Kwan <dougkwan@google.com>
10267
10268 * arm.cc (Arm_exidx_fixup): New class.
10269
af2cdeae
DK
102702010-01-21 Doug Kwan <dougkwan@google.com>
10271
10272 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
10273 classes.
10274 (Arm_exidx_section_offset_map): New type.
10275
993d07c1
DK
102762010-01-21 Doug Kwan <dougkwan@google.com>
10277
10278 * arm.cc (Arm_exidx_input_section): New class.
10279 (Arm_relobj::exidx_input_section_by_link,
10280 Arm_relobj::exidx_input_section_by_shndx,
10281 Arm_relobj::make_exidx_input_section): New methods.
10282 (read_arm_attributes_section): Remove.
10283 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
10284 information about them.
10285 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
10286 to here.
10287
5ac169d4
DK
102882010-01-20 Doug Kwan <dougkwan@google.com>
10289
10290 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
10291 Input_section_specifier to Section_id.
10292 (Target_arm::new_arm_input_section: Adjust code for change of key
10293 type.
10294 (Target_arm::find_arm_input_section): Ditto.
10295 * gc.h (object.h): Include for Section_id nand Section_id_hash.
10296 (Section_id): Remove.
10297 (Garbage_collection::Section_id_hash): Remove.
10298 * icf.h (object.h): Include for Section_id nand Section_id_hash.
10299 (Section_id): Remove.
10300 (Icf::Section_id_hash): Remove.
10301 * object.h (Section_id, Const_section_id, Section_id_hash,
10302 Const_section_id_hash): New type definitions.
10303 * output.cc (Output_section::add_relaxed_input_section): Change to
10304 use Const_section_id instead of Input_section_specifier as key type.
10305 (Output_section::add_merge_input_section): Ditto.
10306 (Output_section::build_relaxation_map): Change to use Section_id
10307 instead of Input_section_specifier as key type.
2e702c99 10308 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
10309 Ditto.
10310 (Output_section::convert_input_sections_to_relaxed_sections): Change
10311 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 10312 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
10313 (Output_section::find_relaxed_input_section): Ditto.
10314 * output.h (Input_section_specifier): Remove class.
10315 (Output_section::Output_section_data_by_input_section_map): Change
10316 key type to Const_section_id.
10317 (Output_section::Output_relaxed_input_section_by_input_section_map):
10318 Ditto.
10319 (Output_section::Relaxation_map): Change key type to Section_id.
10320
a2162063
ILT
103212010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10322
10323 * gold/arm.cc: Added support for R_ARM_V4BX relocation
10324 (class Arm_v4bx_stub): New class.
10325 (DEF_STUBS): Updated definition to support v4_veneer_bx.
10326 (Stub_factory::make_arm_v4bx_stub): New method.
10327 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
10328 (Stub_table::empty): Handle v4bx stubs.
10329 (Stub_table::add_arm_v4bx_stub): New method.
10330 (Stub_table::find_arm_v4bx_stub): New method.
10331 (Arm_relocate_functions::v4bx): New method.
10332 (Target_arm::fix_v4bx): New method.
10333 (Target_arm::Target_arm): Handle R_ARM_V4BX.
10334 (Stub_table::relocate_stubs): Likewise.
10335 (Stub_table::do_write): Likewise.
10336 (Stub_table::update_data_size_and_addralign): Likewise.
10337 (Stub_table::finalize_stubs): Likewise.
10338 (Target_arm::Scan::local): Likewise.
10339 (Target_arm::Scan::global): Likewise.
10340 (Target_arm::do_finalize_sections): Likewise.
10341 (Target_arm::Relocate::relocate): Likewise.
10342 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10343 Likewise.
10344 (Target_arm::scan_reloc_for_stub): Likewise.
10345 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10346
5696ab0b
ILT
103472010-01-19 Ian Lance Taylor <iant@google.com>
10348
10349 * output.cc (Output_section_headers::do_sized_write): Write large
10350 segment count to sh_info field.
10351 (Output_file_header::do_sized_write): For large segment count,
10352 write PN_XNUM to e_phnum field.
10353
800d0f56
ILT
103542010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10355
10356 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10357 (Arm_relocate_functions::thm_jump8): New function.
10358 (Arm_relocate_functions::thm_jump11): New function.
10359 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10360 R_ARM_THM_JUMP11.
10361 (Target_arm::Scan::global): Likewise.
10362 (Target_arm::Relocate::relocate): Likewise.
10363 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10364 Likewise.
10365
41263c05
DK
103662010-01-14 Doug Kwan <dougkwan@google.com>
10367
10368 * arm.cc (map, utility): Include headers.
10369 (Target_arm::apply_cortex_a8_workaround): New method.
10370 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10371 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10372 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10373 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10374 the --[no-]fix-cortex-a8 command line options.
10375 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10376 (Target_arm::relocate_stub): Use addend in instruction template.
10377 * options.h (DEFINE_bool): Set the user-set flag.
10378 (General_options): Add --[no-]-fix-cortex options.
10379 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10380 : Update fast look-up map after conversion.
41263c05 10381
459e9b03
ST
103822010-01-14 Sriraman Tallam <tmsriram@google.com>
10383
10384 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10385 in the first pass of do_layout.
10386
b521dfe4
DK
103872010-01-13 Doug Kwan <dougkwan@google.com>
10388
10389 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10390 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10391 apparent compiler problem of not folding static constant integral
10392 data members of elfcpp::Elf_sizes<32>.
10393
44272192
DK
103942010-01-13 Doug Kwan <dougkwan@google.com>
10395
10396 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10397 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10398 Arm_relobj::scan_section_for_cortex_a8_erratum,
10399 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10400 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10401 sections to scan for relocation stubs into a new method
10402 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10403 relocation and Cortex-A8 stub scanning.
10404 (Target_arm::do_relax): Force stubs to be after stubbed sections
10405 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10406 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10407 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10408
44b71ece
ILT
104092010-01-12 Ian Lance Taylor <iant@google.com>
10410
10411 * target-reloc.h (visibility_error): New inline function.
10412 (relocate_section): Call visibility_error.
10413 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10414 (MOSTLYCLEANFILES): Likewise.
10415 (protected_4_pic.o, protected_3.err): New targets.
10416 * testsuite/protected_4.cc: New file.
10417
a120bc7f
DK
104182010-01-12 Doug Kwan <dougkwan@google.com>
10419
10420 * arm.cc (Cortex_a8_reloc): New class.
10421 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10422 and cortex_a8_relocs_info_.
10423 (Target_arm::fix_cortex_a8): New method definition.
10424 (Target_arm::Cortex_a8_relocs_info): New type.
10425 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10426 New data member declarations.
10427 (Target_arm::scan_reloc_for_stub): Record information about
10428 relocations for THUMB branches that might be exempted from the
10429 Cortex-A8 workaround.
10430 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10431 at the beginning of a relaxation pass.
10432
20138696
DK
104332010-01-12 Doug Kwan <dougkwan@google.com>
10434
10435 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10436 (Arm_relobj::Mapping_symbol_position,
10437 Arm_reloj::Mapping_symbol_position_less,
10438 Arm_relobj::Mapping_symbols_info): New types.
10439 (Target_arm::is_mapping_symbol_name): New method definition.
10440 (Arm_relobj::do_count_local_symbols): Save information about mapping
10441 symbols.
10442
089d69dc
DK
104432010-01-11 Doug Kwan <dougkwan@google.com>
10444
10445 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10446 Arm_relocate_functions::thumb32_branch_upper,
10447 Arm_relocate_functions::thumb32_branch_lower,
10448 Arm_relocate_functions::thumb32_cond_branch_offset,
10449 Arm_relocate_functions::thumb32_cond_branch_upper,
10450 Arm_relocate_functions::thumb32_cond_branch_lower,
10451 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10452 branch offset encoding.
10453 (Arm_relocate_functions::thumb_branch_common): Use new branch
10454 offset encoding methods to avoid code duplication.
10455 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10456 (Stub_addend_reader::operator()): Use new branch encoding method
10457 to avoid code duplication.
10458
99e5bff2
DK
104592010-01-11 Doug Kwan <dougkwan@google.com>
10460
10461 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10462 (Target_arm::do_finalize_sections): Define special EXIDX section
10463 symbols only if referenced.
10464 * gc.h (Garbage_collection::add_reference): New method.
10465 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10466 code duplication.
10467
98e090bd
ILT
104682010-01-11 Ian Lance Taylor <iant@google.com>
10469
d0a91bd8
ILT
10470 * script.cc (Version_script_info::build_expression_list_lookup):
10471 Change complaing about duplicate wildcard match from error to
10472 warning.
10473
98e090bd
ILT
10474 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10475 of 2009-12-30.
10476 (Version_script_info::Version_script_info): Initialize globs_,
10477 default_version_, default_is_global_, and exact_. Don't
10478 initialize globals_ or locals_.
10479 (Version_script_info::build_lookup_tables): Build local symbols
10480 first.
10481 (Version_script_info::unquote): New function.
10482 (Version_script_info::add_exact_match): New function.
10483 (Version_script_info::build_expression_list_lookup): Remove lookup
10484 parameter. Add is_global parameter. Change all callers. Handle
10485 wildcard pattern specially. Unquote pattern. Call
10486 add_exact_match.
10487 (Version_script_info::get_name_to_match): New function.
10488 (Version_script_info::get_symbol_version): New function.
10489 (Version_script_info::get_symbol_version_helper): Remove.
10490 (Version_script_info::check_unmatched_names): Call unquote.
10491 * script.h (class Version_script_info): Change get_symbol_version
10492 to be non-inline and add is_global parameter; change all callers.
10493 Rewrite symbol_is_local. Update declarations. Define struct
10494 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10495 Remove globals_ and locals_ members. Add exact_, globs_,
10496 default_version_, is_global_.
10497 (Version_script_info::Glob): Remove pattern, add expression and
10498 is_global. Update constructor. Change all callers.
10499 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10500 default version.
10501 (Versions::symbol_section_contents): If a symbol is undefined, or
10502 defined in a dynamic object, set the version index to
10503 VER_NDX_LOCAL.
10504 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10505 symbol_is_local.
10506 (Symbol_table::add_from_pluginobj): Likewise.
10507 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10508
d56962d3
DK
105092010-01-11 Doug Kwan <dougkwan@google.com>
10510
10511 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10512 (incremental_dump_LDADD): Add linking option for libintl.
10513 * Makefile.in: Regenerate.
10514
94e6ee91
L
105152010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10516
10517 PR gold/11144
10518 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10519 instead of -Ds.
10520 * testsuite/Makefile.in: Regenerated.
10521
e96c574b
DK
105222010-01-10 Doug Kwan <dougkwan@google.com>
10523
10524 * options.h (DEFINE_var): Use parentheses around argument varname__
10525 in macro body to avoid any unintended subsequent substitutions.
10526
7198066b
ILT
105272010-01-10 Ian Lance Taylor <iant@google.com>
10528
ba4d53bf
ILT
10529 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10530 candidates before doing symbol resolution.
10531
7198066b
ILT
10532 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10533 ODR candidates if only one is weak.
10534
a2beed37
ILT
105352010-01-08 Ian Lance Taylor <iant@google.com>
10536
10537 * script.cc (Version_script_info::build_expression_list_lookup):
10538 Don't warn about ambiguous version, just record the ambiguity.
10539 (Version_script_info::get_symbol_version_helper): Give error if
10540 version is ambiguous.
10541
2fb7225c
DK
105422010-01-08 Doug Kwan <dougkwan@google.com>
10543
10544 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10545 prev_data_size_ and prev_addralign_. Remove initializer for
10546 deleted data member has_been_changed_.
10547 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10548 to determine if the table is empty.
10549 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10550 Remove.
10551 (Stub_table::add_reloc_stub): Define method in class definition
10552 instead of just declaring it there.
10553 (Stub_table::add_cortex_a8_stub): New method definition.
10554 (Stub_table::update_data_size_and_addralign): Ditto.
10555 (Stub_table::finalize_stubs): Ditto.
10556 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10557 (Stub_table::do_addralign_): Return address alignment in the
10558 (Stub_table::do_reset_address_and_file_offset): Define method in
10559 class definition instead of declaring it there. Set current data
10560 size to be the data size of the previous pass.
10561 (Stub_table::set_final_data_size): Use current data size as the
10562 final data size.
10563 (Stub_table::relocate_stub): Change parameter type of stub from
10564 Reloc_stub pointer to Stub pointer.
10565 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10566 (Stub_table::Cortex_a8_stub_list): New typedef.
10567 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10568 Stub_table::prev_addralign_): New data member.
10569 (Arm_relobj::Arm_relobj): Initialize data member
10570 section_has_cortex_a8_workaround_.
10571 (Arm_relobj::section_has_cortex_a8_workaround,
10572 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10573 definitions.
10574 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10575 declarations.
10576 (Target_arm::relocate_stub): Change parameter type of stub from
10577 Reloc_stub pointer to Stub pointer.
10578 (Insn_template::size, Insn_template::alignment): Handle
10579 THUMB16_SPECIAL_TYPE.
10580 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10581 Stub_table::update_data_size_and_addralign,
10582 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10583 definitions.
10584 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10585 (Stub_table::do_write): Ditto.
10586 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10587
880cd20d
ILT
105882010-01-08 Ian Lance Taylor <iant@google.com>
10589
10590 PR 11108
10591 * symtab.h (class Symbol): Remove fields is_target_special_ and
10592 has_plt_offset_. Add field is_defined_in_discarded_section_.
10593 (Symbol::is_defined_in_discarded_section): New function.
10594 (Symbol::set_is_defined_in_discarded_section): New function.
10595 (Symbol::has_plt_offset): Rewrite.
10596 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10597 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10598 Don't initialize is_target_special_ or has_plt_offset_.
10599 Initialize is_defined_in_discarded_section_.
10600 (Symbol_table::add_from_relobj): If appropriate, set
10601 is_defined_in_discarded_section.
10602 * resolve.cc (Symbol::override_base_with_special): Don't test
10603 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10604 * target-reloc.h (relocate_section): Do special handling for
10605 symbols defined in discarded sections for global symbols as well
10606 as local symbols.
10607
2703e3eb
ILT
106082010-01-08 Ian Lance Taylor <iant@google.com>
10609
10610 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10611 the SHT_SYMTAB case.
10612
339d40a3
ILT
106132010-01-08 Ian Lance Taylor <iant@google.com>
10614
10615 * object.cc (Sized_relobj::do_layout): Don't get confused if
10616 layout_eh_frame returns NULL.
10617
abecea76
ILT
106182010-01-08 Ian Lance Taylor <iant@google.com>
10619
10620 PR 11084
10621 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10622 dynamic symbol table, use the normal symbol table.
10623 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10624 symbol table.
10625
6b7dd3f3
ILT
106262010-01-08 Ian Lance Taylor <iant@google.com>
10627
10628 PR 11072
10629 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10630 sections.
10631
36c50e63
L
106322010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10633
10634 * version.cc (print_version): Change to "Copyright 2010".
10635
e291e7b9
ILT
106362010-01-08 Ian Lance Taylor <iant@google.com>
10637
10638 PR 10287
10639 PR 11063
10640 * i386.cc (class Target_i386): Change return type of plt_section
10641 to be non-const.
10642 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10643 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10644 tls_desc_rel_ field.
10645 (Output_data_plt_i386::rel_tls_desc): New function.
10646 (Target_i386::rel_tls_desc_section): New function.
10647 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10648 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10649 R_386_TLS_DESC reloc in rel_tls_desc_section.
10650 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10651 Define struct Tlsdesc_info.
10652 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10653 (Target_x86_64::do_reloc_symbol_index): New function.
10654 (Target_x86_64::add_tlsdesc_info): New function.
10655 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10656 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10657 tlsdesc_rel_ field.
10658 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10659 all callers.
10660 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10661 (Target_x86_64::rela_tlsdesc_section): New function.
10662 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10663 handling.
10664 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10665 (Target_x86_64::do_reloc_addend): New function.
10666 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10667 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10668 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10669 (Output_reloc::type): New function.
10670 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10671 (Output_reloc::is_target_specific): New function.
10672 (Output_reloc::target_arg): New function.
10673 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10674 absolute relocs and target specific relocs.
10675 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10676 add_target_specific.
10677 (class Output_data_reloc) [SHT_RELA]: Likewise.
10678 * output.cc (Output_reloc::Output_reloc): Add four new versions
10679 for absolute relocs and target specific relocs.
10680 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10681 (Output_reloc::get_symbol_index): Likewise.
10682 (Output_reloc::local_section_offset): Check that local_sym_index_
10683 is not TARGET_CODE or 0.
10684 (Output_reloc::symbol_value): Likewise.
10685 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10686 reloc.
10687 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10688 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10689 functions.
10690 * layout.cc (add_target_dynamic_tags): Use output section for
10691 DT_PLTRELSZ and DT_JMPREL.
10692
3a44184e
ILT
106932010-01-07 Ian Lance Taylor <iant@google.com>
10694
10695 PR 11061
10696 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10697 function.
10698 (class Output_data_reloc_generic): Define.
10699 (class Output_data_reloc_base): Change base class to
10700 Output_data_reloc_generic. Change add() method to call
10701 bump_relative_reloc_count for a relative reloc. Remove
10702 sort_relocs_ field.
10703 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10704 to sort_relocs().
10705 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10706 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10707 appropriate.
10708 * layout.h (class Layout): Update declaration.
10709
ea715a34
ILT
107102010-01-07 Ian Lance Taylor <iant@google.com>
10711
10712 * output.h (class Output_data): Add const version of
10713 output_section and do_output_section.
10714 (class Output_section_data): Add const version of
10715 do_output_section.
10716 (class Output_section): Likewise.
10717 * layout.cc (Layout::add_target_dynamic_tags): New function.
10718 * layout.h (class Layout): Update declarations.
10719 * arm.cc (Target_arm::do_finalize_sections): Use
10720 add_target_dynamic_tags.
10721 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10722 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10723 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10724 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10725
659948a4
ILT
107262010-01-07 Ian Lance Taylor <iant@google.com>
10727
10728 PR 11042
10729 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10730 object as needed.
10731
9d3b86f6
ILT
107322010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10733 Ian Lance Taylor <iant@google.com>
10734
10735 PR 11019
10736 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10737 Xindex::read_symtab_xindex.
10738
bb0d3eb0
DK
107392010-01-07 Doug Kwan <dougkwan@google.com>
10740
10741 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10742 (Insn_template::thumb16_bcond_insn): New method declaration.
10743 (Insn_template): Fix spelling.
10744 (Stub::thumb16_special): New method declaration.
10745 (Stub::do_write): Define virtual method which was previously pure
10746 virtual.
10747 (Stub::do_thumb16_special): New method declaration.
10748 (Stub::do_fixed_endian_write): New template member.
10749 (Reloc_stub::do_write): Remove.
10750 (Reloc_stub::do_fixed_endian_write): Remove.
10751 (Cortex_a8_stub): New class definition.
10752 (Stub_factory::make_cortex_a8_stub): New method definition.
10753 (Stub_factory::Stub_factory): Add missing static storage class
10754 qualifier for elf32_arm_stub_a8_veneer_blx.
10755
ffeef7df
ILT
107562010-01-07 Ian Lance Taylor <iant@google.com>
10757
dc3f80fe
ILT
10758 PR 10980
10759 * options.h (class General_options): Add --warn-unresolved-symbols
10760 and --error-unresolved-symbols.
10761 * errors.cc (Errors::undefined_symbol): Implement
10762 --warn-unresolved-symbols.
10763
ffeef7df
ILT
10764 * options.h (class General_options): Add -z text and -z textoff.
10765 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10766
f1ec9ded
ST
107672010-01-06 Sriraman Tallam <tmsriram@google.com>
10768
10769 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10770 (Garbage_collection::cident_sections): New function.
10771 (Garbage_collection::add_cident_section): New function.
10772 (Garbage_collection::cident_sections_): New member.
10773 (gc_process_relocs): Add references to sections whose names are C
10774 identifiers.
10775 * gold.h (cident_section_start_prefix): New constant.
10776 (cident_section_stop_prefix): New constant.
10777 (is_cident): New function.
10778 * layout.cc (Layout::define_section_symbols): Replace string constants
10779 with the newly defined constants.
10780 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10781 C identifiers.
10782 * testsuite/Makefile.am: Add gc_orphan_section_test.
10783 * testsuite/Makefile.in: Regenerate.
10784 * testsuite/gc_orphan_section_test.cc: New file.
10785 * testsuite/gc_orphan_section_test.sh: New file.
10786
6eda8c29
ILT
107872010-01-06 Ian Lance Taylor <iant@google.com>
10788
b9674e17
ILT
10789 PR 10980
10790 * options.h (class General_options): Add --warn-shared-textrel.
10791 * layout.cc (Layout::finish_dynamic_section): Implement
10792 --warn-shared-textrel.
10793
6eda8c29
ILT
10794 PR 10980
10795 * options.h (class General_options): Add --warn-multiple-gp.
10796
32dcd44e
ILT
107972010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10798
10799 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10800 $(THREADSLIB) and $(LIBDL).
10801 * Makefile.in: Rebuild.
10802
a192ba05
ILT
108032010-01-06 Ian Lance Taylor <iant@google.com>
10804
10805 PR 10980
10806 * options.cc (General_options::parse_section_start): New function.
10807 (General_options::section_start): New function.
10808 (General_options::General_options): Initialize all members.
10809 * options.h: Include <map>
10810 (class General_options): Add --section-start. Add section_starts_
10811 member.
10812 * layout.cc (Layout::attach_allocated_section_to_segment): If
10813 --section-start was used, set the address of the segment. Remove
10814 local sort_sections.
10815 (Layout::relaxation_loop_body): If the address of the load segment
10816 has been set by --section-start, don't use it.
10817 * output.h (Output_segment::update_flags_for_output_section): New
10818 function.
10819 * output.cc (Output_segment::add_output_section): Call
10820 update_flags_for_output_section.
10821
dde3f402
ILT
108222010-01-05 Ian Lance Taylor <iant@google.com>
10823
62dfdd4d
ILT
10824 PR 10980
10825 * options.h (class General_options): Add --undefined-version.
10826 * script.cc (struct Version_expression): Add was_matched_by_symbol
10827 field.
10828 (Version_script_info::matched_symbol): New function.
10829 (Version_script_info::get_symbol_version_helper): Call
10830 matched_symbol.
10831 (Version_script_info::check_unmatched_names): New function.
10832 * script.h (class Version_script_info): Update declarations.
10833 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10834
9c4ae156
ILT
10835 * options.h (class General_options): Use DEFINE_bool_alias for
10836 allow_multiple_definition.
10837 * resolve.cc (Symbol_table::should_override): Don't test
10838 allow_multiple_definition.
10839
dde3f402
ILT
10840 PR 10980
10841 * options.h (class General_options): Add --cref.
10842 * main.cc (main): Print cref table if --cref. Don't close mapfile
10843 until after printing cref table.
10844 * cref.cc: Include "symtab.h".
10845 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10846 (Cref_table_compare::operator()): New function.
10847 (Cref_inputs::gather_cref): New function.
10848 (filecol): New static const.
10849 (Cref_inputs::print_cref): New function.
10850 (Cref::print_cref): New function.
10851 * cref.h: Include <cstdio>.
10852 (class Cref): Update declarations.
10853 * mapfile.h (Mapfile::file): New function.
10854 * object.h (class Object): Define Symbols. Declare virtual
10855 do_get_global_symbols.
10856 (Object::get_global_symbols): New function.
10857 * object.cc (Input_objects::add_object): Pass object to cref_ if
10858 --cref.
10859 (Input_objects::archive_start): Likewise.
10860 (Input_objects::archive_stop): Likewise.
10861 (Input_objects::print_cref): New function.
10862 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10863 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10864 --cref.
10865 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10866 function.
10867 * plugin.h (class Sized_pluginobj): Update declarations.
10868
8781f709
ILT
108692010-01-05 Ian Lance Taylor <iant@google.com>
10870
10871 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10872 to is_default_version. Rename insdef to insdefault.
10873 (Symbol_table::add_from_relobj): Rename def to is_default_version
10874 and local to is_forced_local.
10875 (Symbol_table::add_from_pluginobj): Likewise.
10876 (Symbol_table::add_from_dynobj): Likewise.
10877 (Symbol_table::define_special_symbol): Rename insdef to
10878 insdefault.
10879
fe35d28d
ILT
108802010-01-04 Ian Lance Taylor <iant@google.com>
10881
30bc8c46
ILT
10882 PR 10980
10883 * options.h (class General_options): Add
10884 --allow-multiple-definition and -z muldefs.
10885 * resolve.cc (Symbol_table::should_override): Don't warn about a
10886 multiple symbol definition if --allow-multiple-definition or -z
10887 muldefs.
10888
7eaea549
ILT
10889 PR 10980
10890 * options.h (class General_options): Add --add-needed and
10891 --copy-dt-needed-entries. Tweak --as-needed help entry.
10892 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10893 error if --copy-dt-needed-entries aka --add-needed is used and
10894 would cause a change in behaviour.
10895
fe35d28d
ILT
10896 PR 10980
10897 * options.h (class General_options): Add -G as a short version of
10898 --shared. Add no-op options -assert, -g, and -i.
10899
55a2bb35
ST
109002010-01-04 Sriraman Tallam <tmsriram@google.com>
10901
10902 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10903 check for .text or .gnu.linkonce.t sections.
10904 * icf.cc (Icf::find_identical_sections): Ditto.
10905 Change the detection for mangled function name within the section
10906 name.
10907 * icf.h (is_section_foldable_candidate): New function.
10908
719328e1
ILT
109092009-12-30 Ian Lance Taylor <iant@google.com>
10910
10911 PR 10980
10912 * options.h (class General_options): Permit two dashes with
10913 --retain-symbols-file.
10914
d7bb5745
ILT
109152009-12-30 Ian Lance Taylor <iant@google.com>
10916
403a15dd
ILT
10917 PR 10979
10918 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10919 don't put the file header and segment headers in the text
10920 segment.
10921
eda294df
ILT
10922 PR 10979
10923 * common.cc (Sort_commons::operator()): Stabilize sort when both
10924 entries are NULL.
10925 (Symbol_table::do_allocate_commons_list): When allocating common
10926 symbols, skip a symbol which is no longer common.
10927 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10928 an object before checking its type.
10929 * testsuite/common_test_2.c: New file.
10930 * testsuite/common_test_3.c: New file.
10931 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10932 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10933 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10934 (common_test_2_pic.o, common_test_2.so): New targets.
10935 (common_test_3_pic.o, common_test_3.so): New targets.
10936 * testsuite/Makefile.in: Rebuild.
10937
d7bb5745
ILT
10938 PR 10979
10939 * script.cc (read_input_script): If we see a new SECTIONS clause,
10940 and we have added an input section, give an error.
10941 * layout.h (class Layout): Add have_added_input_section function.
10942 Add have_added_input_section_ field.
10943 * layout.cc (Layout::Layout): Initialize
10944 have_added_input_section_.
10945 (Layout::layout): Set have_added_input_section_.
10946 (Layout::layout_eh_frame): Likewise.
10947
fc59c572
ILT
109482009-12-30 Ian Lance Taylor <iant@google.com>
10949
10950 PR 10931
10951 * options.h (class General_options): Add --sort-common option.
10952 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10953 * common.cc (Sort_common): Add sort_order parameter to
10954 constructor. Add sort_order_ field.
10955 (Sort_commons::operator): Check sort_order_.
10956 (Symbol_table::allocate_commons): Determine the sort order.
10957 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10958 Change all callers.
10959 (Symbol_table::do_allocate_commons_list): Likewise.
10960
1c74fab0
ILT
109612009-12-30 Ian Lance Taylor <iant@google.com>
10962
10963 PR 10916
10964 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10965 symbols from this object, don't change the visibility of an
10966 undefined symbol.
10967 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10968
6affe781
ILT
109692009-12-30 Ian Lance Taylor <iant@google.com>
10970
10971 PR 10861
10972 * script.h (class Version_script_info): Define Language enum.
10973 Update declarations. Define Glob, Exact, and Lookup types. Add
10974 new fields globals_, locals_, and is_finalized_.
10975 * script.cc: Various formatting fixes.
10976 (class Parser_closure): Change language_stack_ from a vector of
10977 std::string to one of Version_script_info::Language. Adjust all
10978 uses accordingly.
10979 (class Lazy_demangler): Remove.
10980 (struct Version_expression): Change language from std::string to
10981 Version_script_info::Language.
10982 (Version_script_info::Version_script_info): New function.
10983 (Version_script_info::~Version_script_info): Don't call clear.
10984 (Version_script_info::finalize): New function.
10985 (Version_script_info::build_lookup_tables): New function.
10986 (Version_script_info::build_expression_list_lookup): New
10987 function.
10988 (Version_script_info::get_symbol_version_helper): Rewrite to use
10989 lookup tables.
10990 (Version_script_info::print_expression_list): Adjust to use
10991 Version_script_info::Language.
10992 (script_push_lex_into_version_mode): Check that the version script
10993 has not been finalized.
10994 (version_script_push_lang): Change language string to
10995 Version_script_info::Language.
10996 * options.cc (Command_line::version_script): New function.
10997 * options.h (class General_options): Add finalize_dynamic_list
10998 function. Change version_script from declaration to definition.
10999 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11000 * testsuite/version_script.map: Remove duplicate def of foo.
11001 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11002 version_script.map.
11003 * testsuite/Makefile.in: Rebuild.
11004
818bf354
ILT
110052009-12-30 Ian Lance Taylor <iant@google.com>
11006
11007 PR 10843
11008 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11009 if the input symbol index is 0, make the output symbol index 0.
11010
ebcc8304
ILT
110112009-12-30 Ian Lance Taylor <iant@google.com>
11012
11013 PR 10670
11014 * options.h (class General_options): Add -x/--discard-all.
11015 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11016 --discard-all. If the local symbol needs a dynamic entry, check
11017 that before handling --discard-locals.
11018
176fe33f
ILT
110192009-12-30 Ian Lance Taylor <iant@google.com>
11020
bb321bb1
ILT
11021 PR 10450
11022 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11023 flags to PF_R.
11024 (Output_segment::add_output_section): Don't change the flags if
11025 the type is PT_TLS.
11026
176fe33f
ILT
11027 PR 10450
11028 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11029 GNU hash table if they need a dynamic value. Otherwise, don't add
11030 them if they are defined in a dynamic object or are forced local.
11031
e8cd95c7
ILT
110322009-12-29 Ian Lance Taylor <iant@google.com>
11033
1b81fb71
ILT
11034 PR 10450
11035 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11036 .gnu.hash table for a 32-bit target.
11037
8d6d383d
ILT
11038 PR 10450
11039 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11040 regular and a dynamic object only needs a dynamic symbol table
11041 entry if it is externally visible.
11042
e785ec03
ILT
11043 PR 10450
11044 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11045 constructor. Add global_offset_table_ field.
11046 (Target_i386::got_section): Set global_offset_table_.
11047 (Target_i386::do_finalize_sections): Set global_offset_table_
11048 size.
11049 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11050 in constructor. Add global_offset_table_ field.
11051 (Target_x86_64::got_section): Set global_offset_table_.
11052 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11053 size.
11054
1a2dff53
ILT
11055 * layout.cc (Layout::Layout): Initialize increase_relro_.
11056 (Layout::get_output_section): Add is_relro, is_last_relro, and
11057 is_first_non_relro parameters. Change all callers.
11058 (Layout::choose_output_section): Likewise.
11059 (Layout::add_output_section_data): Likewise.
11060 (Layout::make_output_section): Likewise.
11061 (Layout::set_segment_offsets): Clear increase_relro when using a
11062 linker script.
11063 * layout.h (class Layout): Add increase_relro method. Add
11064 increase_relro_ field. Update declarations.
11065 * output.cc (Output_section::Output_section): Initialize
11066 is_last_relro_ and is_first_non_relro_.
11067 (Output_segment::add_output_section): Group relro sections is
11068 do_sort is true. Handle is_last_relro and is_first_non_relro.
11069 (Output_segment::maximum_alignment): Remove relro handling.
11070 (Output_segment::set_section_addresses): Add increase_relro
11071 parameter. Change all callers. Add initial alignment to align
11072 relro sections on separate page. Remove old relro handling.
11073 (Output_segment::set_section_list_addresses): Remove in_relro
11074 parameter. Change all callers.
11075 (Output_segment::set_offset): Add increase parameter. Change all
11076 callers. Remove old relro handling.
11077 * output.h (class Output_section): Add new methods: is_last_relro,
11078 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11079 Add is_last_relro_ and is_first_non_relro_ fields.
11080 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11081 Create separate .got.plt section. Call increase_relro.
11082 * x86_64.cc (Target_x86_64::got_section): Likewise.
11083 * testsuite/relro_script_test.t: Add .got.plt.
11084
f0ba79e2
ILT
11085 PR 10450
11086 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11087 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11088 (Layout::finalize): Call set_dynamic_symbol_size.
11089 (Layout::set_dynamic_symbol_size): New function.
11090 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11091 set_dynamic_symbol_size.
11092
e8cd95c7
ILT
11093 PR 10450
11094 * output.h (class Output_section): Add is_entsize_zero_ field.
11095 * output.cc (Output_section::Output_section): Initialize
11096 is_entsize_zero_.
11097 (Output_section::set_entsize): If two different entsizes are
11098 requested, force it to zero.
11099 (Output_section::add_input_section): Set flags for .debug_str
11100 before updating section flags. Set entsize.
11101 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11102 and SHF_STRING if all input sections have those flags.
11103
3e1b9a8a
RÁE
111042009-12-29 Rafael Espindola <espindola@google.com>
11105
11106 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11107 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11108 reporting.
3e1b9a8a 11109
3dcad376
ST
111102009-12-29 Sriraman Tallam <tmsriram@google.com>
11111
11112 * options.cc (General_options::parse_version): Allow -v to exit
11113 without an error if there is nothing to link.
11114
084e2665
ILT
111152009-12-29 Ian Lance Taylor <iant@google.com>
11116
11117 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
11118 using a version of gcc before 4.1.
11119 * configure: Rebuild.
11120
250acde3
CD
111212009-12-28 Chris Demetriou <cgd@google.com>
11122
11123 * attributes.cc (Output_attributes_section_data::do_write): Use
11124 std::vector::front rather than std::vector::data.
11125
99fff23b
ILT
111262009-12-28 Ian Lance Taylor <iant@google.com>
11127
11128 * symtab.h (class Symbol_table): Add enum Defined.
11129 * resolve.cc (Symbol_table::should_override): Add defined
11130 parameter. Change all callers. Test whether object is NULL
11131 before calling a method on it.
11132 (Symbol_table::report_resolve_problem): Add defined parameter.
11133 Change all callers.
11134 (Symbol_table::should_override_with_special): Likewise.
11135 * symtab.cc (Symbol_table::define_in_output_data): Add defined
11136 parameter. Change all callers.
11137 (Symbol_table::do_define_in_output_data): Likewise.
11138 (Symbol_table::define_in_output_segment): Likewise.
11139 (Symbol_table::do_define_in_output_segment): Likewise.
11140 (Symbol_table::define_as_constant): Likewise.
11141 (Symbol_table::do_define_as_constant): Likewise.
11142 * script.h (class Symbol_assignment): Add is_defsym parameter to
11143 constructor; change all callers.
11144 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
11145 parameter. Change all callers. Add is_defsym_ field.
11146 (class Parser_closure): Add parsing_defsym parameter to
11147 constructor; change all callers. Add parsing_defsym accessor
11148 function. Add parsing_defsym_ field.
11149
556bd683
ILT
111502009-12-28 Ian Lance Taylor <iant@google.com>
11151
11152 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 11153 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 11154
1782c879
ILT
111552009-12-23 Ian Lance Taylor <iant@google.com>
11156
11157 * i386.cc (Target_i386::do_calls_non_split): Recognize
11158 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
11159 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
11160 -fsplit-stack prologue when using %r11.
1782c879 11161
329ca2b1
ST
111622009-12-21 Sriraman Tallam <tmsriram@google.com>
11163
11164 * options.cc (General_options::parse_version): Make -v continue and do
11165 the link like GNU ld does.
11166
d675ff46
RÁE
111672009-12-17 Rafael Avila de Espindola <espindola@google.com>
11168
11169 * Makefile.am (CCFILES): Add timer.cc.
11170 (HFILES): Add timer.h.
11171 * configure.ac: Check for sysconf and times.
11172 * main.cc: include timer.h.
11173 (main): Use Timer instead of get_run_time.
11174 * timer.cc: New.
11175 * timer.h: New.
11176 * workqueue.cc: include timer.h.
11177 (Workqueue::find_and_run_task):
11178 Report user, sys and wall time.
11179 * Makefile.in: Regenerate.
11180 * config.in: Regenerate.
11181 * configure: Regenerate.
11182
d6344fb5
DK
111832009-12-16 Doug Kwan <dougkwan@google.com>
11184
11185 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
11186 sections.
11187 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
11188 relaxed input sections.
11189 * output.cc (Output_section::find_relaxed_input_section): Change
11190 return type to Output_relaxed_input_section pointer. Adjust code
11191 for new type of relaxed_input_section_map_.
11192 * output.h (Output_section::find_relaxed_input_section): Change
11193 return type to Output_relaxed_input_section pointer.
11194 (Output_section::Output_relaxed_input_section_by_input_section_map):
11195 New type.
11196 (Output_section::relaxed_input_section_map_): Change type to
11197 Output_section::Output_relaxed_input_section_by_input_section_map.
11198 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
11199 input section.
11200
0e0d5469
ILT
112012009-12-15 Ian Lance Taylor <iant@google.com>
11202
11203 * layout.cc (Layout::create_shstrtab): Only write out after input
11204 sections if we are compressing debug sections.
11205
0649a889
ILT
112062009-12-15 Ian Lance Taylor <iant@google.com>
11207
11208 * archive.cc (Archive::add_symbols): Only look up a symbol without
11209 a version if there is, in fact, a version.
11210
2ea97941
ILT
112112009-12-14 Ian Lance Taylor <iant@google.com>
11212
11213 Revert -Wshadow changes, all changes from:
11214 2009-12-11 Doug Kwan <dougkwan@google.com>
11215 2009-12-11 Nick Clifton <nickc@redhat.com>
11216 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
11217
b0eec2cc
DK
112182009-12-11 Doug Kwan <dougkwan@google.com>
11219
11220 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
11221 due to -Wshadow.
11222 * attributes.cc (Object_attribute::size): Ditto.
11223 (Attributes_section_data::size): Ditto.
11224 (Attributes_section_data::Attributes_section_data): Ditto.
11225 (Output_attributes_section_data::do_write): Ditto.
11226 * attributes.h (Object_attribute::set_type): Ditto.
11227 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
11228
91d6fa6a
NC
112292009-12-11 Nick Clifton <nickc@redhat.com>
11230
11231 * archive.cc: Fix shadowed variable warnings.
11232 * arm.cc: Likewise.
11233 * compressed_output.cc: Likewise.
11234 * compressed_output.h: Likewise.
11235 * configure: Likewise.
11236 * dwarf_reader.cc: Likewise.
11237 * dynobj.cc: Likewise.
11238 * dynobj.h: Likewise.
11239 * ehframe.cc: Likewise.
11240 * ehframe.h: Likewise.
11241 * errors.cc: Likewise.
11242 * expression.cc: Likewise.
11243 * fileread.cc: Likewise.
11244 * fileread.h: Likewise.
11245 * freebsd.h: Likewise.
11246 * i386.cc: Likewise.
11247 * icf.cc: Likewise.
11248 * incremental.h: Likewise.
11249 * layout.cc: Likewise.
11250 * layout.h: Likewise.
11251 * mapfile.cc: Likewise.
11252 * merge.cc: Likewise.
11253 * merge.h: Likewise.
11254 * object.cc: Likewise.
11255 * object.h: Likewise.
11256 * options.h: Likewise.
11257 * output.cc: Likewise.
11258 * output.h: Likewise.
11259 * parameters.cc: Likewise.
11260 * plugin.cc: Likewise.
11261 * powerpc.cc: Likewise.
11262 * reduced_debug_output.cc: Likewise.
11263 * reduced_debug_output.h: Likewise.
11264 * reloc.cc: Likewise.
11265 * reloc.h: Likewise.
11266 * resolve.cc: Likewise.
11267 * script-sections.cc: Likewise.
11268 * script.cc: Likewise.
11269 * script.h: Likewise.
11270 * sparc.cc: Likewise.
11271 * symtab.cc: Likewise.
11272 * symtab.h: Likewise.
11273 * target-select.cc: Likewise.
11274 * target-select.h: Likewise.
11275 * token.h: Likewise.
11276 * workqueue.cc: Likewise.
11277 * workqueue.h: Likewise.
11278 * x86_64.cc: Likewise.
11279
a0351a69
DK
112802009-12-10 Doug Kwan <dougkwan@google.com>
11281
11282 * arm.cc (attributes.h): New include.
11283 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
11284 (Arm_relobj::~Arm_relobj): Delete object pointed by
11285 attributes_section_data_.
11286 (Arm_relobj::attributes_section_data): New method definition.
11287 (Arm_relobj::attributes_section_data_): New data member declaration.
11288 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
11289 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
11290 attributes_section_data_.
11291 (Arm_dynobj::attributes_section_data): New method definition.
11292 (Arm_dynobj::attributes_section_data_): New data member declaration.
11293 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
11294 initialization value of may_use_blx_ to false.
2e702c99 11295 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
11296 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
11297 object attributes to compute results instead of hard-coding.
11298 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
11299 Target_arm::get_secondary_compatible_arch,
11300 Target_arm::set_secondary_compatible_arch
11301 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11302 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
11303 New method declarations.
11304 (Target_arm::get_aeabi_object_attribute): New method definition.
11305 (Target_arm::attributes_section_data_): New data member declaration.
11306 (read_arm_attributes_section): New template definition.
11307 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
11308 (Arm_dynobj::do_read_symbols): Ditto.
11309 (Target_arm::do_finalize_sections): Merge attributes sections from
11310 input. Check for BLX use after attributes section merging.
11311 Fix __exidx_start and __exidx_end visibility. Create an
11312 .ARM.attributes section if necessary.
11313 (Target_arm::get_secondary_compatible_arch,
11314 Target_arm::set_secondary_compatible_arch,
11315 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
11316 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 11317 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
11318 New method definitions.
11319
b59befec
ILT
113202009-12-09 Ian Lance Taylor <iant@google.com>
11321
11322 * plugin.cc (Plugin::load): Don't cast from void* to a function
11323 pointer.
11324
1276bc89
ILT
113252009-12-09 Ian Lance Taylor <iant@google.com>
11326
11327 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
11328 information fields.
11329
2f2de248
L
113302009-12-09 H.J. Lu <hongjiu.lu@intel.com>
11331
11332 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
11333 Replace two_file_shared_1.so with two_file_shared_2.so.
11334 * testsuite/Makefile.in: Regenerated.
11335
4f787271
DK
113362009-12-08 Doug Kwan <dougkwan@google.com>
11337
11338 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
11339 (HFILES): Add attributes.h and int_encoding.h.
11340 * Makefile.in: Regenerate.
11341 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
11342 function definitions to int_encoding.cc
11343 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11344 prototypes to int_encoding.h
11345 * reduced_debug_output.cc (int_encoding.h): New include.
11346 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11347 function definitions to int_encoding.cc
11348 (insert_into_vector, read_from_pointer): Move template definitions to
11349 int_encoding.h
11350 * attributes.cc: New file.
11351 * attributes.h: New file.
11352 * int_encoding.cc: New file.
11353 * int_encoding.h: New file.
11354
20b52f1a
RÁE
113552009-12-07 Rafael Avila de Espindola <espindola@google.com>
11356
11357 PR gold/11055
11358 * incremental-dump.cc (dump_incremental_inputs): New.
11359 (main): Use dump_incremental_inputs.
11360
53d7974c
L
113612009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11362
11363 PR gold/10893
11364 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11365 checking elfcpp::STT_FUNC.
11366 (Target_i386::Relocate::relocate): Likewise.
11367 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11368
11369 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11370 symbols from shared libraries into normal FUNC symbols.
11371
11372 * symtab.h (Symbol): Add is_func and use it.
11373
05a352e6
DK
113742009-12-05 Doug Kwan <dougkwan@google.com>
11375
11376 * arm.cc (Target_arm::arm_info): Initialize new fields
11377 attributes_section and attributes_vendor.
11378 * i386.cc (Target_i386::i386_info): Same.
11379 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11380 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11381 fields attributes_section and attributes_vendor.
53d7974c 11382 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11383 * target.h (Target::attributes_section, Target::attributes_vendor,
11384 Target::is_attributes_section, Target::attribute_arg_type,
11385 Target::attributes_order): New method definitions.
11386 (Target::Target_info::attributes_section,
11387 Target::Target_info::attributes_vendor): New fields.
11388 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11389 virtual method definitions.
11390 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11391 attributes_section and attributes_vendor.
11392 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11393
f4e5969c
DK
113942009-12-05 Doug Kwan <dougkwan@google.com>
11395
11396 * arm.cc: Update comments about interworking and stub generation.
11397 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11398 considered as non-PIC.
11399 (Arm_relocate_functions::base_abs): Fix formatting.
11400 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11401 of function to use GOT entry address instead of offset.
11402 (Target_arm::Scan::global): Issue an error if a symbol would need a
11403 PLT does not get one because it is untyped. Remove code to create
11404 dynamic symbols for relative branches.
11405 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11406 takes unsigned integer instead of boolean.
11407
1abce4a6
L
114082009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11409
11410 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11411 (two_file_test_LDADD): Likewise.
11412 (common_test_1_LDADD): Likewise.
11413 (exception_test_LDADD) Likewise.
11414 (weak_test_LDADD): Likewise.
11415 (many_sections_test_LDADD): Likewise.
11416 (initpri1_LDADD): Likewise.
11417 (script_test_1_LDADD): Likewise.
11418 (script_test_2_LDADD): Likewise.
11419 (justsyms_LDADD): Likewise.
11420 (binary_test_LDADD): Likewise.
11421 (large_LDADD): Likewise.
11422 * testsuite/Makefile.in: Regenerated.
11423
adcf2816 114242009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11425
adcf2816
L
11426 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11427 (Symbol_table::override_with_special): Likewise.
11428 (Symbol_table::add_from_object): Likewise.
11429
28e67f5d
RÁE
114302009-12-04 Rafael Avila de Espindola <espindola@google.com>
11431
11432 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11433 Don't set the data_offset twice.
11434
ae10a101
RÁE
114352009-12-04 Rafael Avila de Espindola <espindola@google.com>
11436
11437 * testsuite/Makefile.in: Regenerate.
11438
f59f41f3
DK
114392009-12-03 Doug Kwan <dougkwan@google.com>
11440
11441 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11442 (Target_arm::do_finalize_sections): Add parameter for symbol table
11443 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11444 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11445 parameter for symbol table pointer.
11446 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11447 an additional parameter for a pointer to symbol table.
11448 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11449 parameter for a symbol table pointer.
11450 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11451 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11452 Ditto.
11453 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11454 parameter for a symbol table pointer.
11455
ca55d848
RÁE
114562009-12-03 Rafael Avila de Espindola <espindola@google.com>
11457
11458 * incremental.cc (Incremental_inputs_header)
11459 (Incremental_inputs_header_write, Incremental_inputs_entry)
11460 (Incremental_inputs_entry_write): Move ...
11461 * incremental.h (Incremental_inputs_header)
11462 (Incremental_inputs_header_write, Incremental_inputs_entry)
11463 (Incremental_inputs_entry_write): here.
11464
3aec4f9c
RÁE
114652009-12-02 Rafael Avila de Espindola <espindola@google.com>
11466
11467 * incremental.cc (make_sized_incremental_binary): Set the target.
11468 Error if it is incompatible.
11469 * output.h (Output_file): Add filename method.
11470
9c0ae74d
RÁE
114712009-12-02 Rafael Avila de Espindola <espindola@google.com>
11472
11473 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11474 from the get_* methods.
11475
a45500ae
RÁE
114762009-12-02 Rafael Avila de Espindola <espindola@google.com>
11477
11478 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11479 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11480 Write 0 for the data_offset of scripts.
11481
325e6408
RÁE
114822009-12-02 Rafael Avila de Espindola <espindola@google.com>
11483
11484 * testsuite/Makefile.am: Add the incremental_test.sh test.
11485 * testsuite/incremental_test.sh: New.
11486 * testsuite/incremental_test_1.c: New.
11487 * testsuite/incremental_test_2.c: New.
11488
954c3e2e
RÁE
114892009-12-01 Rafael Avila de Espindola <espindola@google.com>
11490
703d02da 11491 * incremental-dump.cc (main): Fix typos.
954c3e2e 11492
f8086623
RÁE
114932009-11-27 Rafael Avila de Espindola <espindola@google.com>
11494
11495 PR gold/11025
11496 * incremental-dump.cc (main): Use llu to print 64 bit values.
11497
3b0dd6ac
L
114982009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11499 H.J. Lu <hongjiu.lu@intel.com>
11500
11501 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11502 $(LIBDL).
11503 (incremental_dump_LDADD): Likewise.
11504 * Makefile.in: Regenerated.
11505
a6d1ef57 115062009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11507
a6d1ef57
DK
11508 Revert:
11509
11510 2009-11-25 Doug Kwan <dougkwan@google.com>
11511
11512 * arm.cc (Target_arm::Target_arm): Move method definition
11513 outside of class definition. Add code to handle
11514 --target1-rel, --target1-abs and --target2= options.
11515 (Target_arm::get_reloc_reloc_type): Change method to be
11516 non-static and const.
11517 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11518 New data member declaration.
11519 (Target_arm::Scan::local, Target_arm::Scan::global,
11520 Target_arm::Relocate::relocate,
11521 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11522 Adjust call to Target_arm::get_real_reloc_type.
11523 (Target_arm::get_real_reloc_type): Use command line options
11524 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11525 * options.h (--target1-rel, --target1-abs, --target2): New
11526 ARM-only options.
11527
50aeb7d4
DK
115282009-11-25 Doug Kwan <dougkwan@google.com>
11529
11530 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11531 class definition. Add code to handle --target1-rel, --target1-abs
11532 and --target2= options.
11533 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11534 and const.
11535 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11536 member declaration.
11537 (Target_arm::Scan::local, Target_arm::Scan::global,
11538 Target_arm::Relocate::relocate,
11539 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11540 call to Target_arm::get_real_reloc_type.
11541 (Target_arm::get_real_reloc_type): Use command line options to
11542 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11543 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11544 options.
11545
51938283
DK
115462009-11-25 Doug Kwan <dougkwan@google.com>
11547
11548 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11549 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11550 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11551 formatting.
11552 (Arm_relocate_functions::thm_call): Replace body with a call to
11553 Arm_relocate_functions::thumb_branch_common.
11554 (Arm_relocate_functions::thm_jump24,
11555 Arm_relocate_functions::thm_xpc22): New method definitions.
11556 (Arm_relocate_functions::thumb_branch_common): New method definition.
11557 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11558 operator.
11559 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11560 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11561
e2b8f3c4
RÁE
115622009-11-24 Rafael Avila de Espindola <espindola@google.com>
11563
11564 * Makefile.am: Build incremental-dump
11565 * Makefile.in: Regenerate.
11566 * incremental-dump.cc: New.
11567 * incremental.cc (Incremental_inputs_header_data,
11568 Incremental_inputs_entry_data): Move to incremental.h
11569 * incremental.h: (Incremental_inputs_header_data,
11570 Incremental_inputs_entry_data): Move from incremental.cc
11571
bcba9aec
RÁE
115722009-11-24 Rafael Avila de Espindola <espindola@google.com>
11573
11574 * incremental.cc (Incremental_inputs_header,
11575 Incremental_inputs_header_write, Incremental_inputs_entry,
11576 Incremental_inputs_entry_write): Add a typedef with the data type.
11577
7c3afe08
RÁE
115782009-11-24 Rafael Avila de Espindola <espindola@google.com>
11579
11580 * incremental.cc (Incremental_inputs_header,
11581 Incremental_inputs_header_write, Incremental_inputs_entry,
11582 Incremental_inputs_entry_write): Update comment about which
11583 type has the filed descriptions.
11584
d204b6e9
DK
115852009-11-15 Doug Kwan <dougkwan@google.com>
11586
11587 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11588 (Arm_relocate_functions::arm_branch_common): Change method defintion
11589 in class definition to a method declaration and update list of formal
11590 parameters.
11591 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11592 Arm_relocation_functions::jump24): Adjust call to
11593 Arm_relocate_functions::arm_branch_common. Update list of formal
11594 parameters.
11595 (Arm_relocate_functions::xpc25): New method definition.
11596 (Arm_relocate_functions::arm_branch_common): Move method defintion
11597 out from class definition. Use stubs for mode-switching and extending
11598 branch ranges.
11599 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11600 specially. Change code to enable use of stubs in ARM branches.
11601
43d12afe
DK
116022009-11-10 Doug Kwan <dougkwan@google.com>
11603
11604 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11605 in method declaration.
11606 (Target_arm::relocate_stub): New method declaration.
11607 (Target_arm::default_target): Change to return a pointer instead of
11608 a const reference.
11609 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11610 Target_arm::default_target.
11611 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11612 method definition.
11613 (Target_arm::relocate_section): Adjust view.
11614 (Target_arm::relocate_stub): New method definition.
11615
ac33a407
DK
116162009-11-10 Doug Kwan <dougkwan@google.com>
11617
11618 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11619 a format warning.
11620 * incremental.cc (open_incremental_binary): Initialized local
11621 variables to avoid warnings.
11622 * object.cc (make_elf_object): Ditto.
11623 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11624 a format warning.
e1df38aa 11625
88ee28e9
L
11626009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11627
11628 PR gold/10930
11629 * testsuite/plugin_test.c: Include "config.h".
11630
2daedcd6
DK
116312009-11-09 Doug Kwan <dougkwan@google.com>
11632
11633 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11634 (arm_symbol_value): Remove.
11635 (Arm_relocate_functions::arm_branch_common,
11636 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11637 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11638 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11639 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11640 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11641 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11642 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11643 Arm_relocate_functions::thm_mobw_abs_nc,
11644 Arm_relocate_functions::thm_mov_abs,
11645 Arm_relocate_functions::movw_prel_nc,
11646 Arm_relocate_functions::thm_movt_abs,
11647 Arm_relocate_functions::movt_prel,
11648 Arm_relocate_functions::thm_movw_prel_nc,
11649 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11650 (Target_arm::Relocate::relocate): Only decompose address into two
11651 parts if relocation type uses the thumb-bit and pass the actual
11652 bit instead of a flag indicating that the thumb-bit is used. Adjust
11653 calls to methods in Arm_relocate_functions for this change.
11654
1276bc89 116552009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11656
11657 PR 10925
11658 * reloc.cc: Instantiate
11659 Sized_relobj::initialize_input_to_output_maps and
11660 Sized_relobj:free_input_to_output_maps.
11661
e53ad1b5
ILT
116622009-11-06 Ian Lance Taylor <iant@google.com>
11663
11664 PR 10876
11665 * defstd.cc (in_segment): Set only_if_ref true for "end".
11666
eb44217c
DK
116672009-11-06 Doug Kwan <dougkwan@google.com>
11668
11669 * arm.cc (class Reloc_stub): Correct a comment.
11670 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11671 (Target_arm::scan_section_for_stubs): New method declaration.
11672 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11673 Change methods from private to protected.
11674 (Target_arm::do_may_relax): New method definition.
11675 (Target_arm::do_relax, Target_arm::group_sections,
11676 Target_arm::scan_reloc_for_stub,
11677 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11678 (Target_arm::arm_input_section_map_): New data member declaration.
11679 (Target_arm::scan_reloc_for_stub,
11680 Target_arm::scan_reloc_section_for_stubs,
11681 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11682 Target_arm::do_relax): New method definitions.
11683
5d329b7d
ILT
116842009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11685
11686 * configure.ac: Check for (struct stat)::st_mtim
11687 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11688 * config.in: Regenerate.
11689 * configure: Regenerate.
11690
96a0d71b
ILT
116912009-11-05 Ian Lance Taylor <iant@google.com>
11692
11693 PR 10910
11694 * output.cc (Output_segment::add_output_section): Add missing
11695 return statement.
11696
594c8e5e
ILT
116972009-11-04 Ian Lance Taylor <iant@google.com>
11698
11699 PR 10880
11700 * object.h (class Object): Add is_needed and set_is_needed
11701 methods. Add is_needed_ field. Make bool fields into bitfields.
11702 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11703 defined in a dynamic object and referenced by a regular object,
11704 set is_needed for the dynamic object.
11705 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11706 if the file is marked with as_needed and it is not needed.
11707
22b127cc
ILT
117082009-11-04 Ian Lance Taylor <iant@google.com>
11709
11710 PR 10887
11711 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11712 tags if data is discarded by linker script.
11713 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11714 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11715 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11716 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11717
f5c870d2
ILT
117182009-11-04 Ian Lance Taylor <iant@google.com>
11719
11720 * layout.cc (Layout::get_output_section): Add is_interp and
11721 is_dynamic_linker_section parameters. Change all callers.
11722 (Layout::choose_output_section): Likewise.
11723 (Layout::make_output_section): Likewise.
11724 (Layout::add_output_section_data): Add is_dynamic_linker_section
11725 parameter. Change all callers.
11726 * layout.h (class Layout): Update declarations.
11727 * output.h (class Output_section): Add is_interp, set_is_interp,
11728 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11729 Add is_interp_, is_dynamic_linker_section_ fields. Change
11730 generate_code_fills_at_write_ to a bitfield.
11731 * output.cc (Output_section::Output_sections): Initialize new
11732 fields.
11733 (Output_segment::add_output_section): Add do_sort parameter.
11734 Change all callers.
11735
1ae4d23b
ILT
117362009-11-03 Ian Lance Taylor <iant@google.com>
11737
11738 PR 10860
11739 * options.h (class General_options): Add --warn-common.
11740 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11741 merging two common symbols.
11742 (Symbol_table::should_override): Handle --warn-common when merging
11743 a common symbol with a defined symbol. Use report_resolve_problem
11744 for multiple definitions.
11745 (Symbol_table::report_resolve_problem): New function.
11746 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11747
55da9579
DK
117482009-11-03 Doug Kwan <dougkwan@google.com>
11749
11750 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11751 stub_factory_.
11752 (Target_arm::stub_factory): New method definition.
11753 (Target_arm::new_arm_input_section,
11754 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11755 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11756 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11757 New type definitions.
11758 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11759 member declarations.
11760 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11761 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11762 New method definitions.
11763
37a9ac43
ILT
117642009-11-03 Ian Lance Taylor <iant@google.com>
11765
11766 * options.h (class General_options): Add --warn_constructors.
11767
b3d6a3d4
ILT
117682009-11-03 Ian Lance Taylor <iant@google.com>
11769
11770 PR 10893
11771 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11772 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11773
934b01dd
ILT
117742009-11-03 Ian Lance Taylor <iant@google.com>
11775
11776 PR 10895
11777 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11778 --msgid-bugs-address.
11779 (install-pdf): New target.
11780 (install-data_yes): Look up one directory to find mkinstalldirs.
11781
03c1939b
L
117822009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11783
11784 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11785 tree.
11786
ebd95253
DK
117872009-10-30 Doug Kwan <dougkwan@google.com>
11788
11789 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11790
e9bbb538
DK
117912009-10-30 Doug Kwan <dougkwan@google.com>
11792
11793 * arm.cc (Stub_addend_reader): New struct template definition
11794 and partial specializations.
11795 (Stub_addend_reader::operator()): New method definition for a
11796 partially specialized template.
11797
d5b40221
DK
117982009-10-30 Doug Kwan <dougkwan@google.com>
11799
11800 * arm.cc (Arm_relobj::processor_specific_flags): New method
11801 definition.
11802 (Arm_relobj::do_read_symbols): New method declaration.
11803 (Arm_relobj::processor_specific_flags_): New data member declaration.
11804 (Arm_dynobj): New class definition.
11805 (Target_arm::do_finalize_sections): Add input_objects parameter.
11806 (Target_arm::do_adjust_elf_header): New method declaration.
11807 (Target_arm::are_eabi_versions_compatible,
11808 (Target_arm::merge_processor_specific_flags): New method declaration.
11809 (Target_arm::do_make_elf_object): New overloaded method definitions
11810 and declaration.
11811 (Arm_relobj::do_read_symbols): New method definition.
11812 (Arm_dynobj::do_read_symbols): Ditto.
11813 (Target_arm::do_finalize_sections): Add input_objects parameters.
11814 Merge processor-specific flags from all input objects.
11815 (Target_arm::are_eabi_versions_compatible,
11816 Target_arm::merge_processor_specific_flags,
11817 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11818 New method definitions.
11819 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11820 Input_objects pointer type parameter.
11821 * layout.cc (Layout::finalize): Pass input objects to target's.
11822 finalize_sections function.
11823 * output.cc (Output_file_header::do_sized_write): Set ELF file
11824 header's processor-specific flags.
11825 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11826 Input_objects pointer type parameter.
11827 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11828 * target.h (Input_objects): New forward class declaration.
11829 (Target::processor_specific_flags,
11830 Target::are_processor_specific_flags_sect): New method definitions.
11831 (Target::finalize_sections): Add input_objects parameter.
11832 (Target::Target): Initialize processor_specific_flags_ and
11833 are_processor_specific_flags_set_.
11834 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11835 parameter.
11836 (Target::set_processor_specific_flags): New method definition.
11837 (Target::processor_specific_flags_,
11838 Target::are_processor_specific_flags_set_): New data member
11839 declarations.
11840 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11841 Input_objects pointer type parameter.
11842
ebabffbd
DK
118432009-10-30 Doug Kwan <dougkwan@google.com>
11844
11845 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11846
ad0f2072
ILT
118472009-10-28 Ian Lance Taylor <iant@google.com>
11848
11849 * object.h (class Relobj): Drop options parameter from
11850 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11851 do_scan_relocs, do_relocate. Change all callers.
11852 (class Sized_relobj): Drop options parameters from
11853 do_gc_process_relocs, do_scan_relocs, do_relocate,
11854 do_relocate_sections, relocate_sections, emit_relocs_scan,
11855 emit_relocs_scan_reltype. Change all callers.
11856 (struct Relocate_info): Remove options field and all references to
11857 it.
11858 * reloc.h (class Read_relocs): Remove options constructor
11859 parameter and options_ field. Change all callers.
11860 (class Gc_process_relocs, class Scan_relocs): Likewise.
11861 (class Relocate_task): Likewise.
11862 * target-reloc.h (scan_relocs): Remove options parameter. Change
11863 all callers.
11864 (scan_relocatable_relocs): Likewise.
11865 * target.h (class Sized_target): Remove options parameter from
11866 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11867 all callers.
11868 * gc.h (gc_process_relocs): Remove options parameter. Change all
11869 callers.
11870 * arm.cc: Update functions to remove options parameters.
11871 * i386.cc: Likewise.
11872 * powerpc.cc: Likewise.
11873 * sparc.cc: Likewise.
11874 * x86_64.cc: Likewise.
11875 * testsuite/testfile.cc: Likewise.
11876
8ffa3667
DK
118772009-10-28 Doug Kwan <dougkwan@google.com>
11878
11879 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11880 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11881 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11882 New method definitions.
11883
40f36857
CC
118842009-10-28 Cary Coutant <ccoutant@google.com>
11885
11886 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11887 (Plugin::cleanup_done_): New member.
11888 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11889 (Plugin_manager::cleanup_done_): Remove.
11890 (Plugin_manager::add_input_file): Edit error message.
11891 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11892 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11893
2c849493
ILT
118942009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11895
11896 * fileread.cc: (File_read::View::~View): Use the new
11897 data_ownership_ filed.
11898 (File_read::~File_read): Dispose the new whole_file_view_.
11899 (File_read::open): Mmap the whole file if needed.
11900 (File_read::open): Use whole_file_view_ instead of contents_.
11901 (File_read::find_view): Use whole_file_view_ if applicable.
11902 (File_read::do_read): Use whole_file_view_ instead of contents_.
11903 (File_read::make_view): Use whole_file_view_ instead of contents_,
11904 update File_read::View::View call.
11905 (File_read::find_or_make_view): Update File_read::View::View
11906 call.
11907 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11908 remove contents_
11909 (File_read::View::Data_ownership): New enum.
11910 (File_read::View::View): Replace bool mapped_ with Data_ownership
11911 argument.
11912 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11913 (File_read::View::data_ownership_): New field.
11914 (File_read::contents_): Remove (replaced by whole_file_view_).
11915 (File_read::whole_file_view_): New field.
11916 * options.h (class General_options): Add --keep-files-mapped.
11917
24998053
CC
119182009-10-27 Cary Coutant <ccoutant@google.com>
11919
11920 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11921 * testsuite/Makefile.am (plugin_test_5): New test case.
11922 * testsuite/Makefile.in: Regenerate.
11923
72adc4fa
DK
119242009-10-25 Doug Kwan <dougkwan@google.com>
11925
11926 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11927 from private to protected to allow access by child class.
11928 (Sized_relobj::do_relocate_sections): New method declaration.
11929 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11930 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11931 Sized_relobj::relocate_sections. Instantiate template explicitly
11932 for different target sizes and endianity.
11933
07f508a2
DK
119342009-10-24 Doug Kwan <dougkwan@google.com>
11935
11936 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11937 (Arm_input_section::as_arm_input_section): New method.
11938 (Arm_output_section): New class definition.
11939 (Arm_output_section::create_stub_group,
11940 Arm_output_section::group_sections): New method definitions.
11941
10ad9fe5
DK
119422009-10-22 Doug Kwan <dougkwan@google.com>
11943
11944 * arm.cc (Arm_input_section): New class definition.
11945 (Arm_input_section::init, Arm_input_section:do_write,
11946 Arm_input_section::set_final_data_size,
11947 Arm_input_section::do_reset_address_and_file_offset): New method
11948 definitions.
11949
56ee5e00
DK
119502009-10-21 Doug Kwan <dougkwan@google.com>
11951
11952 * arm.cc (Stub_table, Arm_input_section): New forward class
11953 declarations.
11954 (Stub_table): New class defintion.
11955 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11956 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11957 New method definition.
11958
b569affa
DK
119592009-10-21 Doug Kwan <dougkwan@google.com>
11960
11961 * arm.cc: Update copyright comments.
11962 (Target_arm): New forward class template declaration.
11963 (Arm_address): New type.
11964 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11965 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11966 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11967 constants.
11968 (Insn_template): Same.
11969 (DEF_STUBS): New macro.
11970 (Stub_type): New enum type.
11971 (Stub_template): New class definition.
11972 (Stub): Same.
11973 (Reloc_stub): Same.
11974 (Stub_factory): Same.
11975 (Target_arm::Target_arm): Initialize may_use_blx_ and
11976 should_force_pic_veneer_.
11977 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11978 Target_arm::should_force_pic_veneer,
11979 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11980 Target_arm::using_thumb_only, Target_arm:;default_target): New
11981 method defintions.
11982 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11983 New data member declarations.
11984 (Insn_template::size, Insn_template::alignment): New method defintions.
11985 (Stub_template::Stub_template): New method definition.
11986 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11987 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11988 (Stub_factory::Stub_factory): New method definition.
11989 * gold.h (string_hash): New template.
11990 * output.h (Input_section_specifier::hash_value): Use
11991 gold::string_hash.
11992 (Input_section_specifier::string_hash): Remove.
11993 * stringpool.cc (Stringpool_template::string_hash): Use
11994 gold::string_hash.
11995
6c172549
DK
119962009-10-20 Doug Kwan <dougkwan@google.com>
11997
11998 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11999 symbols of relaxed input sections.
12000 * output.h (Output_section::find_relaxed_input_section): Make
12001 method public.
12002
c5617f2f
DK
120032009-10-16 Doug Kwan <dougkwan@google.com>
12004
12005 * dynobj.cc (Versions::Versions): Initialize version_script_.
12006 Only insert base version symbol definition for a shared object
12007 if version script defines any version versions.
12008 (Versions::define_base_version): New method definition.
12009 (Versions::add_def): Check that base version is not needed.
12010 (Versions::add_need): Define base version lazily.
12011 * dynobj.h (Versions::define_base_version): New method declaration.
12012 (Versions::needs_base_version_): New data member declaration.
12013 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12014 (check_DATA): Add no_version_test.stdout.
12015 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12016 New make rules.
12017 * testsuite/Makefile.in: Regenerate.
12018 * testsuite/no_version_test.c: New file.
12019 * testsuite/no_version_test.sh: Ditto.
12020
3c12dcdb
DK
120212009-10-16 Doug Kwan <dougkwan@google.com>
12022
12023 * expression.cc (class Segment_start_expression): New class definition.
12024 (Segment_start_expression::value): New method definition.
12025 (script_exp_function_segment_start): Return a new
12026 Segment_start_expression.
12027 * gold/script-c.h (script_saw_segment_start_expression): New function
12028 prototype.
12029 * script-sections.cc (Script_sections::Script_sections): Initialize
12030 SAW_SEGMENT_START_EXPRESSION_ to false.
12031 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12032 and -Tbbs options to specify section addresses if given in
12033 command line and no SEGMENT_START expression is seen in a script.
12034 * script-sections.h (Script_sections::saw_segment_start_expression,
12035 Script_sections::set_saw_segment_start_expression): New method
12036 definition.
12037 (Script_sections::saw_segment_start_expression_): New data member
12038 declaration.
12039 * script.cc (script_saw_segment_start_expression): New function.
12040 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12041 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12042 script_test_7.sh and script_test_8.sh.
12043 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12044 script_test_8.stdout.
12045 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12046 (script_test_6, script_test_6.stdout, script_test_7,
12047 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12048 * Makefile.in: Regenerate.
12049 * testsuite/script_test_6.sh: New file.
12050 * testsuite/script_test_6.t: Same.
12051 * testsuite/script_test_7.sh: Same.
12052 * testsuite/script_test_7.t: Same.
12053 * testsuite/script_test_8.sh: Same.
12054
64b1ae37
DK
120552009-10-16 Doug Kwan <dougkwan@google.com>
12056
12057 * output.cc (Output_segment::set_section_list_address): Cast
12058 expressions to unsigned long long type to avoid format warnings.
12059
661be1e2
ILT
120602009-10-15 Ian Lance Taylor <iant@google.com>
12061
12edd763 12062 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12063 dot assignment to script_sections_.
12edd763
ILT
12064 * script-sections.cc (Script_sections::add_dot_assignment):
12065 Initialize if necessary.
12066
68b6574b
ILT
12067 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12068 program headers with no load segment if there is a linker script.
12069
661be1e2
ILT
12070 * layout.cc (Layout::set_segment_offsets): Align the file offset
12071 to the segment aligment for -N or -n with no load segment.
12072 * output.cc (Output_segment::add_output_section): Don't crash if
12073 the first section is a TLS section.
12074 (Output_segment::set_section_list_addresses): Print an error
12075 message if the address moves backward in a linker script.
12076 * script-sections.cc
12077 (Output_section_element_input::set_section_addresses): Don't
12078 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12079 (Orphan_output_section::set_section_addresses): Likewise.
12080
f15f61a7
DK
120812009-10-15 Doug Kwan <dougkwan@google.com>
12082
12083 * layout.cc (Layout::finish_dynamic_section): Generate tags
12084 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12085 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12086 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12087
82bb573a
ILT
120882009-10-14 Ian Lance Taylor <iant@google.com>
12089
12090 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12091 fields.
12092 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12093 data_shdr fields of relinfo.
12094 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12095 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12096 R_386_TLS_LDO_32, adjust based on section flags.
12097 (Target_i386::Relocate::fix_up_ldo): Remove.
12098
374ad285
ILT
120992009-10-13 Ian Lance Taylor <iant@google.com>
12100
12101 Add support for -pie.
12102 * options.h (class General_options): Add -pie and
12103 --pic-executable.
12104 (General_options::output_is_position_independent): Test -pie.
12105 (General_options::output_is_executable): Return true if not shared
12106 and not relocatable.
12107 (General_options::output_is_pie): Remove.
12108 * options.cc (General_options::finalize): Reject incompatible uses
12109 of -pie.
12110 * gold.cc (queue_middle_tasks): A -pie link is not static.
12111 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12112 * symtab.cc (Symbol::final_value_is_known): Return false if
12113 output_is_position_independent.
12114 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
12115 output_is_position_independent.
12116 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
12117 output_is_position_independent.
12118 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
12119 output_is_position_independent.
12120 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
12121 two_file_pie_test.
12122 (basic_pie_test.o, basic_pie_test): New targets.
12123 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
12124 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
12125 (two_file_pie_test): New target.
12126 * testsuite/Makefile.in: Rebuild.
12127 * README: Remove note saying that -pie is not supported.
12128
c6585162
ILT
121292009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
12130
12131 * options.h (class General_options): Add -init and -fini.
12132 * layout.cc (Layout::finish_dynamic_section): Emit
12133 given init and fini functions.
12134
032ce4e9
ST
121352009-10-13 Sriraman Tallam <tmsriram@google.com>
12136
12137 * gc.h (gc_process_relocs): Check if icf is enabled using new
12138 function.
12139 * gold.cc (queue_initial_tasks): Likewise.
12140 (queue_middle_tasks): Likewise.
12141 * object.cc (do_layout): Likewise.
12142 * symtab.cc (is_section_folded): Likewise.
12143 * main.cc (main): Likewise.
12144 * reloc.cc (Read_relocs::run): Likewise.
12145 (Sized_relobj::do_scan_relocs): Likewise.
12146 * icf.cc (is_function_ctor_or_dtor): New function.
12147 (Icf::find_identical_sections): Check if function is ctor or dtor when
12148 safe icf is chosen.
12149 * options.h (General_options::icf): Change option to be an enum.
12150 (Icf_status): New enum.
12151 (icf_enabled): New method.
12152 (icf_safe_folding): New method.
12153 (set_icf_status): New method.
12154 (icf_status_): New variable.
12155 * (options.cc) (General_options::finalize): Set icf_status_.
12156 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
12157 icf_test and icf_keep_unique_test to use the --icf enum flag.
12158 * testsuite/icf_safe_test.sh: New file.
e1df38aa 12159 * testsuite/icf_safe_test.cc: New file.
032ce4e9 12160
f345227a
ST
121612009-10-12 Sriraman Tallam <tmsriram@google.com>
12162
12163 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
12164 includes to gc.h and icf.h.
12165 * arm.cc: Include gc.h.
12166 * gold.cc: Likewise.
12167 * i386.cc: Likewise.
12168 * powerpc.cc: Likewise.
12169 * sparc.cc: Likewise.
12170 * x86_64.cc: Likewise.
12171 * gc.h: Include icf.h.
12172
1c7814ed
ILT
121732009-10-11 Ian Lance Taylor <iant@google.com>
12174
12175 * plugin.cc: Include "gold.h" before other header files.
12176
ae3b5189
CD
121772009-10-10 Chris Demetriou <cgd@google.com>
12178
12179 * options.h (Input_file_argument::Input_file_type): New enum.
12180 (Input_file_argument::is_lib_): Replace with...
12181 (Input_file_argument::type_): New member.
12182 (Input_file_argument::Input_file_argument): Take Input_file_type
12183 'type' rather than boolean 'is_lib' as second argument.
12184 (Input_file_argument::is_lib): Use type_.
12185 (Input_file_argument::is_searched_file): New function.
12186 (Input_file_argument::may_need_search): Handle is_searched_file.
12187 * options.cc (General_options::parse_library): Support -l:filename.
12188 (General_options::parse_just_symbols): Update for Input_file_argument
12189 changes.
12190 (Command_line::process): Likewise.
12191 * archive.cc (Archive::get_file_and_offset): Likewise.
12192 * plugin.cc (Plugin_manager::release_input_file): Likewise.
12193 * script.cc (read_script_file, script_add_file): Likewise.
12194 * fileread.cc (Input_file::Input_file): Likewise.
12195 (Input_file::will_search_for): Handle is_searched_file.
12196 (Input_file::open): Likewise.
12197 * readsyms.cc (Read_symbols::get_name): Likewise.
12198 * testsuite/Makefile.am (searched_file_test): New test.
12199 * testsuite/Makefile.in: Regenerate.
12200 * testsuite/searched_file_test.cc: New file.
12201 * testsuite/searched_file_test_lib.cc: New file.
12202
f3048a1d
ILT
122032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12204 Ian Lance Taylor <iant@google.com>
12205
12206 * descriptor.cc: Include <cstdio> and "binary-io.h".
12207 (Descriptors::open): Open the files in binary mode always.
12208 * script.cc (Lex::get_token): Treat \r as whitespace.
12209
d4780e57
ILT
122102009-10-09 Ian Lance Taylor <iant@google.com>
12211
12212 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
12213
d9a893b8
ILT
122142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12215 Ian Lance Taylor <iant@google.com>
12216
12217 * configure.ac: Check for readv function also.
12218 * fileread.cc (readv): Define if not HAVE_READV.
12219 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
12220 does not exist.
12221 * config.in: Regenerate.
12222 * configure: Regenerate.
12223
c0a62865
DK
122242009-10-09 Doug Kwan <dougkwan@google.com>
12225
12226 * layout.cc (Layout::make_output_section): Call target hook to make
12227 ordinary output section.
12228 (Layout::finalize): Adjust parameter list of call the
12229 Target::may_relax().
12230 * layout.h (class Layout::section_list): New method.
12231 * merge.h (Output_merge_base::entsize): Change visibility to public.
12232 (Output_merge_base::is_string, Output_merge_base::do_is_string):
12233 New methods.
12234 (Output_merge_string::do_is_string): New method.
12235 * object.cc (Sized_relobj::do_setup): renamed from
12236 Sized_relobj::set_up.
12237 * object.h (Sized_relobj::adjust_shndx,
12238 Sized_relobj::initializ_input_to_output_maps,
12239 Sized_relobj::free_input_to_output_maps): Change visibilities to
12240 protected.
12241 (Sized_relobj::setup): Virtualize.
12242 (Sized_relobj::do_setup): New method declaration.
12243 (Sized_relobj::invalidate_section_offset,
12244 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
12245 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
12246 * options.cc (parse_int): New function.
12247 * options.h (parse_int): New declaration.
12248 (DEFINE_int): New macro.
12249 (stub_group_size): New option.
12250 * output.cc (Output_section::Output_section): Initialize memebers
12251 merge_section_map_, merge_section_by_properties_map_,
12252 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
12253 (Output_section::add_input_section): Handled deferred code-fill
12254 generation and remove an old comment.
12255 (Output_section::add_relaxed_input_section): New method definition.
12256 (Output_section::add_merge_input_section): Use merge section by
12257 properties map to speed to search. Update merge section maps
12258 as appropriate.
12259 (Output_section::build_relaxation_map): New method definition.
12260 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
12261 Same.
12262 (Output_section::relax_input_section): Renamed to
12263 Output_section::convert_input_sections_to_relaxed_sections and change
12264 interface to take a vector of pointers to relaxed sections.
12265 (Output_section::find_merge_section,
12266 Output_section::find_relaxed_input_section): New method definitions.
12267 (Output_section::is_input_address_mapped,
12268 Output_section::output_offset, Output_section::output_address):
12269 Use output section data maps to speed up searching.
12270 (Output_section::find_starting_output_address): Add comments.
12271 (Output_section::do_write,
12272 Output_section::write_to_postprocessing_buffer): Do code-fill
12273 generation as appropriate.
12274 (Output_section::get_input_sections): Invalidate relaxed input section
12275 map.
12276 (Output_section::restore_states): Adjust type of checkpoint .
12277 Invalidate relaxed input section map.
12278 * output.h (Output_merge_base): New class declaration.
12279 (Input_section_specifier): New class defintion.
12280 (class Output_relaxed_input_section) Change base class to
12281 Output_section_data_build.
12282 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
12283 base class initializer.
12284 (Output_section::add_relaxed_input_section): New method declaration.
12285 (Output_section::Input_section): Change visibility to protected.
2e702c99 12286 (Output_section::Input_section::relobj,
c0a62865
DK
12287 Output_section::Input_section::shndx): Handle relaxed input sections.
12288 Output_section::input_sections) Change visibility to protected. Also
12289 define overload to return a non-const pointer.
12290 (Output_section::Merge_section_properties): New class defintion.
12291 (Output_section::Merge_section_by_properties_map,
12292 Output_section::Output_section_data_by_input_section_map,
12293 Output_section::Relaxation_map): New types.
12294 (Output_section::relax_input_section): Rename method to
12295 Output_section::convert_input_sections_to_relaxed_sections and change
12296 interface to take a vector of relaxed section pointers.
12297 (Output_section::find_merge_section,
12298 Output_section::find_relaxed_input_section,
12299 Output_section::build_relaxation_map,
12300 Output_section::convert_input_sections_in_list_to_relaxed_sections):
12301 New method declarations.
12302 (Output_section::merge_section_map_
12303 Output_section::merge_section_by_properties_map_,
12304 Output_section::relaxed_input_section_map_,
12305 Output_section::is_relaxed_input_section_map_valid_,
12306 Output_section::generate_code_fills_at_write_): New data members.
12307 * script-sections.cc
12308 (Output_section_element_input::set_section_addresses): Call
12309 current_data_size and addralign methods of relaxed input sections.
12310 (Orphan_output_section::set_section_addresses): Call current_data_size
12311 and addralign methods of relaxed input sections.
12312 * symtab.cc (Symbol_table::compute_final_value): Extract template
12313 from the body of Symbol_table::sized_finalize_symbol.
12314 (Symbol_table::sized_finalized_symbol): Call
12315 Symbol_table::compute_final_value.
12316 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
12317 (Symbol_table::compute_final_value): New templated method declaration.
12318 * target.cc (Target::do_make_output_section): New method defintion.
12319 * target.h (Target::make_output_section): New method declaration.
12320 (Target::relax): Add more parameters for input objects, symbol table
12321 and layout. Adjust call to do_relax.
12322 (Target::do_make_output_section): New method declaration.
12323 (Target::do_relax): Add parameters for input objects, symbol table
12324 and layout.
12325
d446d6c4
ILT
123262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12327
12328 * pread.c: Include stdio.h.
12329
bc06c745
ILT
123302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12331
12332 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
12333 defined.
12334
75aea3d0
ILT
123352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
12336
12337 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
12338 Change read_shndx type to unsigned int.
12339 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12340 int.
12341 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12342 * dwarf_reader.h (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 * layout.cc (Layout::create_symtab_sections): Cast the result of
12348 local_symcount * symsize to off_t in the gold_assert.
12349
be8fcb75
ILT
123502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12351
12352 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12353 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12354 R_ARM_BASE_ABS.
12355 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12356 (Arm_relocate_functions::thm_abs5): New function.
12357 (Arm_relocate_functions::abs12): New function.
12358 (Arm_relocate_functions::abs16): New function.
12359 (Arm_relocate_functions::base_abs): New function.
12360 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12361 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12362 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12363 R_ARM_BASE_ABS.
12364 (Scan::global): Likewise.
12365 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12366 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12367 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12368 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12369 R_ARM_BASE_ABS.
12370
c2a122b6
ILT
123712009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12372
12373 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12374 (Arm_relocate_functions::movt_prel): New function.
12375 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12376 (Arm_relocate_functions::thm_movt_prel): New function.
12377 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12378 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12379 (Scan::global, Relocate::relocate): Likewise.
12380 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12381
c4aa1e2d
ILT
123822009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12383
12384 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12385 Incremental_checker.
12386 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12387 unsigned int.
12388 (class Incremental_inputs_header): New class.
12389 (Incremental_inputs_header_writer): Edit comment.
12390 (Incremental_inputs_entry): New class.
12391 (Incremental_inputs_entry_writer): Edit comment.
12392 (Sized_incremental_binary::do_find_incremental_inputs_section):
12393 Add *strtab_shndx parameter, fill it.
12394 (Sized_incremental_binary::do_check_inputs): New method.
12395 (Incremental_checker::can_incrementally_link_output_file): Use
12396 Sized_incremental_binary::check_inputs.
12397 (Incremental_inputs::report_command_line): Save command line in
12398 command_line_.
12399 * incremental.h:
12400 (Incremental_binary::find_incremental_inputs_section): New
12401 method.
12402 (Incremental_binary::do_find_incremental_inputs_section): Add
12403 strtab_shndx parameter.
12404 (Incremental_binary::do_check_inputs): New pure virtual method.
12405 (Sized_incremental_binary::do_check_inputs): Declare.
12406 (Incremental_checker::Incremental_checker): Add incremental_inputs
12407 parameter, use it to initialize incremental_inputs_.
12408 (Incremental_checker::incremental_inputs_): New field.
12409 (Incremental_checker::command_line): New method.
12410 (Incremental_checker::inputs): New method.
12411 (Incremental_checker::command_line_): New field.
12412
c549a694
ILT
124132009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12414
12415 * incremental.cc: Include <cstdarg> and "target-select.h".
12416 (vexplain_no_incremental): New function.
12417 (explain_no_incremental): New function.
12418 (Incremental_binary::error): New method.
12419 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12420 method.
12421 (make_sized_incremental_binary): New function.
12422 (open_incremental_binary): New function.
12423 (can_incrementally_link_file): Add checks if output is ELF and has
12424 inputs section.
12425 * incremental.h: Include "elfcpp_file.h" and "output.h".
12426 (Incremental_binary): New class.
12427 (Sized_incremental_binary): New class.
12428 (open_incremental_binary): Declare.
12429 * object.cc (is_elf_object): Use
12430 elfcpp::Elf_recognizer::is_elf_file.
12431 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12432 * output.h (Output_file::filesize): New method.
12433
fd3c5f0b
ILT
124342009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12435
12436 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12437 New function.
12438 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12439 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12440 function.
12441 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12442 function.
12443 (Arm_relocate_functions::movw_abs_nc): New function.
12444 (Arm_relocate_functions::movt_abs): New function.
12445 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12446 (Arm_relocate_functions::thm_movt_abs): New function.
12447 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12448 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12449 (Scan::global): Likewise.
12450 (Relocate::relocate): Likewise.
12451 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12452
7f5309a5
ILT
124532009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12454
12455 * arm.cc (Arm_relocate_functions::got_prel) New function.
12456 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12457 (Relocate::relocate): Likewise.
12458 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12459
364c7fa5
ILT
124602009-10-06 Ian Lance Taylor <iant@google.com>
12461
12462 * options.h (class General_options): Define
12463 split_stack_adjust_size parameter.
12464 * object.h (class Object): Add uses_split_stack_ and
12465 has_no_split_stack_ fields. Add uses_split_stack and
12466 has_no_split_stack accessor functions. Declare
12467 handle_split_stack_section.
12468 (class Reloc_symbol_changes): Define.
12469 (class Sized_relobj): Define Function_offsets. Declare
12470 split_stack_adjust, split_stack_adjust_reltype, and
12471 find_functions.
12472 * object.cc (Object::handle_split_stack_section): New function.
12473 (Sized_relobj::do_layout): Call handle_split_stack_section.
12474 * dynobj.cc (Sized_dynobj::do_layout): Call
12475 handle_split_stack_section.
12476 * reloc.cc (Sized_relobj::relocate_sections): Call
12477 split_stack_adjust for executable sections in split_stack
12478 objects. Pass reloc_map to relocate_section.
12479 (Sized_relobj::split_stack_adjust): New function.
12480 (Sized_relobj::split_stack_adjust_reltype): New function.
12481 (Sized_relobj::find_functions): New function.
12482 * target-reloc.h: Include "object.h".
12483 (relocate_section): Add reloc_symbol_changes parameter. Change
12484 all callers.
12485 * target.h (class Target): Add calls_non_split method. Declare
12486 do_calls_non_split virtual method. Declare match_view and
12487 set_view_to_nop.
12488 * target.cc: Include "elfcpp.h".
12489 (Target::do_calls_non_split): New function.
12490 (Target::match_view): New function.
12491 (Target::set_view_to_nop): New function.
12492 * gold.cc (queue_middle_tasks): Give an error if mixing
12493 split-stack and non-split-stack objects with -r.
12494 * i386.cc (Target_i386::relocate_section): Add
12495 reloc_symbol_changes parameter.
12496 (Target_i386::do_calls_non_split): New function.
12497 * x86_64.cc (Target_x86_64::relocate_section): Add
12498 reloc_symbol_changes parameter.
12499 (Target_x86_64::do_calls_non_split): New function.
12500 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12501 parameter.
12502 * powerpc.cc (Target_powerpc::relocate_section): Add
12503 reloc_symbol_changes parameter.
12504 * sparc.cc (Target_sparc::relocate_section): Add
12505 reloc_symbol_changes parameter.
12506 * configure.ac: Call AM_CONDITIONAL for the default target.
12507 * configure: Rebuild.
12508 * testsuite/Makefile.am (TEST_AS): New variable.
12509 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12510 (check_DATA): Add split_i386 and split_x86_64 files.
12511 (SPLIT_DEFSYMS): Define.
12512 (split_i386_[1234n].o): New targets.
12513 (split_i386_[124]): New targets.
12514 (split_i386_[1234r].stdout): New targets.
12515 (split_x86_64_[1234n].o): New targets.
12516 (split_x86_64_[124]): New targets.
12517 (split_x86_64_[1234r].stdout): New targets.
12518 (MOSTLYCLEANFILES): Add new executables.
12519 * testsuite/split_i386.sh: New file.
12520 * testsuite/split_x86_64.sh: New file.
12521 * testsuite/split_i386_1.s: New file.
12522 * testsuite/split_i386_2.s: New file.
12523 * testsuite/split_i386_3.s: New file.
12524 * testsuite/split_i386_4.s: New file.
12525 * testsuite/split_i386_n.s: New file.
12526 * testsuite/split_x86_64_1.s: New file.
12527 * testsuite/split_x86_64_2.s: New file.
12528 * testsuite/split_x86_64_3.s: New file.
12529 * testsuite/split_x86_64_4.s: New file.
12530 * testsuite/split_x86_64_n.s: New file.
12531 * testsuite/testfile.cc (Target_test): Update relocation_section
12532 function.
12533 * testsuite/Makefile.in: Rebuild.
12534
e8a9fcda
ILT
125352009-10-06 Ian Lance Taylor <iant@google.com>
12536
12537 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12538 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12539 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12540 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12541 the address on ldo_addrs_.
12542 (Target_i386::Relocate::fix_up_ldo): New function.
12543
e99daf92
ILT
125442009-10-06 Rafael Espindola <espindola@google.com>
12545
12546 * plugin.cc (add_input_library): New.
12547 (Plugin::load): Add add_input_library to tv.
12548 (Plugin_manager::add_input_file): Add the is_lib argument.
12549 (add_input_file): Update call to Plugin_manager::add_input_file.
12550 (add_input_library): New.
12551 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12552
966d4097
DK
125532009-09-30 Doug Kwan <dougkwan@google.com>
12554
12555 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12556 symbol and call Symbol::may_need_copy_reloc to determine if
12557 a copy reloc is needed.
12558 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12559 nocopyreloc is given in command line.
12560 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12561 given in command line.
12562 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12563 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12564 of the removed Target_i386::may_need_copy_reloc.
12565 * options.h (copyreloc): New option with default value false.
12566 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12567 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12568 instead of the removed Target_powerpc::may_need_copy_reloc.
12569 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12570 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12571 instead of the removed Target_sparc::may_need_copy_reloc.
12572 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12573 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12574 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12575 instead of the removed Target_x86_64::may_need_copy_reloc.
12576
029ba973
ILT
125772009-09-30 Ian Lance Taylor <iant@google.com>
12578
12579 * object.h (class Object): Remove target_ field, and target,
12580 sized_target, and set_target methods.
12581 (Object::sized_target): Remove.
12582 (class Sized_relobj): Update declarations. Remove sized_target.
12583 * object.cc (Sized_relobj::setup): Remove target parameter.
12584 Change all callers.
12585 (Input_objects::add_object): Don't do anything with the target.
12586 (make_elf_sized_object): Add punconfigured parameter. Change all
12587 callers. Set or test parameter target.
12588 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12589 Change all callers.
12590 * parameters.cc (Parameters::set_target): Change parameter type to
12591 be non-const.
12592 (Parameters::default_target): Remove.
12593 (set_parameters_target): Change parameter type to be non-const.
12594 (parameters_force_valid_target): New function.
12595 (parameters_clear_target): New function.
12596 * parameters.h (class Parameters): Update declarations. Remove
12597 default_target method. Add sized_target and clear_target
12598 methods. Change target_ to be non-const.
12599 (set_parameters_target): Update declaration.
12600 (parameters_force_valid_target): Declare.
12601 (parameters_clear_target): Declare.
12602 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12603 as NULL if we aren't searching.
12604 (Add_symbols::run): Don't check for compatible target.
12605 * fileread.cc (Input_file::open_binary): Call
12606 parameters_force_valid_target.
12607 * gold.cc (queue_middle_tasks): Likewise.
12608 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12609 set_target on object.
12610 * dynobj.h (class Sized_dynobj): Update declarations.
12611 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12612 make_elf_object returns NULL.
12613 (Archive::include_member): Don't check whether object target is
12614 compatible.
12615 * output.cc (Output_section::add_input_section): Get target from
12616 parameters.
12617 (Output_section::relax_input_section): Likewise.
12618 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12619 parameters.
12620 (Sized_relobj::do_scan_relocs): Likewise.
12621 (Sized_relobj::relocate_sections): Likewise.
12622 * resolve.cc (Symbol_table::resolve): Likewise.
12623 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12624 parameter. Change all callers.
12625 (Symbol_table::add_from_object): Get target from parameters.
12626 (Symbol_table::add_from_relobj): Don't check object target.
12627 (Symbol_table::add_from_dynobj): Likewise.
12628 (Symbol_table::define_special_symbol): Get target from
12629 parameters.
12630 * symtab.h (class Symbol_table): Update declaration.
12631 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12632 parameter. Change all callers. Clear parameter target.
12633 (Binary_test): Test target here.
12634 * testsuite/object_unittest.cc (gold_testsuite): Remove
12635 target_test_pointer parameter. Change all callers.
12636 (Object_test): Test target here.
12637
a6a22b83
ILT
126382009-09-26 Ian Lance Taylor <iant@google.com>
12639
12640 * testsuite/initpri1.c: Don't try to use constructor priorities if
12641 compiling with gcc before 4.3.
12642
6a8f49fe
ILT
126432009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12644
12645 * testsuite/retain_symbols_file_test.sh (check_present): Change
12646 output file name to retain_symbols_file_test.stdout.
12647 (check_absent): Likewise.
12648
8c604651
CS
126492009-09-18 Craig Silverstein <csilvers@google.com>
12650
12651 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12652 * options.cc: Include <cerrno> and <fstream>.
12653 (General_options::finalize): Parse -retain-symbols-file tag.
12654 * options.h: New flag.
12655 (General_options): New method should_retain_symbol, new
12656 variable symbols_to_retain.
12657 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12658 should_retain_symbol map.
12659 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12660 * testsuite/Makefile.in: Regenerate.
12661 * testsuite/retain_symbols_file_test.sh: New file.
12662
ca58b19f
NC
126632009-09-18 Nick Clifton <nickc@redhat.com>
12664
12665 * po/es.po: Updated Spanish translation.
12666
20e6d0d6
DK
126672009-09-17 Doug Kwan <dougkwan@google.com>
12668
12669 * debug.h (DEBUG_RELAXATION): New constant.
12670 (DEBUG_ALL): Add DEBUG_RELAXATION.
12671 (debug_string_to_enum): Add relaxation debug option.
12672 * layout.cc
12673 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12674 Layout::Relaxation_debug_check::read_sections,
12675 Layout::Relaxation_debug_check::read_sections): New method definitions.
12676 (Layout::Layout): Initialize data members
12677 record_output_section_data_from_scrips_,
12678 script_output_section_data_list_ and relaxation_debug_check_.
12679 (Layout::save_segments, Layout::restore_segments,
12680 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12681 Layout::relaxation_loop_body): New method definitions.
12682 (Layout::finalize): Support relaxation. Move section layout code to
12683 Layout::relaxation_loop_body.
12684 (Layout::set_asection_address_from_script): Move code for orphan
12685 section placement out.
12686 (Layout::place_orphan_sections_in_script): New method definition.
12687 * layout.h (Output_segment_headers, Output_file_header):
12688 New forward class declarations.
12689 (Layout::~Layout): Define.
12690 (Layout::new_output_section_data_from_script): New method definition.
12691 (Layout::place_orphan_sections_in_script): New method declaration.
12692 (Layout::Segment_states): New type declaration.
12693 (Layout::save_segments, Layout::restore_segments,
12694 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12695 Layout::relaxation_loop_body): New method declarations.
12696 (Layout::Output_section_data_list): New type declaration.
12697 (Layout::Relaxation_debug_check): New class definition.
12698 (Layout::record_output_section_data_from_script_,
12699 Layout::script_output_section_data_list_, Layout::segment_states_,
12700 Layout::relaxation_debug_check_): New data members.
12701 * output.cc: (Output_section_headers::do_size): New method definition.
12702 (Output_section_headers::Output_section_headers): Move size
12703 computation to Output_section_headers::do_size.
12704 (Output_segment_headers::do_size): New method definition.
e1df38aa 12705 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12706 Output_file_header::do_size and call it.
12707 (Output_file_header::do_size): New method definition.
12708 (Output_data_group::Output_data_group): Adjust call to
12709 Output_section_data.
12710 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12711 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12712 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12713 RELAXED_INPUT_SECTION_CODE.
12714 (Output_section::Output_section): Initialize data member checkpoint_.
12715 (Output_section::~Output_section): Delete checkpoint object pointed
12716 by checkpoint_.
12717 (Output_section::add_input_section): Always add an Input_section if
12718 relaxing.
12719 (Output_section::add_merge_input_section): Add assert.
12720 (Output_section::relax_input_section): New method definition.
12721 (Output_section::set_final_data_size): Set load address to zero for
12722 an unallocated section.
12723 (Output_section::do_address_and_file_offset_have_reset_values):
12724 New method definition.
12725 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12726 Handle relaxed input section.
12727 (Output_section::sort_attached_input_sections): Checkpoint input
12728 section list lazily.
12729 (Output_section::get_input_sections): Change type of input_sections to
12730 list of Simple_input_section pointers. Checkpoint input section list
12731 lazily. Also handle relaxed input sections.
12732 (Output_section::add_input_section_for_script): Take a reference to
12733 a Simple_input_section object instead of Relobj pointer and section
12734 index as parameter. Handle relaxed input sections.
12735 (Output_section::save_states, Output_section::restore_states): New
12736 method definitions.
12737 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12738 (Output_data::is_data_size_fixed): New method definition.
12739 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12740 if it is fixed.
12741 (Output_data::address_and_file_offset_have_reset_values): New method
12742 definition.
12743 (Output_data::do_address_and_file_offset_have_reset_values): New method
12744 definition.
12745 (Output_data::set_data_size): Check that data size is not fixed.
12746 (Output_data::fix_data_size): New method definition.
12747 (Output_data::is_data_size_fixed_): New data member.
12748 (Output_section_headers::set_final_data_size): New method definition.
12749 (Output_section_headers::do_size): New method declaration.
12750 (Output_segment_headers::set_final_data_size): New method definition.
12751 (Output_segment_headers::do_size): New method declaration.
12752 (Output_file_header::set_final_data_size)::New method definition.
12753 (Output_file_header::do_size)::New method declaration.
12754 (Output_section_data::Output_section_data): Add new parameter
12755 is_data_size_fixed and use it to fix data size.
12756 (Output_data_const::Output_data_const): Adjust call to base class
12757 constructor and fix data size.
12758 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12759 base class constructor and fix data size.
12760 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12761 base class constructor and fix data size.
12762 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12763 class constructor and fix data size.
12764 (Output_data_group::set_final_data_size): New method definition.
12765 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12766 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12767 class constructor and fix data size.
12768 (Output_relaxed_input_section): New class definition.
12769 (Output_section::Simple_input_section): New class definition.
12770 (Output_section::get_input_sections): Adjust parameter list.
12771 (Output_section::add_input_section_for_script): Same.
12772 (Output_section::save_states, Output_section::restore_states,
12773 Output_section::do_address_and_file_offset_have_reset_values,
12774 (Output_section::Input_section::Input_section): Handle
12775 RELAXED_INPUT_SECTION_CODE. Add new overload for
12776 Output_relaxed_input_section.
12777 (Output_section::Input_section::is_input_section,
12778 Output_section::Input_section::set_output_section): Handle relaxed
12779 input section.
12780 (Output_section::Input_section::is_relaxed_input_section,
12781 Output_section::Input_section::output_section_data,
12782 Output_section::Input_section::relaxed_input_section): New method
12783 definitions.
12784 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12785 value.
12786 (Output_section::Input_section::u1_): Update comments.
12787 (Output_section::Input_section::u2_): Add new union member poris.
12788 (Output_section::Checkpoint_output_section): New classs definition.
12789 (Output_section::relax_input_section): New method declaration.
12790 (Output_section::checkpoint_): New data member.
12791 (Output_segment): Update comments.
12792 (Output_segment::Output_segment): Un-privatize copy constructor.
12793 (Output_segment::operator=): Un-privatize.
12794 * script-sections.cc (Output_section_element::Input_section_list):
12795 Change element type to Output_section::Simple_input_section.
12796 (Output_section_element_dot_assignment::set_section_addresses):
12797 Register output section data for relaxation clean up.
12798 (Output_data_exression::Output_data_expression): Adjust call to base
12799 constructor to fix data size.
12800 (Output_section_element_data::set_section_addresses): Register
12801 Output_data_expression object for relaxation clean up.
12802 (struct Input_section_info): Replace Relobj pointer and section index
12803 pair with Output_section::Simple_input_section and Convert struct to a
12804 class.
12805 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12806 Input_section_info data member to use accessors.
20e6d0d6
DK
12807 (Output_section_element_input::set_section_addresses): Use layout
12808 parameter. Adjust code to use Output_section::Simple_input_section
12809 and Input_secction_info classes. Register filler for relaxation
12810 clean up.
12811 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12812 and section index pair with Output_section::Simple_input_section
12813 class. Adjust code accordingly.
12814 (Phdrs_element::release_segment): New method definition.
12815 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12816 segment list.
12817 (Script_sections::release_segments): New method definition.
12818 * gold/script-sections.h (Script_sections::release_segments): New
12819 method declaration.
12820 * gold/target.h (Target::may_relax, Target::relax,
12821 Target::do_may_relax, Target::do_relax): New method definitions.
12822
5e445df6
ILT
128232009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12824
12825 * arm.cc (has_signed_unsigned_overflow): New function.
12826 (Arm_relocate_functions::abs8): New function.
12827 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12828 (Target_arm::Scan::global): Likewise.
12829 (Target_arm::relocate::relocate): Likewise.
12830 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12831 Likewise.
12832
8c604651 128332009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12834
12835 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12836 * testsuite/Makefile.in: Regenerate.
12837
1e9cc1c2
NC
128382009-09-11 Nick Clifton <nickc@redhat.com>
12839
12840 * po/gold.pot: Updated by the Translation project.
12841
6a89f575
CC
128422009-09-08 Cary Coutant <ccoutant@google.com>
12843
12844 * output.cc (Output_file::open): Add execute permission to empty file.
12845 * testsuite/Makefile.am (permission_test): New test.
12846 * testsuite/Makefile.in: Regenerate.
12847
fdcac5af
ILT
128482009-09-02 Ian Lance Taylor <iant@google.com>
12849
12850 * output.cc (Output_file::resize): Call map_no_anonymous rather
12851 than map.
12852
44453f85
ILT
128532009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12854
12855 * gold.cc: Include "incremental.h".
12856 (queue_initial_tasks): Call Incremental_checker methods.
12857 * incremental.cc: Include "output.h".
12858 (Incremental_checker::can_incrementally_link_output_file): New
12859 method.
12860 * incremental.h (Incremental_checker): New class.
12861
12862 * output.cc (Output_file::open_for_modification): New method.
12863 (Output_file::map_anonymous): Changed return type to bool. Record
12864 map in base_ field.
12865 (Output_file::map_no_anonymous): New method, broken out of map.
12866 (Output_file::map): Use map_no_anonymous and map_anonymous.
12867 * output.h (class Output_file): Update declarations.
12868
293c1386
CC
128692009-08-24 Cary Coutant <ccoutant@google.com>
12870
12871 * options.h (Command_line::Pre_options): New class.
12872 (Command_line::pre_options): New member.
12873 * options.cc (gold::options::ready_to_register): New variable.
12874 (One_option::register_option): Do nothing if not registering options.
12875 Assert if same short option registered twice.
12876 (General_options::General_options): Turn off option registration when
12877 done constructing.
12878 (Command_line::Pre_options::Pre_options): New constructor.
12879
f773f3d2
CC
128802009-08-24 Cary Coutant <ccoutant@google.com>
12881
06a73cfe
CC
12882 * options.h (General_options::no_keep_memory): Remove incorrect
12883 short option.
f773f3d2 12884
a15af8e2
RW
128852009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12886
12887 * Makefile.am (am__skiplex, am__skipyacc): New.
12888 * Makefile.in: Regenerate.
12889
c462b41b
RW
128902009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12891
14ec8efd
RW
12892 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12893 (INCLUDES): ... this.
12894 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12895 (AM_CPPFLAGS): Renamed from ...
12896 (INCLUDE): ... this.
12897 * Makefile.in, testsuite/Makefile.in: Regenerate.
12898
81ecdfbb
RW
12899 * Makefile.in: Regenerate.
12900 * aclocal.m4: Likewise.
12901 * config.in: Likewise.
12902 * configure: Likewise.
12903 * testsuite/Makefile.in: Likewise.
12904
c462b41b
RW
12905 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12906 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12907 * Makefile.in: Regenerate.
12908 * testsuite/Makefile.in: Regenerate.
12909
2da73f13
CC
129102009-08-19 Cary Coutant <ccoutant@google.com>
12911
12912 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12913 symbols in shared libraries overridden by hidden or internal symbols
12914 in the main program.
12915
2db70501
CD
129162009-08-19 Chris Demetriou <cgd@google.com>
12917
12918 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12919 checking source file names in error messages.
12920
f733487b
DK
129212009-08-18 Doug Kwan <dougkwan@google.com>
12922
12923 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12924 an elcpp::Ehdr as parameter. Adjust call to set_target.
12925 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12926 an elfcpp::Ehdr as parameter.
12927 * object.cc (Object::set_target): Remove the version that looks up
12928 a target and sets it.
12929 (Sized_relobj::setup): Take a Target object instead of
12930 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12931 (make_elf_sized_object): Find target and ask target to
12932 make an ELF object.
12933 * object.h: (Object::set_target): Remove the version that looks up
12934 a target and sets it.
12935 (Sized_relobj::setup): Take a Target object instead of
12936 an elfcpp:Ehdr as parameter.
12937 * target.cc: Include dynobj.h.
12938 (Target::do_make_elf_object_implementation): New.
2e702c99 12939 (Target::do_make_elf_object): New.
f733487b
DK
12940 * target.h (Target::make_elf_object): New template declaration.
12941 (Target::do_make_elf_object): New method declarations.
12942 (Target::do_make_elf_object_implementation): New template declaration.
12943
cc70f101
ILT
129442009-08-14 Ian Lance Taylor <iant@google.com>
12945
12946 * gold.h (FUNCTION_NAME): Define.
12947 (gold_unreachable): Use FUNCTION_NAME.
12948
ef5e0cb1
ST
129492009-08-12 Sriraman Tallam <tmsriram@google.com>
12950
12951 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12952 symbol in the --keep-unique list is not found.
12953
48c187ce
ST
129542009-08-12 Sriraman Tallam <tmsriram@google.com>
12955
12956 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12957 been maked as --keep-unique.
12958 (Icf::unfold_section): New function.
12959 * icf.h (Icf::unfold_section): New function.
12960 * options.h (General_options::keep_unique): New option.
12961 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12962 * testsuite/Makefile.in: Regenerate.
12963 * testsuite/icf_keep_unique_test.sh: New file.
12964 * testsuite/icf_keep_unique_test.cc: New file.
12965
645afe0c
CC
129662009-08-12 Cary Coutant <ccoutant@google.com>
12967
12968 PR 10471
12969 * resolve.cc (Symbol_table::resolve): Check for references from
12970 dynamic objects to hidden and internal symbols.
12971 * testsuite/Makefile.am (hidden_test.sh): New test.
12972 * testsuite/Makefile.in: Regenerate.
12973 * testsuite/hidden_test.sh: New script.
12974 * testsuite/hidden_test_1.c: New test source.
12975 * testsuite/hidden_test_main.c: New test source.
12976
11af873f
DK
129772009-08-11 Doug Kwan <dougkwan@google.com>
12978
12979 * arm.cc: Update comments.
12980 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12981 segment to locate the .ARM.exidx section if present.
12982
b9f7d72d
DK
129832009-08-09 Doug Kwan <dougkwan@google.com>
12984
12985 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12986 patch.
12987
ddd3c53c
ST
129882009-08-07 Sriraman Tallam <tmsriram@google.com>
12989 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12990 compiler warnings.
12991
27721062
ST
129922009-08-06 Sriraman Tallam <tmsriram@google.com>
12993
12994 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12995 valid tls_segment only for non-debug-section relocations.
12996 * testsuite/Makefile.am: Add gc_tls_test.
12997 * testsuite/Makefile.in: Regenerate.
12998 * testsuite/gc_tls_test.cc: New file.
12999 * testsuite/gc_tls_test.sh: New file.
13000
ef15dade 130012009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13002
ef15dade
ST
13003 * icf.cc: New file.
13004 * icf.h: New file.
13005 * Makefile.am (CCFILES): Add icf.cc.
13006 (HFILES): Add icf.h
13007 * Makefile.in: Regenerate.
13008 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13009 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13010 section, symbol and addend information for the relocs.
13011 * gold.cc (queue_middle_tasks): Call identical code folding.
13012 * gold.h: Add defines for multimap.
13013 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13014 to the call of finalize_local_symbols.
13015 * main.cc (main): Create object of class Icf.
13016 * object.cc (Sized_relobj::do_layout): Allow this function to be
13017 called twice during icf.
13018 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13019 to sections marked as identical by icf.
13020 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13021 when available.
13022 (Sized_relobj::do_section_entsize): New function.
13023 * object.h (Object::section_entsize): New function.
13024 (Object::do_section_entsize): New pure virtual function.
13025 (Relobj::finalize_local_symbols): Add new parameter.
13026 (Relobj::do_section_entsize): New function.
13027 * options.h (General_options::icf): New option.
13028 (General_options::icf_iterations): New option.
13029 (General_options::print_icf_sections): New option.
13030 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13031 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13032 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13033 icf.
13034 * symtab.cc (Symbol_table::is_section_folded): New function.
13035 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13036 to sections marked as identical by icf.
13037 * symtab.h (Symbol_table::set_icf): New function.
13038 (Symbol_table::icf): New function.
13039 (Symbol_table::is_section_folded): New function.
13040 (Symbol_table::icf_): New data member.
13041 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13042 * testsuite/Makefile.am: Add commands to build icf_test.
13043 * testsuite/Makefile.in: Regenerate.
13044 * testsuite/icf_test.sh: New file.
13045 * testsuite/icf_test.cc: New file.
13046
c3b65ac4
CD
130472009-07-24 Chris Demetriou <cgd@google.com>
13048
13049 * layout.cc (is_compressible_debug_section): Fix incorrect
13050 comment about compressed section names.
13051
1caf2c51
ILT
130522009-07-20 Ian Lance Taylor <ian@airs.com>
13053
13054 PR 10419
13055 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13056
1ef4d87f
ILT
130572009-07-16 Ian Lance Taylor <iant@google.com>
13058
13059 PR 10400
13060 * layout.h: #include <map>.
13061 (class Kept_section): Change from struct to class. Add accessors
13062 and setters. Add section size to Comdat_group mapping. Change
13063 Comdat_group to std::map. Add is_comdat_ field. Add
13064 linkonce_size field in union.
13065 (class Layout): Update declaration of find_or_add_kept_section.
13066 Don't declare find_kept_object.
13067 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13068 parameter. Add object, shndx, is_comdat, and is_group_name
13069 parameters. Change all callers. Adjust for new Kept_section.
13070 (Layout::find_kept_object): Remove.
13071 * object.cc (Sized_relobj::include_section_group): Update use of
13072 Kept_section. Rename secnum to shndx. Only record
13073 Kept_comdat_section if sections are the same size.
13074 (Sized_relobj::include_linkonce_section): Update use of
13075 Kept_section. Only record Kept_comdat_section if sections are the
13076 same size. Set size of linkonce section.
13077 (Sized_relobj::map_to_kept_section): Update call to
13078 get_kept_comdat_section.
13079 * object.h (class Sized_relobj): Rename fields in
13080 Kept_comdat_section to drop trailing underscores; change object
13081 field to Relobj*. Change Kept_comdat_section_table to store
13082 struct rather than pointer.
13083 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13084 Add kept_object and kept_shndx parameters. Change all callers.
13085 (Sized_relobj::get_kept_comdat_section): Change return type to
13086 bool. Add kept_object and kept_shndx parameters. Change all
13087 callers.
13088 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13089 Layout::find_or_add_kept_section.
13090
37c3b7b0
ILT
130912009-07-09 Ian Lance Taylor <iant@google.com>
13092
13093 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13094 Reserve space in the hash table.
13095
98fa85cb
ILT
130962009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13097
13098 * fileread.cc (File_read::get_mtime): New method.
13099 * fileread.h (Timespec): New structure.
13100 (File_read::get_mtime): New method.
13101 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13102 Renamed from timestamp_nsec.
13103 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13104 Elf_Xword.
e1df38aa 13105 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13106 timestamp_nsec.
e1df38aa 13107 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13108 (Incremental_inputs::report_obejct): Save mtime; style fix.
13109 (Incremental_inputs::report_script): Save mtime; style fix.
13110 (Incremental_inputs::finalize_inputs): Style fix.
13111 (Incremental_inputs::finalize): Style fix.
13112 (Incremental_inputs::create_input_section_data): Store inputs
13113 mtime.
13114 * incremental.h (Incremental_inputs::report_script): Add mtime
13115 argument.
13116 (Incremental_inputs::Input_info::Input_info): Intialize only one
13117 union member.
13118 (Incremental_inputs::Input_info::archive): Move to nameless
13119 union.
13120 (Incremental_inputs::Input_info::obejct): Move to nameless union.
13121 (Incremental_inputs::Input_info::script): Move to nameless union.
13122 (Incremental_inputs::mtime): New field.
13123 * script.cc (read_input_script): Pass file mtime to
13124 Incremental_input.
13125 * script.h (Script_info::inputs): Style fix.
13126
c9d70757
ILT
131272009-07-01 Ian Lance Taylor <ian@airs.com>
13128
13129 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
13130 instead of 32.
13131
9c547ec3
ILT
131322009-06-24 Ian Lance Taylor <iant@google.com>
13133
13134 PR 10156
13135 * layout.cc (Layout::choose_output_section): If we find an
13136 existing section, update the flags.
13137 (Layout::create_notes): New function, broken out of
13138 Layout::finalize.
13139 (Layout::finalize): Don't create note sections.
13140 (Layout::create_note): Don't crash if linker script discards
13141 section.
13142 (Layout::create_gold_note): Likewise.
13143 (Layout::create_build_id): Likewise. Don't set
13144 after_input_sections on the section.
13145 (Layout::create_executable_stack_info): Remove target parameter.
13146 Change caller.
13147 * layout.h (class Layout): Declare create_notes. Update
13148 declaration of create_executable_stack_info.
13149 * gold.cc (queue_middle_tasks): Call create_notes.
13150 * output.cc (Output_section::update_flags_for_input_section): Move
13151 here from output.h. If SHF_ALLOC flag is newly set, mark address
13152 invalid.
13153 * output.h (Output_data::mark_address_invalid): New function.
13154 (class Output_section): Only declare, not define,
13155 update_flags_for_input_section. Remove set_flags.
13156
55458500
ILT
131572009-06-24 Ian Lance Taylor <iant@google.com>
13158
13159 * script-sections.cc (Output_section_definition::
13160 set_section_addresses): Rename shadowing local load_address to
13161 laddr.
13162
1307d6cd
ILT
131632009-06-24 Ian Lance Taylor <iant@google.com>
13164
13165 PR 10244
13166 * reloc.cc (relocate_sections): Skip empty relocation sections.
13167
ec3f783e
ILT
131682009-06-23 Ian Lance Taylor <iant@google.com>
13169
13170 PR 10156
13171 * layout.cc (Layout::create_note): Use choose_output_section
13172 rather than make_output_section.
13173
459c9f1c
ILT
131742009-06-23 Ian Lance Taylor <iant@google.com>
13175
13176 PR 10237
13177 * options.cc (General_options::parse_V): Set printed_version_.
13178 (General_options::General_options): Initialize printed_version_.
13179 * options.h (class General_options): Add printed_version_ field.
13180 * gold.cc (queue_initial_tasks): If there are no input files,
13181 don't give a fatal error if we printed the version information.
13182 (queue_middle_tasks): If using -r with a shared object, give a
13183 fatal error rather than an ordinary error.
13184
1518dc8f
ILT
131852009-06-23 Ian Lance Taylor <iant@google.com>
13186
13187 PR 10219
13188 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
13189 (Layout::make_output_section): Set have_stabstr_section_ if we see
13190 a .stab*str section.
13191 (Layout::finalize): Call link_stabs_sections.
13192 (Layout::link_stabs_sections): New file.
13193 * layout.h (class Layout): Add have_stabstr_section_ field.
13194 Declare link_stabs_sections.
13195
3d857b98
DK
131962009-06-23 Doug Kwan <dougkwan@google.com>
13197
13198 * Makefile.am (libgold_a_LIBADD): New.
13199 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 13200 * Makefile.in: Regenerate.
3d857b98
DK
13201 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
13202 * configure: Regenerate.
13203 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
13204 * fileread.cc: Include sys/state.h
13205 * gold.h: Declare memmem and strndup if found missing.
13206 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
13207
0639a6f6
ILT
132082009-06-23 Ian Lance Taylor <iant@google.com>
13209
13210 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
13211 * configure: Rebuild.
13212
8d63875c
ILT
132132009-06-23 Ian Lance Taylor <iant@google.com>
13214
13215 PR 10147
13216 * object.cc (Object::section_contents): Don't try to get a view if
13217 the section has length zero.
13218 (Object::handle_gnu_warning_section): If the section is empty, use
13219 the name of the section as the warning.
13220
f7c8a183
ILT
132212009-06-23 Ian Lance Taylor <iant@google.com>
13222
13223 PR 10133
13224 * stringpool.h (class Stringpool_template): Add optimize_ field.
13225 (Stringpool_template::set_optimize): New function.
13226 * stringpool.cc (Stringpool_template::Stringpool_template):
13227 Initialize optimize_ field.
13228 (Stringpool_template::set_string_offsets): Test local optimize
13229 fild rather than parameter.
13230 * layout.cc (Layout::Layout): Call set_optimize on the section
13231 name stringpool.
13232
e6a307ba
ILT
132332009-06-22 Ian Lance Taylor <iant@google.com>
13234
13235 PR 10030
13236 * yyscript.y: Parse TARGET.
13237 * script.cc (script_set_target): New function.
13238 * script-c.h (script_set_target): Declare.
13239 * options.cc (General_options::string_to_object_format): Rename
13240 from string_to_object_format in anonymous namespace. Change
13241 callers.
13242 * options.h (class General_options): Declare
13243 string_to_object_format.
13244
3ee173de
ILT
132452009-06-22 Ian Lance Taylor <iant@google.com>
13246
13247 * script-sections.cc (Script_sections::create_segments): Don't put
13248 program headers in a PT_LOAD segment if -n or -N.
13249
132502009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
13251
13252 PR 10141
13253 * options.h (class General_options): Add -z lazy and -z now. Sort
13254 -z options into alphabetical order.
13255 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
13256
cd6739a1 132572009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
13258
13259 * layout.cc (Layout::make_output_section): Call
13260 Target::new_output_section.
13261 (Layout::attach_allocated_section_to_segment): Put large section
13262 sections in a separate load segment with the large segment flag
13263 set.
13264 (Layout::segment_precedes): Sort large data segments after other
13265 load segments.
13266 (align_file_offset): New static function.
13267 (Layout::set_segment_offsets): Use align_file_offset.
13268 * output.h (class Output_section): Add is_small_section_ and
13269 is_large_section_ fields.
13270 (Output_section::is_small_section): New function.
13271 (Output_section::set_is_small_section): New function.
13272 (Output_section::is_large_section): New function.
13273 (Output_section::set_is_large_section): New function.
13274 (Output_section::is_large_data_section): New function.
13275 (class Output_segment): Add is_large_data_segment_ field.
13276 (Output_segment::is_large_data_segment): New function.
13277 (Output_segment::set_is_large_data_segment): New function.
13278 * output.cc (Output_section::Output_section): Initialize new
13279 fields.
13280 (Output_segment::Output_segment): Likewise.
13281 (Output_segment::add_output_section): Add assertion that large
13282 data sections always go in large data segments. Force small data
13283 sections to the end of the list of data sections. Force small BSS
13284 sections to the start of the list of BSS sections. For large BSS
13285 sections to the end of the list of BSS sections.
13286 * symtab.h (class Symbol): Declare is_common_shndx.
13287 (Symbol::is_defined): Check Symbol::is_common_shndx.
13288 (Symbol::is_common): Likewise.
13289 (class Symbol_table): Define enum Commons_section_type. Update
13290 declarations. Add small_commons_ and large_commons_ fields.
13291 * symtab.cc (Symbol::is_common_shndx): New function.
13292 (Symbol_table::Symbol_table): Initialize new fields.
13293 (Symbol_table::add_from_object): Put small and large common
13294 symbols in the right list.
13295 (Symbol_table::sized_finalized_symbol): Check
13296 Symbol::is_common_shndx.
13297 (Symbol_table::sized_write_globals): Likewise.
13298 * common.cc (Symbol_table::do_allocate_commons): Allocate new
13299 common symbol lists. Don't call do_allocate_commons_list if the
13300 list is empty.
13301 (Symbol_table::do_allocate_commons_list): Remove is_tls
13302 parameter. Add comons_section_type parameter. Change all
13303 callers. Handle small and large common symbols.
13304 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
13305 Symbol::is_common_shndx.
13306 * resolve.cc (symbol_to_bits): Likewise.
13307 * target.h (Target::small_common_shndx): New function.
13308 (Target::small_common_section_flags): New function.
13309 (Target::large_common_shndx): New function.
13310 (Target::large_common_section_flags): New function.
13311 (Target::new_output_section): New function.
13312 (Target::Target_info): Add small_common_shndx, large_common_shndx,
13313 small_common_section_flags, and large_common_section_flags
13314 fields.
13315 (Target::do_new_output_section): New virtual function.
13316 * arm.cc (Target_arm::arm_info): Initialize new fields.
13317 * i386.cc (Target_i386::i386_info): Likewise.
13318 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
13319 Likewise.
13320 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
13321 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13322 (Target_x86_64::do_new_output_section): New function.
13323 * configure.ac: Define conditional MCMODEL_MEDIUM.
13324 * testsuite/Makefile.am (check_PROGRAMS): Add large.
13325 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
13326 (large_LDFLAGS): Define.
13327 * testsuite/large.c: New file.
13328 * testsuite/testfile.cc (Target_test::test_target_info):
13329 Initialize new fields.
13330 * configure, testsuite/Makefile.in: Rebuild.
13331
bb04269c
DK
133322009-06-05 Doug Kwan <dougkwan@google.com>
13333
13334 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 13335 * Makefile.in: Regenerate.
bb04269c
DK
13336 * i386.cc (class Target_i386): Define new virtual method to
13337 override do_is_local_label_name in parent.
13338 * object.cc (Sized_relobj::do_count_local_symbols): Discard
13339 local symbols if --discard-locals or -X is given.
13340 * options.h (class General_options): Declare new options
13341 '--discard-locals' and '-X' for discarding locals.
13342 * target.h (class Target): Define new methods is_local_label_name.
13343 Declare new virtual method do_is_local_label_name.
13344 * target.cc: New file.
13345 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13346 (check_SCRIPTS): Add discard_locals_test.sh.
13347 (check_DATA): Add discard_local_tests.syms.
13348 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13349 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13350 * testsuite/Makefile.in: Regenerate.
13351 * testsuite/discard_locals_test.c: New file.
13352 * testsuite/discard_locals_test.sh: Same.
13353
805bb01c
DK
133542009-06-05 Doug Kwan <dougkwan@google.com>
13355
13356 * object.cc (Sized_relobj::Sized_relobj): Initialize
13357 discarded_eh_frame_shndx_ to -1U.
13358 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13359 section.
13360 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13361 a discarded .eh_frame section.
13362 (Sized_relobj::do_finalize_local_symbols): Ditto.
13363 * object.h (class Sized_relobj): Declare new member
13364 discarded_eh_frame_shndx_.
13365 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13366 (local_labels_test.o, local_labels_test): New rules.
13367 * testsuite/Makefile.in: Regenerate.
13368
1dcd334d
DK
133692009-06-04 Doug Kwan <dougkwan@google.com>
13370
13371 * layout.cc (Layout::section_name_mapping): Add mapping for
13372 special ARM sections.
13373
96d49306
DK
133742009-06-03 Doug Kwan <dougkwan@google.com>
13375
13376 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13377 (utils::has_overflow): Same.
13378
dff16297
ILT
133792009-06-03 Ian Lance Taylor <iant@google.com>
13380
13381 * layout.cc (Layout::section_name_mapping): New array, replacing
13382 Layout::linkonce_mapping.
13383 (Layout::section_name_mapping_count): New variable, replacing
13384 Layout::linkonce_mapping_count.
13385 (Layout::linkonce_output_name): Remove.
13386 (Layout::output_section_name): Rewrite.
13387 * layout.h (class Layout): Rename Linkonce_mapping to
13388 Section_name_mapping, linkonce_mapping to section_name_mapping,
13389 linkonce_mapping_count to section_name_mapping_count. Don't
13390 declare linkonce_output_name.
13391
c121c671
DK
133922009-06-03 Doug Kwan <dougkwan@google.com>
13393
13394 * gold/arm.cc (namespace utils): New.
13395 (Target_arm::reloc_is_non_pic): Define new method.
13396 (class Arm_relocate_functions): New.
13397 (Target_arm::Relocate::relocate): Handle relocation types used by
13398 Android.
13399
07800fab
ILT
134002009-06-03 Ian Lance Taylor <iant@google.com>
13401
13402 * arm.cc (Target_arm::scan::global): Use || instead of |.
13403
c121c671
DK
134042009-06-02 Doug Kwan <dougkwan@google.com>
13405
13406 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13407 issued_non_pic_error_.
13408 (class Target_arm::Scan): Declare new method check_non_pic.
13409 Define new method symbol_needs_plt_entry.
13410 Declare new data member issued_non_pic_error_.
13411 (class Target_arm::Relocate): Declare new method
13412 should_apply_static_reloc.
13413 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13414 (Target_arm::Scan::check_non_pic): Define new method.
13415 (Target_arm::Scan::local): Handle a small subset of reloc types used
13416 by Android.
13417 (Target_arm::Scan::local): Same.
13418 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13419
b19b0c6d
ILT
134202009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13421
13422 * incremental.cc (Incremental_inputs::report_command_line): Filter
13423 out --incremental-* options.
13424
94cdfcff
DK
134252009-05-29 Doug Kwan <dougkwan@google.com>
13426
13427 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13428 template class.
13429 (class Target_arm): Update comment.
13430 (Target_arm::Target_arm): Initialize new data members GOT_,
13431 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13432 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13433 and Target_arm::rel_dyn_section.
13434 Declare new_enum Target_arm::Got_type.
13435 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13436 and DYNBSS_.
13437 Update commments for member do_dynsym_value.
13438 (Target_arm::got_size, Target_arm::plt_section,
13439 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13440 new methods inside class defintion.
13441 (Target_arm::got_section): Define new method.
13442 (Target_arm::rel_dyn_section): Same.
13443 (Output_data_plt_arm): New template class.
13444 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13445 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13446 (Output_data_plt_arm::add_entry): Same.
13447 (Output_data_plt_arm::first_plt_entry): Define new
13448 static data member for PLT instruction template.
13449 (Output_data_plt_arm::plt_entry): Same.
13450 (Output_data_plt_arm::do_write): Define new method.
13451 (Target_arm::make_plt_entry): Same.
13452 (Target_arm::do_finalize_sections): Same.
13453 (Target_arm::do_dynsym_value): Same.
13454
4a657b0d
DK
134552009-05-28 Doug Kwan <dougkwan@google.com>
13456
13457 * Makefile.am (TARGETSOURCES): Add arm.cc.
13458 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13459 * Makefile.in: Regenerate.
13460 * arm.cc: New file.
13461 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13462
e7ae8c36
DK
134632009-05-26 Doug Kwan <dougkwan@google.com>
13464
13465 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13466 (General_options::check_excluded_libs): Strip off directories in
13467 archive name before matching like GNU ld does.
13468 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13469 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13470 (exclude_libs_test_LDFLAGS): Add linker option
13471 -Wl,--exclude-libs,libexclude_libs_test_3
13472 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13473 an explicit archive without using -l.
13474 (alt/libexclude_libs_test_3.a): New make rule.
13475 * testsuite/Makefile.in: Regenerate.
13476 * testsuite/exclude_libs_test.c : Declare lib3_default().
13477 (main): Call it.
13478 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13479 * exclude_libs_test_3.c: New file.
13480
f12e7348
NC
134812009-05-26 Nick Clifton <nickc@redhat.com>
13482
13483 * po/id.po: New Indonesian translation.
13484 * po/gold.pot: Updated template file.
13485
4daadc0d
ST
134862009-05-22 Sriraman Tallam <tmsriram@google.com>
13487
e1df38aa 13488 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13489 gc_comdat_test files. Add -Wl,--gc-sections to build
13490 gc_comdat_test.
13491 * testsuite/Makefile.in: Regenerate.
13492 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13493
531813ad
ST
134942009-05-21 Sriraman Tallam <tmsriram@google.com>
13495
13496 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13497 kept comdat section was garbage collected.
13498 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13499 * testsuite/Makefile.in: Regenerate.
13500 * testsuite/gc_comdat_test.sh: New file.
13501 * testsuite/gc_comdat_test_1.cc: New file.
13502 * testsuite/gc_comdat_test_2.cc: New file.
13503
65514900
CC
135042009-05-19 Doug Kwan <dougkwan@google.com>
13505
13506 * archive.cc (Archive::Archive): Move constructor from archive.h
13507 to here. Initialize no_export_.
13508 (Archive::get_elf_object_for_member): Set no_export flag of object.
13509 * archive.h (Archive::Archive): Move constructor body to
13510 archive.cc.
13511 (Archive::no_export): New method.
13512 (Archive::no_export_): New field.
13513 * object.h (Object::Object): Initialize no_export_ to false.
13514 (Object::no_export, Object::set_no_export): New methods.
13515 (Object::no_export_): New field.
13516 * options.cc (General_options::parse_exclude_libs): New method.
13517 (General_options::check_excluded_libs) Same.
13518 * options.h (exclude_libs): New option.
13519 (General_options::check_excluded_libs): New method declaration.
13520 (General_options::excluded_libs_): New field.
13521 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13522 default or protected visibility if an object has no-export flag set.
13523 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13524 (check_SCRIPTS): Add exclude_libs_test.sh.
13525 (check_DATA): Add exclude_libs_test.syms.
13526 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13527 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13528 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13529 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13530 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13531 libexclude_libs_test_2.a): New rules.
13532 * testsuite/Makefile.in: Regenerate.
13533 * testsuite/exclude_libs_test.c: New file.
13534 * testsuite/exclude_libs_test.sh: Ditto.
13535 * testsuite/exclude_libs_test_1.c: Ditto.
13536 * testsuite/exclude_libs_test_2.c: Ditto.
13537
1b77ea50
ILT
135382009-05-15 Ian Lance Taylor <iant@google.com>
13539
13540 * configure.ac: Check for declarations for cases where libiberty.h
13541 checks HAVE_DECL_xxx.
13542 * configure, config.in: Rebuild.
13543
072fe7ce
ILT
135442009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13545
13546 * gold.h (Incremental_argument_list): Remove (invalid) forward
13547 declaration.
13548 * incremental.cc (Incremental_inputs::report_achive): New method.
13549 (Incremental_inputs::report_object): New method.
13550 (Incremental_inputs::report_script): New method.
13551 (Incremental_inputs::finalize_inputs): New method.
13552 (Incremental_inputs::finalize): Call finalize_inputs().
13553 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13554 Create inputs entries.
13555 * incremental.h (Incremental_input_type): New enum.
13556 (Incremental_inputs::Incremental_input): Initialize new fields.
13557 (Incremental_inputs::report_inputs): New method.
13558 (Incremental_inputs::report_achive): New method.
13559 (Incremental_inputs::report_object): New method.
13560 (Incremental_inputs::report_script): New method.
13561 (Incremental_inputs::finalize_inputs): New method.
13562 (Incremental_inputs::Input_info): New struct.
13563 (Incremental_inputs::Input_info_map): New typedef.
13564 (Incremental_inputs::lock_): New field.
13565 (Incremental_inputs::Inputs_): New field.
13566 (Incremental_inputs::Inputs_map): New field.
13567 * main.cc (main): Call Incremental_input::report_inputs.
13568 * options.h (Input_argument_list): Typedef moved from
13569 Input_arguments.
13570 (Input_file_group::Files): Remove, use ::Input_argument_list.
13571 (Input_file_group::Input_argument_list): Remove, use
13572 ::Input_argument_list.
13573 * plugin.cc (Plugin_manager::add_input_file): Add error in
13574 incremental build.
13575 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13576 functions.
13577 * script.cc (read_input_script): Call
13578 Incremental_input::report_script.
13579 * script.h (Script_info): New class.
13580
b0481b0b
ILT
135812009-04-27 Ian Lance Taylor <iant@google.com>
13582
13583 * x86_64.cc (do_adjust_output_section): Set entsize to
13584 plt_entry_size.
13585
b22a5a41 135862009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13587
13588 * output.cc (Output_file::close): After short writes, continue
13589 writing from the correct offset in the buffer being written.
13590
40fde488
CD
135912009-04-23 Chris Demetriou <cgd@google.com>
13592
13593 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13594 * configure: Regenerate.
13595 * config.in: Regenerate.
13596 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13597 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13598
3ce2c28e
ILT
135992009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13600
13601 * incremental.cc (Incremental_inputs_header_data): Renamed from
13602 Incremental_input_header_data.
13603 (Incremental_inputs_header_data::data_size): New field.
13604 (Incremental_inputs_header_data::put_input_file_count): Renamed
13605 from input_file_count.
13606 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13607 from command_line_offset.
13608 (Incremental_inputs_header_data::put_reserved): Renamed from
13609 put_reserved.
13610 (Incremental_inputs_entry_data): Renamed from
13611 Incremental_input_entry_data.
13612 (Incremental_inputs_entry_data::data_size): New field.
13613 (Incremental_inputs::report_command_line): New method.
13614 (Incremental_inputs::finalize): New method.
13615 (Incremental_inputs::create_incremental_inputs_data): New method.
13616 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13617 * incremental.h: New file.
13618 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13619 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13620 incremental builds.
703d02da 13621 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13622 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13623 (Layout::create_incremental_info_sections): New method.
13624 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13625 * main.cc (main): Notify Incremental_input of the command line.
13626
e55bde5e
ILT
136272009-04-01 Ian Lance Taylor <iant@google.com>
13628 Mikolaj Zalewski <mikolajz@google.com>
13629
13630 * gold.h (reserve_unordered_map): Define, three versions, one for
13631 each version of Unordered_map.
13632 * layout.cc (Layout::Layout): Remove options parameter. Add
13633 number_of_input_files parameter. Don't initialize options_.
13634 Initialize number_of_input_files_ and resized_signatures_. Move
13635 sections_are_attached_.
13636 (Layout::layout_group): Reserve space for group_signatures_.
13637 (Layout::find_or_add_kept_section): Change name parameter to be a
13638 reference. Resize signatures_ map when it gets large enough.
13639 (Layout::layout_eh_frame): Use parameters->options() instead of
13640 this->options_.
13641 (Layout::make_output_section): Likewise.
13642 (Layout::attach_allocated_section_to_segment): Likewise.
13643 (Layout::finalize, Layout::create_executable_stack): Likewise.
13644 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13645 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13646 * layout.h (class Layout): Update declarations. Remove options_
13647 field. Add number_of_input_files_ and resized_signatures_
13648 fields. Move sections_are_attached_ field.
13649 * main.cc (main): Pass number of input files to Layout
13650 constructor. Don't pass options.
13651
154b857c
ILT
136522009-03-30 Ian Lance Taylor <iant@google.com>
13653
13654 * ffsll.c (ffsll): Correct implementation.
13655
2f35ab9b
ILT
136562009-03-27 Ian Lance Taylor <iant@google.com>
13657
fd03461a
ILT
13658 * ffsll.c: New file.
13659 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13660 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13661 * ftruncate.c (ftruncate): Declare before definition.
13662 * mremap.c (mremap): Likewise.
13663 * pread.c (pread): Likewise.
13664 * configure, Makefile.in, config.in: Rebuild.
13665
2f35ab9b
ILT
13666 * mremap.c: New file.
13667 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13668 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13669 (mremap): Declare if HAVE_MREMAP is not defined.
13670 * configure, Makefile.in, config.in: Rebuild.
13671
33aea2fd
CC
136722009-03-27 Cary Coutant <ccoutant@google.com>
13673
13674 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13675 position independent.
13676 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13677 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13678
6d479619
CC
136792009-03-24 Cary Coutant <ccoutant@google.com>
13680
13681 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13682 an executable.
13683 (needs_dynamic_reloc): Likewise.
13684
afc06bb8
ILT
136852009-03-24 Ian Lance Taylor <iant@google.com>
13686
13687 * yyscript.y (file_cmd): Recognize EXTERN.
13688 (extern_name_list, extern_name_list_body): New nonterminals.
13689 * script.cc (script_add_extern): Define.
13690 * script-c.h (script_add_extern): Declare.
13691
f6060a4d
ILT
136922009-03-24 Rafael Avila de Espindola <espindola@google.com>
13693
13694 * object.cc (is_elf_object): Define.
13695 * object.h (is_elf_object): Declare.
13696 * archive.cc (Archive::get_elf_object_for_member): Call
13697 is_elf_object.
33aea2fd 13698 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13699
26736d8e
ILT
137002009-03-24 Elliott Hughes <enh@google.com>
13701
13702 * output.cc (Output_file::map_anonymous): Define.
13703 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13704 try an anonymous one. Report the size if the mmap fails.
13705 * output.h (class Output_file): Declare map_anonymous.
13706
22fd9730
ILT
137072009-03-24 Ian Lance Taylor <iant@google.com>
13708
13709 * target-select.cc (instantiate_target): Don't acquire the lock if
13710 the instantiated_target_ field has already been set.
13711
cb010894
ILT
137122009-03-23 Ian Lance Taylor <iant@google.com>
13713
7f055c20
ILT
13714 * gold-threads.h (class Initialize_lock): Define.
13715 * gold-threads.cc (class Initialize_lock_once): Define.
13716 (initialize_lock_control): New static variable.
13717 (initialize_lock_pointer): New static variable.
13718 (initialize_lock_once): New static function.
13719 (Initialize_lock::Initialize_lock): Define.
13720 (Initialize_lock::initialize): Define.
13721 * target-select.h: Include "gold-threads.h".
13722 (class Target_selector): Add lock_ and initialize_lock_ fields.
13723 Don't define instantiate_target, just declare it.
13724 * target-select.cc (Target_selector::Target_selector): Initialize
13725 new fields.
13726 (Target_selector::instantiate_target): Define.
13727 * descriptors.h: Include "gold-threads.h".
13728 (class Descriptors): Add initialize_lock_ field.
13729 * descriptors.cc (Descriptors::Descriptors): Initialize new
13730 field.
13731 (Descriptors::open): Use initialize_lock_ field
13732 * errors.h (class Errors): Add initialize_lock_ field.
13733 * errors.cc (Errors::Errors): Initialize new field.
13734 (Errors::initialize_lock): Use initialize_lock_ field.
13735 * powerpc.cc (class Target_selector_powerpc): Remove
13736 instantiated_target_ field. In do_recognize call
13737 instantiate_target rather than do_instantiate_target. In
13738 do_instantiate_target just allocate a new target.
13739 * sparc.cc (class Target_selector_sparc): Likewise.
13740
36959681
ILT
13741 * freebsd.h: New file.
13742 * i386.cc: Include "freebsd.h".
13743 (Target_i386): Derive from Target_freebsd rather than
13744 Sized_target.
13745 (Target_selector_i386): Derive from Target_selector_freebsd rather
13746 than Target_selector.
13747 * x86_64.cc: Include "freebsd.h".
13748 (Target_x86_64): Derive from Target_freebsd rather than
13749 Sized_target.
13750 (Target_selector_x86_64): Derive from Target_selector_freebsd
13751 rather than Target_selector.
13752 * target.h (class Target): Add adjust_elf_header and
13753 do_adjust_elf_header.
13754 * output.cc (Output_file_header:: do_sized_write): Call target
13755 adjust_elf_header routine.
13756 * configure.tgt: Set targ_osabi.
13757 * configure.ac: Define GOLD_DEFAULT_OSABI.
13758 * parameters.cc (Parameters::default_target): Pass
13759 GOLD_DEFAULT_OSABI to select_target.
13760 * target-select.h (class Target_selector): Make instantiate_target
13761 protected rather than private.
13762 * Makefile.am (HFILES): Add freebsd.h.
13763 * configure, Makefile.in, config.in: Rebuild.
13764
cb010894
ILT
13765 * merge.cc (do_add_input_section): Correct pend value. Change
13766 message about last entry not being null terminated from error to
13767 warning.
13768
0e879927
ILT
137692009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13770
13771 * incremental.cc: New file.
13772 * Makefile.am (CCFILES): Add incremental.cc.
13773 * Makefile.in: Rebuild.
13774
41105937
PP
137752009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13776
13777 * layout.cc (Layout::output_section_name): Preserve names
13778 of '.note.' sections.
e1df38aa 13779
60439920
ILT
137802009-03-19 Ian Lance Taylor <iant@google.com>
13781
13782 * descriptors.cc (Descriptors::open): Check that the options are
13783 valid before using them.
13784
0d371ad3
ILT
137852009-03-18 Ian Lance Taylor <iant@google.com>
13786
13787 * script-sections.h: Include <list>.
13788 (class Script_sections): Change Sections_elements from std::vector
13789 to std::list. Typedef public Elements_iterator. Add
13790 orphan_section_placement_, data_segment_align_start_, and
13791 saw_data_segment_align_ fields. Remove data_segment_align_index_
13792 field.
13793 * script-sections.cc (class Orphan_section_placement): New class.
13794 (class Sections_element): Add virtual functions is_relro and
13795 orphan_section_init. Remove virtual function place_orphan_here.
13796 (class Output_section_definition): Add is_relro and
13797 orphan_section_init. Remove place_orphan_here.
13798 (class Orphan_output_section): Likewise.
13799 (Script_sections::Script_sections): Update for field changes.
13800 (Script_sections::data_segment_align): Set saw_data_segment_align_
13801 and data_segment_align_start_, not data_segment_align_index.
13802 (Script_sections::data_segment_relro_end): Check
13803 saw_data_segment_align_. Use data_segment_align_start_ rather
13804 than data_segment_align_index_.
13805 (Script_sections::place_orphan): Rewrite to use
13806 Orphan_section_placement.
13807
9201d894
ILT
138082009-03-17 Ian Lance Taylor <iant@google.com>
13809
9c5b8369
ILT
13810 * archive.cc (Archive::add_symbols): Check for a version attached
13811 to the symbol name in the archive map.
13812 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13813 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13814 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13815 (ver_test_11.a): New target.
13816 * testsuite/Makefile.in: Rebuild.
13817
9201d894
ILT
13818 * configure.ac: Check for chsize and posix_fallocate. Replace
13819 ftruncate.
13820 * ftruncate.c: New file, from gnulib.
13821 * output.cc (posix_fallocate): Define dummy version if not
13822 HAVE_POSIX_FALLOCATE.
13823 (Output_file::map): Call posix_fallocate rather than lseek and
13824 write.
13825 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13826 * configure, Makefile.in, config.in: Rebuild.
13827
ef4ab7a8 138282009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13829
ef4ab7a8
PP
13830 * layout.h (Layout::create_note): Add section_name parameter.
13831 * layout.cc (Layout::create_note): Likewise.
13832 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13833
8c500701
ILT
138342009-03-17 Ian Lance Taylor <iant@google.com>
13835
e85b18e1
ILT
13836 * descriptors.cc: Include "options.h".
13837 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13838 (Descriptors::open): Always use O_CLOEXEC when opening a new
13839 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13840 then set FD_CLOEXEC.
13841
9efe6174
ILT
13842 * sparc.cc (class Target_sparc): Add has_got_section.
13843 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13844 make sure we have a GOT section.
13845
13846 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13847 (Target_sparc::Scan::local): Likewise.
13848 (Target_sparc::Scan::global): Likewise.
13849 (Target_sparc::Relocate::relocate): Likewise.
13850 (Target_sparc::Relocate::relocate_tls): Likewise.
13851
8c500701
ILT
13852 * symtab.cc (Symbol_table::define_default_version): New function,
13853 broken out of add_from_object.
13854 (Symbol_table::add_from_object): Call define_default_version.
13855 (Symbol_table::define_special_symbol): Add resolve_oldsym
13856 parameter. Change all callers. If the version for a symbol comes
13857 from a version script, resolve it with the symbol with the same
13858 name with no version. Also add the symbol without a version if
13859 appropriate.
13860 (do_define_in_output_data): If resolving with oldsym, don't delete
13861 sym.
13862 (do_define_in_output_segment): Likewise.
13863 (do_define_as_constant): Likewise.
13864 * symtab.h (class Symbol_table): Update declarations.
13865
f1ed28fb
ILT
138662009-03-13 Ian Lance Taylor <iant@google.com>
13867
15f8229b
ILT
13868 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13869 (Read_symbols::requeue): New function.
13870 (Read_symbols::do_read_symbols): If make_elf_object fails because
13871 the target type is not configured, and the file was searched for,
13872 issue a warning and retry with the next directory.
13873 (Add_symbols::run): If the file has an incompatible format, and
13874 it was searched for, requeue the Read_symbols task. On error,
13875 release the object.
13876 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13877 dirindex parameter to constructor. Change all callers. Declare
13878 incompatible_warning and requeue.
13879 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13880 input_argument_ and input_group_ fields. Add them to
13881 constructor. Change all callers.
13882 (class Read_script): Add dirindex_ field. Add it to constructor.
13883 Change all callers.
13884 * archive.cc (Archive::setup): Remove input_objects parameter.
13885 Change all callers.
13886 (Archive::get_file_and_offset): Likewise.
13887 (Archive::read_all_symbols): Likewise.
13888 (Archive::read_symbols): Likewise.
13889 (Archive::get_elf_object_for_member): Remove input_objects
13890 parameter. Add punconfigured parameter. Change all callers.
13891 (Archive::add_symbols): Change return type to bool. Check return
13892 value of include_member.
13893 (Archive::include_all_members): Likewise.
13894 (Archive::include_member): Change return type to bool. Return
13895 false if first included object has incompatible target. Set
13896 included_member_ field.
13897 (Add_archive_symbols::run): If add_symbols returns false, requeue
13898 Read_symbols task.
13899 * archive.h (class Archive): Add included_member_ field.
13900 Initialize it in constructor. Add input_file and searched_for
13901 methods. Update declarations.
13902 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13903 input_argument_ fields. Add them to constructor. Change all
13904 callers.
13905 * script.cc: Include "target-select.h".
13906 (class Parser_closure): Add skip_on_incompatible_target_ and
13907 found_incompatible_target_ fields. Add
13908 skip_on_incompatible_target parameter to constructor. Change all
13909 callers. Add methods skip_on_incompatible_target,
13910 clear_skip_on_incompatible_target, found_incompatible_target, and
13911 set_found_incompatible_target.
13912 (read_input_script): Add dirindex parameter. Change all callers.
13913 If parser finds an incompatible target, requeue Read_symbols
13914 task.
13915 (script_set_symbol): Clear skip_on_incompatible_target in
13916 closure.
13917 (script_add_assertion, script_parse_option): Likewise.
13918 (script_start_sections, script_add_phdr): Likewise.
13919 (script_check_output_format): New function.
13920 * script.h (read_input_script): Update declaration.
13921 * script-c.h (script_check_output_format): Declare.
13922 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13923 (ignore_cmd): Remove OUTPUT_FORMAT.
13924 * fileread.cc (Input_file::Input_file): Add explicit this.
13925 (Input_file::will_search_for): New function.
13926 (Input_file::open): Add pindex parameter. Change all callers.
13927 * fileread.h (class Input_file): Add input_file_argument method.
13928 Declare will_search_for. Update declarations.
13929 * object.cc (make_elf_object): Add punconfigured parameter.
13930 Change all callers.
13931 * object.h (class Object): Make input_file public. Add
13932 searched_for method.
13933 (make_elf_object): Update declaration.
13934 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13935 restart search.
13936 * dirsearch.h (class Dirsearch): Update declaration.
13937 * options.h (class General_options): Add --warn-search-mismatch.
13938 * parameters.cc (Parameters::is_compatible_target): New function.
13939 * parameters.h (class Parameters): Declare is_compatible_target.
13940 * workqueue.cc (Workqueue::add_blocker): New function.
13941 * workqueue.h (class Workqueue): Declare add_blocker.
13942
f1ed28fb
ILT
13943 * fileread.cc (Input_file::open): Remove options parameter.
13944 Change all callers.
13945 (Input_file::open_binary): Likewise.
13946 * script.cc (read_input_script): Likewise.
13947 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13948 options parameter from constructor. Change all callers.
13949 (class Read_script): Likewise.
13950 * fileread.h (class Input_file): Update declarations.
13951 * script.h (read_input_script): Update declaration.
13952
34dd024a
NC
139532009-03-10 Nick Clifton <nickc@redhat.com>
13954
13955 * po/es.po: New Spanish translation.
13956
6d71b17c
CC
139572009-03-06 Cary Coutant <ccoutant@google.com>
13958
13959 * options.cc (parse_short_option): Keep dash_z from registering itself.
13960
031cdbed
ILT
139612009-03-03 Ian Lance Taylor <iant@google.com>
13962
13963 PR 9918
13964 * target-reloc.h (relocate_section): Pass output_section to
13965 relocate.
13966 * i386.cc (Target_i386::should_apply_static_reloc): Add
13967 output_section parameter. Change all callers.
13968 (Target_i386::Relocate::relocate): Add output_section parameter.
13969 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13970 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13971 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13972 * testsuite/two_file_shared.sh: New script.
13973 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13974 (check_DATA): Add two_file_shared.dbg.
13975 (two_file_shared.dbg): New target.
13976 * testsuite/Makefile.in: Rebuild.
13977
15d5fa16
ILT
139782009-03-01 Ian Lance Taylor <iant@google.com>
13979
13980 * configure.ac: Check for byteswap.h.
13981 * configure: Rebuild.
13982 * config.in: Rebuild.
13983
8a4c0b0d
ILT
139842009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13985
13986 * layout.cc (Layout::find_or_add_kept_section): New function.
13987 (Layout::add_comdat): Removed.
13988 * layout.h (struct Kept_section): Move out of class Layout.
13989 Remove trailing underscores from field names. Add group_sections
13990 field. Rename group_ field to is_group. Change all uses.
13991 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13992 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13993 comdat_groups_ field.
13994 (Sized_relobj::include_section_group): Use
13995 find_or_add_kept_section and Kept_section::group_sections.
13996 (Sized_relobj::include_linkonce_section): Likewise.
13997 * object.cc (class Sized_relobj): Don't define Comdat_group or
13998 Comdat_group_table. Remove find_comdat_group and
13999 add_comdat_group. Remove comdat_groups_ field.
14000 * plugin.cc (include_comdat_group): Use
14001 Layout::find_or_add_kept_section.
14002
b4ecf66b
ILT
140032009-02-28 Ian Lance Taylor <iant@google.com>
14004
14359ca0
ILT
14005 * README: --gc-sections and map files are now supported. Document
14006 some build requirements.
14007
b4ecf66b
ILT
14008 PR 6992
14009 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14010 relocatable link set the value of the section symbol to zero.
14011 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14012 relocatable link don't include the section address in the local
14013 symbol value.
14014
0602e05a
ILT
140152009-02-27 Ian Lance Taylor <iant@google.com>
14016
fd9d194f
ILT
14017 PR 6811
14018 * options.h (class Search_directory): Add is_system_directory.
14019 (class General_options): Declare is_in_system_directory.
14020 * options.cc (get_relative_sysroot): Make static.
14021 (get_default_sysroot): Make static.
14022 (General_optoins::is_in_system_directory): New function.
14023 * fileread.cc (Input_file::is_in_system_directory): New function.
14024 * fileread.h (class Input_file): Declare is_in_system_directory.
14025 * object.h (class Object): Add is_in_system_directory.
14026 (class Input_objects): Remove system_library_directory_ field.
14027 * object.cc (Input_objects::add_object): Don't set
14028 system_library_directory_.
14029 (input_objects::found_in_system_library_directory): Remove.
14030 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14031 parameter. Change all callers.
14032 (Symbol_table::sized_write_globals): Likewise.
14033 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14034 Call Object::is_in_system_directory.
14035 * symtab.h (class Symbol_table): Update declarations.
14036
61edd21f
ILT
14037 PR 5990
14038 * descriptors.h (Open_descriptor): Add is_on_stack field.
14039 * descriptors.cc (Descriptors::open): If the descriptor is on the
14040 top of the stack, remove it. Initialize is_on_stack field.
14041 (Descriptors::release): Only add pod to stack if it is not on the
14042 stack already.
14043 (Descriptors::close_some_descriptor): Clear stack_next and
14044 is_on_stack fields.
14045
e29e076a
ILT
14046 PR 7091
14047 * output.cc (Output_section::find_starting_output_address): Rename
14048 from starting_output_address; add PADDR parameter; change return
14049 type.
14050 * output.h (class Output_section): Declare
14051 find_starting_output_address instead of starting_output_address.
14052 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14053 section symbol for which we can't find a merge section.
14054
0602e05a
ILT
14055 PR 9836
14056 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14057 hidden or internal, force the symbol to be local.
14058 * resolve.cc (Symbol::override_visibility): Define.
14059 (Symbol::override_base): Use override_visibility.
14060 (Symbol_table::resolve): Likewise.
14061 (Symbol::override_base_with_special): Likewise.
14062 (Symbol_table::override_with_special): If the visibility is hidden
14063 or internal, force the symbol to be local.
14064 * symtab.h (class Symbol): Add set_visibility and
14065 override_visibility.
14066 * testsuite/ver_test_1.sh: New file.
14067 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14068 (check_DATA): Add ver_test_1.syms.
14069 (ver_test_1.syms): New target.
14070 * testsuite/Makefile.in: Rebuild.
14071
401a9a73
CC
140722009-02-25 Cary Coutant <ccoutant@google.com>
14073
14074 * layout.cc (Layout::choose_output_section): Don't rename sections
14075 when using a linker script that has a SECTIONS clause.
14076 * Makefile.in: Regenerate.
14077
14078 * testsuite/Makefile.am (script_test_5.sh): New test case.
14079 * testsuite/Makefile.in: Regenerate.
14080 * testsuite/script_test_5.cc: New file.
14081 * testsuite/script_test_5.sh: New file.
14082 * testsuite/script_test_5.t: New file.
14083
f488e4b0
CC
140842009-02-13 Rafael Avila de Espindola <espindola@google.com>
14085
14086 * archive.cc (Archive::include_member): Update calls to add_symbols.
14087 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14088 the Layout argument.
14089 * dynobj.h (do_add_symbols): Add the Layout argument.
14090 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14091 Layout argument.
14092 * object.h (Object::add_symbols): Add the Layout argument.
14093 (Object::do_add_symbols): Add the Layout argument.
14094 (Sized_relobj::do_add_symbols): Add the Layout argument.
14095 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14096 Unify the two versions.
14097 (Add_plugin_symbols): Remove.
14098 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14099 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14100 (Add_plugin_symbols): Remove.
14101 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14102 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14103 (Add_symbols::run): Make it work with Pulginobj.
14104
89dd1680
ILT
141052009-02-06 Ian Lance Taylor <iant@google.com>
14106
14107 * object.cc (Sized_relobj::do_layout): Make info message start
14108 with lower case letter.
14109
266d0a74
ILT
141102009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14111
602b464e
ILT
14112 * binary.cc: Fix file comment.
14113
266d0a74
ILT
14114 * options.h (enum Incremental_disposition): Define.
14115 (class General_options): Add new options: --incremental,
14116 --incremental_changed, --incremental_unchanged,
14117 --incremental_unknown. Add incremental_disposition_ and
14118 implicit_incremental_ fields.
14119 (General_options::incremental_disposition): New function.
14120 (class Position_dependent_options): Add incremental_disposition
14121 option.
14122 (Position_dependent_options::copy_from_options): Set incremental
14123 dispositions.
14124 * options.cc (General_options::parse_incremental_changed): New
14125 function.
2e702c99
RM
14126 (General_options::parse_incremental_unchanged): New function.
14127 (General_options::parse_incremental_unknown): New function.
14128 (General_options::General_options): Initialize new fields
266d0a74 14129 incremental_disposition_ and implicit_incremental_.
2e702c99 14130 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
14131 without --incremental.
14132
f073bbf7
CD
141332009-02-06 Chris Demetriou <cgd@google.com>
14134
14135 * gold.h (gold_undefined_symbol): Change to take only a Symbol
14136 pointer and to report location as the file name associated with
14137 the symbol.
14138 (gold_undefined_symbol_at_location): New function to replace the
14139 old gold_undefined_symbol functionality.
14140 * target-reloc.h (relocate_section): Update to use
14141 gold_undefined_symbol_at_location.
14142 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14143 Call gold_undefined_symbol function rather than gold_error.
14144 * errors.h (Errors::undefined_symbol): Take location as a
14145 string, rather than calculating it from a relocation.
14146 * errors.cc (Errors::fatal): Print "fatal error:" before the
14147 formatted message.
14148 (Errors::error, Errors::error_at_location): Print "error: "
14149 before the formatted message.
14150 (Errors::undefined_symbol): Take location as a string, rather
14151 than calculating it from a relocation.
14152 (gold_undefined_symbol_at_location): New function akin to
14153 old gold_undefined_symbol, calculates location from relocation.
14154 (gold_undefined_symbol): Change to take only a Symbol pointer
14155 and to report location as the file name associated with the symbol.
14156 * testsuite/debug_msg.sh: Update for changed error messages.
14157 * testsuite/undef_symbol.sh: Likewise.
14158
8e94a90c
ILT
141592009-02-04 Duncan Sands <baldrick@free.fr>
14160
14161 PR 9812
14162 * reduced_debug_output.h
14163 (Output_reduced_debug_abbrev_section::failed): Use format for
14164 gold_warning.
14165 (Output_reduced_debug_info_section::faild): Likewise.
14166
88a0e15b
ILT
141672009-01-31 Mikolaj Zalewski <mikolajz@google.com>
14168
14169 * script.cc (Lazy_demangler): New class.
2e702c99 14170 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
14171 symbol only once.
14172
5efc7cd2
CC
141732009-01-29 Cary Coutant <ccoutant@google.com>
14174
14175 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
14176 to __tls_get_addr.
14177 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14178
e0ebcf42
ILT
141792009-01-28 Ian Lance Taylor <iant@google.com>
14180
5efc7cd2 14181 * version.cc (version_string): Bump to 1.9.
75fe7426 14182
e0ebcf42
ILT
14183 * gold.h: Include <cstring> and <stdint.h>.
14184 * version.cc: Include <cstdio>.
14185 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
14186 warning.
14187 * reduced_debug_output.cc (insert_into_vector): Rename from
14188 Insert_into_vector; change all callers. Use Swap_unaligned to
14189 avoid aliasing issue; remove union since it is unnecessary.
14190
8e2813be 141912009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
14192
14193 * Makefile.am (CCFILES): Add gc.cc.
14194 (HFILES): Add gc.h.
14195 * Makefile.in: Regenerate.
14196 * gold.cc (Gc_runner): New class.
14197 (queue_initial_tasks): Call garbage collection related tasks
14198 when corresponding options are invoked.
14199 (queue_middle_gc_tasks): New function.
14200 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
14201 processed early before laying out sections during garbage collection.
14202 * gold.h (queue_middle_gc_tasks): New function.
14203 (is_prefix_of): Move from "layout.cc".
14204 * i386.cc (Target_i386::gc_process_relocs): New function.
14205 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
14206 * main.cc (main): Create object of class "Garbage_collection".
14207 * object.cc (Relobj::copy_symbols_data): New function.
14208 (Relobj::is_section_name_included): New function.
e1df38aa
NC
14209 (Sized_relobj::do_layout): Allow this function to be called twice
14210 during garbage collection and defer layout of section during the
6d03d481
ST
14211 first call.
14212 * object.h (Relobj::get_symbols_data): New function.
14213 (Relobj::is_section_name_included): New function.
14214 (Relobj::copy_symbols_data): New function.
14215 (Relobj::set_symbols_data): New function.
14216 (Relobj::get_relocs_data): New function.
14217 (Relobj::set_relocs_data): New function.
14218 (Relobj::is_output_section_offset_invalid): New pure virtual function.
14219 (Relobj::gc_process_relocs): New function.
14220 (Relobj::do_gc_process_relocs): New pure virtual function.
14221 (Relobj::sd_): New data member.
14222 (Sized_relobj::is_output_section_offset_invalid): New function.
14223 (Sized_relobj::do_gc_process_relocs): New function.
14224 * options.h (General_options::gc_sections): Modify to not be a no-op.
14225 (General_options::print_gc_sections): New option.
14226 * plugin.cc (Plugin_finish::run): Remove function call to
14227 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
14228 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
14229 * reloc.cc (Read_relocs::run): Add task to process relocs and
14230 determine unreferenced sections when doing garbage collection.
14231 (Gc_process_relocs): New class.
14232 (Sized_relobj::do_gc_process_relocs): New function.
14233 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
14234 sections that are garbage collected.
14235 * reloc.h (Gc_process_relocs): New class.
14236 * sparc.cc (Target_sparc::gc_process_relocs): New function.
14237 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
14238 symbols whose corresponding sections are garbage collected.
14239 (Symbol_table::Symbol_table): Add new parameter for the garbage
14240 collection object.
14241 (Symbol_table::gc_mark_undef_symbols): New function.
14242 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14243 (Symbol_table::gc_mark_dyn_syms): New function.
14244 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
14245 as garbage.
14246 (Symbol_table::add_from_object): Likewise.
14247 (Symbol_table::add_from_relobj): When building shared objects, do not
14248 treat externally visible symbols as garbage.
14249 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
14250 table information for static and relocatable links.
14251 * symtab.h (Symbol_table::set_gc): New function.
14252 (Symbol_table::gc): New function.
14253 (Symbol_table::gc_mark_undef_symbols): New function.
14254 (Symbol_table::gc_mark_symbol_for_shlib): New function.
14255 (Symbol_table::gc_mark_dyn_syms): New function.
14256 (Symbol_table::gc_): New data member.
e1df38aa 14257 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
14258 function.
14259 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
14260 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
14261
3b293544
CF
142622009-01-20 Chris Faylor <me.sourceware@sourceware.org>
14263
14264 * options.h (General_options::gc_sections): Define as a no-op for now.
14265 (General_options::no_keep_memory): Ditto.
14266 (General_options::Bshareable): Define.
14267 * options.cc (General_options::finalize): Honor -Bshareable.
14268
83d22aa8
AS
142692009-01-20 Andreas Schwab <schwab@suse.de>
14270
14271 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
14272 read the value in the contents, since we don't use it. Use the
14273 template endianness when writing.
14274 (Relocate::relocate): Use it for R_PPC_REL16_HA.
14275
cd536b21
AS
142762009-01-19 Andreas Schwab <schwab@suse.de>
14277
14278 * configure.tgt (powerpc64-*): Fix targ_obj.
14279
99e9a495
ILT
142802009-01-15 Ian Lance Taylor <iant@google.com>
14281
14282 * object.cc (Sized_relobj::write_local_symbols): Don't write out
14283 local symbols when stripping all symbols.
14284
bbbfea06
CC
142852009-01-14 Cary Coutant <ccoutant@google.com>
14286
99e9a495 14287 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 14288
0f7c0701
CC
142892009-01-14 Cary Coutant <ccoutant@google.com>
14290
14291 * archive.cc (Archive::get_elf_object_for_member): Remove call
14292 to File_read::claim_for_plugin.
14293 * descriptors.cc (Descriptors::open): Remove reference to
14294 is_claimed.
14295 (Descriptors::claim_for_plugin): Remove.
14296 * descriptors.h (Descriptors::claim_for_plugin): Remove.
14297 (Descriptors::is_claimed): Remove.
14298 (claim_descriptor_for_plugin): Remove.
14299 * fileread.cc (File_read::claim_for_plugin): Remove.
14300 * fileread.h (File_read::claim_for_plugin): Remove.
14301 (File_read::descriptor): Reopen descriptor if necessary.
14302 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
14303 (Plugin_manager::all_symbols_read): Add task parameter. Change
14304 all callers.
14305 (Plugin_manager::get_input_file): New function.
14306 (Plugin_manager::release_input_file): New function.
14307 (Pluginobj::Pluginobj): Add filesize parameter and initialize
14308 corresponding data member.
14309 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
14310 and pass to base constructor. Change all callers.
14311 (get_input_file, release_input_file): New functions.
14312 (make_sized_plugin_object): Add filesize parameter. Change all callers.
14313 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
14314 (Plugin_manager::all_symbols_read): Add task parameter.
14315 (Plugin_manager::get_input_file): New function.
14316 (Plugin_manager::release_input_file): New function.
14317 (Plugin_manager::task_): New data member.
14318 (Pluginobj::Pluginobj): Add filesize parameter.
14319 (Pluginobj::filename): New function.
14320 (Pluginobj::descriptor): New function.
14321 (Pluginobj::filesize): New function.
14322 (Pluginobj::filesize_): New data member.
14323 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
14324 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
14325 File_read::claim_for_plugin; use Object::unlock to unlock the file.
14326
14327 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
14328 with archive libraries.
14329 * testsuite/Makefile.in: Regenerate.
14330 * testsuite/plugin_test.c (struct sym_info): New type.
14331 (get_input_file, release_input_file): New static variables.
14332 (onload): Capture new transfer vector entries.
14333 (claim_file_hook): Stop reading at end of file according to filesize.
14334 Factor out parsing of readelf output into separate function.
14335 (all_symbols_read_hook): Exercise get_input_file and release_input_file
14336 APIs and get the source file name from the symbol table. Convert
14337 source file name to corresponding object file name. Print info
14338 message when adding new input files.
14339 (parse_readelf_line): New function.
14340 * testsuite/plugin_test_1.sh: Add checks for new info messages.
14341 * testsuite/plugin_test_2.sh: Likewise.
14342 * testsuite/plugin_test_3.sh: Likewise.
14343 * testsuite/plugin_test_4.sh: New test case.
14344
62a6d109
ILT
143452009-01-07 Ian Lance Taylor <iant@google.com>
14346
14347 * version.cc (version_string): Bump to 1.8.
14348
483620e8
CC
143492008-12-23 Cary Coutant <ccoutant@google.com>
14350
14351 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14352 * plugin.cc (Plugin_manager::finish): Rename as
14353 layout_deferred_objects. Move cleanup to separate function.
14354 (Plugin_manager::cleanup): New function.
14355 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14356 separately.
14357 * plugin.h (Plugin_manager::finish): Rename as
14358 layout_deferred_objects.
14359 (Plugin_manager::cleanup): New function.
14360 (Plugin_manager::cleanup_done): New field.
14361
d66a9eb3
CC
143622008-12-23 Cary Coutant <ccoutant@google.com>
14363
14364 * plugin.cc (is_visible_from_outside): New function.
14365 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14366 so we don't return "IR only" status for exported symbols or -r links.
14367
14368 * testsuite/Makefile.am (plugin_test_3): New test case.
14369 * testsuite/Makefile.in: Regenerate.
14370 * testsuite/plugin_test_3.sh: New file.
14371
5995b570
CC
143722008-12-22 Cary Coutant <ccoutant@google.com>
14373
14374 * object.cc (Sized_relobj::layout_section): New function.
14375 (Sized_relobj::do_layout): Defer layout of input sections until after
14376 plugin has provided replacement files.
14377 (Sized_relobj::do_layout_deferred_sections): New function.
14378 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14379 (Relobj::layout_deferred_sections): New function.
14380 (Relobj::do_layout_deferred_sections): New function.
14381 (Sized_relobj::do_layout_deferred_sections): New function.
14382 (Sized_relobj::layout_section): New function.
14383 (Sized_relobj::Deferred_layout): New structure.
14384 (Sized_relobj::deferred_layout_): New field.
14385 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14386 Change all callers. Layout deferred sections.
14387 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14388 references.
14389 (Plugin_hook::run): Move code from do_plugin_hook inline.
14390 (Plugin_hook::do_plugin_hook): Remove.
14391 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14392 (Plugin_manager::finish): Renamed, was cleanup.
14393 (Plugin_manager::should_defer_layout): New function.
14394 (Plugin_manager::add_deferred_layout_object): New function.
14395 (Plugin_manager::Deferred_layout_list): New type.
14396 (Plugin_manager::deferred_layout_objects_): New field.
14397 (Plugin_hook::do_plugin_hook): Remove.
14398
ee769c88
ILT
143992008-12-17 Ian Lance Taylor <iant@google.com>
14400
14401 * options.h (class General_options): Add --no case for
14402 --export-dynamic.
14403
abc8dcba
CC
144042008-12-16 Cary Coutant <ccoutant@google.com>
14405
14406 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14407 vector.
14408 (Plugin_manager::claim_file): Create plugin object even if
14409 plugin did not call the add_symbols callback.
14410 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14411 asking for more symbols than were added.
14412 * testsuite/Makefile.am (plugin_test_1): Add test case with
14413 no global symbols.
14414 (empty.syms): New target.
14415 * testsuite/Makefile.in: Regenerate.
14416 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14417 message. Don't call add_symbols if no globals.
14418 (all_symbols_read_hook): Don't provide replacement for empty
14419 claimed file.
14420
b0074644
ILT
144212008-12-12 Ian Lance Taylor <iant@google.com>
14422
68943102
ILT
14423 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14424 r_type == 0 for a local symbol with r_sym == 0.
14425 (scan_relocatable_relocs): Pass r_sym to
14426 local_non_section_strategy.
14427 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14428 r_sym parameter.
14429
b0074644
ILT
14430 * configure.ac: Update test for TLS descriptors: they are
14431 supported as of glibc 2.9.
14432 * configure: Rebuild.
14433
c2508178
ILT
144342008-12-11 Ian Lance Taylor <iant@google.com>
14435
14436 PR 7091
14437 * target-reloc.h (Default_scan_relocatable_relocs): For each
14438 function, map r_type == 0 to RELOC_DISCARD.
14439
2756a258
CC
144402008-12-10 Cary Coutant <ccoutant@google.com>
14441
14442 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14443 object to override a kept COMDAT group from a plugin object.
14444
bb6f53d3
ILT
144452008-12-09 Ian Lance Taylor <iant@google.com>
14446
fbc558e1
ILT
14447 PR 7088
14448 * yyscript.y (file_cmd): Handle INPUT.
14449
bb6f53d3
ILT
14450 * testsuite/initpri1.c: Change all declarations to be full
14451 prototypes by adding void, to avoid compiler warnings.
14452
4674ecfc
CC
144532008-12-05 Rafael Avila de Espindola <espindola@google.com>
14454
14455 * options.cc (General_options::parse_plugin_opt): New.
14456 (General_options::add_plugin): The argument now is just the filename.
14457 (General_options::add_plugin_option): New.
14458 * options.h (plugin_opt): New.
14459 (add_plugin): Change argument name.
14460 (add_plugin_option): New.
14461 * plugin.cc (Plugin::load): Don't parse the plugin option.
14462 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14463 (Plugin::add_option): New.
14464 (Plugin::args_): Change type.
14465 (Plugin::filename_): New.
14466 (Plugin_manager::add_plugin_option): New.
14467 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14468 * testsuite/Makefile.in: Regenerate.
14469
fd06b4aa
CC
144702008-12-05 Cary Coutant <ccoutant@google.com>
14471
14472 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14473 Handle --strip-lto-sections option.
14474 * options.h (strip_lto_sections): New option.
14475
6c52134c
CC
144762008-12-01 Cary Coutant <ccoutant@google.com>
14477
14478 * plugin.cc (ld_plugin_message): Change format parameter to const.
14479 Fix mismatch between new[] and delete.
14480
a45248e0
CC
144812008-11-14 Cary Coutant <ccoutant@google.com>
14482
14483 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14484 instead of -1U.
14485
c82fbeee
CS
144862008-11-05 Craig Silverstein <csilvers@google.com>
14487
14488 * options.cc (General_options::parse_dynamic_list): New function.
14489 * options.h (General_options): New flags dynamic_list,
14490 dynamic_list_data, dynamic_list_cpp_new, and
14491 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14492 (General_options::in_dynamic_list): New function.
14493 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14494 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14495 (Lex::can_continue_name): Likewise.
14496 (yylex): Likewise.
14497 (read_script_file): New parameter script_options.
14498 (read_dynamic_list): New function.
14499 (Script_options::define_dynamic_list): New function.
14500 (dynamic_list_keyword_parsecodes): New variable.
14501 (dynamic_list_keywords): New variable.
14502 * script.h (Script_options::define_dynamic_list): New function
14503 prototype.
14504 (read_dynamic_list): New function prototype.
14505 * symtab.cc (strprefix): New macro.
14506 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14507 dynamic_list_data, dynamic_list_cpp_new, and
14508 dynamic_list_cpp_typeinfo.
14509 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14510 (dynamic_list_expr): New rule.
14511 (dynamic_list_nodes): Likewise.
14512 (dynamic_list_node): Likewise.
14513 * testsuite/Makefile.am (dynamic_list): New test.
14514 * testsuite/Makefile.in: Regenerated.
14515 * testsuite/dynamic_list.t: New file.
14516 * testsuite/dynamic_list.sh: New file.
14517
e0bb29a5
CS
145182008-11-05 Craig Silverstein <csilvers@google.com>
14519
14520 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14521 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14522 (t11_last): Likewise.
14523 * testsuite/ver_test_6.c (main): Likewise.
14524
4e1e25e0
CC
145252008-10-07 Cary Coutant <ccoutant@google.com>
14526
14527 * options.c (General_options::finalize): Add check for -static and
14528 -shared.
14529 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14530 is not empty.
14531
92f03fcb
CC
145322008-10-02 Cary Coutant <ccoutant@google.com>
14533
14534 * plugin.cc (make_sized_plugin_object): Fix conditional
14535 compilation to work when not all targets are enabled.
14536
fbd8a257
CC
145372008-09-29 Cary Coutant <ccoutant@google.com>
14538
14539 * archive.cc (Archive::get_file_and_offset): Use filename instead
14540 of name to get library path.
14541 (Archive::include_member): Unlock external member of a thin archive.
14542
14543 * testsuite/Makefile.am (TEST_AR): New variable.
14544 (thin_archive_test_1): New test.
14545 (thin_archive_test_2): New test.
81636b3f
CC
14546 * testsuite/Makefile.in: Regenerate.
14547 * testsuite/thin_archive_main.cc: New file.
14548 * testsuite/thin_archive_test_1.cc: New file.
14549 * testsuite/thin_archive_test_2.cc: New file.
14550 * testsuite/thin_archive_test_3.cc: New file.
14551 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14552
eff45813
CC
145532008-09-29 Cary Coutant <ccoutant@google.com>
14554
14555 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14556 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14557 instead of -1U.
14558 (Sized_relobj::do_finalize_local_symbols): Likewise.
14559 (Sized_relobj::map_to_kept_section): Likewise.
14560 * object.h (Sized_relobj::invalid_address): New constant.
14561 (Sized_relobj::do_output_section_offset): Check for invalid_address
14562 and return -1ULL.
14563 * output.cc (Output_reloc::local_section_offset): Use constant
14564 invalid_address instead of -1U.
14565 (Output_reloc::get_address): Likewise.
14566 (Output_section::output_address): Change -1U to -1ULL.
14567 * output.h (Output_reloc::invalid_address): New constant.
14568 * reloc.cc (Sized_relobj::write_sections): Use constant
14569 invalid_address instead of -1U.
14570 (Sized_relobj::relocate_sections): Likewise.
14571 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14572 values for merge sections.
14573 * target-reloc.h (relocate_for_relocatable): Use constant
14574 invalid_address instead of -1U.
14575
89fc3421
CC
145762008-09-19 Cary Coutant <ccoutant@google.com>
14577
14578 Add plugin functionality for link-time optimization (LTO).
14579 * configure.ac (plugins): Add --enable-plugins option.
14580 * configure: Regenerate.
14581 * config.in: Regenerate.
14582 * Makefile.am (LIBDL): New variable.
14583 (CCFILES): Add plugin.cc.
14584 (HFILES): Add plugin.h.
14585 (ldadd_var): Add LIBDL.
14586 * Makefile.in: Regenerate.
14587
14588 * archive.cc: Include "plugin.h".
14589 (Archive::setup): Don't preread archive symbols when using a plugin.
14590 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14591 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14592 files.
14593 (Archive::include_member): Add symbols from plugin objects.
14594 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14595 * descriptors.cc (Descriptors::open): Check for file descriptors
14596 abandoned by plugins.
14597 (Descriptors::claim_for_plugin): New function.
14598 * descriptors.h (Descriptors::claim_for_plugin): New function.
14599 (Open_descriptor::is_claimed): New field.
14600 (claim_descriptor_for_plugin): New function.
14601 * fileread.cc (File_read::claim_for_plugin): New function.
14602 * fileread.h (File_read::claim_for_plugin): New function.
14603 (File_read::descriptor): New function.
14604 * gold.cc: Include "plugin.h".
14605 (queue_initial_tasks): Add task to call plugin hooks for generating
14606 new object files.
14607 * main.cc: Include "plugin.h".
14608 (main): Load plugin libraries.
14609 * object.h (Pluginobj): Declare.
14610 (Object::pluginobj): New function.
14611 (Object::do_pluginobj): New function.
14612 (Object::set_target): New function.
14613 * options.cc: Include "plugin.h".
14614 (General_options::parse_plugin): New function.
14615 (General_options::General_options): Initialize plugins_ field.
14616 (General_options::add_plugin): New function.
14617 * options.h (Plugin_manager): Declare.
14618 (General_options): Add --plugin option.
14619 (General_options::has_plugins): New function.
14620 (General_options::plugins): New function.
14621 (General_options::add_plugin): New function.
14622 (General_options::plugins_): New field.
14623 * plugin.cc: New file.
14624 * plugin.h: New file.
14625 * readsyms.cc: Include "plugin.h".
14626 (Read_symbols::do_read_symbols): Check for archive before checking
14627 for ELF file. Call plugin hooks to claim files.
14628 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14629 from a real object file; force override when processing replacement
14630 files.
14631 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14632 (Symbol::init_base_object): Likewise.
14633 (Symbol::init_base_output_data): Likewise.
14634 (Symbol::init_base_output_segment): Likewise.
14635 (Symbol::init_base_constant): Likewise.
14636 (Symbol::init_base_undefined): Likewise.
14637 (Symbol::output_section): Assert that object is not a plugin.
14638 (Symbol_table::add_from_pluginobj): New function.
14639 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14640 undefined.
14641 (Symbol_table::sized_write_globals): Likewise.
14642 (Symbol_table::add_from_pluginobj): Instantiate template.
14643 * symtab.h (Sized_pluginobj): Declare.
14644 (Symbol::in_real_elf): New function.
14645 (Symbol::set_in_real_elf): New function.
14646 (Symbol::in_real_elf_): New field.
14647 (Symbol_table::add_from_pluginobj): New function.
14648
14649 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14650 (LIBDL): New variable.
14651 (LDADD): Add LIBDL.
14652 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14653 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14654 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14655 (MOSTLYCLEANFILES): Likewise.
14656 * testsuite/Makefile.in: Regenerate.
14657 * testsuite/plugin_test.c: New file.
14658 * testsuite/plugin_test_1.sh: New file.
14659 * testsuite/plugin_test_2.sh: New file.
14660
de31bda5
ILT
146612008-09-16 Ian Lance Taylor <iant@google.com>
14662
9c2d0ef9
ILT
14663 * target-reloc.h (relocate_section): Check whether a symbol is
14664 defined by the ABI before reporting an undefined symbol error.
14665 * target.h (Target::is_defined_by_abi): Make parameter const.
14666 (Target::do_is_defined_by_abi): Likewise.
14667 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14668 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14669 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14670 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14671 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14672 * testsuite/Makefile.in: Rebuild.
14673
de31bda5
ILT
14674 * fileread.cc (make_view): Add casts to avoid warning.
14675
9fa33bee
AO
146762008-09-16 Alexandre Oliva <aoliva@redhat.com>
14677
14678 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14679 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14680
183fd0e3
AO
146812008-09-16 Alexandre Oliva <aoliva@redhat.com>
14682
14683 * options.h (General_options::output_is_executable): New.
14684 (General_options::output_is_pie): New.
14685 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14686 for shared libraries.
14687 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14688
7be8330a
CD
146892008-09-11 Chris Demetriou <cgd@google.com>
14690
14691 * options.h (origin): New -z option.
14692 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14693 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14694 in DT_FLAGS_1.
14695
a9caad02
CC
146962008-09-05 Cary Coutant <ccoutant@google.com>
14697
14698 * fileread.cc (File_read::make_view): Add check for attempt to map
14699 beyond end of file.
14700
ae6dce4d
CC
147012008-09-05 Cary Coutant <ccoutant@google.com>
14702
14703 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14704 explicit instantiations.
14705
d7ab2a47
KVH
147062008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14707
14708 PR gold/6858
14709 * options.cc (General_options::finalize): Allow undefined symbols
14710 in shlibs if linking -shared.
14711
14712 PR gold/6859
14713 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14714 symbols as not needing a dynsym entry.
14715
1e52a9c1
CS
147162008-08-20 Craig Silverstein <csilvers@google.com>
14717
14718 * fileread.cc (File_read::open): Do not lock the file unless it
14719 was successfully opened.
14720
d85c80a3
CC
147212008-08-14 Cary Coutant <ccoutant@google.com>
14722
14723 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14724 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14725 * testsuite/tls_test.cc (struct int128): 128-bit struct
14726 for testing TLS relocs with non-zero addend.
14727 (v12): New TLS variable.
14728 (t12): New test.
14729 (t_last): Add check for v12.
14730 * testsuite/tls_test.h (t12): New function.
14731 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14732
2d924fd9
ILT
147332008-08-13 Ian Lance Taylor <iant@google.com>
14734
14735 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14736 set tls_segment_ or relro_segment_.
14737 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14738 when appropriate.
14739 * output.h (Output_section::clear_is_relro): New function.
14740 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14741 sections specially even when output_data_ is empty.
14742 (Output_segment::maximum_alignment): When first section is relro,
14743 only force alignment for PT_LOAD segments.
14744 * script.cc (script_data_segment_align): New function.
14745 (script_data_segment_relro_end): New function.
14746 * script-c.h (script_data_segment_align): Declare.
14747 (script_data_segment_relro_end): Declare.
14748 * script-sections.h (class Script_sections): Declare
14749 data_segment_align and data_segment_relro_end. Add fields
14750 segment_align_index_ and saw_relro_end_.
14751 * script-sections.cc (class Sections_element): Add set_is_relro
14752 virtual function. Add new bool* parameter to place_orphan_here.
14753 Add get_output_section virtual function.
14754 (class Output_section_definition): Add set_is_relro. Add new
14755 bool* parameter to place_orphan_here. Add get_output_section.
14756 Add is_relro_ field.
14757 (Output_section_definition::Output_section_definition): Initialize
14758 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14759 and is_relro_ fields.
14760 (Output_section_definition::place_orphan_here): Add is_relro
14761 parameter.
14762 (Output_section_definition::set_section_addresses): Set relro for
14763 output section.
14764 (Output_section_definition::alternate_constraint): Likewise.
14765 (class Orphan_output_section): Add new bool* parameter to
14766 place_orphan_here. Add get_output_section.
14767 (Orphan_output_section::place_orphan_here): Add is_relro
14768 parameter.
14769 (Script_sections::Script_sections): Initialize
14770 data_segment_align_index_ and saw_relro_end_.
14771 (Script_sections::data_segment_align): New function.
14772 (Script_sections::data_segment_relro_end): New function.
14773 (Script_sections::place_orphan): Set or clear is_relro.
14774 (Script_sections::set_section_addresses): Force alignment of first
14775 TLS section.
14776 * yyscript.y (exp): Call script_data_segment_align and
14777 script_data_segment_relro_end.
14778 * testsuite/relro_script_test.t: New file.
14779 * testsuite/relro_test.cc (using_script): Declare.
14780 (t1, t2): Test using_script.
14781 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14782 (relro_script_test_SOURCES): Define.
14783 (relro_script_test_DEPENDENCIES): Define.
14784 (relro_script_test_LDFLAGS): Define.
14785 (relro_script_test_LDADD): Define.
14786 (relro_script_test.so): New target.
14787 * testsuite/Makefile.in: Rebuild.
14788
f827c9a9
CC
147892008-08-06 Cary Coutant <ccoutant@google.com>
14790
14791 * archive.cc (Archive::total_archives, Archive::total_members)
14792 (Archive::total_members_loaded): New variables.
14793 (Archive::setup): Add parameter. Add option to preread
14794 archive symbols.
14795 (Archive::read_armap): Add counter.
14796 (Archive::get_file_and_offset): New function.
14797 (Archive::get_elf_object_for_member): New function.
14798 (Archive::read_all_symbols): New function.
14799 (Archive::read_symbols): New function.
14800 (Archive::add_symbols): Add counters.
14801 (Archive::include_all_members): Use armap to find members if it's
14802 already built.
14803 (Archive::include_member): Skip reading symbols if already read.
14804 Factored code into Archive::get_file_and_offset and
14805 Archive::get_elf_object_for_member. Changed call to
14806 Mapfile::report_include_archive_member.
14807 (Archive::print_stats): New function.
14808 * archive.h: Declare Object and Read_symbols_data classes.
14809 (Archive::Archive): Add initializers for new members.
14810 (Archive::setup): Add parameter.
14811 (Archive::print_stats): New function.
14812 (Archive::total_archives, Archive::total_members)
14813 (Archive::total_members_loaded): New variables.
14814 (Archive::get_file_and_offset): New function.
14815 (Archive::get_elf_object_for_member): New function.
14816 (Archive::read_all_symbols): New function.
14817 (Archive::read_symbols): New function.
14818 (Archive::Archive_member): New class.
14819 (Archive::members_): New member.
14820 (Archive::num_members_): New member.
14821 * main.cc: Include archive.h.
14822 (main): Call Archive::print_stats.
14823 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14824 archive parameter; member_name is now the fully-decorated name.
14825 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14826 * options.h: (General_options): Add --preread-archive-symbols option.
14827 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14828 Archive::setup.
14829
de4c45bd
ILT
148302008-08-04 Ian Lance Taylor <iant@google.com>
14831
14832 * symtab.h (Symbol::use_plt_offset): New function.
14833 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14834 * powerpc.cc (Relocate::relocate): Likewise.
14835 * sparc.cc (Relocate::relocate): Likewise.
14836 * x86_64.cc (Relocate::relocate): Likewise.
14837 * testsuite/weak_plt.sh: New test.
14838 * testsuite/weak_plt_main.cc: New test.
14839 * testsuite/weak_plt_shared.cc: New test.
14840 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14841 (check_PROGRAMS): Add weak_plt.
14842 (check_DATA): Add weak_plt_shared.so.
14843 (weak_plt_main_pic.o, weak_plt): New targets.
14844 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14845 * testsuite/Makefile.in: Rebuild.
14846
14847 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14848 gcctestdir/ld.
14849 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14850 * testsuite/Makefile.in: Rebuild.
14851
323ee3f4
AM
148522008-08-04 Alan Modra <amodra@bigpond.net.au>
14853
14854 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14855 * Makefile.in: Regenerate.
14856 * po/POTFILES.in: Regenerate.
14857
7c07ecec
ILT
148582008-07-29 Ian Lance Taylor <iant@google.com>
14859
14860 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14861 symbols before other symbols.
14862 * testsuite/script_test_2.cc (test_addr): Declare.
14863 (test_addr_alias): Declare.
14864 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14865 values.
7c07ecec
ILT
14866 * testsuite/script_test_2.t: Define test_addr_alias and
14867 test_addr.
14868
5778530e
ILT
148692008-07-24 Ian Lance Taylor <iant@google.com>
14870
2a00e4fb
ILT
14871 PR 5990
14872 * descriptors.cc: New file.
14873 * descriptors.h: New file.
14874 * gold-threads.h (class Hold_optional_lock): New class.
14875 * fileread.cc: Include "descriptors.h".
14876 (File_read::~File_read): Release descriptor rather than closing
14877 it.
14878 (File_read::open) [file]: Call open_descriptor rather than open.
14879 Set is_descriptor_opened_.
14880 (File_read::open) [memory]: Assert that descriptor is not open.
14881 (File_read::reopen_descriptor): New function.
14882 (File_read::release): Release descriptor.
14883 (File_read::do_read): Make non-const. Reopen descriptor.
14884 (File_read::read): Make non-const.
14885 (File_read::make_view): Reopen descriptor.
14886 (File_read::do_readv): Likewise.
14887 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14888 Update declarations.
14889 * layout.cc: Include "descriptors.h".
14890 (Layout::create_build_id): Use open_descriptor rather than open.
14891 * output.cc: Include "descriptors.h".
14892 (Output_file::open): Use open_descriptor rather than open.
14893 * archive.cc (Archive::const_iterator): Change Archive to be
14894 non-const.
14895 (Archive::begin, Archive::end): Make non-const.
14896 (Archive::count_members): Likewise.
14897 * archive.h (class Archive): Update declarations.
14898 * object.h (Object::read): Make non-const.
14899 * Makefile.am (CCFILES): Add descriptors.cc.
14900 (HFILES): Add descriptors.h.
14901 * Makefile.in: Rebuild.
14902
801647d1
ILT
14903 PR 6716
14904 * gold.h: Always include <clocale>. Add Solaris workarounds
14905 following code in binutils/sysdep.h.
14906
5edd166e
ILT
14907 PR 6048
14908 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14909 this->eh_frame_hdr_ is NULL before using it.
14910
c89ad728
ILT
14911 * dynobj.cc (Versions::Versions): Update comment.
14912
aa86f06b
ILT
14913 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14914 the base version name.
14915
5778530e
ILT
14916 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14917 array size plus one.
14918 (Stringpool_template::set_string_offsets): Subtract one from key
14919 before using it as an array index.
14920 (Stringpool_template::get_offset_with_length): Likewise.
14921 (Stringpool_template::write_to_buffer): Likewise.
14922 * stringpool.h (Stringpool_template::get_offset_from_key):
14923 Likewise.
14924
057ead22
ILT
149252008-07-23 Ian Lance Taylor <iant@google.com>
14926
7f649c59
ILT
14927 PR 6658
14928 * object.h (Merged_symbol_value::value): Do our best to handle a
14929 negative addend.
14930
057ead22
ILT
14931 PR 6647
14932 * script.cc (Version_script_info::get_versions): Don't add empty
14933 version tag to return value.
14934 (Version_script_info::get_symbol_version_helper): Change return
14935 type to bool. Add pversion parameter. Change all callers.
14936 (script_register_vers_node): Don't require a non-NULL tag.
14937 * script.h (class Version_script_info): Update declarations.
14938 (Version_script_info::get_symbol_version): Change return type to
14939 bool. Add version parameter. Change all callers.
14940 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14941 handling. Handle an empty version from a version script.
14942 (Symbol_table::define_special_symbol): Likewise.
14943 * testsuite/ver_test_10.script: New file.
14944 * testsuite/ver_test_10.sh: New file.
14945 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14946 (check_DATA): Add ver_test_10.syms.
14947 (ver_test_10.syms, ver_test_10.so): New target.
14948 * testsuite/Makefile.in: Rebuild.
14949
58e54ac2
CD
149502008-07-23 Simon Baldwin <simonb@google.com>
14951
14952 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14953 to zero for undefined symbols from dynamic libraries.
14954
95d14cd3
ILT
149552008-07-23 Ian Lance Taylor <iant@google.com>
14956
14957 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14958 Change all callers.
14959 * symtab.h (class Symbol_table): Update declaration.
14960 * testsuite/ver_test_9.cc: New file.
14961 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14962 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14963 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14964 (ver_test_9.so, ver_test_9.o): New targets.
14965 * testsuite/Makefile.in: Rebuild.
14966
92de84a6
ILT
149672008-07-22 Ian Lance Taylor <iant@google.com>
14968
34810851
ILT
14969 * options.h (class General_options): Define --check-sections.
14970 * layout.cc (Layout::set_segment_offsets): Handle
14971 --check-sections.
14972
af6156ef
ILT
14973 * options.h (class General_options): Define -n/--nmagic and
14974 -N/--omagic.
14975 * options.cc (General_options::finalize): For -n/--nmagic or
14976 -N/--omagic, set -static.
14977 * layout.cc (Layout::attach_allocated_section_to_segment): If
14978 -N/--omagic, don't put read-only and read-write sections in
14979 different segments.
14980 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14981 finding a read-only segment.
14982 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14983 don't set the minimum segment alignment to the common page size,
14984 and don't set the file offset to the address modulo the page size.
14985 * script-sections.cc (Script_sections::create_segments): If
14986 -n/--omagic, don't put read-only and read-write sections in
14987 different segments.
14988
92de84a6
ILT
14989 * cref.cc: New file.
14990 * cref.h: New file.
14991 * options.h (class General_options): Add --print-symbol-counts.
14992 * main.cc (main): Issue defined symbol report if requested.
14993 * archive.cc (Archive::interpret_header): Make into a const member
14994 function.
14995 (Archive::add_symbols): Call Input_objects::archive_start and
14996 archive_stop.
14997 (Archive::const_iterator): Define new class.
14998 (Archive::begin, Archive::end): New functions.
14999 (Archive::include_all_members): Rewrite to use iterator.
15000 (Archive::count_members): New function.
15001 * archive.h (class Archive): Update declarations.
15002 (Archive::filename): New function.
15003 * object.cc: Include "cref.h".
15004 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15005 (Sized_relobj::do_get_global_symbol_counts): New function.
15006 (Input_objects::add_object): Add object to cross-referencer.
15007 (Input_objects::archive_start): New function.
15008 (Input_objects::archive_stop): New function.
15009 (Input_objects::print_symbol_counts): New function.
15010 * object.h: Declare Cref and Archive.
15011 (Object::get_global_symbol_counts): New function.
15012 (Object::do_get_global_symbol_counts): New pure virtual function.
15013 (class Sized_relobj): Add defined_count_ field. Update
15014 declarations.
15015 (class Input_objects): Add cref_ field. Update constructor.
15016 Update declarations.
15017 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15018 defined_count_.
15019 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15020 symbol counts.
15021 (Sized_dynobj::do_get_global_symbol_counts): New function.
15022 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15023 defined_count_. Update declarations. Define Symbols typedef.
15024 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15025 parameter. Change all callers.
15026 (Symbol_table::add_from_dynobj): Add sympointers and defined
15027 parameters. Change all callers.
15028 * symtab.h (class Symbol_table): Update declarations.
15029 * Makefile.am (CCFILES): Add cref.cc.
15030 (HFILES): Add cref.h.
15031 * Makefile.in: Rebuild.
15032
3f7c5e1d
CD
150332008-07-22 Simon Baldwin <simonb@google.com>
15034
15035 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15036 to zero when writing undefined symbols.
15037
e0b64032
ILT
150382008-07-22 Ian Lance Taylor <iant@google.com>
15039
15040 * output.cc (Output_section::add_input_section): Don't try to
15041 merge empty merge sections.
15042
096b02cf
CS
150432008-07-21 Craig Silverstein <csilvers@google.com>
15044
15045 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15046 Include symbol version in error message.
cd536b21 15047
1d1f116d
CD
150482008-07-20 Chris Demetriou <cgd@google.com>
15049
cd536b21 15050 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15051 (RANDOM_SEED_CFLAGS): New substituted variable.
15052 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15053 * configure: Rebuild.
15054 * Makefile.in: Likewise.
15055 * testsuite/Makefile.in: Likewise.
15056
a18f591e
ILT
150572008-07-18 Ian Lance Taylor <iant@google.com>
15058
15059 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15060 where we see NAME/NULL and NAME/VERSION as separate symbols.
15061 * testsuite/ver_test_main.cc (main): Call t4.
15062 (t4, t4_2a): Define.
15063 * testsuite/ver_test_2.cc (t4_2): Define.
15064 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15065 * testsuite/ver_test_4.cc (t4_2a): Define.
15066 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15067 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15068
c6e3f6ed
ILT
150692008-07-17 Ian Lance Taylor <iant@google.com>
15070
15071 * dynobj.cc (Versions::add_def): If we give an error about a
15072 missing version, go ahead and create the version anyhow.
15073
ef9beddf
ILT
150742008-07-10 Ian Lance Taylor <iant@google.com>
15075
15076 Handle output sections with more than 0x7fffffff bytes.
15077 * object.h (class Relobj): Change map_to_output_ to
15078 output_sections_, and just keep a section pointer. Change all
15079 uses. Move comdat group support to Sized_relobj.
15080 (Relobj::is_section_specially_mapped): Remove.
15081 (Relobj::output_section): Remove poff parameter. Change all
15082 callers.
15083 (Relobj::output_section_offset): New function.
15084 (Relobj::set_section_offset): Rewrite.
15085 (Relobj::map_to_output): Remove.
15086 (Relobj::output_sections): New function.
15087 (Relobj::do_output_section_offset): New pure virtual function.
15088 (Relobj::do_set_section_offset): Likewise.
15089 (class Sized_relobj): Add section_offsets_ field. Add comdat
15090 group support from Relobj. Update declarations.
15091 (Sized_relobj::get_output_section_offset): New function.
15092 (Sized_relobj::do_output_section_offset): New function.
15093 (Sized_relobj::do_set_section_offset): New function.
15094 * object.cc (Relobj::output_section_address): Remove.
15095 (Sized_relobj::Sized_relobj): Initialize new fields.
15096 (Sized_relobj::include_section_group): Cast find_kept_object to
15097 Sized_relobj.
15098 (Sized_relobj::include_linkonce_section): Likewise.
15099 (Sized_relobj::do_layout): Use separate arrays for output section
15100 and output offset.
15101 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15102 output_sections.
15103 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15104 output_sections and section_offsets.
15105 (Sized_relobj::write_local_symbols): Likewise.
15106 (map_to_kept_section): Compute output address directly.
15107 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15108 output_sections and section_offsets.
15109 (Sized_relobj::write_sections): Likewise.
15110 (Sized_relobj::relocate_sections): Likewise.
15111 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15112 * output.h (class Output_reloc): Update declarations. Change
15113 u2_.relobj to Sized_relobj*.
15114 (class Output_data_reloc): Change add functions to use
15115 Sized_relobj*.
15116 * output.cc (Output_reloc::Output_reloc): Change relobj to
15117 Sized_relobj*.
15118 (Output_reloc::local_section_offset): Change return type to
15119 Elf_Addr. Use get_output_section_offset.
15120 (Output_reloc::get_address): Likewise.
15121 (Output_section::is_input_address_mapped): Don't call
15122 is_section_specially_mapped.
15123 (Output_section::output_offset): Likewise.
15124 (Output_section::output_address): Likewise.
15125 (Output_section::starting_output_address): Likewise.
15126 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
15127 parameter to Sized_relobj*.
15128 (Copy_relocs::need_copy_reloc): Likewise.
15129 (Copy_relocs::save): Likewise.
15130 * copy-relocs.h (class Copy_relocs): Update declarations.
15131 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
15132 Sized_relobj*. Change relobj_ field to Sized_relobj*.
15133 * target-reloc.h (relocate_for_relocatable): Change
15134 offset_in_output_section type to Elf_Addr. Change code that uses
15135 it as well.
15136 * layout.cc (Layout::layout): Always set *off.
15137 * mapfile.cc (Mapfile::print_input_section): Use
15138 output_section_offset.
15139 * i386.cc (Target_i386::copy_reloc): Change object parameter to
15140 Sized_relobj*.
15141 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
15142 * sparc.cc (Target_sparc::copy_reloc): Likewise.
15143 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
15144
5cb66f97
ILT
151452008-07-03 Ian Lance Taylor <iant@google.com>
15146
15147 * layout.cc (Layout::include_section): Do not discard unrecognized
15148 SHT_STRTAB sections.
15149
afe47622
CS
151502008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
15151
15152 * script.cc (Lex::can_continue_name): Make '?' allowable in
15153 version-script names.
15154 * testsuite/version_script.map: Change glob pattern to use '?'
15155
5adf9721
ILT
151562008-06-30 Manish Singh <yosh@gimp.org>
15157
15158 PR 6585
15159 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
15160 Correct typo.
15161
e6fde208
ILT
151622008-06-30 Ian Lance Taylor <iant@google.com>
15163
15164 PR 6660
15165 PR 6682
15166 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
15167 versions]: Don't try to read the value in the contents, since we
15168 don't use it. Use the template endianness when writing.
15169
3f2e6a2d
CC
151702008-06-25 Cary Coutant <ccoutant@google.com>
15171
15172 * fileread.cc (File_read::make_view): Assert on zero-length view.
15173 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
15174 symbol table when there are no symbols to read.
15175
c43d3a48
CS
151762008-06-23 Craig Silverstein <csilvers@google.com>
15177
15178 * version.cc (version_string): Bump to 1.7
15179
5f494ea0
CS
151802008-06-18 Craig Silverstein <csilvers@google.com>
15181
15182 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
15183 constant 0xFFFF to type Valtype.
15184 (Powerpc_relocate_functions::rel16_ha): Likewise.
15185
c42e122e
ILT
151862008-06-17 Ian Lance Taylor <iant@google.com>
15187
f34787f8
ILT
15188 * output.h (Output_section::Input_section): Initialize p2align_ to
15189 zero for Output_section_data constructors.
15190 (Output_section::Input_section::addralign): If not an input
15191 section, return the alignment of the Output_section_data.
15192 * testsuite/copy_test.cc: New file.
15193 * testsuite/copy_test_1.cc: New file.
15194 * testsuite/copy_test_2.cc: New file.
15195 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
15196 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
15197 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
15198 (copy_test_1_pic.o, copy_test_1.so): New targets.
15199 (copy_test_2_pic.o, copy_test_2.so): New targets.
15200 * testsuite/Makefile.in: Rebuild.
15201
c42e122e
ILT
15202 * script-sections.cc (Script_sections::place_orphan): Initialize
15203 local variable exact.
15204
ce3ac18a
DE
152052008-06-13 David Edelsohn <edelsohn@gnu.org>
15206
15207 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
15208
42cacb20
DE
152092008-06-12 David Edelsohn <edelsohn@gnu.org>
15210 David S. Miller <davem@davemloft.net>
15211
15212 * powerpc.cc: New file.
15213 * Makefile.am (TARGETSOURCES): Add powerpc.cc
15214 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
15215 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
15216 * Makefile.in: Rebuild.
15217
7b308235
ILT
152182008-06-09 Ian Lance Taylor <iant@google.com>
15219
15220 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
15221 <exception>.
15222 (throwing, orig_terminate): New static variables.
15223 (terminate_handler): New static function.
15224 (t2): Set terminate handler.
15225
f0b886e3
ILT
152262008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
15227
15228 PR 6584
cd536b21 15229 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
15230 alignment.
15231
3e90f135
CC
152322008-05-30 Cary Coutant <ccoutant@google.com>
15233
15234 * archive.cc (Archive::include_all_members) Correct to step
15235 over symbol table and extended name table in thin archives.
15236
e09ad04a
ILT
152372008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
15238
15239 PR 6407
15240 * target-reloc.h (relocate_for_relocatable): Fix new_offset
15241 calculation.
15242
62b01cb5
ILT
152432008-05-28 Caleb Howe <cshowe@google.com>
15244
15245 * reduced_debug_output.cc: New file.
15246 * reduced_debug_output.h: New file.
92de84a6 15247 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
15248 * options.cc (General_options::finalize): Add strip_debug_non_line
15249 to the strip heirarchy.
15250 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
15251 fields.
15252 * layout.cc: Include "reduced_debug_output.h".
15253 (Layout::Layout): Initialize new fields.
15254 (line_only_debug_sections): New static array.
15255 (is_lines_only_debug_sections): New static inline function.
15256 (Layout::include_section): Handle --strip-debug-non-line.
15257 (Layout::make_output_section): If --strip-debug-non-line, build
15258 new output sections for .debug_abbrev and .debug_info.
15259 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
15260 gold. Warn about possible overflow.
15261 (read_signed_LEB_128): Likewise.
15262 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
15263 (read_signed_LEB_128): Declare.
15264 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
15265 (HFILES): Add reduced_debug_output.h.
15266 * Makefile.in: Rebuild.
15267
7d9e3d98
ILT
152682008-05-21 Ian Lance Taylor <iant@google.com>
15269
15270 * mapfile.cc: New file.
15271 * mapfile.h: New file.
15272 * options.h (class General_options): Add -M/--print-map and -Map.
15273 * options.cc (General_options::finalize): Make -M equivalent to
15274 -Map -.
15275 * main.cc: Include <cstdio> and "mapfile.h".
15276 (main): Open mapfile if requested.
15277 * gold.cc (class Middle_runner): Add mapfile_ field. Update
15278 constructor. Change caller.
15279 (queue_initial_tasks): Add mapfile parameter. Change caller.
15280 (queue_middle_tasks): Likewise.
15281 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
15282 declarations.
15283 * archive.cc: Include "mapfile.h".
15284 (Archive::add_symbols): Add mapfile parameter. Change all
15285 callers. Pass mapfile, symbol, and reason to include_member.
15286 (Archive::include_all_members): Add mapfile parameter. Change all
15287 callers.
15288 (Archive::include_member): Add mapfile, sym, and why parameters.
15289 Change all callers. Report inclusion to map file.
15290 * archive.h: Include "fileread.h".
15291 (class Archive): Update declarations.
15292 (Archive::file): New const method.
15293 (class Add_archive_symbols): Add mapfile_ field. Update
15294 constructor. Change all callers.
15295 * readsyms.h (class Read_symbols): Likewise.
15296 (class Finish_group): Likewise.
15297 (class Read_script): Likewise.
15298 * common.cc: Include "mapfile.h".
15299 (Symbol_table::allocate_commons): Add mapfile parameter. Change
15300 all callers.
15301 (Symbol_table::do_allocate_commons): Likewise.
15302 (Symbol_table::do_allocate_commons_list): Likewise. Report common
15303 symbol allocation to mapfile.
15304 * common.h (class Allocate_commons_task): Add mapfile_ field.
15305 Update constructor. Change all callers.
15306 * symtab.h (class Symbol_table): Update declarations.
15307 * layout.cc: Include "mapfile.h".
15308 (Layout_task_runner::run): Print information to mapfile.
15309 (Layout::create_gold_note): Change Output_data_fixed_space to
15310 Output_data_zero_fill.
15311 (Layout::create_build_id): Likewise.
15312 (Layout::print_to_mapfile): New function.
15313 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
15314 constructor. Change caller.
15315 (class Layout): Declare print_to_mapfile.
15316 * output.cc (Output_section::Input_section::print_to_mapfile): New
15317 function.
15318 (Output_section::add_input_section): If producing a map, always
15319 add to input_sections_ list.
15320 (Output_section::do_print_to_mapfile): New function.
15321 (Output_segment::print_sections_to_mapfile): New function.
15322 (Output_segment::print_section_list_to_mapfile): New function.
15323 * output.h: Include "mapfile.h".
15324 (Output_data::print_to_mapfile): New function.
15325 (Output_data::do_print_to_mapfile): New virtual function.
15326 (Output_segment_headers::do_print_to_mapfile): New function.
15327 (Output_file_header::do_print_to_mapfile): New function.
15328 (Output_data_const::do_print_to_mapfile): New function.
15329 (class Output_data_const_buffer): Add map_name_ field. Update
15330 constructor. Change all callers. Add do_print_to_mapfile
15331 function.
15332 (class Output_data_fixed_space): Likewise.
15333 (class Output_data_space): Likewise.
15334 (class Output_data_zero_fill): New class.
15335 (Output_data_strtab::do_print_to_mapfile): New function.
15336 (Output_data_reloc_base::do_print_to_mapfile): New function.
15337 (Output_relocatable_relocs::do_print_to_mapfile): New function.
15338 (Output_data_group::do_print_to_mapfile): New function.
15339 (Output_data_got::do_print_to_mapfile): New function.
15340 (Output_data_dynamic::do_print_to_mapfile): New function.
15341 (Output_symtab_xindex::do_print_to_mapfile): New function.
15342 (class Output_section): Declare do_print_to_mapflie. Declare
15343 print_to_mapfile in Input_section.
15344 (class Output_segment): Declare new functions.
15345 * object.h (Sized_relobj::symbol_count): New function.
15346 * script-sections.cc
15347 (Output_section_element_dot_assignment::set_section_addresses):
15348 Change Output_data_fixed_space to Output_data_zero_fill.
15349 (Output_data_expression::do_print_to_mapfile): New function.
15350 * script.cc (read_input_script): Add mapfile parameter. Change
15351 all callers.
15352 * script.h (read_input_script): Update declaration.
15353 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15354 (Eh_frame::do_print_to_mapfile): New function.
15355 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15356 (Output_merge_string::do_print_to_mapfile): New function.
15357 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15358 function.
15359 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15360 function.
15361 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15362 function.
15363 * Makefile.am (CCFILES): Add mapfile.cc.
15364 (HFILES): Add mapfile.h.
15365 * Makefile.in: Rebuild.
15366
9f1d377b
ILT
153672008-05-19 Ian Lance Taylor <iant@google.com>
15368
15369 * options.h (class General_options): Add -z relro.
15370 * layout.cc (Layout::Layout): Initialize relro_segment_.
15371 (Layout::add_output_section_data): Return the output section.
15372 (Layout::make_output_section): Rcognize relro sections and mark
15373 them appropriately.
15374 (Layout::attach_allocated_section_to_segment): Put relro sections
15375 in a PT_GNU_RELRO segment.
15376 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15377 section as relro.
15378 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15379 PT_TLS segments.
15380 (Layout::linkonce_mapping): Map d.rel.ro.local to
15381 .data.rel.ro.local.
15382 (Layout::output_section_name): Us .data.rel.ro.local for any
15383 section which begins with that.
15384 * layout.h (class Layout): Update add_output_section_data
15385 declaration. Add relro_segment_ field.
15386 * output.cc (Output_section::Output_section): Initialize is_relro_
15387 and is_relro_local_ fields.
15388 (Output_segment::add_output_section): Group relro sections.
15389 (Output_segment::is_first_section_relro): New function.
15390 (Output_segment::maximum_alignment): If there is a relro section,
15391 align the segment to the common page size.
15392 (Output_segment::set_section_addresses): Track whether we are
15393 looking at relro sections. If the last section is a relro
15394 section, align to the common page size.
15395 (Output_segment::set_section_list_addresses): Add in_relro
15396 parameter. Change all callers. Align to the page size when
15397 moving from relro to non-relro section.
15398 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15399 segment.
15400 * output.h (class Output_section): Add is_relro_ and
15401 is_relro_local_ fields.
15402 (Output_section::is_relro): New function.
15403 (Output_section::set_is_relro): New function.
15404 (Output_section::is_relro_local): New function.
15405 (Output_section::set_is_relro_local): New function.
15406 (class Output_segment): Update declarations.
15407 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15408 * sparc.cc (Target_sparc::got_section): Likewise.
15409 * x86_64.cc (Target_x86_64::got_section): Likewise.
15410 * testsuite/relro_test_main.cc: New file.
15411 * testsuite/relro_test.cc: New file.
15412 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15413 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15414 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15415 (relro_test.so, relro_test_pic.o): New targets.
15416 * testsuite/Makefile.in: Rebuild.
15417
a984ee1d
ILT
154182008-05-16 Ian Lance Taylor <iant@google.com>
15419
01676dcd
ILT
15420 * output.cc (Output_segment::add_output_section): Remove front
15421 parameter.
15422 * output.h (class Output_segment): Remove
15423 add_initial_output_section and overloaded add_output_section.
15424 Update declaration of remaining add_output_section.
15425 * layout.cc (Layout::create_interp): Call add_output_section
15426 rather than add_initial_output_section.
15427 (Layout::finish_dynamic_section): Likewise.
15428
497897f9
ILT
15429 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15430 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15431 know the dynamic type.
15432 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15433 field. Initialize it in constructor.
15434 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15435 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15436 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15437 reloc.
15438
a984ee1d
ILT
15439 * output.cc (Output_reloc::get_address): Change return type to
15440 Elf_Addr.
15441 * output.h (class Output_reloc): Update get_address declaration.
15442 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15443 for section addresses.
15444
55ba0940
ILT
154452008-05-09 Ian Lance Taylor <iant@google.com>
15446
15447 PR 6493
15448 * gold.cc (gold_nomem): Use return value of write.
15449
75517b77
ILT
154502008-05-08 Ian Lance Taylor <iant@google.com>
15451
15452 * symtab.c (Symbol::init_base_output_data): Add version
15453 parameter. Change all callers.
15454 (Symbol::init_base_output_segment): Likewise.
15455 (Symbol::init_base_constant): Likewise.
15456 (Symbol::init_base_undefined): Likewise.
15457 (Sized_symbol::init_output_data): Likewise.
15458 (Sized_symbol::init_output_segment): Likewise.
15459 (Sized_symbol::init_constant): Likewise.
15460 (Sized_symbol::init_undefined): Likewise.
15461 (Symbol_table::do_define_in_output_data): If the new symbol has a
15462 version, mark it as the default.
15463 (Symbol_table::do_define_in_output_segment): Likewise.
15464 (Symbol_table::do_define_as_constant): Likewise.
15465 * symtab.h (class Symbol): Update declarations.
15466 (class Sized_symbol): Likewise.
15467 * resolve.cc (Symbol::override_version): New function.
c42e122e 15468 (Symbol::override_base): Call override_version.
75517b77
ILT
15469 (Symbol::override_base_with_special): Likewise.
15470 * testsuite/ver_script_8.script: New file.
15471 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15472 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15473 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15474 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15475
f1f70eae
ILT
154762008-05-06 Ian Lance Taylor <iant@google.com>
15477
f3e9c5c5
ILT
15478 PR 6049
15479 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15480 functions.
15481 (class General_options): Remove existing --undefined, and add
15482 --no-undefined instead. Add new --undefined as synonym for -u.
15483 * archive.cc (Archive::add_symbols): Check whether symbol was
15484 named with -u.
15485 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15486 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15487 all uses. Add IS_UNDEFINED. Update declarations to split
15488 different versions of init_base. Declare init_base_undefined.
15489 (Symbol::is_defined): Handle IS_UNDEFINED.
15490 (Symbol::is_undefined): Likewise.
15491 (Symbol::is_weak_undefined): Call is_undefined.
15492 (Symbol::is_absolute): Handle IS_CONSTANT.
15493 (class Sized_symbol): Update declarations to split different
15494 versions of init. Declare init_undefined.
15495 (class Symbol_table): Declare new functions.
15496 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15497 Change all callers.
15498 (Symbol::init_base_output_data): Likewise.
15499 (Symbol::init_base_output_segment): Likewise.
15500 (Symbol::init_base_constant): Likewise.
15501 (Symbol::init_base_undefined): New function.
15502 (Sized_symbol::init_object): Rename from init. Change all
15503 callers.
15504 (Sized_symbol::init_output_data): Likewise.
15505 (Sized_symbol::init_output_segment): Likewise.
15506 (Sized_symbol::init_constant): Likewise.
15507 (Sized_symbol::init_undefined): New function.
15508 (Symbol_table::add_undefined_symbols_from_command_line): New
15509 function.
15510 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15511 function.
15512 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15513 (Symbol::output_section): Likewise.
15514 (Symbol::set_output_section): Likewise.
15515 (Symbol_table::sized_finalize_symbol): Likewise.
15516 (Symbol_table::sized_write_globals): Likewise.
15517 * resolve.cc (Symbol_table::should_override): Likewise.
15518 (Symbol::override_base_with_special): Likewise.
15519
8bdcdf2c
ILT
15520 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15521 symbol, change it to have default visibility.
15522 * testsuite/protected_1.cc: New file.
15523 * testsuite/protected_2.cc: New file.
15524 * testsuite/protected_3.cc: New file.
15525 * testsuite/protected_main_1.cc: New file.
15526 * testsuite/protected_main_2.cc: New file.
15527 * testsuite/protected_main_3.cc: New file.
15528 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15529 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15530 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15531 (protected_1.so): New target.
15532 (protected_1_pic.o, protected_2_pic.o): New targets.
15533 (protected_3_pic.o): New target.
15534 (check_PROGRAMS): Add protected_2.
15535 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15536 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15537 * testsuite/Makefile.in: Rebuild.
15538
2b706932
ILT
15539 * options.h (DEFINE_var): Add set_user_set_##varname__.
15540 (DEFINE_bool_alias): New macro.
15541 (class General_options): Define -Bstatic using DEFINE_bool_alias
15542 rather than DEFINE_special. Add --undefined as an alias for -z
15543 defs.
15544 * options.cc (General_options::parse_Bstatic): Remove.
15545
d82a5bcc
ILT
15546 * options.h (class General_options): Add --fatal-warnings.
15547 * main.cc (main): Implement --fatal-warnings.
15548 * errors.h (Errors::warning_count): New function.
15549
f1f70eae
ILT
15550 * options.h (class General_options): Add -Bsymbolic-functions.
15551 * symtab.h (Symbol::is_preemptible): Check for
15552 -Bsymbolic-functions.
15553
8825ac63
ILT
155542008-05-05 Ian Lance Taylor <iant@google.com>
15555
d98bc257
ILT
15556 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15557 as noVARNAME rather than no-VARNAME.
15558 (class General_options): Add option -z combreloc.
15559 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15560 get_address.
15561 (Output_reloc::sort_before) [SHT_REL]: New function.
15562 (Output_reloc::sort_before) [SHT_RELA]: New function.
15563 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15564 Sort_relocs_comparison.
15565 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15566 parameter. Change all callers.
15567 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15568 sort_relocs parameter. Change all callers.
15569 * output.cc (Output_reloc::get_address): New function, broken out
15570 of write_rel.
15571 (Output_reloc::write_rel): Call it.
15572 (Output_reloc::compare): New function.
15573 (Output_data_reloc_base::do_write): Optionally sort relocs.
15574
60b2b4e7
ILT
15575 * configure.ac: If targ_extra_obj is set, link it in.
15576 * configure.tgt: Initialize all variables.
15577 (x86_64*): Set targ_extra_obj and targ_extra_size.
15578 * configure: Rebuild.
15579
8825ac63
ILT
15580 * object.cc (Sized_relobj::include_section_group): Adjust section
15581 indexes read from group data. Build vector to pass to
15582 layout_group.
15583 * layout.cc (Layout::layout_group): Add flags and shndxes
15584 parameters. Remove contents parameter. Change caller. Update
15585 explicit instantiations.
15586 * layout.h (class Layout): Update layout_group declaration.
15587 * output.cc (Output_data_group::Output_data_group): Add flags and
15588 input_shndxes parameters. Remove contents parameter. Change
15589 caller.
15590 (Output_data_group::do_write): Change input_sections_ to
15591 input_shndxes_.
15592 * output.h (class Output_data_group): Update constructor
15593 declaration. Rename input_sections_ to input_shndxes_.
15594 * testsuite/many_sections_test.cc: Add template.
15595
e94cf127
CC
155962008-04-30 Cary Coutant <ccoutant@google.com>
15597
4418b2d5
CC
15598 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15599
e94cf127
CC
15600 * layout.cc (Layout::include_section): Refactored check for debug
15601 info section.
15602 (Layout::add_comdat): Add new parameters. Change type
15603 of signature parameter. Add object and shndx to signatures table.
15604 (Layout::find_kept_object): New function.
15605 * layout.h: Include <cstring>.
15606 (Layout::is_debug_info_section): New function.
15607 (Layout::add_comdat): Add new parameters.
15608 (Layout::find_kept_object): New function.
15609 (Layout::Kept_section): New struct.
15610 (Layout::Signatures): Change type of map range.
15611 * object.cc (Relobj::output_section_address): New function.
15612 (Sized_relobj::include_section_group): Add new parameters. Change
15613 calls to Layout::add_comdat. Change to build table of kept comdat
15614 groups and table mapping discarded sections to kept sections.
15615 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15616 (Sized_relobj::do_layout): Change calls to include_section_group and
15617 include_linkonce_section.
15618 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15619 value to zero when section is discarded.
15620 (Sized_relobj::map_to_kept_section): New function.
15621 * object.h (Relobj::output_section_address): New function.
15622 (Relobj::Comdat_group): New type.
15623 (Relobj::find_comdat_group): New function.
15624 (Relobj::Comdat_group_table): New type.
15625 (Relobj::Kept_comdat_section): New type.
15626 (Relobj::Kept_comdat_section_table): New type.
15627 (Relobj::add_comdat_group): New function.
15628 (Relobj::set_kept_comdat_section): New function.
15629 (Relobj::get_kept_comdat_section): New function.
15630 (Relobj::comdat_groups_): New field.
15631 (Relobj::kept_comdat_sections_): New field.
15632 (Symbol_value::input_value): Update comment.
15633 (Sized_relobj::map_to_kept_section) New function.
15634 (Sized_relobj::include_linkonce_section): Add new parameter.
15635 * target-reloc.h (Comdat_behavior): New type.
15636 (get_comdat_behavior): New function.
15637 (relocate_section): Add code to map a discarded section to the
15638 corresponding kept section when applying a relocation.
15639
e4e5049b
CS
156402008-04-30 Craig Silverstein <csilvers@google.com>
15641
15642 * dwarf_reader.cc (next_generation_count): New static var.
15643 (Addr2line_cache_entry): New struct.
15644 (addr2line_cache): New static var.
15645 (Dwarf_line_info::one_addr2line): Added caching.
15646 (Dwarf_line_info::clear_addr2line_cache): New function.
15647 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15648 cache-size parameter.
15649 (Dwarf_line_info::one_addr2line_cache): New function.
15650 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15651 new cache-size argument to one_addr2line(), and clear cache.
15652
d09e9154
CC
156532008-04-28 Cary Coutant <ccoutant@google.com>
15654
15655 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15656 R_386_PC8 relocations.
15657
7ef73768
ILT
156582008-04-23 Ian Lance Taylor <iant@google.com>
15659
55438702
ILT
15660 * object.cc (Sized_relobj::include_section_group): Check for
15661 invalid section group.
15662
c165fb93
ILT
15663 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15664 header size.
15665
7ef73768
ILT
15666 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15667 than read for file header.
15668 * archive.cc (Archive::include_member): Likewise.
15669
6194aaab
L
156702008-04-23 Paolo Bonzini <bonzini@gnu.org>
15671
15672 * aclocal.m4: Regenerate.
15673 * configure: Regenerate.
15674
d491d34e
ILT
156752008-04-19 Ian Lance Taylor <iant@google.com>
15676
5ea2bac6
ILT
15677 * version.cc (version_string): Bump to 1.6.
15678
7bc3e21a
ILT
15679 * testsuite/Makefile.am (many_sections_r_test): New target.
15680 (many_sections_r_test_SOURCES): Remove.
15681 (many_sections_r_test_DEPENDENCIES): Remove.
15682 (many_sections_r_test_LDFLAGS): Remove.
15683 (many_sections_r_test_LDADD): Remove.
15684
7fcd3aa9
ILT
15685 * object.cc (Sized_relobj::do_add_symbols): Always pass
15686 local_symbol_count_ to add_from_relobj.
15687
4c94d6ae
ILT
15688 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15689 every thousand variables.
15690 * testsuite/Makefile.in: Rebuild.
15691
d491d34e
ILT
15692 * object.cc (Xindex::initialize_symtab_xindex): New function.
15693 (Xindex::read_symtab_xindex): New function.
15694 (Xindex::sym_xindex_to_shndx): New function.
15695 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15696 available.
15697 (Sized_relobj::do_initialize_xindex): New function.
15698 (Sized_relobj::do_read_symbols): Adjust section links.
15699 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15700 parameter. Change all callers.
15701 (Sized_relobj::include_section_group): Adjust section links and
15702 symbol section indexes.
15703 (Sized_relobj::do_layout): Adjust section links.
15704 (Sized_relobj::do_count_local_symbols): Adjust section links and
15705 symbol section indexes.
15706 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15707 ordinary and special symbols.
15708 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15709 dynsym_xindex parameters. Change all callers. Adjust section
15710 links. Use SHN_XINDEX when needed.
15711 (Sized_relobj::get_symbol_location_info): Adjust section links.
15712 Don't get fooled by special symbols.
15713 * object.h (class Xindex): Define.
15714 (class Object): Add xindex_ parameter. Declare virtual functoin
15715 do_initialize_xindex.
15716 (Object::adjust_sym_shndx): New function.
15717 (Object::set_xindex): New protected function.
15718 (class Symbol_value): Add is_ordinary_shndx_ field.
15719 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15720 (Symbol_value::value): Assert ordinary section.
15721 (Symbol_value::initialize_input_to_output_map): Likewise.
15722 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15723 Change all callers.
15724 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15725 all callers.
15726 (class Sized_relobj): Update declarations.
15727 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15728 parameter. Change all callers.
15729 (Sized_relobj::adjust_shndx): New function.
15730 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15731 field.
15732 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15733 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15734 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15735 (Sized_dynobj::read_dynsym_section): Adjust section links.
15736 (Sized_dynobj::read_dynamic): Likewise.
15737 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15738 section links.
15739 (Sized_dynobj::do_initialize_xindex): New function.
15740 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15741 do_initialize_xindex.
15742 (Sized_dynobj::adjust_shndx): New function.
15743 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15744 dynsym_xindex_ fields.
15745 (Layout::finalize): Add a call to set_section_indexes before
15746 creating the symtab sections.
15747 (Layout::set_section_indexes): Don't do anything if the section
15748 already has a section index.
15749 (Layout::create_symtab_sections): Add shnum parameter. Change
15750 caller. Create .symtab_shndx section if needed.
15751 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15752 caller.
15753 (Layout::allocated_output_section_count): New function.
15754 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15755 needed.
15756 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15757 fields. Update declarations.
15758 (Layout::symtab_xindex): New function.
15759 (Layout::dynsym_xindex): New function.
15760 (class Write_symbols_task): Add layout_ field.
15761 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15762 Change caller.
15763 * output.cc (Output_section_headers::Output_section_headers): Add
15764 shstrtab_section parameter. Change all callers.
15765 (Output_section_headers::do_sized_write): Store overflow values
15766 for section count and section string table section index in
15767 section header zero.
15768 (Output_file_header::do_sized_write): Check for overflow of
15769 section count and section string table section index.
15770 (Output_symtab_xindex::do_write): New function.
15771 (Output_symtab_xindex::endian_do_write): New function.
15772 * output.h (class Output_section_headers): Add shstrtab_section_.
15773 Update declarations.
15774 (class Output_symtab_xindex): Define.
15775 (Output_section::has_out_shndx): New function.
15776 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15777 field.
15778 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15779 Change all callers.
15780 (Sized_symbol::init): Likewise.
15781 (Symbol::output_section): Check for ordinary symbol.
15782 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15783 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15784 callers.
15785 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15786 Change all callers. Simplify handling of symbols from sections
15787 not included in the link.
15788 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15789 distinction.
15790 (Weak_alias_sorter::operator()): Assert that symbols are
15791 ordinary.
15792 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15793 distinction.
15794 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15795 parameters. Change all callers.
15796 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15797 symbol distinction. Use SHN_XINDEX when needed.
15798 (Symbol_table::write_section_symbol): Add symtab_xindex
15799 parameter. Change all callers.
15800 (Symbol_table::sized_write_section_symbol): Likewise. Use
15801 SHN_XINDEX when needed.
15802 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15803 declarations.
15804 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15805 (Symbol::is_defined): Check is_ordinary.
15806 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15807 (Symbol::is_absolute, Symbol::is_common): Likewise.
15808 (class Sized_symbol): Update declarations.
15809 (class Symbol_table): Update declarations.
15810 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15811 parameters. Change all callers.
15812 (Sized_symbol::override): Likewise.
15813 (Symbol_table::override): Likewise.
15814 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15815 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15816 is_ordinary, and orig_st_shndx parameters. Change all callers.
15817 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15818 to be in an ordinary section.
15819 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15820 object and is_ordinary parameters. Change all callers.
15821 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15822 Change all callers. Don't add undefined or non-ordinary symbols
15823 to reloc_map_.
15824 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15825 Change all callers.
15826 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15827 declarations.
15828 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15829 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15830 (Sized_relobj::relocate_sections): Likewise.
15831 * target-reloc.h (scan_relocs): Adjust section symbol index.
15832 (scan_relocatable_relocs): Likewise.
15833 * i386.cc (Scan::local): Check for ordinary symbols.
15834 * sparc.cc (Scan::local): Likewise.
15835 * x86_64.cc (Scan::local): Likewise.
15836 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15837 to symbol_section_and_value.
15838 * testsuite/many_sections_test.cc: New file.
15839 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15840 (check_PROGRAMS): Add many_sections_test.
15841 (many_sections_test_SOURCES): Define.
15842 (many_sections_test_DEPENDENCIES): Define.
15843 (many_sections_test_LDFLAGS): Define.
15844 (BUILT_SOURCES): Add many_sections_define.h.
15845 (many_sections_define.h): New target.
15846 (BUILT_SOURCES): Add many_sections_check.h.
15847 (many_sections_check.h): New target.
15848 (check_PROGRAMS): Add many_sections_r_test.
15849 (many_sections_r_test_SOURCES): Define.
15850 (many_sections_r_test_DEPENDENCIES): Define.
15851 (many_sections_r_test_LDFLAGS): Define.
15852 (many_sections_r_test_LDADD): Define.
15853 (many_sections_r_test.o): New target.
15854 * testsuite/Makefile.in: Rebuild.
15855
c5818ff1
CC
158562008-04-17 Cary Coutant <ccoutant@google.com>
15857
15858 * errors.cc (Errors::info): New function.
15859 (gold_info): New function.
15860 * errors.h (Errors::info): New function.
15861 * gold.h (gold_info): New function.
15862 * object.cc (Input_objects::add_object): Print trace output.
15863 * options.cc (options::parse_set): New function.
15864 (General_options::parse_wrap): Deleted.
15865 (General_options::General_options): Deleted initializer.
15866 * options.h (options::String_set): New typedef.
15867 (options::parse_set): New function.
15868 (DEFINE_set): New macro.
15869 (General_options::wrap): Changed to use DEFINE_set. Changed
15870 callers of any_wrap_symbols and is_wrap_symbol.
15871 (General_options::trace, General_options::trace_symbol):
15872 New options.
15873 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15874 (General_options::wrap_symbols_): Deleted.
15875 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15876
b5be4a7c
DM
158772008-04-17 David S. Miller <davem@davemloft.net>
15878
15879 * options.cc (General_options::parse_V): New function.
15880 * options.h: Add entries for -V and -Qy.
15881
155a0dd7
ILT
158822008-04-17 Ian Lance Taylor <iant@google.com>
15883
15884 * common.cc (Symbol_table::allocate_commons): Remove options
15885 parameter. Change caller.
15886 (Symbol_table::do_allocate_commons): Remove options parameter.
15887 Change caller. Just call do_allocate_commons_list twice.
15888 (Symbol_table::do_allocate_commons_list): New function, broken out
15889 of do_allocate_commons.
15890 * common.h (class Allocate_commons_task): Remove options_ field.
15891 Update constructor.
15892 * symtab.cc (Symbol_table::Symbol_table): Initialize
15893 tls_commons_.
15894 (Symbol_table::add_from_object): Put TLS common symbols on
15895 tls_commons_ list.
15896 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15897 which are IN_OUTPUT_DATA.
15898 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15899 allocate_commons and do_allocate_commons declarations. Declare
15900 do_allocate_commons_list.
15901 * gold.cc (queue_middle_tasks): Update creation of
15902 Allocate_commons_task to not pass options.
15903 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15904 (TLS_TEST_C_FLAGS): New variable.
15905 (tls_test_c_pic.o): New target.
15906 (tls_test_shared.so): Link in tls_test_c_pic.o.
15907 (tls_test_c_pic_ie.o): New target.
15908 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15909 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15910 (tls_test_c.o): New target.
15911 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15912 (tls_pic_test_LDADD): Likewise.
15913 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15914 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15915 (tls_test_c_gnu2.o): New target.
15916 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15917 tls_test_c_gnu2.o.
15918 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15919 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15920 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15921 * testsuite/tls_test.cc: Include "config.h".
15922 (t_last): Call t11_last.
15923 * testsuite/tls_test.h (t11, t11_last): Declare.
15924 * testsuite/tls_test_c.c: New file.
15925 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15926 * configure.ac: Check for OpenMP support.
15927 * configure, config.in, Makefile.in: Rebuild.
15928 * testsuite/Makefile.in: Rebuild.
15929
edfbb029
CC
159302008-04-16 Cary Coutant <ccoutant@google.com>
15931
15932 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15933 (Target_i386::tls_base_symbol_defined_): New field.
15934 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15935 (Target_i386::Scan::global): Likewise.
15936 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15937 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15938 (Target_x86_64::tls_base_symbol_defined_): New field.
15939 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15940 (Target_x86_64::Scan::global): Likewise.
15941
f3c69fca
CC
159422008-04-16 Cary Coutant <ccoutant@google.com>
15943
15944 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15945 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15946 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15947 building shared libraries.
15948 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15949 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15950 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15951 * testsuite/Makefile.in: Rebuild.
15952 * testsuite/weak_undef.h: New file.
15953 * testsuite/weak_undef_file1.cc: Add extra test cases.
15954 * testsuite/weak_undef_file2.cc: Likewise.
15955 * testsuite/weak_undef_test.cc: Likewise.
15956
7c414435
DM
159572008-04-16 David S. Miller <davem@davemloft.net>
15958
32b769e1
DM
15959 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15960 Add issued_non_pic_error_ field. Declare check_non_pic.
15961 (Target_sparc::Scan::check_non_pic): New function.
15962 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15963 (Target_sparc::Scan::global): Likewise.
15964
11936fb1
DM
15965 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15966 * configure: Rebuild.
15967
7c414435
DM
15968 * options.h (DEFINE_enable): New macro.
15969 (new_dtags): New enable option.
15970 (initfirst, interpose, loadfltr, nodefaultlib,
15971 nodelete, nodlopen, nodump): New -z options.
15972 * layout.cc (Layout:finish_dynamic_section): If new
15973 dtags enabled, emit DT_RUNPATH. Also, emit a
15974 DT_FLAGS_1 containing any specified -z flags.
15975
85c7bf8b
ILT
159762008-04-16 Ian Lance Taylor <iant@google.com>
15977
12c0daef
ILT
15978 * copy-relocs.cc: New file.
15979 * copy-relocs.h: New file.
15980 * reloc.cc: Remove Copy_relocs code.
15981 * reloc.h: Likewise.
15982 * reloc-types.h (struct Reloc_types) [both versions]: Add
15983 get_reloc_addend_noerror.
15984 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15985 variants of add_global which take an addend which must be zero.
15986 * i386.cc: Include "copy-relocs.h".
15987 (class Target_i386): Change type of copy_relocs_ to variable,
15988 update initializer.
15989 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15990 Change all callers.
15991 (Target_i386::do_finalize_sections): Change handling of
15992 copy_relocs_.
15993 * sparc.cc: Include "copy-relocs.h".
15994 (class Target_sparc): Change type of copy_relocs_ to variable,
15995 update initializer.
15996 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15997 Change all callers.
15998 (Target_sparc::do_finalize_sections): Change handling of
15999 copy_relocs_.
16000 * x86_64.cc: Include "copy-relocs.h".
16001 (class Target_x86_64): Change type of copy_relocs_ to variable,
16002 update initializer.
16003 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16004 class. Change all callers.
16005 (Target_x86_64::do_finalize_sections): Change handling of
16006 copy_relocs_.
16007 * Makefile.am (CCFILES): Add copy-relocs.cc.
16008 (HFILES): Add copy-relocs.h.
16009
4f4995b6
ILT
16010 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16011
85c7bf8b
ILT
16012 * testsuite/script_test_4.sh: Permit leading zeroes.
16013
4f2a9edd
ILT
160142008-04-15 Ian Lance Taylor <iant@google.com>
16015
e6188289
ILT
16016 * script-sections.cc (Script_sections::create_segments): Use
16017 header_size_adjustment even when there is enough room for the
16018 headers.
16019 * testsuite/script_test_4.sh: New file.
16020 * testsuite/script_test_4.t: New file.
16021 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16022 (check_DATA): Add script_test_4.stdout.
16023 (MOSTLYCLEANFILES): Likewise.
16024 (script_test_4): New target.
16025 (script_test_4.stdout): New target.
16026 * testsuite/Makefile.in: Rebuild.
16027
4f2a9edd
ILT
16028 * sparc.cc: Add definitions for Output_data_plt_sparc class
16029 constants.
16030
f5314dd5
DM
160312008-04-14 David S. Miller <davem@davemloft.net>
16032
16033 * sparc.cc: New file.
16034 * Makefile.am (TARGETSOURCES): Add sparc.cc
16035 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16036 * configure.tgt: Document targ_extra_size and
16037 targ_extra_big_endian. Add entries for sparc-* and
16038 sparc64-*.
16039 * configure.ac: Handle targ_extra_size and
16040 targ_extra_big_endian.
16041 * Makefile.in: Rebuild.
16042 * configure: Likewise.
16043 * po/POTFILES.in: Likewise.
16044 * po/gold.pot: Likewise.
16045
154e0e9a
ILT
160462008-04-14 Ian Lance Taylor <iant@google.com>
16047
16048 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16049 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16050 in the name/type/flags to section mapping. Don't call
16051 allocate_output_section.
16052 (Layout::choose_output_section): Change parameter from adjust_name
16053 to is_input_section. Don't permit input sections after sections
16054 are attached to segments. Don't call allocate_output_section.
16055 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16056 not write_enable_output_section.
16057 (Layout::make_output_section): Don't push to
16058 unattached_section_list_ nor call attach_to_segment. Call
16059 attach_section_to_segment if sections are attached.
16060 (Layout::attach_sections_to_segments): New function.
16061 (Layout::attach_section_to_segment): New function.
16062 (Layout::attach_allocated_section_to_segment): Rename from
16063 attach_to_segment. Remove flags parameter.
16064 (Layout::allocate_output_section): Remove function.
16065 (Layout::write_enable_output_section): Remove function.
16066 * layout.h (class Layout): Update for above changes. Add new
16067 field sections_are_attached_.
16068 * output.h (Output_section::update_flags_for_input_section): New
16069 function.
16070 * output.cc (Output_section::add_input_section): Call
16071 update_flags_for_input_section.
16072 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16073
009a67a2
CC
160742008-04-11 Cary Coutant <ccoutant@google.com>
16075
16076 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16077 thought unnecessary.
16078 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16079
759b1a24
ILT
160802008-04-11 Ian Lance Taylor <iant@google.com>
16081
16082 * output.h (class Output_section_data): Remove inline definition
16083 of set_addralign.
16084 * output.cc (Output_section_data::set_addralign): New function.
16085
c2b45e22
CC
160862008-04-11 Cary Coutant <ccoutant@google.com>
16087
16088 Add support for TLS descriptors for i386 and x86_64.
16089 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16090 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16091 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16092 GOT_TYPE_TLS_DESC.
16093 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16094 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16095 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16096 relocations.
16097 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16098 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16099 Fix problem with initial-exec relocations.
16100 (Target_i386::Relocate::relocate_tls): Likewise.
16101 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16102 relaxation.
16103 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16104 support for section-plus-offset dynamic table entries.
16105 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16106 (Output_data_dynamic::Dynamic_entry): Add support for
16107 section-plus-offset dynamic table entries.
16108 (Output_data_dynamic::Classification): Likewise.
16109 (Output_data_dynamic::classification_): Renamed offset_.
16110 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16111 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16112 (Target_x86_64::make_plt_section): New function.
16113 (Target_x86_64::reserve_tlsdesc_entries): New function.
16114 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
16115 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
16116 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
16117 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
16118 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
16119 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
16120 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
16121 add extra PLT entry for TLS descriptors.
16122 (Output_data_plt_x86_64::got_): New field.
16123 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
16124 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
16125 fields.
16126 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
16127 descriptors.
16128 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
16129 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
16130 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
16131 R_386_TLS_DESC_CALL relocations.
16132 (Target_x86_64::Scan::global): Likewise.
16133 (Target_x86_64::do_finalize_sections): Add dynamic table entries
16134 for TLS descriptors.
16135 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
16136 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
16137 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
16138 GD-to-IE relaxation.
16139 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
16140 and TLS_DESCRIPTORS.
16141 * Makefile.in: Rebuild.
16142 * configure: Rebuild.
16143 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
16144 (tls_test_shared2.so): New target.
16145 (tls_shared_gd_to_ie_test_SOURCES): New variable.
16146 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
16147 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
16148 (tls_shared_gd_to_ie_test_LDADD): New variable.
16149 (tls_shared_gnu2_gd_to_ie_test): New target.
16150 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
16151 New targets.
16152 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
16153 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
16154 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
16155 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
16156 (tls_shared_gnu2_test): New target.
16157 (tls_test_gnu2_shared.so): New target.
16158 (tls_shared_gnu2_test_SOURCES): New variable.
16159 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
16160 (tls_shared_gnu2_test_LDFLAGS): New variable.
16161 (tls_shared_gnu2_test_LDADD): New variable.
16162 * testsuite/Makefile.in: Rebuild.
16163 * testsuite/Makefile.
16164
83bfb6b7
ILT
161652008-04-11 Ian Lance Taylor <iant@google.com>
16166
16167 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
16168 justsyms.t.
16169 * testsuite/Makefile.in: Rebuild.
16170
16171 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
16172 long.
16173 * testsuite/script_test_2.cc (main): Adjust test.
16174
706e1f5e
ILT
161752008-04-11 David S. Miller <davem@davemloft.net>
16176 Ian Lance Taylor <iant@google.com>
16177
16178 * options.h (General_options): Add entries for '-Y' and
16179 '-relax'.
16180 * options.cc (General_options:finalize): If -Y was used, add those
16181 entries to the library path instead of the default "/lib" and
16182 "/usr/lib".
16183
7c98e6bb
DM
161842008-04-11 David S. Miller <davem@davemloft.net>
16185
16186 * testsuite/justsyms.t: Start at 0x100.
16187 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
16188 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
16189 long.
16190 * testsuite/script_test_2.cc: Adjust string and section length
16191 checks.
7c98e6bb 16192
99a37bfd
ILT
161932008-04-09 Ian Lance Taylor <iant@google.com>
16194
2cefc357
ILT
16195 PR gold/5996
16196 * script-sections.cc (Sections_element::allocate_to_segment): Add
16197 orphan parameter.
16198 (Output_section_definition::allocate_to_segment): Likewise.
16199 (Orphan_output_section::allocate_to_segment): Likewise.
16200 (Script_sections::attach_sections_using_phdrs_clause): Don't
16201 propagate non-PT_LOAD segments to orphan sections.
16202 * testsuite/Makefile.am (script_test_3.stdout): Generate using
16203 readelf rather than objdump.
16204 * testsuite/script_test_3.sh: Adjust accordingly. Test that
16205 .interp section and PT_INTERP segment are the same size.
16206 * testsuite/Makefile.in: Rebuild.
16207
99a37bfd
ILT
16208 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
16209 aliases for symbols defined in the same object.
16210 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
16211 (weak_alias_test_SOURCES): New variable.
16212 (weak_alias_test_DEPENDENCIES): New variable.
16213 (weak_alias_test_LDFLAGS): New variable.
16214 (weak_alias_test_LDADD): New variable.
16215 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
16216 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
16217 (weak_alias_test_3.o): New target.
16218 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
16219 * testsuite/weak_alias_test_main.cc: New file.
16220 * testsuite/weak_alias_test_1.cc: New file.
16221 * testsuite/weak_alias_test_2.cc: New file.
16222 * testsuite/weak_alias_test_3.cc: New file.
16223
780e49c5
ILT
162242008-04-08 Ian Lance Taylor <iant@google.com>
16225
cdb0b8f5
ILT
16226 * options.h (class General_options): Add --noinhibit-exec option.
16227 * main.cc (main): Check --noinhibit-exec.
16228
0864d551
ILT
16229 * options.h (class General_options): Define --wrap as a special
16230 option. Add wrap_symbols_ field.
16231 (General_options::any_wrap_symbols): New function.
16232 (General_options::is_wrap_symbol): New function.
16233 * options.cc (General_options::parse_wrap): New function.
16234 (General_options::General_options): Initialize wrap_symbols_.
16235 * symtab.cc (Symbol_table::wrap_symbol): New function.
16236 (Symbol_table::add_from_object): Handle --wrap.
16237 * symtab.h (class Symbol_table): Declare wrap_symbol.
16238 * target.h (Target::wrap_char): New function.
16239 (Target::Target_info): Add wrap_char field.
16240 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
16241 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
16242 * testsuite/testfile.cc (Target_test::test_target_info):
16243 Likewise.
16244
789aa6de
ILT
16245 * errors.cc (Errors::undefined_symbol): Mention symbol version if
16246 there is one.
16247
2c38906f
ILT
16248 * layout.h (class Layout): Add added_eh_frame_data_ field.
16249 * layout.cc (Layout::Layout): Initialize new field.
16250 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
16251 output section until we find a section we merged successfully.
16252 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
16253 that the size be non-zero.
16254
780e49c5
ILT
16255 * merge.cc (Object_merge_map::get_output_offset): Remove inline
16256 qualifier.
16257
7fcd0256
ILT
162582008-04-08 Craig Silverstein <csilvers@google.com>
16259
16260 * configure.ac: Export new conditional variable HAVE_ZLIB.
16261 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
16262 on HAVE_ZLIB.
16263 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
16264 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16265
6835af53
ILT
162662008-04-07 Ian Lance Taylor <iant@google.com>
16267
e24f324c
ILT
16268 * version.cc (version_string): Set to "1.5".
16269
a036edd8
ILT
16270 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
16271 Add issued_non_pic_error_ field. Declare check_non_pic.
16272 (Target_x86_64::Scan::check_non_pic): New function.
16273 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
16274 (Target_x86_64::Scan::global): Likewise.
16275
624f8810
ILT
16276 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
16277 addend parameter. Change caller. Handle merge sections.
16278 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
16279 Address to Addend. Don't add in the result of
16280 local_section_offset, pass down the addend and use the returned
16281 value.
16282 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
16283 Update declarations of local_section_offset and symbol_value.
16284 * testsuite/two_file_test_1.cc (t18): New function.
16285 * testsuite/two_file_test_2.cc (f18): New function.
16286 * testsuite/two_file_test_main.cc (main): Call t18.
16287 * testsuite/two_file_test.h (t18, f18): Declare.
16288
6835af53
ILT
16289 * configure.ac: Don't test for objdump, c++filt, or readelf.
16290 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
16291 conditionals.
16292 (TEST_READELF): New variable.
16293 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
16294 (check_PROGRAMS): Add two_file_strip_test.
16295 (two_file_strip_test): New target.
16296 (check_PROGRAMS): Add two_file_same_shared_strip_test.
16297 (two_file_same_shared_strip_test_SOURCES): New variable.
16298 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
16299 (two_file_same_shared_strip_test_LDFLAGS): New variable.
16300 (two_file_same_shared_strip_test_LDADD): New variable.
16301 (two_file_shared_strip.so): New target.
16302 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
16303 (ver_test_5.syms, ver_test_7.syms): Likewise.
16304 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
16305 (strip_test_3.stdout): Use TEST_OBJDUMP.
16306 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16307
86925eef
CC
163082008-04-04 Cary Coutant <ccoutant@google.com>
16309
16310 * symtab.h (Symbol::is_weak_undefined): New function.
16311 (Symbol::is_strong_undefined): New function.
16312 (Symbol::is_absolute): New function.
16313 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
16314 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
16315 absolute symbols.
16316 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
16317 (weak_undef_test): New target.
16318 * testsuite/Makefile.in: Rebuild.
16319 * testsuite/weak_undef_file1.cc: New file.
16320 * testsuite/weak_undef_file2.cc: New file.
16321 * testsuite/weak_undef_test.cc: New file.
16322
126f3ece
ILT
163232008-04-03 Craig Silverstein <csilvers@google.com>
16324
16325 * compressed_output.h (class Output_compressed_section): Use
16326 unsigned buffer.
16327 * compressed_output.cc (zlib_compress): Use unsigned buffers,
16328 add zlib header.
16329 (zlib_compressed_suffix): Removed.
16330 (Output_compressed_section::set_final_data_size): Use unsigned
16331 buffers.
16332 * testsuite/Makefile.am (flagstest_compress_debug_sections):
16333 Fix linker invocation.
16334 (flagstest_o_specialfile_and_compress_debug_sections):
16335 Likewise.
16336 * testsuite/Makefile.in: Regenerated.
16337
deae2a14
DM
163382008-04-02 David S. Miller <davem@davemloft.net>
16339
16340 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
16341 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
16342
70752818
ILT
163432008-04-02 Craig Silverstein <csilvers@google.com>
16344
16345 * TODO: New file.
16346
39d0cb0e
ILT
163472008-04-02 Ian Lance Taylor <iant@google.com>
16348
16349 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16350 parameters. Update for new key type to views_. Change all
16351 callers.
16352 (File_read::read): Adjust for byteshift in returned view.
16353 (File_read::add_view): New function, broken out of
16354 find_and_make_view.
16355 (File_read::make_view): New function, broken out of
16356 find_and_make_view.
16357 (File_read::find_or_make_view): Add offset and aligned
16358 parameters. Rewrite accordingly. Change all callers.
16359 (File_read::get_view): Add offset and aligned parameters. Adjust
16360 for byteshift in return value.
16361 (File_read::get_lasting_view): Likewise.
16362 * fileread.h (class File_read): Update declarations.
16363 (class File_read::View): Add byteshift_ field. Add byteshift to
16364 constructor. Add byteshift method.
16365 * archive.h (Archive::clear_uncached_views): New function.
16366 (Archive::get_view): Add aligned parameter. Change all callers.
16367 * object.h (Object::get_view): Add aligned parameter. Change all
16368 callers.
16369 (Object::get_lasting_view): Likewise.
16370
16371 * fileread.cc (File_read::release): Don't call clear_views if
16372 there are multiple objects.
16373 * fileread.h (File_read::clear_uncached_views): New function.
16374 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16375 on the archive.
16376
a1207466
CC
163772008-03-31 Cary Coutant <ccoutant@google.com>
16378
16379 Add thin archive support.
16380 * archive.cc (Archive::armagt): New const.
16381 (Archive::setup): Remove task parameter and calls to unlock.
16382 (Archive::unlock_nested_archives): New function.
16383 (Archive::read_header): Add nested_off parameter. Change
16384 all callers.
16385 (Archive::interpret_header): Likewise.
16386 (Archive::include_all_members): Change to handle thin
16387 archives.
16388 (Archive::include_member): Likewise.
16389 * archive.h (Archive::Archive): Add new parameters and
16390 initializers.
16391 (Archive::armagt): New const.
16392 (Archive::setup): Remove task parameter.
16393 (Archive::unlock_nested_archives): New function.
16394 (Archive::read_header): Add nested_off parameter.
16395 (Archive::interpret_header): Likewise.
16396 (Archive::Nested_archive_table): New typedef.
16397 (Archive::is_thin_archive_): New field.
16398 (Archive::nested_archives_): New field.
16399 (Archive::options_): New field.
16400 (Archive::dirpath_): New field.
16401 (Archive::task_): New field.
16402 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16403 for thin archives. Pass additional parameters to
16404 Archive::Archive. Unlock the archive file after calling
16405 Archive::setup.
cd536b21 16406
479f6503
ILT
164072008-03-29 Ian Lance Taylor <iant@google.com>
16408
686c8caf
ILT
16409 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16410 version symbol to be local.
16411 * testsuite/ver_test_4.sh: New file.
16412 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16413 (check_DATA): Add ver_test_4.syms.
16414 (ver_test_4.syms): New target.
16415 * testsuite/Makefile.in: Rebuild.
16416
ab794b6b
ILT
16417 * output.cc
16418 (Output_section::Input_section_sort_entry::has_priority): New
16419 function.
16420 (Output_section::Input_section_sort_entry::match_file_name): New
16421 function.
16422 (Output_section::Input_section_sort_entry::match_section_name):
16423 Remove.
16424 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16425 Remove.
16426 (Output_section::Input_section_sort_entry::match_section_file):
16427 Remove.
16428 (Output_section::Input_section_sort_compare::operator()): Rewrite
16429 using new Input_section_sort_entry functions. Sort crtbegin and
16430 crtend first. Sort sections with no priority before sections with
16431 a priority.
16432 * testsuite/initpri1.c (d3): Check j != 4.
16433 (cd5): New constructor/destructor function.
16434 (main): Check j != 2.
16435
479f6503
ILT
16436 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16437 new symbol when resolving, don't call set_is_default.
16438 * testsuite/ver_test_7.cc: New file.
16439 * testsuite/ver_test_7.sh: New file.
16440 * testsuite/Makefile.am (ver_test_7.so): New target.
16441 (ver_test_7.o): New target.
16442 (check_SCRIPTS): Add ver_test_7.sh.
16443 (check_DATA): Add ver_test_7.syms.
16444 (ver_test_7.syms): New target.
16445
2fd32231
ILT
164462008-03-28 Ian Lance Taylor <iant@google.com>
16447
16448 * layout.cc (Layout::layout): If we see an input section with a
16449 name that needs sorting, set the must_sort flag for the output
16450 section.
16451 (Layout::make_output_section): If the name of the output section
16452 indicates that it might require sorting, set the may_sort flag.
16453 * output.h (Output_section::may_sort_attached_input_sections): New
16454 function.
16455 (Output_section::set_may_sort_attached_input_sections): New
16456 function.
16457 (Output_section::must_sort_attached_input_sections): New
16458 function.
16459 (Output_section::set_must_sort_attached_input_sections): New
16460 function.
16461 (class Output_section): Declare Input_section_sort_entry. Define
16462 Input_section_sort_compare. Declare
16463 sort_attached_input_sections. Add new fields:
16464 may_sort_attached_input_sections_,
16465 must_sort_attached_input_sections_,
16466 attached_input_sections_are_sorted_.
16467 * output.cc (Output_section::Output_section): Initialize new
16468 fields.
16469 (Output_section::add_input_section): Add an entry to
16470 input_sections_ if may_sort or must_sort are true.
16471 (Output_section::set_final_data_size): Call
16472 sort_attached_input_sections if necessary.
16473 (Output_section::Input_section_sort_entry): Define new class.
16474 (Output_section::Input_section_sort_compare::operator()): New
16475 function.
16476 (Output_section::sort_attached_input_sections): New function.
16477 * configure.ac: Check whether the compiler supports constructor
16478 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16479 * testsuite/initpri1.c: New file.
16480 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16481 CONSTRUCTOR_PRIORITY.
16482 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16483 (initpri1_LDFLAGS): New variable.
16484 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16485
18e6b24e
ILT
164862008-03-27 Ian Lance Taylor <iant@google.com>
16487
49bdd526
ILT
16488 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16489 * testsuite/common_test_1.c: New file.
16490 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16491 (common_test_1_SOURCES): New variable.
16492 (common_test_1_DEPENDENCIES): New variable.
16493 (common_test_1_LDFLAGS): New variable.
16494
18e6b24e
ILT
16495 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16496 and commons_ correctly when NAME/VERSION does not override
16497 NAME/NULL.
16498 * testsuite/ver_test_6.c: New file.
16499 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16500 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16501 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16502
04bf7072
ILT
165032008-03-26 Ian Lance Taylor <iant@google.com>
16504
5871526f
ILT
16505 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16506 of an undefined symbol from a version script.
16507 * testsuite/Makefile.am (ver_test_5.so): New target.
16508 (ver_test_5.o): New target.
16509 (check_SCRIPTS): Add ver_test_5.sh.
16510 (check_DATA): Add ver_test_5.syms.
16511 (ver_test_5.syms): New target.
16512 * testsuite/ver_test_5.cc: New file.
16513 * testsuite/ver_test_5.script: New file.
16514 * testsuite/ver_test_5.sh: New file.
16515 * Makefile.in, testsuite/Makefile.in: Rebuild.
16516
04bf7072
ILT
16517 PR gold/5986
16518 Fix problems building gold with gcc 4.3.0.
16519 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16520 (gold_error_at_location, gold_warning_at_location): Use it.
16521 * configure.ac: Check whether we can compile and use a template
16522 function with a printf attribute.
16523 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16524 when jumping over bytes.
16525 * object.cc: Instantiate Object::read_section_data.
16526 * debug.h: Include <cstring>
16527 * dwarf_reader.cc: Include <algorithm>
16528 * main.cc: Include <cstring>.
16529 * options.cc: Include <cstring>.
16530 * output.cc: Include <cstring>.
16531 * script.cc: Include <cstring>.
16532 * script.h: Include <string>.
16533 * symtab.cc: Include <cstring> and <algorithm>.
16534 * target-select.cc: Include <cstring>.
16535 * version.cc: Include <string>.
16536 * testsuite/testmain.cc: Include <cstdlib>.
16537 * configure, config.in: Rebuild.
16538
874c5b28
ILT
165392008-03-25 Ian Lance Taylor <iant@google.com>
16540
819d6c3a
ILT
16541 * options.cc: Include "../bfd/bfdver.h".
16542 (options::help): Print bug reporting address.
16543
f4b2c6f5
ILT
16544 * version.cc (print_version): Adjust output for current value of
16545 BFD_VERSION_STRING.
16546
16547 * NEWS: New file.
16548
e96caa79
ILT
16549 * options.cc (options::help): Print list of supported targets.
16550 * target-select.h: Include <vector>.
16551 (class Target_selector): Make machine_, size_, and is_big_endian_
16552 fields const. Add bfd_name_ and instantiated_target_ fields.
16553 (Target_selector::Target_selector): Add bfd_name parameter.
16554 (Target_selector::recognize): Make non-virtual, call
16555 do_recognize.
16556 (Target_selector::recognize_by_name): Make non-virtual, call
16557 do_recognize_by_name.
16558 (Target_selector::supported_names): New function.
16559 (Target_selector::bfd_name): New function.
16560 (Target_selector::do_instantiate_target): New pure virtual
16561 function.
16562 (Target_selector::do_recognize): New virtual function.
16563 (Target_selector::do_recognize_by_name): New virtual function.
16564 (Target_selector::instantiate_target): New private function.
16565 (supported_target_names): Declare.
16566 * target-select.cc (Target_selector::Target_selector): Update for
16567 new parameter and fields.
16568 (select_target_by_name): Check that the name matches before
16569 calling recognize_by_name.
16570 (supported_target_names): New function.
16571 * i386.cc (class Target_selector_i386): Update Target_selector
16572 constructor call. Remove recognize and recognize_by_name. Add
16573 do_instantiate_target.
16574 * x86_64.cc (class Target_selector_x86_64): Likewise.
16575 * testsuite/testfile.cc (class Target_selector_test): Update for
16576 changes to Target_selector.
16577
874c5b28
ILT
16578 * README: Rewrite, with some notes on unsupported features.
16579
0a65a3a7
CC
165802008-03-24 Cary Coutant <ccoutant@google.com>
16581
16582 * i386.cc (Target_i386::Got_type): New enum declaration.
16583 (Target_i386::Scan::local): Updated callers of Output_data_got
16584 member functions.
16585 (Target_i386::Scan::global): Likewise.
16586 (Target_i386::Relocate::relocate): Likewise.
16587 (Target_i386::Relocate::relocate_tls): Likewise.
16588 * object.h (Got_offset_list): New class.
16589 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16590 (Sized_relobj::local_got_offset): Likewise.
16591 (Sized_relobj::set_local_got_offset): Likewise.
16592 (Sized_relobj::local_has_tls_got_offset): Removed.
16593 (Sized_relobj::local_tls_got_offset): Removed.
16594 (Sized_relobj::set_local_tls_got_offset): Removed.
16595 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16596 * output.cc (Output_data_got::add_global): Added got_type parameter.
16597 (Output_data_got::add_global_with_rel): Likewise.
16598 (Output_data_got::add_global_with_rela): Likewise.
16599 (Output_data_got::add_global_pair_with_rel): New function.
16600 (Output_data_got::add_global_pair_with_rela): New function.
16601 (Output_data_got::add_local): Added got_type parameter.
16602 (Output_data_got::add_local_with_rel): Likewise.
16603 (Output_data_got::add_local_with_rela): Likewise.
16604 (Output_data_got::add_local_pair_with_rel): New function.
16605 (Output_data_got::add_local_pair_with_rela): New function.
16606 (Output_data_got::add_global_tls): Removed.
16607 (Output_data_got::add_global_tls_with_rel): Removed.
16608 (Output_data_got::add_global_tls_with_rela): Removed.
16609 (Output_data_got::add_local_tls): Removed.
16610 (Output_data_got::add_local_tls_with_rel): Removed.
16611 (Output_data_got::add_local_tls_with_rela): Removed.
16612 * output.h (Output_data_got::add_global): Added got_type parameter.
16613 (Output_data_got::add_global_with_rel): Likewise.
16614 (Output_data_got::add_global_with_rela): Likewise.
16615 (Output_data_got::add_global_pair_with_rel): New function.
16616 (Output_data_got::add_global_pair_with_rela): New function.
16617 (Output_data_got::add_local): Added got_type parameter.
16618 (Output_data_got::add_local_with_rel): Likewise.
16619 (Output_data_got::add_local_with_rela): Likewise.
16620 (Output_data_got::add_local_pair_with_rel): New function.
16621 (Output_data_got::add_local_pair_with_rela): New function.
16622 (Output_data_got::add_global_tls): Removed.
16623 (Output_data_got::add_global_tls_with_rel): Removed.
16624 (Output_data_got::add_global_tls_with_rela): Removed.
16625 (Output_data_got::add_local_tls): Removed.
16626 (Output_data_got::add_local_tls_with_rel): Removed.
16627 (Output_data_got::add_local_tls_with_rela): Removed.
16628 * resolve.cc (Symbol::override_base_with_special): Removed
16629 reference to has_got_offset_ field.
16630 * symtab.cc (Symbol::init_fields): Replaced initialization
16631 of got_offset_ with got_offsets_. Removed initialization
16632 of has_got_offset_
53fcba31 16633 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16634 (Symbol::got_offset): Likewise.
16635 (Symbol::set_got_offset): Likewise.
16636 (Symbol::has_tls_got_offset): Removed.
16637 (Symbol::tls_got_offset): Removed.
16638 (Symbol::set_tls_got_offset): Removed.
16639 (Symbol::got_offset_): Removed.
16640 (Symbol::tls_mod_got_offset_): Removed.
16641 (Symbol::tls_pair_got_offset_): Removed.
16642 (Symbol::got_offsets_): New field.
16643 (Symbol::has_got_offset): Removed.
16644 (Symbol::has_tls_mod_got_offset): Removed.
16645 (Symbol::has_tls_pair_got_offset): Removed.
16646 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16647 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16648 member functions.
16649 (Target_x86_64::Scan::global): Likewise.
16650 (Target_x86_64::Relocate::relocate): Likewise.
16651 (Target_x86_64::Relocate::relocate_tls): Likewise.
16652
bd52eafb
BE
166532008-03-25 Ben Elliston <bje@au.ibm.com>
16654
16655 * yyscript.y: Fix spelling error in comment.
16656
8b105e34
ILT
166572008-03-24 Ian Lance Taylor <iant@google.com>
16658
8ed814a9
ILT
16659 * options.h (class General_options): Define build_id option.
16660 * layout.h (class Layout): Declare write_build_id, create_note,
16661 create_build_id. Add build_id_note_ member.
16662 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16663 "libiberty.h", "md5.h", "sha1.h".
16664 (Layout::Layout): Initialize eh_frame_data_,
16665 eh_frame_hdr_section_, and build_id_note_.
16666 (Layout::finalize): Call create_build_id.
16667 (Layout::create_note): New function, broken out of
16668 Layout::create_gold_note.
16669 (Layout::create_gold_note): Call create_note.
16670 (Layout::create_build_id): New function.
16671 (Layout::write_build_id): New function.
16672 (Close_task_runner::run): Call write_build_id.
16673
8b105e34
ILT
16674 * x86_64.cc: Correct license to GPLv3.
16675
086a1841
ILT
166762008-03-23 Ian Lance Taylor <iant@google.com>
16677
16678 * options.cc: Include "demangle.h".
16679 (parse_optional_string): New function.
16680 (parse_long_option): Handle takes_optional_argument.
16681 (parse_short_option): Update dash_z initializer. Handle
16682 takes_optional_argument.
16683 (General_options::General_options): Initialize do_demangle_.
16684 (General_options::finalize): Set do_demangle_. Handle demangling
16685 style.
16686 * options.h (parse_optional_string): Declare.
16687 (struct One_option): Add optional_arg field. Update constructor.
16688 Update call constructor calls. Add takes_optional_argument
16689 function.
16690 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16691 (DEFINE_optional_string): Define.
16692 (General_options::demangle): Change from DEFINE_bool to
16693 DEFINE_optional_string.
16694 (General_options::no_demangle): New function.
16695 (General_options::do_demangle): New function.
16696 (General_options::set_do_demangle): New function.
16697 (General_options::execstack_status_): Move definition to end of
16698 class definition.
16699 (General_options::static_): Likewise.
16700 (General_options::do_demangle_): New field.
16701 * object.cc (big_endian>::get_symbol_location_info): Call
16702 Options::do_demangle, not Options::demangle.
16703 * symtab.cc (demangle): Likewise.
16704
cbb93e63
ILT
167052008-03-22 Ian Lance Taylor <iant@google.com>
16706
16707 * gold.h: Include <cstddef> and <sys/types.h>
16708 * options.h: Include <cstring>.
16709
ec531623
ILT
167102008-03-21 Ian Lance Taylor <iant@google.com>
16711
16712 * Added source code to GNU binutils.
752937aa 16713\f
b90efa5b 16714Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
16715
16716Copying and distribution of this file, with or without modification,
16717are permitted in any medium without royalty provided the copyright
16718notice and this notice are preserved.
16719
16720Local Variables:
16721mode: change-log
16722left-margin: 8
16723fill-column: 74
16724version-control: never
16725End:
This page took 1.062535 seconds and 4 git commands to generate.